properties = [ 'sid' => Values::array_get($payload, 'sid'), 'participantSid' => Values::array_get($payload, 'participant_sid'), 'roomSid' => Values::array_get($payload, 'room_sid'), 'name' => Values::array_get($payload, 'name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'enabled' => Values::array_get($payload, 'enabled'), 'kind' => Values::array_get($payload, 'kind'), 'url' => Values::array_get($payload, 'url'), ]; $this->solution = ['roomSid' => $roomSid, 'participantSid' => $participantSid, '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 PublishedTrackContext Context for this PublishedTrackInstance */ protected function proxy(): PublishedTrackContext { if (!$this->context) { $this->context = new PublishedTrackContext( $this->version, $this->solution['roomSid'], $this->solution['participantSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch the PublishedTrackInstance * * @return PublishedTrackInstance Fetched PublishedTrackInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): PublishedTrackInstance { return $this->proxy()->fetch(); } /** * 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.PublishedTrackInstance ' . \implode(' ', $context) . ']'; } }