Class: Twilio::REST::Api::V2010::AccountContext::ShortCodeInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Api::V2010::AccountContext::ShortCodeInstance
- Defined in:
- lib/twilio-ruby/rest/api/v2010/account/short_code.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The unique sid that identifies this account.
-
#api_version ⇒ String
The API version to use.
-
#context ⇒ ShortCodeContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date this resource was created.
-
#date_updated ⇒ Time
The date this resource was last updated.
-
#fetch ⇒ ShortCodeInstance
Fetch a ShortCodeInstance.
-
#friendly_name ⇒ String
A human readable description of this resource.
-
#initialize(version, payload, account_sid: nil, sid: nil) ⇒ ShortCodeInstance
constructor
Initialize the ShortCodeInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#short_code ⇒ String
The short code.
-
#sid ⇒ String
A string that uniquely identifies this short-codes.
-
#sms_fallback_method ⇒ String
HTTP method Twilio will use with sms fallback url.
-
#sms_fallback_url ⇒ String
URL Twilio will request if an error occurs in executing TwiML.
-
#sms_method ⇒ String
HTTP method to use when requesting the sms url.
-
#sms_url ⇒ String
URL Twilio will request when receiving an SMS.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(friendly_name: :unset, api_version: :unset, sms_url: :unset, sms_method: :unset, sms_fallback_url: :unset, sms_fallback_method: :unset) ⇒ ShortCodeInstance
Update the ShortCodeInstance.
-
#uri ⇒ String
The URI for this resource.
Constructor Details
#initialize(version, payload, account_sid: nil, sid: nil) ⇒ ShortCodeInstance
Initialize the ShortCodeInstance
257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 |
# File 'lib/twilio-ruby/rest/api/v2010/account/short_code.rb', line 257 def initialize(version, payload, account_sid: nil, sid: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'api_version' => payload['api_version'], 'date_created' => Twilio.deserialize_rfc2822(payload['date_created']), 'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']), 'friendly_name' => payload['friendly_name'], 'short_code' => payload['short_code'], 'sid' => payload['sid'], 'sms_fallback_method' => payload['sms_fallback_method'], 'sms_fallback_url' => payload['sms_fallback_url'], 'sms_method' => payload['sms_method'], 'sms_url' => payload['sms_url'], 'uri' => payload['uri'], } # Context @instance_context = nil @params = {'account_sid' => account_sid, 'sid' => sid || @properties['sid'], } end |
Instance Method Details
#account_sid ⇒ String
Returns The unique sid that identifies this account.
294 295 296 |
# File 'lib/twilio-ruby/rest/api/v2010/account/short_code.rb', line 294 def account_sid @properties['account_sid'] end |
#api_version ⇒ String
Returns The API version to use.
300 301 302 |
# File 'lib/twilio-ruby/rest/api/v2010/account/short_code.rb', line 300 def api_version @properties['api_version'] 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
285 286 287 288 289 290 |
# File 'lib/twilio-ruby/rest/api/v2010/account/short_code.rb', line 285 def context unless @instance_context @instance_context = ShortCodeContext.new(@version, @params['account_sid'], @params['sid'], ) end @instance_context end |
#date_created ⇒ Time
Returns The date this resource was created.
306 307 308 |
# File 'lib/twilio-ruby/rest/api/v2010/account/short_code.rb', line 306 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date this resource was last updated.
312 313 314 |
# File 'lib/twilio-ruby/rest/api/v2010/account/short_code.rb', line 312 def date_updated @properties['date_updated'] end |
#fetch ⇒ ShortCodeInstance
Fetch a ShortCodeInstance
367 368 369 |
# File 'lib/twilio-ruby/rest/api/v2010/account/short_code.rb', line 367 def fetch context.fetch end |
#friendly_name ⇒ String
Returns A human readable description of this resource.
318 319 320 |
# File 'lib/twilio-ruby/rest/api/v2010/account/short_code.rb', line 318 def friendly_name @properties['friendly_name'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
407 408 409 410 |
# File 'lib/twilio-ruby/rest/api/v2010/account/short_code.rb', line 407 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Api.V2010.ShortCodeInstance #{values}>" end |
#short_code ⇒ String
Returns The short code. e.g., 894546.
324 325 326 |
# File 'lib/twilio-ruby/rest/api/v2010/account/short_code.rb', line 324 def short_code @properties['short_code'] end |
#sid ⇒ String
Returns A string that uniquely identifies this short-codes.
330 331 332 |
# File 'lib/twilio-ruby/rest/api/v2010/account/short_code.rb', line 330 def sid @properties['sid'] end |
#sms_fallback_method ⇒ String
Returns HTTP method Twilio will use with sms fallback url.
336 337 338 |
# File 'lib/twilio-ruby/rest/api/v2010/account/short_code.rb', line 336 def sms_fallback_method @properties['sms_fallback_method'] end |
#sms_fallback_url ⇒ String
Returns URL Twilio will request if an error occurs in executing TwiML.
342 343 344 |
# File 'lib/twilio-ruby/rest/api/v2010/account/short_code.rb', line 342 def sms_fallback_url @properties['sms_fallback_url'] end |
#sms_method ⇒ String
Returns HTTP method to use when requesting the sms url.
348 349 350 |
# File 'lib/twilio-ruby/rest/api/v2010/account/short_code.rb', line 348 def sms_method @properties['sms_method'] end |
#sms_url ⇒ String
Returns URL Twilio will request when receiving an SMS.
354 355 356 |
# File 'lib/twilio-ruby/rest/api/v2010/account/short_code.rb', line 354 def sms_url @properties['sms_url'] end |
#to_s ⇒ Object
Provide a user friendly representation
400 401 402 403 |
# File 'lib/twilio-ruby/rest/api/v2010/account/short_code.rb', line 400 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Api.V2010.ShortCodeInstance #{values}>" end |
#update(friendly_name: :unset, api_version: :unset, sms_url: :unset, sms_method: :unset, sms_fallback_url: :unset, sms_fallback_method: :unset) ⇒ ShortCodeInstance
Update the ShortCodeInstance
387 388 389 390 391 392 393 394 395 396 |
# File 'lib/twilio-ruby/rest/api/v2010/account/short_code.rb', line 387 def update(friendly_name: :unset, api_version: :unset, sms_url: :unset, sms_method: :unset, sms_fallback_url: :unset, sms_fallback_method: :unset) context.update( friendly_name: friendly_name, api_version: api_version, sms_url: sms_url, sms_method: sms_method, sms_fallback_url: sms_fallback_url, sms_fallback_method: sms_fallback_method, ) end |
#uri ⇒ String
Returns The URI for this resource.
360 361 362 |
# File 'lib/twilio-ruby/rest/api/v2010/account/short_code.rb', line 360 def uri @properties['uri'] end |