properties = [ 'redirectTo' => Values::array_get($payload, 'redirect_to'), 'day' => Values::array_get($payload, 'day'), 'size' => Values::array_get($payload, 'size'), 'createDate' => Values::array_get($payload, 'create_date'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'resourceType' => Values::array_get($payload, 'resource_type'), ]; $this->solution = ['resourceType' => $resourceType, 'day' => $day ?: $this->properties['day'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return DayContext Context for this DayInstance */ protected function proxy(): DayContext { if (!$this->context) { $this->context = new DayContext( $this->version, $this->solution['resourceType'], $this->solution['day'] ); } return $this->context; } /** * Fetch the DayInstance * * @return DayInstance Fetched DayInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): DayInstance { 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.Bulkexports.V1.DayInstance ' . \implode(' ', $context) . ']'; } }