class Twilio::REST::Monitor::V1::AlertInstance
Public Class Methods
Initialize the AlertInstance
@param [Version] version Version
that contains the resource @param [Hash] payload payload that contains response from Twilio
@param [String] sid The SID of the Alert resource to fetch. @return [AlertInstance] AlertInstance
Twilio::REST::InstanceResource::new
# File lib/twilio-ruby/rest/monitor/v1/alert.rb 225 def initialize(version, payload, sid: nil) 226 super(version) 227 228 # Marshaled Properties 229 @properties = { 230 'account_sid' => payload['account_sid'], 231 'alert_text' => payload['alert_text'], 232 'api_version' => payload['api_version'], 233 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 234 'date_generated' => Twilio.deserialize_iso8601_datetime(payload['date_generated']), 235 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 236 'error_code' => payload['error_code'], 237 'log_level' => payload['log_level'], 238 'more_info' => payload['more_info'], 239 'request_method' => payload['request_method'], 240 'request_url' => payload['request_url'], 241 'request_variables' => payload['request_variables'], 242 'resource_sid' => payload['resource_sid'], 243 'response_body' => payload['response_body'], 244 'response_headers' => payload['response_headers'], 245 'sid' => payload['sid'], 246 'url' => payload['url'], 247 'request_headers' => payload['request_headers'], 248 'service_sid' => payload['service_sid'], 249 } 250 251 # Context 252 @instance_context = nil 253 @params = {'sid' => sid || @properties['sid'], } 254 end
Public Instance Methods
@return [String] The SID of the Account that created the resource
# File lib/twilio-ruby/rest/monitor/v1/alert.rb 269 def account_sid 270 @properties['account_sid'] 271 end
@return [String] The text of the alert
# File lib/twilio-ruby/rest/monitor/v1/alert.rb 275 def alert_text 276 @properties['alert_text'] 277 end
@return [String] The API version used when the alert was generated
# File lib/twilio-ruby/rest/monitor/v1/alert.rb 281 def api_version 282 @properties['api_version'] 283 end
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [AlertContext] AlertContext
for this AlertInstance
# File lib/twilio-ruby/rest/monitor/v1/alert.rb 260 def context 261 unless @instance_context 262 @instance_context = AlertContext.new(@version, @params['sid'], ) 263 end 264 @instance_context 265 end
@return [Time] The ISO 8601 date and time in GMT when the resource was created
# File lib/twilio-ruby/rest/monitor/v1/alert.rb 287 def date_created 288 @properties['date_created'] 289 end
@return [Time] The date and time when the alert was generated specified in ISO 8601 format
# File lib/twilio-ruby/rest/monitor/v1/alert.rb 293 def date_generated 294 @properties['date_generated'] 295 end
@return [Time] The ISO 8601 date and time in GMT when the resource was last updated
# File lib/twilio-ruby/rest/monitor/v1/alert.rb 299 def date_updated 300 @properties['date_updated'] 301 end
@return [String] The error code for the condition that generated the alert
# File lib/twilio-ruby/rest/monitor/v1/alert.rb 305 def error_code 306 @properties['error_code'] 307 end
Fetch the AlertInstance
@return [AlertInstance] Fetched AlertInstance
# File lib/twilio-ruby/rest/monitor/v1/alert.rb 384 def fetch 385 context.fetch 386 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/monitor/v1/alert.rb 397 def inspect 398 values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") 399 "<Twilio.Monitor.V1.AlertInstance #{values}>" 400 end
@return [String] The log level
# File lib/twilio-ruby/rest/monitor/v1/alert.rb 311 def log_level 312 @properties['log_level'] 313 end
@return [String] The URL of the page in our Error Dictionary with more information about the error condition
# File lib/twilio-ruby/rest/monitor/v1/alert.rb 317 def more_info 318 @properties['more_info'] 319 end
@return [String] The request headers of the request that generated the alert
# File lib/twilio-ruby/rest/monitor/v1/alert.rb 371 def request_headers 372 @properties['request_headers'] 373 end
@return [String] The method used by the request that generated the alert
# File lib/twilio-ruby/rest/monitor/v1/alert.rb 323 def request_method 324 @properties['request_method'] 325 end
@return [String] The URL of the request that generated the alert
# File lib/twilio-ruby/rest/monitor/v1/alert.rb 329 def request_url 330 @properties['request_url'] 331 end
@return [String] The variables passed in the request that generated the alert
# File lib/twilio-ruby/rest/monitor/v1/alert.rb 335 def request_variables 336 @properties['request_variables'] 337 end
@return [String] The SID of the resource for which the alert was generated
# File lib/twilio-ruby/rest/monitor/v1/alert.rb 341 def resource_sid 342 @properties['resource_sid'] 343 end
@return [String] The response body of the request that generated the alert
# File lib/twilio-ruby/rest/monitor/v1/alert.rb 347 def response_body 348 @properties['response_body'] 349 end
@return [String] The response headers of the request that generated the alert
# File lib/twilio-ruby/rest/monitor/v1/alert.rb 353 def response_headers 354 @properties['response_headers'] 355 end
@return [String] The SID of the service or resource that generated the alert
# File lib/twilio-ruby/rest/monitor/v1/alert.rb 377 def service_sid 378 @properties['service_sid'] 379 end
@return [String] The unique string that identifies the resource
# File lib/twilio-ruby/rest/monitor/v1/alert.rb 359 def sid 360 @properties['sid'] 361 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/monitor/v1/alert.rb 390 def to_s 391 values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") 392 "<Twilio.Monitor.V1.AlertInstance #{values}>" 393 end
@return [String] The absolute URL of the Alert resource
# File lib/twilio-ruby/rest/monitor/v1/alert.rb 365 def url 366 @properties['url'] 367 end