properties = [ 'countryCode' => Values::array_get($payload, 'country_code'), 'country' => Values::array_get($payload, 'country'), 'uri' => Values::array_get($payload, 'uri'), 'beta' => Values::array_get($payload, 'beta'), 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), ]; $this->solution = ['accountSid' => $accountSid, 'countryCode' => $countryCode ?: $this->properties['countryCode'], ]; } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return AvailablePhoneNumberCountryContext Context for this AvailablePhoneNumberCountryInstance */ protected function proxy(): AvailablePhoneNumberCountryContext { if (!$this->context) { $this->context = new AvailablePhoneNumberCountryContext( $this->version, $this->solution['accountSid'], $this->solution['countryCode'] ); } return $this->context; } /** * Fetch the AvailablePhoneNumberCountryInstance * * @return AvailablePhoneNumberCountryInstance Fetched AvailablePhoneNumberCountryInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch(): AvailablePhoneNumberCountryInstance { return $this->proxy()->fetch(); } /** * Access the voip */ protected function getVoip(): VoipList { return $this->proxy()->voip; } /** * Access the national */ protected function getNational(): NationalList { return $this->proxy()->national; } /** * Access the mobile */ protected function getMobile(): MobileList { return $this->proxy()->mobile; } /** * Access the machineToMachine */ protected function getMachineToMachine(): MachineToMachineList { return $this->proxy()->machineToMachine; } /** * Access the tollFree */ protected function getTollFree(): TollFreeList { return $this->proxy()->tollFree; } /** * Access the sharedCost */ protected function getSharedCost(): SharedCostList { return $this->proxy()->sharedCost; } /** * Access the local */ protected function getLocal(): LocalList { return $this->proxy()->local; } /** * 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.Api.V2010.AvailablePhoneNumberCountryInstance ' . \implode(' ', $context) . ']'; } }