class Twilio::REST::Api::V2010::AccountContext::AvailablePhoneNumberCountryInstance

Public Class Methods

new(version, payload, account_sid: nil, country_code: nil) click to toggle source

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

Calls superclass method 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

beta() click to toggle source

@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
context() click to toggle source

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
country() click to toggle source

@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
country_code() click to toggle source

@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() click to toggle source

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
inspect() click to toggle source

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
local() click to toggle source

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
machine_to_machine() click to toggle source

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
mobile() click to toggle source

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
national() click to toggle source

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
shared_cost() click to toggle source

Access the shared_cost @return [shared_cost] shared_cost

    # File lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb
435 def shared_cost
436   context.shared_cost
437 end
subresource_uris() click to toggle source

@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
to_s() click to toggle source

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
toll_free() click to toggle source

Access the toll_free @return [toll_free] toll_free

    # File lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb
407 def toll_free
408   context.toll_free
409 end
uri() click to toggle source

@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
voip() click to toggle source

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