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
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
-
#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).
-
#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 numbers is enabled, else ‘false`.
-
#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.
-
#links ⇒ String
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
286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 |
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb', line 286 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
311 312 313 314 315 316 |
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb', line 311 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.
332 333 334 |
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb', line 332 def continent @properties['continent'] end |
#country_codes ⇒ Array[String]
Returns The E.164 assigned country codes(s).
338 339 340 |
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb', line 338 def country_codes @properties['country_codes'] end |
#fetch ⇒ CountryInstance
Fetch the CountryInstance
375 376 377 |
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb', line 375 def fetch context.fetch end |
#high_risk_special_numbers_enabled ⇒ Boolean
Returns Whether dialing to high-risk special services numbers is enabled.
350 351 352 |
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb', line 350 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 numbers is enabled, else ‘false`.
356 357 358 |
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb', line 356 def high_risk_tollfraud_numbers_enabled @properties['high_risk_tollfraud_numbers_enabled'] end |
#highrisk_special_prefixes ⇒ highrisk_special_prefixes
Access the highrisk_special_prefixes
382 383 384 |
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb', line 382 def highrisk_special_prefixes context.highrisk_special_prefixes end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
395 396 397 398 |
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb', line 395 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Voice.V1.CountryInstance #{values}>" end |
#iso_code ⇒ String
Returns The ISO country code.
320 321 322 |
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb', line 320 def iso_code @properties['iso_code'] end |
#links ⇒ String
Returns A list of URLs related to this resource.
368 369 370 |
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb', line 368 def links @properties['links'] end |
#low_risk_numbers_enabled ⇒ Boolean
Returns Whether dialing to low-risk numbers is enabled.
344 345 346 |
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb', line 344 def low_risk_numbers_enabled @properties['low_risk_numbers_enabled'] end |
#name ⇒ String
Returns The name of the country.
326 327 328 |
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb', line 326 def name @properties['name'] end |
#to_s ⇒ Object
Provide a user friendly representation
388 389 390 391 |
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb', line 388 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.
362 363 364 |
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb', line 362 def url @properties['url'] end |