Class: Twilio::REST::Voice::V1::DialingPermissionsList::CountryContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb,
lib/twilio-ruby/rest/voice/v1/dialing_permissions/country/highrisk_special_prefix.rb

Overview

PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact [email protected]

Defined Under Namespace

Classes: HighriskSpecialPrefixInstance, HighriskSpecialPrefixList, HighriskSpecialPrefixPage

Instance Method Summary collapse

Constructor Details

#initialize(version, iso_code) ⇒ CountryContext

Initialize the CountryContext

Parameters:

  • version (Version)

    Version that contains the resource

  • iso_code (String)

    The ISO country code of the DialingPermissions Country resource to fetch


228
229
230
231
232
233
234
235
236
237
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb', line 228

def initialize(version, iso_code)
  super(version)

  # Path Solution
  @solution = {iso_code: iso_code, }
  @uri = "/DialingPermissions/Countries/#{@solution[:iso_code]}"

  # Dependents
  @highrisk_special_prefixes = nil
end

Instance Method Details

#fetchCountryInstance

Fetch the CountryInstance

Returns:


242
243
244
245
246
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb', line 242

def fetch
  payload = @version.fetch('GET', @uri)

  CountryInstance.new(@version, payload, iso_code: @solution[:iso_code], )
end

#highrisk_special_prefixesHighriskSpecialPrefixList, HighriskSpecialPrefixContext

Access the highrisk_special_prefixes

Returns:


252
253
254
255
256
257
258
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb', line 252

def highrisk_special_prefixes
  unless @highrisk_special_prefixes
    @highrisk_special_prefixes = HighriskSpecialPrefixList.new(@version, iso_code: @solution[:iso_code], )
  end

  @highrisk_special_prefixes
end

#inspectObject

Provide a detailed, user friendly representation


269
270
271
272
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb', line 269

def inspect
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.Voice.V1.CountryContext #{context}>"
end

#to_sObject

Provide a user friendly representation


262
263
264
265
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb', line 262

def to_s
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.Voice.V1.CountryContext #{context}>"
end