class Twilio::REST::Voice::V1::DialingPermissionsList::CountryInstance
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 help@twilio.com.
Public Class Methods
Initialize the CountryInstance
@param [Version] version Version
that contains the resource @param [Hash] payload payload that contains response from Twilio
@param [String] iso_code
The {ISO country
code}[https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2] of the DialingPermissions Country resource to fetch
@return [CountryInstance] CountryInstance
Twilio::REST::InstanceResource::new
# File lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb 286 def initialize(version, payload, iso_code: nil) 287 super(version) 288 289 # Marshaled Properties 290 @properties = { 291 'iso_code' => payload['iso_code'], 292 'name' => payload['name'], 293 'continent' => payload['continent'], 294 'country_codes' => payload['country_codes'], 295 'low_risk_numbers_enabled' => payload['low_risk_numbers_enabled'], 296 'high_risk_special_numbers_enabled' => payload['high_risk_special_numbers_enabled'], 297 'high_risk_tollfraud_numbers_enabled' => payload['high_risk_tollfraud_numbers_enabled'], 298 'url' => payload['url'], 299 'links' => payload['links'], 300 } 301 302 # Context 303 @instance_context = nil 304 @params = {'iso_code' => iso_code || @properties['iso_code'], } 305 end
Public Instance Methods
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [CountryContext] CountryContext
for this CountryInstance
# File lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb 311 def context 312 unless @instance_context 313 @instance_context = CountryContext.new(@version, @params['iso_code'], ) 314 end 315 @instance_context 316 end
@return [String] The name of the continent in which the country is located
# File lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb 332 def continent 333 @properties['continent'] 334 end
@return [Array] The E.164 assigned country codes(s)
# File lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb 338 def country_codes 339 @properties['country_codes'] 340 end
Fetch the CountryInstance
@return [CountryInstance] Fetched CountryInstance
# File lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb 375 def fetch 376 context.fetch 377 end
@return [Boolean] Whether dialing to high-risk special services numbers is enabled
# File lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb 350 def high_risk_special_numbers_enabled 351 @properties['high_risk_special_numbers_enabled'] 352 end
@return [Boolean] Whether dialing to high-risk toll fraud numbers is enabled, else `false`
# File lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb 356 def high_risk_tollfraud_numbers_enabled 357 @properties['high_risk_tollfraud_numbers_enabled'] 358 end
Access the highrisk_special_prefixes
@return [highrisk_special_prefixes] highrisk_special_prefixes
# File lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb 382 def highrisk_special_prefixes 383 context.highrisk_special_prefixes 384 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb 395 def inspect 396 values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") 397 "<Twilio.Voice.V1.CountryInstance #{values}>" 398 end
@return [String] The ISO country code
# File lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb 320 def iso_code 321 @properties['iso_code'] 322 end
@return [String] A list of URLs related to this resource
# File lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb 368 def links 369 @properties['links'] 370 end
@return [Boolean] Whether dialing to low-risk numbers is enabled
# File lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb 344 def low_risk_numbers_enabled 345 @properties['low_risk_numbers_enabled'] 346 end
@return [String] The name of the country
# File lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb 326 def name 327 @properties['name'] 328 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb 388 def to_s 389 values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") 390 "<Twilio.Voice.V1.CountryInstance #{values}>" 391 end
@return [String] The absolute URL of this resource
# File lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb 362 def url 363 @properties['url'] 364 end