properties = [ 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'enabled' => Values::array_get($payload, 'enabled'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'sid' => Values::array_get($payload, 'sid'), 'audioSources' => Values::array_get($payload, 'audio_sources'), 'audioSourcesExcluded' => Values::array_get($payload, 'audio_sources_excluded'), 'videoLayout' => Values::array_get($payload, 'video_layout'), 'resolution' => Values::array_get($payload, 'resolution'), 'trim' => Values::array_get($payload, 'trim'), 'format' => Values::array_get($payload, 'format'), 'statusCallback' => Values::array_get($payload, 'status_callback'), 'statusCallbackMethod' => Values::array_get($payload, 'status_callback_method'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return CompositionHookContext Context for this CompositionHookInstance */ protected function proxy(): CompositionHookContext { if (!$this->context) { $this->context = new CompositionHookContext( $this->version, $this->solution['sid'] ); } return $this->context; } /** * Delete the CompositionHookInstance * * @return bool True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete(): bool { return $this->proxy()->delete(); } /** * Fetch the CompositionHookInstance * * @return CompositionHookInstance Fetched CompositionHookInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): CompositionHookInstance { return $this->proxy()->fetch(); } /** * Update the CompositionHookInstance * * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 100 characters long and it must be unique within the account. * @param array|Options $options Optional Arguments * @return CompositionHookInstance Updated CompositionHookInstance * @throws TwilioException When an HTTP error occurs. */ public function update(string $friendlyName, array $options = []): CompositionHookInstance { return $this->proxy()->update($friendlyName, $options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get(string $name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $context = []; foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Video.V1.CompositionHookInstance ' . \implode(' ', $context) . ']'; } }