Class: Twilio::REST::Api::V2010::AccountContext::NotificationInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Api::V2010::AccountContext::NotificationInstance
- Defined in:
- lib/twilio-ruby/rest/api/v2010/account/notification.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the Account that created the resource.
-
#api_version ⇒ String
The API version used to generate the notification.
-
#call_sid ⇒ String
The SID of the Call the resource is associated with.
-
#context ⇒ NotificationContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The RFC 2822 date and time in GMT that the resource was created.
-
#date_updated ⇒ Time
The RFC 2822 date and time in GMT that the resource was last updated.
-
#delete ⇒ Boolean
Deletes the NotificationInstance.
-
#error_code ⇒ String
A unique error code corresponding to the notification.
-
#fetch ⇒ NotificationInstance
Fetch a NotificationInstance.
-
#initialize(version, payload, account_sid: nil, sid: nil) ⇒ NotificationInstance
constructor
Initialize the NotificationInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#log ⇒ String
An integer log level.
-
#message_date ⇒ Time
The date the notification was generated.
-
#message_text ⇒ String
The text of the notification.
-
#more_info ⇒ String
A URL for more information about the error code.
-
#request_method ⇒ String
HTTP method used with the request url.
-
#request_url ⇒ String
URL of the resource that generated the notification.
-
#request_variables ⇒ String
Twilio-generated HTTP variables sent to the server.
-
#response_body ⇒ String
The HTTP body returned by your server.
-
#response_headers ⇒ String
The HTTP headers returned by your server.
-
#sid ⇒ String
The unique string that identifies the resource.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#uri ⇒ String
The URI of the resource, relative to ‘api.twilio.com`.
Constructor Details
#initialize(version, payload, account_sid: nil, sid: nil) ⇒ NotificationInstance
Initialize the NotificationInstance
254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 254 def initialize(version, payload, account_sid: nil, sid: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'api_version' => payload['api_version'], 'call_sid' => payload['call_sid'], 'date_created' => Twilio.deserialize_rfc2822(payload['date_created']), 'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']), 'error_code' => payload['error_code'], 'log' => payload['log'], 'message_date' => Twilio.deserialize_rfc2822(payload['message_date']), 'message_text' => payload['message_text'], 'more_info' => payload['more_info'], 'request_method' => payload['request_method'], 'request_url' => payload['request_url'], 'sid' => payload['sid'], 'uri' => payload['uri'], 'request_variables' => payload['request_variables'], 'response_body' => payload['response_body'], 'response_headers' => payload['response_headers'], } # Context @instance_context = nil @params = {'account_sid' => account_sid, 'sid' => sid || @properties['sid'], } end |
Instance Method Details
#account_sid ⇒ String
296 297 298 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 296 def account_sid @properties['account_sid'] end |
#api_version ⇒ String
302 303 304 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 302 def api_version @properties['api_version'] end |
#call_sid ⇒ String
308 309 310 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 308 def call_sid @properties['call_sid'] end |
#context ⇒ NotificationContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
287 288 289 290 291 292 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 287 def context unless @instance_context @instance_context = NotificationContext.new(@version, @params['account_sid'], @params['sid'], ) end @instance_context end |
#date_created ⇒ Time
314 315 316 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 314 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
320 321 322 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 320 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Deletes the NotificationInstance
406 407 408 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 406 def delete context.delete end |
#error_code ⇒ String
326 327 328 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 326 def error_code @properties['error_code'] end |
#fetch ⇒ NotificationInstance
Fetch a NotificationInstance
399 400 401 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 399 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
419 420 421 422 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 419 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Api.V2010.NotificationInstance #{values}>" end |
#log ⇒ String
332 333 334 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 332 def log @properties['log'] end |
#message_date ⇒ Time
338 339 340 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 338 def @properties['message_date'] end |
#message_text ⇒ String
344 345 346 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 344 def @properties['message_text'] end |
#more_info ⇒ String
350 351 352 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 350 def more_info @properties['more_info'] end |
#request_method ⇒ String
356 357 358 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 356 def request_method @properties['request_method'] end |
#request_url ⇒ String
362 363 364 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 362 def request_url @properties['request_url'] end |
#request_variables ⇒ String
368 369 370 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 368 def request_variables @properties['request_variables'] end |
#response_body ⇒ String
374 375 376 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 374 def response_body @properties['response_body'] end |
#response_headers ⇒ String
380 381 382 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 380 def response_headers @properties['response_headers'] end |
#sid ⇒ String
386 387 388 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 386 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
412 413 414 415 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 412 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Api.V2010.NotificationInstance #{values}>" end |
#uri ⇒ String
392 393 394 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 392 def uri @properties['uri'] end |