Class: Twilio::REST::Voice::V1::DialingPermissionsList::CountryInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.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].

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, iso_code: nil) ⇒ CountryInstance

Initialize the CountryInstance

Parameters:



292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb', line 292

def initialize(version, payload, iso_code: nil)
  super(version)

  # Marshaled Properties
  @properties = {
      'iso_code' => payload['iso_code'],
      'name' => payload['name'],
      'continent' => payload['continent'],
      'country_codes' => payload['country_codes'],
      'low_risk_numbers_enabled' => payload['low_risk_numbers_enabled'],
      'high_risk_special_numbers_enabled' => payload['high_risk_special_numbers_enabled'],
      'high_risk_tollfraud_numbers_enabled' => payload['high_risk_tollfraud_numbers_enabled'],
      'url' => payload['url'],
      'links' => payload['links'],
  }

  # Context
  @instance_context = nil
  @params = {'iso_code' => iso_code || @properties['iso_code'], }
end

Instance Method Details

#contextCountryContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context

Returns:



317
318
319
320
321
322
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb', line 317

def context
  unless @instance_context
    @instance_context = CountryContext.new(@version, @params['iso_code'], )
  end
  @instance_context
end

#continentString

Returns Name of the continent.

Returns:

  • (String)

    Name of the continent



338
339
340
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb', line 338

def continent
  @properties['continent']
end

#country_codesString

Returns The E.164 assigned country codes(s).

Returns:

  • (String)

    The E.164 assigned country codes(s)



344
345
346
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb', line 344

def country_codes
  @properties['country_codes']
end

#fetchCountryInstance

Fetch a CountryInstance

Returns:



381
382
383
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb', line 381

def fetch
  context.fetch
end

#high_risk_special_numbers_enabledBoolean

Returns ‘true`, if dialing to high-risk special services numbers is enabled, else `false`.

Returns:

  • (Boolean)

    ‘true`, if dialing to high-risk special services numbers is enabled, else `false`



356
357
358
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb', line 356

def high_risk_special_numbers_enabled
  @properties['high_risk_special_numbers_enabled']
end

#high_risk_tollfraud_numbers_enabledBoolean

Returns ‘true`, if dialing to high-risk toll fraud numbers is enabled, else `false`.

Returns:

  • (Boolean)

    ‘true`, if dialing to high-risk toll fraud numbers is enabled, else `false`



362
363
364
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb', line 362

def high_risk_tollfraud_numbers_enabled
  @properties['high_risk_tollfraud_numbers_enabled']
end

#highrisk_special_prefixeshighrisk_special_prefixes

Access the highrisk_special_prefixes

Returns:



388
389
390
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb', line 388

def highrisk_special_prefixes
  context.highrisk_special_prefixes
end

#inspectObject

Provide a detailed, user friendly representation



401
402
403
404
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb', line 401

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

#iso_codeString

Returns The ISO country code.

Returns:

  • (String)

    The ISO country code



326
327
328
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb', line 326

def iso_code
  @properties['iso_code']
end

Returns A list of URLs related to this resource.

Returns:

  • (String)

    A list of URLs related to this resource



374
375
376
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb', line 374

def links
  @properties['links']
end

#low_risk_numbers_enabledBoolean

Returns ‘true`, if dialing to low-risk numbers is enabled, else `false`.

Returns:

  • (Boolean)

    ‘true`, if dialing to low-risk numbers is enabled, else `false`



350
351
352
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb', line 350

def low_risk_numbers_enabled
  @properties['low_risk_numbers_enabled']
end

#nameString

Returns Name of the country.

Returns:

  • (String)

    Name of the country



332
333
334
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb', line 332

def name
  @properties['name']
end

#to_sObject

Provide a user friendly representation



394
395
396
397
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb', line 394

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

#urlString

Returns The absolute URL of this resource.

Returns:

  • (String)

    The absolute URL of this resource



368
369
370
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb', line 368

def url
  @properties['url']
end