Class: Twilio::REST::Voice::V1::DialingPermissionsList::CountryInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Voice::V1::DialingPermissionsList::CountryInstance
- Defined in:
- lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb
Instance Method Summary collapse
-
#context ⇒ CountryContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#continent ⇒ String
The name of the continent in which the country is located.
-
#country_codes ⇒ Array<String>
The E.164 assigned [country codes(s)](www.itu.int/itudoc/itu-t/ob-lists/icc/e164_763.html).
-
#fetch ⇒ CountryInstance
Fetch the CountryInstance.
-
#high_risk_special_numbers_enabled ⇒ Boolean
Whether dialing to high-risk special services numbers is enabled.
-
#high_risk_tollfraud_numbers_enabled ⇒ Boolean
Whether dialing to high-risk [toll fraud](www.twilio.com/blog/how-to-protect-your-account-from-toll-fraud-with-voice-dialing-geo-permissions-html) numbers is enabled.
-
#highrisk_special_prefixes ⇒ highrisk_special_prefixes
Access the highrisk_special_prefixes.
-
#initialize(version, payload, iso_code: nil) ⇒ CountryInstance
constructor
Initialize the CountryInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#iso_code ⇒ String
The [ISO country code](en.wikipedia.org/wiki/ISO_3166-1_alpha-2).
-
#links ⇒ Hash
A list of URLs related to this resource.
-
#low_risk_numbers_enabled ⇒ Boolean
Whether dialing to low-risk numbers is enabled.
-
#name ⇒ String
The name of the country.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#url ⇒ String
The absolute URL of this resource.
Constructor Details
#initialize(version, payload, iso_code: nil) ⇒ CountryInstance
Initialize the CountryInstance
437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 |
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb', line 437 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
#context ⇒ CountryContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
463 464 465 466 467 468 |
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb', line 463 def context unless @instance_context @instance_context = CountryContext.new(@version , @params['iso_code']) end @instance_context end |
#continent ⇒ String
Returns The name of the continent in which the country is located.
484 485 486 |
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb', line 484 def continent @properties['continent'] end |
#country_codes ⇒ Array<String>
Returns The E.164 assigned [country codes(s)](www.itu.int/itudoc/itu-t/ob-lists/icc/e164_763.html).
490 491 492 |
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb', line 490 def country_codes @properties['country_codes'] end |
#fetch ⇒ CountryInstance
Fetch the CountryInstance
527 528 529 530 |
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb', line 527 def fetch context.fetch end |
#high_risk_special_numbers_enabled ⇒ Boolean
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.
502 503 504 |
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb', line 502 def high_risk_special_numbers_enabled @properties['high_risk_special_numbers_enabled'] end |
#high_risk_tollfraud_numbers_enabled ⇒ Boolean
Returns Whether dialing to high-risk [toll fraud](www.twilio.com/blog/how-to-protect-your-account-from-toll-fraud-with-voice-dialing-geo-permissions-html) 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/blog/how-to-protect-your-account-from-toll-fraud-with-voice-dialing-geo-permissions-html). 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.
508 509 510 |
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb', line 508 def high_risk_tollfraud_numbers_enabled @properties['high_risk_tollfraud_numbers_enabled'] end |
#highrisk_special_prefixes ⇒ highrisk_special_prefixes
Access the highrisk_special_prefixes
535 536 537 |
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb', line 535 def highrisk_special_prefixes context.highrisk_special_prefixes end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
548 549 550 551 |
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb', line 548 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Voice.V1.CountryInstance #{values}>" end |
#iso_code ⇒ String
Returns The [ISO country code](en.wikipedia.org/wiki/ISO_3166-1_alpha-2).
472 473 474 |
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb', line 472 def iso_code @properties['iso_code'] end |
#links ⇒ Hash
Returns A list of URLs related to this resource.
520 521 522 |
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb', line 520 def links @properties['links'] end |
#low_risk_numbers_enabled ⇒ Boolean
Returns Whether dialing to low-risk numbers is enabled.
496 497 498 |
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb', line 496 def low_risk_numbers_enabled @properties['low_risk_numbers_enabled'] end |
#name ⇒ String
Returns The name of the country.
478 479 480 |
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb', line 478 def name @properties['name'] end |
#to_s ⇒ Object
Provide a user friendly representation
541 542 543 544 |
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb', line 541 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Voice.V1.CountryInstance #{values}>" end |
#url ⇒ String
Returns The absolute URL of this resource.
514 515 516 |
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb', line 514 def url @properties['url'] end |