class Twilio::REST::Pricing::V1::MessagingList::CountryInstance
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_country
The {ISO country
code}[http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2] of the pricing information to fetch.
@return [CountryInstance] CountryInstance
Twilio::REST::InstanceResource::new
# File lib/twilio-ruby/rest/pricing/v1/messaging/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_sms_prices' => payload['outbound_sms_prices'], 200 'inbound_sms_prices' => payload['inbound_sms_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
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/v1/messaging/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
@return [String] The name of the country
# File lib/twilio-ruby/rest/pricing/v1/messaging/country.rb 223 def country 224 @properties['country'] 225 end
Fetch the CountryInstance
@return [CountryInstance] Fetched CountryInstance
# File lib/twilio-ruby/rest/pricing/v1/messaging/country.rb 260 def fetch 261 context.fetch 262 end
@return [Array] The list of InboundPrice records
# File lib/twilio-ruby/rest/pricing/v1/messaging/country.rb 241 def inbound_sms_prices 242 @properties['inbound_sms_prices'] 243 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/pricing/v1/messaging/country.rb 273 def inspect 274 values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") 275 "<Twilio.Pricing.V1.CountryInstance #{values}>" 276 end
@return [String] The ISO country code
# File lib/twilio-ruby/rest/pricing/v1/messaging/country.rb 229 def iso_country 230 @properties['iso_country'] 231 end
@return [Array] The list of OutboundSMSPrice records
# File lib/twilio-ruby/rest/pricing/v1/messaging/country.rb 235 def outbound_sms_prices 236 @properties['outbound_sms_prices'] 237 end
@return [String] The currency in which prices are measured, in ISO 4127 format (e.g. usd, eur, jpy)
# File lib/twilio-ruby/rest/pricing/v1/messaging/country.rb 247 def price_unit 248 @properties['price_unit'] 249 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/pricing/v1/messaging/country.rb 266 def to_s 267 values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") 268 "<Twilio.Pricing.V1.CountryInstance #{values}>" 269 end
@return [String] The absolute URL of the resource
# File lib/twilio-ruby/rest/pricing/v1/messaging/country.rb 253 def url 254 @properties['url'] 255 end