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 unique sid that identifies this account.
-
#api_version ⇒ String
The version of the Twilio API in use.
-
#call_sid ⇒ String
The string that uniquely identifies the call.
-
#context ⇒ NotificationContext
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.
-
#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
A string that uniquely identifies this notification.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#uri ⇒ String
The URI for this resource.
Constructor Details
#initialize(version, payload, account_sid: nil, sid: nil) ⇒ NotificationInstance
Initialize the NotificationInstance
228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 228 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
Returns The unique sid that identifies this account.
270 271 272 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 270 def account_sid @properties['account_sid'] end |
#api_version ⇒ String
Returns The version of the Twilio API in use.
276 277 278 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 276 def api_version @properties['api_version'] end |
#call_sid ⇒ String
Returns The string that uniquely identifies the call.
282 283 284 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 282 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
261 262 263 264 265 266 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 261 def context unless @instance_context @instance_context = NotificationContext.new(@version, @params['account_sid'], @params['sid'], ) end @instance_context end |
#date_created ⇒ Time
Returns The date this resource was created.
288 289 290 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 288 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date this resource was last updated.
294 295 296 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 294 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Deletes the NotificationInstance
380 381 382 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 380 def delete context.delete end |
#error_code ⇒ String
Returns A unique error code corresponding to the notification.
300 301 302 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 300 def error_code @properties['error_code'] end |
#fetch ⇒ NotificationInstance
Fetch a NotificationInstance
373 374 375 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 373 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
393 394 395 396 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 393 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Api.V2010.NotificationInstance #{values}>" end |
#log ⇒ String
Returns An integer log level.
306 307 308 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 306 def log @properties['log'] end |
#message_date ⇒ Time
Returns The date the notification was generated.
312 313 314 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 312 def @properties['message_date'] end |
#message_text ⇒ String
Returns The text of the notification.
318 319 320 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 318 def @properties['message_text'] end |
#more_info ⇒ String
Returns A URL for more information about the error code.
324 325 326 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 324 def more_info @properties['more_info'] end |
#request_method ⇒ String
Returns HTTP method used with the request url.
330 331 332 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 330 def request_method @properties['request_method'] end |
#request_url ⇒ String
Returns URL of the resource that generated the notification.
336 337 338 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 336 def request_url @properties['request_url'] end |
#request_variables ⇒ String
Returns Twilio-generated HTTP variables sent to the server.
342 343 344 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 342 def request_variables @properties['request_variables'] end |
#response_body ⇒ String
Returns The HTTP body returned by your server.
348 349 350 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 348 def response_body @properties['response_body'] end |
#response_headers ⇒ String
Returns The HTTP headers returned by your server.
354 355 356 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 354 def response_headers @properties['response_headers'] end |
#sid ⇒ String
Returns A string that uniquely identifies this notification.
360 361 362 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 360 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
386 387 388 389 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 386 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Api.V2010.NotificationInstance #{values}>" end |
#uri ⇒ String
Returns The URI for this resource.
366 367 368 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 366 def uri @properties['uri'] end |