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](www.twilio.com/docs/iam/api/account) that created the Notification resource.
-
#api_version ⇒ String
The API version used to generate the notification.
-
#call_sid ⇒ String
The SID of the [Call](www.twilio.com/docs/voice/api/call-resource) the Notification 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 date and time in GMT that the resource was created specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
-
#date_updated ⇒ Time
The date and time in GMT that the resource was last updated specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
-
#error_code ⇒ String
A unique error code for the error condition that is described in our [Error Dictionary](www.twilio.com/docs/api/errors).
-
#fetch ⇒ NotificationInstance
Fetch the 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 that corresponds to the type of notification: ‘0` is ERROR, `1` is WARNING.
-
#message_date ⇒ Time
The date the notification was actually generated in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
-
#message_text ⇒ String
The text of the notification.
-
#more_info ⇒ String
The URL for more information about the error condition.
-
#request_method ⇒ String
The HTTP method used to generate the notification.
-
#request_url ⇒ String
The URL of the resource that generated the notification.
-
#request_variables ⇒ String
The HTTP GET or POST variables we sent to your 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 that we created to identify the Notification 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
420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 420 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'], 'request_variables' => payload['request_variables'], 'response_body' => payload['response_body'], 'response_headers' => payload['response_headers'], 'sid' => payload['sid'], '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 SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Notification resource.
463 464 465 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 463 def account_sid @properties['account_sid'] end |
#api_version ⇒ String
Returns The API version used to generate the notification. Can be empty for events that don’t have a specific API version, such as incoming phone calls.
469 470 471 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 469 def api_version @properties['api_version'] end |
#call_sid ⇒ String
Returns The SID of the [Call](www.twilio.com/docs/voice/api/call-resource) the Notification resource is associated with.
475 476 477 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 475 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
454 455 456 457 458 459 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 454 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 and time in GMT that the resource was created specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
481 482 483 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 481 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date and time in GMT that the resource was last updated specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
487 488 489 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 487 def date_updated @properties['date_updated'] end |
#error_code ⇒ String
Returns A unique error code for the error condition that is described in our [Error Dictionary](www.twilio.com/docs/api/errors).
493 494 495 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 493 def error_code @properties['error_code'] end |
#fetch ⇒ NotificationInstance
Fetch the NotificationInstance
566 567 568 569 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 566 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
580 581 582 583 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 580 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Api.V2010.NotificationInstance #{values}>" end |
#log ⇒ String
Returns An integer log level that corresponds to the type of notification: ‘0` is ERROR, `1` is WARNING.
499 500 501 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 499 def log @properties['log'] end |
#message_date ⇒ Time
Returns The date the notification was actually generated in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format. Message buffering can cause this value to differ from ‘date_created`.
505 506 507 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 505 def @properties['message_date'] end |
#message_text ⇒ String
Returns The text of the notification.
511 512 513 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 511 def @properties['message_text'] end |
#more_info ⇒ String
Returns The URL for more information about the error condition. This value is a page in our [Error Dictionary](www.twilio.com/docs/api/errors).
517 518 519 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 517 def more_info @properties['more_info'] end |
#request_method ⇒ String
Returns The HTTP method used to generate the notification. If the notification was generated during a phone call, this is the HTTP Method used to request the resource on your server. If the notification was generated by your use of our REST API, this is the HTTP method used to call the resource on our servers.
523 524 525 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 523 def request_method @properties['request_method'] end |
#request_url ⇒ String
Returns The URL of the resource that generated the notification. If the notification was generated during a phone call, this is the URL of the resource on your server that caused the notification. If the notification was generated by your use of our REST API, this is the URL of the resource you called.
529 530 531 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 529 def request_url @properties['request_url'] end |
#request_variables ⇒ String
Returns The HTTP GET or POST variables we sent to your server. However, if the notification was generated by our REST API, this contains the HTTP POST or PUT variables you sent to our API.
535 536 537 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 535 def request_variables @properties['request_variables'] end |
#response_body ⇒ String
Returns The HTTP body returned by your server.
541 542 543 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 541 def response_body @properties['response_body'] end |
#response_headers ⇒ String
Returns The HTTP headers returned by your server.
547 548 549 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 547 def response_headers @properties['response_headers'] end |
#sid ⇒ String
Returns The unique string that that we created to identify the Notification resource.
553 554 555 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 553 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
573 574 575 576 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 573 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Api.V2010.NotificationInstance #{values}>" end |
#uri ⇒ String
Returns The URI of the resource, relative to ‘api.twilio.com`.
559 560 561 |
# File 'lib/twilio-ruby/rest/api/v2010/account/notification.rb', line 559 def uri @properties['uri'] end |