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.rb
Instance Method Summary collapse
-
#beta ⇒ Boolean
The beta.
-
#context ⇒ AvailablePhoneNumberCountryContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#country ⇒ String
The country.
-
#country_code ⇒ String
The ISO Country code to lookup phone numbers for.
-
#fetch ⇒ AvailablePhoneNumberCountryInstance
Fetch a 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 ⇒ String
The subresource_uris.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#toll_free ⇒ toll_free
Access the toll_free.
-
#uri ⇒ String
The uri.
-
#voip ⇒ voip
Access the voip.
Constructor Details
#initialize(version, payload, account_sid: nil, country_code: nil) ⇒ AvailablePhoneNumberCountryInstance
Initialize the AvailablePhoneNumberCountryInstance
318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb', line 318 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 The beta.
373 374 375 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb', line 373 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
342 343 344 345 346 347 348 349 350 351 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb', line 342 def context unless @instance_context @instance_context = AvailablePhoneNumberCountryContext.new( @version, @params['account_sid'], @params['country_code'], ) end @instance_context end |
#country ⇒ String
Returns The country.
361 362 363 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb', line 361 def country @properties['country'] end |
#country_code ⇒ String
Returns The ISO Country code to lookup phone numbers for.
355 356 357 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb', line 355 def country_code @properties['country_code'] end |
#fetch ⇒ AvailablePhoneNumberCountryInstance
Fetch a AvailablePhoneNumberCountryInstance
386 387 388 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb', line 386 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
448 449 450 451 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb', line 448 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Api.V2010.AvailablePhoneNumberCountryInstance #{values}>" end |
#local ⇒ local
Access the local
393 394 395 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb', line 393 def local context.local end |
#machine_to_machine ⇒ machine_to_machine
Access the machine_to_machine
435 436 437 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb', line 435 def machine_to_machine context.machine_to_machine end |
#mobile ⇒ mobile
Access the mobile
407 408 409 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb', line 407 def mobile context.mobile end |
#national ⇒ national
Access the national
414 415 416 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb', line 414 def national context.national end |
#shared_cost ⇒ shared_cost
Access the shared_cost
428 429 430 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb', line 428 def shared_cost context.shared_cost end |
#subresource_uris ⇒ String
Returns The subresource_uris.
379 380 381 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb', line 379 def subresource_uris @properties['subresource_uris'] end |
#to_s ⇒ Object
Provide a user friendly representation
441 442 443 444 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb', line 441 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
400 401 402 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb', line 400 def toll_free context.toll_free end |
#uri ⇒ String
Returns The uri.
367 368 369 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb', line 367 def uri @properties['uri'] end |
#voip ⇒ voip
Access the voip
421 422 423 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb', line 421 def voip context.voip end |