Class: Twilio::REST::Api::V2010::AccountContext::AvailablePhoneNumberCountryContext::TollFreeInstance

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

Instance Method Summary collapse

Constructor Details

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

Initialize the TollFreeInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • account_sid (String) (defaults to: nil)

    The account_sid

  • country_code (String) (defaults to: nil)

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


384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number/toll_free.rb', line 384

def initialize(version, payload, account_sid: nil, country_code: nil)
  super(version)

  # Marshaled Properties
  @properties = {
      'friendly_name' => payload['friendly_name'],
      'phone_number' => payload['phone_number'],
      'lata' => payload['lata'],
      'locality' => payload['locality'],
      'rate_center' => payload['rate_center'],
      'latitude' => payload['latitude'].to_f,
      'longitude' => payload['longitude'].to_f,
      'region' => payload['region'],
      'postal_code' => payload['postal_code'],
      'iso_country' => payload['iso_country'],
      'address_requirements' => payload['address_requirements'],
      'beta' => payload['beta'],
      'capabilities' => payload['capabilities'],
  }
end

Instance Method Details

#address_requirementsString

Returns The type of Address resource the phone number requires.

Returns:

  • (String)

    The type of Address resource the phone number requires


467
468
469
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number/toll_free.rb', line 467

def address_requirements
  @properties['address_requirements']
end

#betaBoolean

Returns Whether the phone number is new to the Twilio platform.

Returns:

  • (Boolean)

    Whether the phone number is new to the Twilio platform


473
474
475
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number/toll_free.rb', line 473

def beta
  @properties['beta']
end

#capabilitiesString

Returns Whether a phone number can receive calls or messages.

Returns:

  • (String)

    Whether a phone number can receive calls or messages


479
480
481
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number/toll_free.rb', line 479

def capabilities
  @properties['capabilities']
end

#friendly_nameString

Returns A formatted version of the phone number.

Returns:

  • (String)

    A formatted version of the phone number


407
408
409
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number/toll_free.rb', line 407

def friendly_name
  @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation


491
492
493
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number/toll_free.rb', line 491

def inspect
  "<Twilio.Api.V2010.TollFreeInstance>"
end

#iso_countryString

Returns The ISO country code of this phone number.

Returns:

  • (String)

    The ISO country code of this phone number


461
462
463
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number/toll_free.rb', line 461

def iso_country
  @properties['iso_country']
end

#lataString

Returns The LATA of this phone number.

Returns:

  • (String)

    The LATA of this phone number


419
420
421
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number/toll_free.rb', line 419

def lata
  @properties['lata']
end

#latitudeString

Returns The latitude of this phone number's location.

Returns:

  • (String)

    The latitude of this phone number's location


437
438
439
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number/toll_free.rb', line 437

def latitude
  @properties['latitude']
end

#localityString

Returns The locality or city of this phone number's location.

Returns:

  • (String)

    The locality or city of this phone number's location


425
426
427
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number/toll_free.rb', line 425

def locality
  @properties['locality']
end

#longitudeString

Returns The longitude of this phone number's location.

Returns:

  • (String)

    The longitude of this phone number's location


443
444
445
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number/toll_free.rb', line 443

def longitude
  @properties['longitude']
end

#phone_numberString

Returns The phone number in E.164 format.

Returns:

  • (String)

    The phone number in E.164 format


413
414
415
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number/toll_free.rb', line 413

def phone_number
  @properties['phone_number']
end

#postal_codeString

Returns The postal or ZIP code of this phone number's location.

Returns:

  • (String)

    The postal or ZIP code of this phone number's location


455
456
457
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number/toll_free.rb', line 455

def postal_code
  @properties['postal_code']
end

#rate_centerString

Returns The rate center of this phone number.

Returns:

  • (String)

    The rate center of this phone number


431
432
433
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number/toll_free.rb', line 431

def rate_center
  @properties['rate_center']
end

#regionString

Returns The two-letter state or province abbreviation of this phone number's location.

Returns:

  • (String)

    The two-letter state or province abbreviation of this phone number's location


449
450
451
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number/toll_free.rb', line 449

def region
  @properties['region']
end

#to_sObject

Provide a user friendly representation


485
486
487
# File 'lib/twilio-ruby/rest/api/v2010/account/available_phone_number/toll_free.rb', line 485

def to_s
  "<Twilio.Api.V2010.TollFreeInstance>"
end