Class: Twilio::REST::Monitor::V1::AlertInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Monitor::V1::AlertInstance
- Defined in:
- lib/twilio-ruby/rest/monitor/v1/alert.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Alert resource.
-
#alert_text ⇒ String
The text of the alert.
-
#api_version ⇒ String
The API version used when the alert was generated.
-
#context ⇒ AlertContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date and time in GMT when the resource was created specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
-
#date_generated ⇒ Time
The date and time in GMT when the alert was generated specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601#UTC) format.
-
#date_updated ⇒ Time
The date and time in GMT when the resource was last updated specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
-
#error_code ⇒ String
The error code for the condition that generated the alert.
-
#fetch ⇒ AlertInstance
Fetch the AlertInstance.
-
#initialize(version, payload, sid: nil) ⇒ AlertInstance
constructor
Initialize the AlertInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#log_level ⇒ String
The log level.
-
#more_info ⇒ String
The URL of the page in our [Error Dictionary](www.twilio.com/docs/api/errors) with more information about the error condition.
-
#request_headers ⇒ String
The request headers of the request that generated the alert.
-
#request_method ⇒ String
The method used by the request that generated the alert.
-
#request_url ⇒ String
The URL of the request that generated the alert.
-
#request_variables ⇒ String
The variables passed in the request that generated the alert.
-
#resource_sid ⇒ String
The SID of the resource for which the alert was generated.
-
#response_body ⇒ String
The response body of the request that generated the alert.
-
#response_headers ⇒ String
The response headers of the request that generated the alert.
-
#service_sid ⇒ String
The SID of the service or resource that generated the alert.
-
#sid ⇒ String
The unique string that we created to identify the Alert resource.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#url ⇒ String
The absolute URL of the Alert resource.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ AlertInstance
Initialize the AlertInstance
399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 |
# File 'lib/twilio-ruby/rest/monitor/v1/alert.rb', line 399 def initialize(version, payload , sid: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'alert_text' => payload['alert_text'], 'api_version' => payload['api_version'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_generated' => Twilio.deserialize_iso8601_datetime(payload['date_generated']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 'error_code' => payload['error_code'], 'log_level' => payload['log_level'], 'more_info' => payload['more_info'], 'request_method' => payload['request_method'], 'request_url' => payload['request_url'], 'request_variables' => payload['request_variables'], 'resource_sid' => payload['resource_sid'], 'response_body' => payload['response_body'], 'response_headers' => payload['response_headers'], 'sid' => payload['sid'], 'url' => payload['url'], 'request_headers' => payload['request_headers'], 'service_sid' => payload['service_sid'], } # Context @instance_context = nil @params = { 'sid' => sid || @properties['sid'] , } end |
Instance Method Details
#account_sid ⇒ String
444 445 446 |
# File 'lib/twilio-ruby/rest/monitor/v1/alert.rb', line 444 def account_sid @properties['account_sid'] end |
#alert_text ⇒ String
450 451 452 |
# File 'lib/twilio-ruby/rest/monitor/v1/alert.rb', line 450 def alert_text @properties['alert_text'] end |
#api_version ⇒ String
456 457 458 |
# File 'lib/twilio-ruby/rest/monitor/v1/alert.rb', line 456 def api_version @properties['api_version'] end |
#context ⇒ AlertContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
435 436 437 438 439 440 |
# File 'lib/twilio-ruby/rest/monitor/v1/alert.rb', line 435 def context unless @instance_context @instance_context = AlertContext.new(@version , @params['sid']) end @instance_context end |
#date_created ⇒ Time
462 463 464 |
# File 'lib/twilio-ruby/rest/monitor/v1/alert.rb', line 462 def date_created @properties['date_created'] end |
#date_generated ⇒ Time
468 469 470 |
# File 'lib/twilio-ruby/rest/monitor/v1/alert.rb', line 468 def date_generated @properties['date_generated'] end |
#date_updated ⇒ Time
474 475 476 |
# File 'lib/twilio-ruby/rest/monitor/v1/alert.rb', line 474 def date_updated @properties['date_updated'] end |
#error_code ⇒ String
480 481 482 |
# File 'lib/twilio-ruby/rest/monitor/v1/alert.rb', line 480 def error_code @properties['error_code'] end |
#fetch ⇒ AlertInstance
Fetch the AlertInstance
559 560 561 562 |
# File 'lib/twilio-ruby/rest/monitor/v1/alert.rb', line 559 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
573 574 575 576 |
# File 'lib/twilio-ruby/rest/monitor/v1/alert.rb', line 573 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Monitor.V1.AlertInstance #{values}>" end |
#log_level ⇒ String
486 487 488 |
# File 'lib/twilio-ruby/rest/monitor/v1/alert.rb', line 486 def log_level @properties['log_level'] end |
#more_info ⇒ String
492 493 494 |
# File 'lib/twilio-ruby/rest/monitor/v1/alert.rb', line 492 def more_info @properties['more_info'] end |
#request_headers ⇒ String
546 547 548 |
# File 'lib/twilio-ruby/rest/monitor/v1/alert.rb', line 546 def request_headers @properties['request_headers'] end |
#request_method ⇒ String
498 499 500 |
# File 'lib/twilio-ruby/rest/monitor/v1/alert.rb', line 498 def request_method @properties['request_method'] end |
#request_url ⇒ String
504 505 506 |
# File 'lib/twilio-ruby/rest/monitor/v1/alert.rb', line 504 def request_url @properties['request_url'] end |
#request_variables ⇒ String
510 511 512 |
# File 'lib/twilio-ruby/rest/monitor/v1/alert.rb', line 510 def request_variables @properties['request_variables'] end |
#resource_sid ⇒ String
516 517 518 |
# File 'lib/twilio-ruby/rest/monitor/v1/alert.rb', line 516 def resource_sid @properties['resource_sid'] end |
#response_body ⇒ String
522 523 524 |
# File 'lib/twilio-ruby/rest/monitor/v1/alert.rb', line 522 def response_body @properties['response_body'] end |
#response_headers ⇒ String
528 529 530 |
# File 'lib/twilio-ruby/rest/monitor/v1/alert.rb', line 528 def response_headers @properties['response_headers'] end |
#service_sid ⇒ String
552 553 554 |
# File 'lib/twilio-ruby/rest/monitor/v1/alert.rb', line 552 def service_sid @properties['service_sid'] end |
#sid ⇒ String
534 535 536 |
# File 'lib/twilio-ruby/rest/monitor/v1/alert.rb', line 534 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
566 567 568 569 |
# File 'lib/twilio-ruby/rest/monitor/v1/alert.rb', line 566 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Monitor.V1.AlertInstance #{values}>" end |
#url ⇒ String
540 541 542 |
# File 'lib/twilio-ruby/rest/monitor/v1/alert.rb', line 540 def url @properties['url'] end |