Class: Twilio::REST::Messaging::V1::ServiceContext::ShortCodeInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Messaging::V1::ServiceContext::ShortCodeInstance
- Defined in:
- lib/twilio-ruby/rest/messaging/v1/service/short_code.rb
Overview
PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the Account that created this resource.
-
#capabilities ⇒ Hash
Any array of values that indicate whether the number can receive calls or messages.
-
#context ⇒ ShortCodeContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#country_code ⇒ String
The 2-character ISO Country Code of the number.
-
#date_created ⇒ Time
The RFC 2822 date and time in GMT that this resource was created.
-
#date_updated ⇒ Time
The RFC 2822 date and time in GMT that this resource was last updated.
-
#delete ⇒ Boolean
Deletes the ShortCodeInstance.
-
#fetch ⇒ ShortCodeInstance
Fetch a ShortCodeInstance.
-
#initialize(version, payload, service_sid: nil, sid: nil) ⇒ ShortCodeInstance
constructor
Initialize the ShortCodeInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#service_sid ⇒ String
The SID of the Service that this resource is associated with.
-
#short_code ⇒ String
The E.164 format of the short code.
-
#sid ⇒ String
The unique string that identifies this resource.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#url ⇒ String
The absolute URL of this ShortCode resource.
Constructor Details
#initialize(version, payload, service_sid: nil, sid: nil) ⇒ ShortCodeInstance
Initialize the ShortCodeInstance
240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/short_code.rb', line 240 def initialize(version, payload, service_sid: nil, sid: nil) super(version) # Marshaled Properties @properties = { 'sid' => payload['sid'], 'account_sid' => payload['account_sid'], 'service_sid' => payload['service_sid'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 'short_code' => payload['short_code'], 'country_code' => payload['country_code'], 'capabilities' => payload['capabilities'], 'url' => payload['url'], } # Context @instance_context = nil @params = {'service_sid' => service_sid, 'sid' => sid || @properties['sid'], } end |
Instance Method Details
#account_sid ⇒ String
280 281 282 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/short_code.rb', line 280 def account_sid @properties['account_sid'] end |
#capabilities ⇒ Hash
316 317 318 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/short_code.rb', line 316 def capabilities @properties['capabilities'] end |
#context ⇒ ShortCodeContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
265 266 267 268 269 270 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/short_code.rb', line 265 def context unless @instance_context @instance_context = ShortCodeContext.new(@version, @params['service_sid'], @params['sid'], ) end @instance_context end |
#country_code ⇒ String
310 311 312 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/short_code.rb', line 310 def country_code @properties['country_code'] end |
#date_created ⇒ Time
292 293 294 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/short_code.rb', line 292 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
298 299 300 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/short_code.rb', line 298 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Deletes the ShortCodeInstance
329 330 331 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/short_code.rb', line 329 def delete context.delete end |
#fetch ⇒ ShortCodeInstance
Fetch a ShortCodeInstance
336 337 338 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/short_code.rb', line 336 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
349 350 351 352 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/short_code.rb', line 349 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Messaging.V1.ShortCodeInstance #{values}>" end |
#service_sid ⇒ String
286 287 288 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/short_code.rb', line 286 def service_sid @properties['service_sid'] end |
#short_code ⇒ String
304 305 306 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/short_code.rb', line 304 def short_code @properties['short_code'] end |
#sid ⇒ String
274 275 276 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/short_code.rb', line 274 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
342 343 344 345 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/short_code.rb', line 342 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Messaging.V1.ShortCodeInstance #{values}>" end |
#url ⇒ String
322 323 324 |
# File 'lib/twilio-ruby/rest/messaging/v1/service/short_code.rb', line 322 def url @properties['url'] end |