class Twilio::REST::Pricing::V2::VoiceList::CountryInstance

Public Class Methods

new(version, payload, iso_country: nil) click to toggle source

Initialize the CountryInstance @param [Version] version Version that contains the resource @param [Hash] payload payload that contains response from Twilio @param [String] iso_country The {ISO country

code}[https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2] of the origin-based
voice pricing information to fetch.

@return [CountryInstance] CountryInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/pricing/v2/voice/country.rb
192 def initialize(version, payload, iso_country: nil)
193   super(version)
194 
195   # Marshaled Properties
196   @properties = {
197       'country' => payload['country'],
198       'iso_country' => payload['iso_country'],
199       'outbound_prefix_prices' => payload['outbound_prefix_prices'],
200       'inbound_call_prices' => payload['inbound_call_prices'],
201       'price_unit' => payload['price_unit'],
202       'url' => payload['url'],
203   }
204 
205   # Context
206   @instance_context = nil
207   @params = {'iso_country' => iso_country || @properties['iso_country'], }
208 end

Public Instance Methods

context() click to toggle source

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/pricing/v2/voice/country.rb
214 def context
215   unless @instance_context
216     @instance_context = CountryContext.new(@version, @params['iso_country'], )
217   end
218   @instance_context
219 end
country() click to toggle source

@return [String] The name of the country

    # File lib/twilio-ruby/rest/pricing/v2/voice/country.rb
223 def country
224   @properties['country']
225 end
fetch() click to toggle source

Fetch the CountryInstance @return [CountryInstance] Fetched CountryInstance

    # File lib/twilio-ruby/rest/pricing/v2/voice/country.rb
260 def fetch
261   context.fetch
262 end
inbound_call_prices() click to toggle source

@return [Array] The list of InboundCallPrice records

    # File lib/twilio-ruby/rest/pricing/v2/voice/country.rb
241 def inbound_call_prices
242   @properties['inbound_call_prices']
243 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/pricing/v2/voice/country.rb
273 def inspect
274   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
275   "<Twilio.Pricing.V2.CountryInstance #{values}>"
276 end
iso_country() click to toggle source

@return [String] The ISO country code

    # File lib/twilio-ruby/rest/pricing/v2/voice/country.rb
229 def iso_country
230   @properties['iso_country']
231 end
outbound_prefix_prices() click to toggle source

@return [Array] The list of OutboundPrefixPriceWithOrigin records

    # File lib/twilio-ruby/rest/pricing/v2/voice/country.rb
235 def outbound_prefix_prices
236   @properties['outbound_prefix_prices']
237 end
price_unit() click to toggle source

@return [String] The currency in which prices are measured, in ISO 4127 format (e.g. usd, eur, jpy)

    # File lib/twilio-ruby/rest/pricing/v2/voice/country.rb
247 def price_unit
248   @properties['price_unit']
249 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/pricing/v2/voice/country.rb
266 def to_s
267   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
268   "<Twilio.Pricing.V2.CountryInstance #{values}>"
269 end
url() click to toggle source

@return [String] The absolute URL of the resource

    # File lib/twilio-ruby/rest/pricing/v2/voice/country.rb
253 def url
254   @properties['url']
255 end