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.
-
#mobile ⇒ mobile
Access the mobile.
-
#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.
Constructor Details
#initialize(version, payload, account_sid: nil, country_code: nil) ⇒ AvailablePhoneNumberCountryInstance
Initialize the AvailablePhoneNumberCountryInstance
266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb', line 266 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.
321 322 323 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb', line 321 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
290 291 292 293 294 295 296 297 298 299 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb', line 290 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.
309 310 311 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb', line 309 def country @properties['country'] end |
#country_code ⇒ String
Returns The ISO Country code to lookup phone numbers for.
303 304 305 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb', line 303 def country_code @properties['country_code'] end |
#fetch ⇒ AvailablePhoneNumberCountryInstance
Fetch a AvailablePhoneNumberCountryInstance
334 335 336 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb', line 334 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
368 369 370 371 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb', line 368 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Api.V2010.AvailablePhoneNumberCountryInstance #{values}>" end |
#local ⇒ local
Access the local
341 342 343 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb', line 341 def local context.local end |
#mobile ⇒ mobile
Access the mobile
355 356 357 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb', line 355 def mobile context.mobile end |
#subresource_uris ⇒ String
Returns The subresource_uris.
327 328 329 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb', line 327 def subresource_uris @properties['subresource_uris'] end |
#to_s ⇒ Object
Provide a user friendly representation
361 362 363 364 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb', line 361 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
348 349 350 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb', line 348 def toll_free context.toll_free end |
#uri ⇒ String
Returns The uri.
315 316 317 |
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb', line 315 def uri @properties['uri'] end |