Class: Twilio::REST::Api::V2010::AccountContext::AvailablePhoneNumberCountryInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Api::V2010::AccountContext::AvailablePhoneNumberCountryInstance
- Defined in:
- lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb
Instance Method Summary collapse
-
#beta ⇒ Boolean
Whether all phone numbers available in the country are new to the Twilio platform.
-
#context ⇒ AvailablePhoneNumberCountryContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#country ⇒ String
The name of the country.
-
#country_code ⇒ String
The [ISO-3166-1](en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the country.
-
#fetch ⇒ AvailablePhoneNumberCountryInstance
Fetch the AvailablePhoneNumberCountryInstance.
-
#initialize(version, payload, account_sid: nil, country_code: nil) ⇒ AvailablePhoneNumberCountryInstance
constructor
Initialize the AvailablePhoneNumberCountryInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#local ⇒ local
Access the local.
-
#machine_to_machine ⇒ machine_to_machine
Access the machine_to_machine.
-
#mobile ⇒ mobile
Access the mobile.
-
#national ⇒ national
Access the national.
-
#shared_cost ⇒ shared_cost
Access the shared_cost.
-
#subresource_uris ⇒ Hash
A list of related AvailablePhoneNumber resources identified by their URIs relative to
https://api.twilio.com. -
#to_s ⇒ Object
Provide a user friendly representation.
-
#toll_free ⇒ toll_free
Access the toll_free.
-
#uri ⇒ String
The URI of the Country resource, relative to
https://api.twilio.com. -
#voip ⇒ voip
Access the voip.
Constructor Details
#initialize(version, payload, account_sid: nil, country_code: nil) ⇒ AvailablePhoneNumberCountryInstance
Initialize the AvailablePhoneNumberCountryInstance
464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 464 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' => account_sid ,'country_code' => country_code || @properties['country_code'] , } end |
Instance Method Details
#beta ⇒ Boolean
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.
513 514 515 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 513 def beta @properties['beta'] end |
#context ⇒ AvailablePhoneNumberCountryContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
486 487 488 489 490 491 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 486 def context unless @instance_context @instance_context = AvailablePhoneNumberCountryContext.new(@version , @params['account_sid'], @params['country_code']) end @instance_context end |
#country ⇒ String
Returns The name of the country.
501 502 503 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 501 def country @properties['country'] end |
#country_code ⇒ String
Returns The [ISO-3166-1](en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the country.
495 496 497 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 495 def country_code @properties['country_code'] end |
#fetch ⇒ AvailablePhoneNumberCountryInstance
Fetch the AvailablePhoneNumberCountryInstance
526 527 528 529 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 526 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
589 590 591 592 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 589 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Api.V2010.AvailablePhoneNumberCountryInstance #{values}>" end |
#local ⇒ local
Access the local
576 577 578 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 576 def local context.local end |
#machine_to_machine ⇒ machine_to_machine
Access the machine_to_machine
555 556 557 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 555 def machine_to_machine context.machine_to_machine end |
#mobile ⇒ mobile
Access the mobile
548 549 550 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 548 def mobile context.mobile end |
#national ⇒ national
Access the national
541 542 543 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 541 def national context.national end |
#shared_cost ⇒ shared_cost
Access the shared_cost
569 570 571 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 569 def shared_cost context.shared_cost end |
#subresource_uris ⇒ Hash
Returns A list of related AvailablePhoneNumber resources identified by their URIs relative to https://api.twilio.com.
519 520 521 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 519 def subresource_uris @properties['subresource_uris'] end |
#to_s ⇒ Object
Provide a user friendly representation
582 583 584 585 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 582 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Api.V2010.AvailablePhoneNumberCountryInstance #{values}>" end |
#toll_free ⇒ toll_free
Access the toll_free
562 563 564 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 562 def toll_free context.toll_free end |
#uri ⇒ String
Returns The URI of the Country resource, relative to https://api.twilio.com.
507 508 509 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 507 def uri @properties['uri'] end |
#voip ⇒ voip
Access the voip
534 535 536 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 534 def voip context.voip end |