Class: Twilio::REST::Pricing::V1::MessagingList::CountryInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Pricing::V1::MessagingList::CountryInstance
- Defined in:
- lib/twilio-ruby/rest/pricing/v1/messaging/country.rb
Instance Method Summary collapse
-
#context ⇒ CountryContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#country ⇒ String
The name of the country.
-
#fetch ⇒ CountryInstance
Fetch the CountryInstance.
-
#inbound_sms_prices ⇒ Array[String]
The list of InboundPrice records.
-
#initialize(version, payload, iso_country: nil) ⇒ CountryInstance
constructor
Initialize the CountryInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#iso_country ⇒ String
The ISO country code.
-
#outbound_sms_prices ⇒ Array[String]
The list of OutboundSMSPrice records.
-
#price_unit ⇒ String
The currency in which prices are measured, in ISO 4127 format (e.g. usd, eur, jpy).
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#url ⇒ String
The absolute URL of the resource.
Constructor Details
#initialize(version, payload, iso_country: nil) ⇒ CountryInstance
Initialize the CountryInstance
192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 |
# File 'lib/twilio-ruby/rest/pricing/v1/messaging/country.rb', line 192 def initialize(version, payload, iso_country: nil) super(version) # Marshaled Properties @properties = { 'country' => payload['country'], 'iso_country' => payload['iso_country'], 'outbound_sms_prices' => payload['outbound_sms_prices'], 'inbound_sms_prices' => payload['inbound_sms_prices'], 'price_unit' => payload['price_unit'], 'url' => payload['url'], } # Context @instance_context = nil @params = {'iso_country' => iso_country || @properties['iso_country'], } 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
214 215 216 217 218 219 |
# File 'lib/twilio-ruby/rest/pricing/v1/messaging/country.rb', line 214 def context unless @instance_context @instance_context = CountryContext.new(@version, @params['iso_country'], ) end @instance_context end |
#country ⇒ String
Returns The name of the country.
223 224 225 |
# File 'lib/twilio-ruby/rest/pricing/v1/messaging/country.rb', line 223 def country @properties['country'] end |
#fetch ⇒ CountryInstance
Fetch the CountryInstance
260 261 262 |
# File 'lib/twilio-ruby/rest/pricing/v1/messaging/country.rb', line 260 def fetch context.fetch end |
#inbound_sms_prices ⇒ Array[String]
Returns The list of InboundPrice records.
241 242 243 |
# File 'lib/twilio-ruby/rest/pricing/v1/messaging/country.rb', line 241 def inbound_sms_prices @properties['inbound_sms_prices'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
273 274 275 276 |
# File 'lib/twilio-ruby/rest/pricing/v1/messaging/country.rb', line 273 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Pricing.V1.CountryInstance #{values}>" end |
#iso_country ⇒ String
Returns The ISO country code.
229 230 231 |
# File 'lib/twilio-ruby/rest/pricing/v1/messaging/country.rb', line 229 def iso_country @properties['iso_country'] end |
#outbound_sms_prices ⇒ Array[String]
Returns The list of OutboundSMSPrice records.
235 236 237 |
# File 'lib/twilio-ruby/rest/pricing/v1/messaging/country.rb', line 235 def outbound_sms_prices @properties['outbound_sms_prices'] end |
#price_unit ⇒ String
Returns The currency in which prices are measured, in ISO 4127 format (e.g. usd, eur, jpy).
247 248 249 |
# File 'lib/twilio-ruby/rest/pricing/v1/messaging/country.rb', line 247 def price_unit @properties['price_unit'] end |
#to_s ⇒ Object
Provide a user friendly representation
266 267 268 269 |
# File 'lib/twilio-ruby/rest/pricing/v1/messaging/country.rb', line 266 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Pricing.V1.CountryInstance #{values}>" end |
#url ⇒ String
Returns The absolute URL of the resource.
253 254 255 |
# File 'lib/twilio-ruby/rest/pricing/v1/messaging/country.rb', line 253 def url @properties['url'] end |