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

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

Instance Method Summary collapse

Constructor Details

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

Initialize the CountryInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • account_sid (String)

    The SID of the Account that created this Country resource.

  • sid (String)

    The SID of the Call resource to fetch.



267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb', line 267

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:



292
293
294
295
296
297
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb', line 292

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

#continentString

Returns The name of the continent in which the country is located.

Returns:

  • (String)

    The name of the continent in which the country is located.



313
314
315
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb', line 313

def continent
    @properties['continent']
end

#country_codesArray<String>

Returns The E.164 assigned [country codes(s)](www.itu.int/itudoc/itu-t/ob-lists/icc/e164_763.html).

Returns:



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

def country_codes
    @properties['country_codes']
end

#fetchCountryInstance

Fetch the CountryInstance

Returns:



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

def fetch

    context.fetch
end

#high_risk_special_numbers_enabledBoolean

Returns Whether dialing to high-risk special services numbers is enabled. These prefixes include number ranges allocated by the country and include premium numbers, special services, shared cost, and others.

Returns:

  • (Boolean)

    Whether dialing to high-risk special services numbers is enabled. These prefixes include number ranges allocated by the country and include premium numbers, special services, shared cost, and others



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

def high_risk_special_numbers_enabled
    @properties['high_risk_special_numbers_enabled']
end

#high_risk_tollfraud_numbers_enabledBoolean

Returns Whether dialing to high-risk [toll fraud](www.twilio.com/learn/voice-and-video/toll-fraud) numbers is enabled. These prefixes include narrow number ranges that have a high-risk of international revenue sharing fraud (IRSF) attacks, also known as [toll fraud](www.twilio.com/learn/voice-and-video/toll-fraud). These prefixes are collected from anti-fraud databases and verified by analyzing calls on our network. These prefixes are not available for download and are updated frequently.

Returns:

  • (Boolean)

    Whether dialing to high-risk [toll fraud](www.twilio.com/learn/voice-and-video/toll-fraud) numbers is enabled. These prefixes include narrow number ranges that have a high-risk of international revenue sharing fraud (IRSF) attacks, also known as [toll fraud](www.twilio.com/learn/voice-and-video/toll-fraud). These prefixes are collected from anti-fraud databases and verified by analyzing calls on our network. These prefixes are not available for download and are updated frequently



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

def high_risk_tollfraud_numbers_enabled
    @properties['high_risk_tollfraud_numbers_enabled']
end

#highrisk_special_prefixeshighrisk_special_prefixes

Access the highrisk_special_prefixes

Returns:



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

def highrisk_special_prefixes
    context.highrisk_special_prefixes
end

#inspectObject

Provide a detailed, user friendly representation



377
378
379
380
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb', line 377

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

#iso_codeString

Returns The [ISO country code](en.wikipedia.org/wiki/ISO_3166-1_alpha-2).

Returns:



301
302
303
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb', line 301

def iso_code
    @properties['iso_code']
end

Returns A list of URLs related to this resource.

Returns:

  • (Hash)

    A list of URLs related to this resource.



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

def links
    @properties['links']
end

#low_risk_numbers_enabledBoolean

Returns Whether dialing to low-risk numbers is enabled.

Returns:

  • (Boolean)

    Whether dialing to low-risk numbers is enabled.



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

def low_risk_numbers_enabled
    @properties['low_risk_numbers_enabled']
end

#nameString

Returns The name of the country.

Returns:

  • (String)

    The name of the country.



307
308
309
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb', line 307

def name
    @properties['name']
end

#to_sObject

Provide a user friendly representation



370
371
372
373
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb', line 370

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.



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

def url
    @properties['url']
end