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



297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 297

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



345
346
347
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 345

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



318
319
320
321
322
323
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 318

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

#countryString



333
334
335
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 333

def country
    @properties['country']
end

#country_codeString



327
328
329
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 327

def country_code
    @properties['country_code']
end

#fetchAvailablePhoneNumberCountryInstance

Fetch the AvailablePhoneNumberCountryInstance



358
359
360
361
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 358

def fetch

    context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



421
422
423
424
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 421

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

#locallocal

Access the local



408
409
410
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 408

def local
    context.local
end

#machine_to_machinemachine_to_machine

Access the machine_to_machine



387
388
389
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 387

def machine_to_machine
    context.machine_to_machine
end

#mobilemobile

Access the mobile



380
381
382
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 380

def mobile
    context.mobile
end

#nationalnational

Access the national



373
374
375
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 373

def national
    context.national
end

#shared_costshared_cost

Access the shared_cost



401
402
403
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 401

def shared_cost
    context.shared_cost
end

#subresource_urisHash



351
352
353
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 351

def subresource_uris
    @properties['subresource_uris']
end

#to_sObject

Provide a user friendly representation



414
415
416
417
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 414

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

#toll_freetoll_free

Access the toll_free



394
395
396
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 394

def toll_free
    context.toll_free
end

#uriString



339
340
341
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 339

def uri
    @properties['uri']
end

#voipvoip

Access the voip



366
367
368
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number_country.rb', line 366

def voip
    context.voip
end