class Twilio::REST::Api::V2010::AccountContext::NotificationInstance
Public Class Methods
Initialize the NotificationInstance
@param [Version] version Version
that contains the resource @param [Hash] payload payload that contains response from Twilio
@param [String] account_sid
The SID of the
{Account}[https://www.twilio.com/docs/iam/api/account] that created the Notification resource.
@param [String] sid The Twilio-provided string that uniquely identifies the
Notification resource to fetch.
@return [NotificationInstance] NotificationInstance
Twilio::REST::InstanceResource::new
# File lib/twilio-ruby/rest/api/v2010/account/notification.rb 239 def initialize(version, payload, account_sid: nil, sid: nil) 240 super(version) 241 242 # Marshaled Properties 243 @properties = { 244 'account_sid' => payload['account_sid'], 245 'api_version' => payload['api_version'], 246 'call_sid' => payload['call_sid'], 247 'date_created' => Twilio.deserialize_rfc2822(payload['date_created']), 248 'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']), 249 'error_code' => payload['error_code'], 250 'log' => payload['log'], 251 'message_date' => Twilio.deserialize_rfc2822(payload['message_date']), 252 'message_text' => payload['message_text'], 253 'more_info' => payload['more_info'], 254 'request_method' => payload['request_method'], 255 'request_url' => payload['request_url'], 256 'request_variables' => payload['request_variables'], 257 'response_body' => payload['response_body'], 258 'response_headers' => payload['response_headers'], 259 'sid' => payload['sid'], 260 'uri' => payload['uri'], 261 } 262 263 # Context 264 @instance_context = nil 265 @params = {'account_sid' => account_sid, 'sid' => sid || @properties['sid'], } 266 end
Public Instance Methods
@return [String] The SID of the Account that created the resource
# File lib/twilio-ruby/rest/api/v2010/account/notification.rb 281 def account_sid 282 @properties['account_sid'] 283 end
@return [String] The API version used to generate the notification
# File lib/twilio-ruby/rest/api/v2010/account/notification.rb 287 def api_version 288 @properties['api_version'] 289 end
@return [String] The SID of the Call the resource is associated with
# File lib/twilio-ruby/rest/api/v2010/account/notification.rb 293 def call_sid 294 @properties['call_sid'] 295 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 [NotificationContext] NotificationContext
for this NotificationInstance
# File lib/twilio-ruby/rest/api/v2010/account/notification.rb 272 def context 273 unless @instance_context 274 @instance_context = NotificationContext.new(@version, @params['account_sid'], @params['sid'], ) 275 end 276 @instance_context 277 end
@return [Time] The RFC 2822 date and time in GMT that the resource was created
# File lib/twilio-ruby/rest/api/v2010/account/notification.rb 299 def date_created 300 @properties['date_created'] 301 end
@return [Time] The RFC 2822 date and time in GMT that the resource was last updated
# File lib/twilio-ruby/rest/api/v2010/account/notification.rb 305 def date_updated 306 @properties['date_updated'] 307 end
@return [String] A unique error code corresponding to the notification
# File lib/twilio-ruby/rest/api/v2010/account/notification.rb 311 def error_code 312 @properties['error_code'] 313 end
Fetch the NotificationInstance
@return [NotificationInstance] Fetched NotificationInstance
# File lib/twilio-ruby/rest/api/v2010/account/notification.rb 384 def fetch 385 context.fetch 386 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/api/v2010/account/notification.rb 397 def inspect 398 values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") 399 "<Twilio.Api.V2010.NotificationInstance #{values}>" 400 end
@return [String] An integer log level
# File lib/twilio-ruby/rest/api/v2010/account/notification.rb 317 def log 318 @properties['log'] 319 end
@return [Time] The date the notification was generated
# File lib/twilio-ruby/rest/api/v2010/account/notification.rb 323 def message_date 324 @properties['message_date'] 325 end
@return [String] The text of the notification
# File lib/twilio-ruby/rest/api/v2010/account/notification.rb 329 def message_text 330 @properties['message_text'] 331 end
@return [String] A URL for more information about the error code
# File lib/twilio-ruby/rest/api/v2010/account/notification.rb 335 def more_info 336 @properties['more_info'] 337 end
@return [String] HTTP
method used with the request url
# File lib/twilio-ruby/rest/api/v2010/account/notification.rb 341 def request_method 342 @properties['request_method'] 343 end
@return [String] URL of the resource that generated the notification
# File lib/twilio-ruby/rest/api/v2010/account/notification.rb 347 def request_url 348 @properties['request_url'] 349 end
@return [String] Twilio-generated HTTP
variables sent to the server
# File lib/twilio-ruby/rest/api/v2010/account/notification.rb 353 def request_variables 354 @properties['request_variables'] 355 end
@return [String] The HTTP
body returned by your server
# File lib/twilio-ruby/rest/api/v2010/account/notification.rb 359 def response_body 360 @properties['response_body'] 361 end
@return [String] The HTTP
headers returned by your server
# File lib/twilio-ruby/rest/api/v2010/account/notification.rb 365 def response_headers 366 @properties['response_headers'] 367 end
@return [String] The unique string that identifies the resource
# File lib/twilio-ruby/rest/api/v2010/account/notification.rb 371 def sid 372 @properties['sid'] 373 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/api/v2010/account/notification.rb 390 def to_s 391 values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") 392 "<Twilio.Api.V2010.NotificationInstance #{values}>" 393 end
@return [String] The URI of the resource, relative to `api.twilio.com`
# File lib/twilio-ruby/rest/api/v2010/account/notification.rb 377 def uri 378 @properties['uri'] 379 end