Class: Twilio::REST::Voice::V1::DialingPermissionsList::CountryContext

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

Defined Under Namespace

Classes: HighriskSpecialPrefixInstance, HighriskSpecialPrefixList, HighriskSpecialPrefixPage

Instance Method Summary collapse

Constructor Details

#initialize(version, iso_code) ⇒ CountryContext

Initialize the CountryContext

Parameters:



174
175
176
177
178
179
180
181
182
183
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb', line 174

def initialize(version, iso_code)
    super(version)

    # Path Solution
    @solution = { iso_code: iso_code,  }
    @uri = "/DialingPermissions/Countries/#{@solution[:iso_code]}"

    # Dependents
    @highrisk_special_prefixes = nil
end

Instance Method Details

#fetchCountryInstance

Fetch the CountryInstance

Returns:



187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb', line 187

def fetch

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    payload = @version.fetch('GET', @uri, headers: headers)
    CountryInstance.new(
        @version,
        payload,
        iso_code: @solution[:iso_code],
    )
end

#highrisk_special_prefixesHighriskSpecialPrefixList, HighriskSpecialPrefixContext

Access the highrisk_special_prefixes

Returns:



207
208
209
210
211
212
213
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb', line 207

def highrisk_special_prefixes
  unless @highrisk_special_prefixes
    @highrisk_special_prefixes = HighriskSpecialPrefixList.new(
            @version, iso_code: @solution[:iso_code], )
  end
  @highrisk_special_prefixes
end

#inspectObject

Provide a detailed, user friendly representation



224
225
226
227
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb', line 224

def inspect
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.Voice.V1.CountryContext #{context}>"
end

#to_sObject

Provide a user friendly representation



217
218
219
220
# File 'lib/twilio-ruby/rest/voice/v1/dialing_permissions/country.rb', line 217

def to_s
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.Voice.V1.CountryContext #{context}>"
end