class Twilio::REST::Api::V2010::AccountContext::AvailablePhoneNumberCountryInstance
Public Class Methods
Initialize the AvailablePhoneNumberCountryInstance
@param [Version] version Version
that contains the resource @param [Hash] payload payload that contains response from Twilio
@param [String] account_sid A 34 character string that uniquely identifies this
resource.
@param [String] country_code
The
{ISO-3166-1}[https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2] country code of the country to fetch available phone number information about.
@return [AvailablePhoneNumberCountryInstance] AvailablePhoneNumberCountryInstance
Twilio::REST::InstanceResource::new
# File lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb 325 def initialize(version, payload, account_sid: nil, country_code: nil) 326 super(version) 327 328 # Marshaled Properties 329 @properties = { 330 'country_code' => payload['country_code'], 331 'country' => payload['country'], 332 'uri' => payload['uri'], 333 'beta' => payload['beta'], 334 'subresource_uris' => payload['subresource_uris'], 335 } 336 337 # Context 338 @instance_context = nil 339 @params = { 340 'account_sid' => account_sid, 341 'country_code' => country_code || @properties['country_code'], 342 } 343 end
Public Instance Methods
@return [Boolean] Whether all phone numbers available in the country are new to the Twilio
platform.
# File lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb 380 def beta 381 @properties['beta'] 382 end
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] AvailablePhoneNumberCountryContext
for this AvailablePhoneNumberCountryInstance
# File lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb 349 def context 350 unless @instance_context 351 @instance_context = AvailablePhoneNumberCountryContext.new( 352 @version, 353 @params['account_sid'], 354 @params['country_code'], 355 ) 356 end 357 @instance_context 358 end
@return [String] The name of the country
# File lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb 368 def country 369 @properties['country'] 370 end
@return [String] The ISO-3166-1 country code of the country.
# File lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb 362 def country_code 363 @properties['country_code'] 364 end
Fetch the AvailablePhoneNumberCountryInstance
@return [AvailablePhoneNumberCountryInstance] Fetched AvailablePhoneNumberCountryInstance
# File lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb 393 def fetch 394 context.fetch 395 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb 455 def inspect 456 values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") 457 "<Twilio.Api.V2010.AvailablePhoneNumberCountryInstance #{values}>" 458 end
Access the local @return [local] local
# File lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb 400 def local 401 context.local 402 end
Access the machine_to_machine
@return [machine_to_machine] machine_to_machine
# File lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb 442 def machine_to_machine 443 context.machine_to_machine 444 end
Access the mobile @return [mobile] mobile
# File lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb 414 def mobile 415 context.mobile 416 end
Access the national @return [national] national
# File lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb 421 def national 422 context.national 423 end
@return [String] A list of related resources identified by their relative URIs
# File lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb 386 def subresource_uris 387 @properties['subresource_uris'] 388 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb 448 def to_s 449 values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") 450 "<Twilio.Api.V2010.AvailablePhoneNumberCountryInstance #{values}>" 451 end
@return [String] The URI of the Country resource, relative to `api.twilio.com`
# File lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb 374 def uri 375 @properties['uri'] 376 end
Access the voip @return [voip] voip
# File lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb 428 def voip 429 context.voip 430 end