Class: Twilio::REST::Api::V2010::AccountContext::AvailablePhoneNumberCountryInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, account_sid: nil, country_code: nil) ⇒ AvailablePhoneNumberCountryInstance

Initialize the AvailablePhoneNumberCountryInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • account_sid (String) (defaults to: nil)

    The SID of the Account that created this AvailablePhoneNumberCountry resource.

  • sid (String)

    The SID of the Call resource to fetch.



472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 472

def initialize(version, payload , account_sid: nil, country_code: nil)
    super(version)
    
    
    # Marshaled Properties
    @properties = { 
        'country_code' => payload['country_code'],
        'country' => payload['country'],
        'uri' => payload['uri'],
        'beta' => payload['beta'],
        'subresource_uris' => payload['subresource_uris'],
    }

    # Context
    @instance_context = nil
    @params = { 'account_sid' =>   ,'country_code' => country_code  || @properties['country_code']  , }
end

Instance Method Details

#betaBoolean

Returns Whether all phone numbers available in the country are new to the Twilio platform. true if they are and false if all numbers are not in the Twilio Phone Number Beta program.

Returns:

  • (Boolean)

    Whether all phone numbers available in the country are new to the Twilio platform. true if they are and false if all numbers are not in the Twilio Phone Number Beta program.



521
522
523
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 521

def beta
    @properties['beta']
end

#contextAvailablePhoneNumberCountryContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context

Returns:



494
495
496
497
498
499
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 494

def context
    unless @instance_context
        @instance_context = AvailablePhoneNumberCountryContext.new(@version , @params['account_sid'], @params['country_code'])
    end
    @instance_context
end

#countryString

Returns The name of the country.

Returns:

  • (String)

    The name of the country.



509
510
511
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 509

def country
    @properties['country']
end

#country_codeString

Returns The ISO-3166-1 country code of the country.

Returns:

  • (String)

    The ISO-3166-1 country code of the country.



503
504
505
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 503

def country_code
    @properties['country_code']
end

#fetchAvailablePhoneNumberCountryInstance

Fetch the AvailablePhoneNumberCountryInstance

Returns:



534
535
536
537
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 534

def fetch

    context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



597
598
599
600
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 597

def inspect
    values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Api.V2010.AvailablePhoneNumberCountryInstance #{values}>"
end

#locallocal

Access the local

Returns:



584
585
586
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 584

def local
    context.local
end

#machine_to_machinemachine_to_machine

Access the machine_to_machine

Returns:



563
564
565
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 563

def machine_to_machine
    context.machine_to_machine
end

#mobilemobile

Access the mobile

Returns:



556
557
558
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 556

def mobile
    context.mobile
end

#nationalnational

Access the national

Returns:



549
550
551
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 549

def national
    context.national
end

#shared_costshared_cost

Access the shared_cost

Returns:



577
578
579
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 577

def shared_cost
    context.shared_cost
end

#subresource_urisHash

Returns A list of related AvailablePhoneNumber resources identified by their URIs relative to https://api.twilio.com.

Returns:

  • (Hash)

    A list of related AvailablePhoneNumber resources identified by their URIs relative to https://api.twilio.com.



527
528
529
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 527

def subresource_uris
    @properties['subresource_uris']
end

#to_sObject

Provide a user friendly representation



590
591
592
593
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 590

def to_s
    values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Api.V2010.AvailablePhoneNumberCountryInstance #{values}>"
end

#toll_freetoll_free

Access the toll_free

Returns:



570
571
572
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 570

def toll_free
    context.toll_free
end

#uriString

Returns The URI of the Country resource, relative to https://api.twilio.com.

Returns:

  • (String)

    The URI of the Country resource, relative to https://api.twilio.com.



515
516
517
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 515

def uri
    @properties['uri']
end

#voipvoip

Access the voip

Returns:



542
543
544
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 542

def voip
    context.voip
end