class Twilio::REST::Api::V2010::AccountContext::CallContext::NotificationInstance

Public Class Methods

new(version, payload, account_sid: nil, call_sid: nil, sid: nil) click to toggle source

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 Call
Notification resource.

@param [String] call_sid The SID of the

{Call}[https://www.twilio.com/docs/voice/api/call-resource] the Call
Notification resource is associated with.

@param [String] sid The Twilio-provided string that uniquely identifies the Call

Notification resource to fetch.

@return [NotificationInstance] NotificationInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/api/v2010/account/call/notification.rb
255 def initialize(version, payload, account_sid: nil, call_sid: nil, sid: nil)
256   super(version)
257 
258   # Marshaled Properties
259   @properties = {
260       'account_sid' => payload['account_sid'],
261       'api_version' => payload['api_version'],
262       'call_sid' => payload['call_sid'],
263       'date_created' => Twilio.deserialize_rfc2822(payload['date_created']),
264       'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']),
265       'error_code' => payload['error_code'],
266       'log' => payload['log'],
267       'message_date' => Twilio.deserialize_rfc2822(payload['message_date']),
268       'message_text' => payload['message_text'],
269       'more_info' => payload['more_info'],
270       'request_method' => payload['request_method'],
271       'request_url' => payload['request_url'],
272       'request_variables' => payload['request_variables'],
273       'response_body' => payload['response_body'],
274       'response_headers' => payload['response_headers'],
275       'sid' => payload['sid'],
276       'uri' => payload['uri'],
277   }
278 
279   # Context
280   @instance_context = nil
281   @params = {'account_sid' => account_sid, 'call_sid' => call_sid, 'sid' => sid || @properties['sid'], }
282 end

Public Instance Methods

account_sid() click to toggle source

@return [String] The SID of the Account that created the resource

    # File lib/twilio-ruby/rest/api/v2010/account/call/notification.rb
302 def account_sid
303   @properties['account_sid']
304 end
api_version() click to toggle source

@return [String] The API version used to create the Call Notification resource

    # File lib/twilio-ruby/rest/api/v2010/account/call/notification.rb
308 def api_version
309   @properties['api_version']
310 end
call_sid() click to toggle source

@return [String] The SID of the Call the resource is associated with

    # File lib/twilio-ruby/rest/api/v2010/account/call/notification.rb
314 def call_sid
315   @properties['call_sid']
316 end
context() click to toggle source

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/call/notification.rb
288 def context
289   unless @instance_context
290     @instance_context = NotificationContext.new(
291         @version,
292         @params['account_sid'],
293         @params['call_sid'],
294         @params['sid'],
295     )
296   end
297   @instance_context
298 end
date_created() click to toggle source

@return [Time] The RFC 2822 date and time in GMT that the resource was created

    # File lib/twilio-ruby/rest/api/v2010/account/call/notification.rb
320 def date_created
321   @properties['date_created']
322 end
date_updated() click to toggle source

@return [Time] The RFC 2822 date and time in GMT that the resource was last updated

    # File lib/twilio-ruby/rest/api/v2010/account/call/notification.rb
326 def date_updated
327   @properties['date_updated']
328 end
error_code() click to toggle source

@return [String] A unique error code corresponding to the notification

    # File lib/twilio-ruby/rest/api/v2010/account/call/notification.rb
332 def error_code
333   @properties['error_code']
334 end
fetch() click to toggle source

Fetch the NotificationInstance @return [NotificationInstance] Fetched NotificationInstance

    # File lib/twilio-ruby/rest/api/v2010/account/call/notification.rb
405 def fetch
406   context.fetch
407 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/api/v2010/account/call/notification.rb
418 def inspect
419   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
420   "<Twilio.Api.V2010.NotificationInstance #{values}>"
421 end
log() click to toggle source

@return [String] An integer log level

    # File lib/twilio-ruby/rest/api/v2010/account/call/notification.rb
338 def log
339   @properties['log']
340 end
message_date() click to toggle source

@return [Time] The date the notification was generated

    # File lib/twilio-ruby/rest/api/v2010/account/call/notification.rb
344 def message_date
345   @properties['message_date']
346 end
message_text() click to toggle source

@return [String] The text of the notification

    # File lib/twilio-ruby/rest/api/v2010/account/call/notification.rb
350 def message_text
351   @properties['message_text']
352 end
more_info() click to toggle source

@return [String] A URL for more information about the error code

    # File lib/twilio-ruby/rest/api/v2010/account/call/notification.rb
356 def more_info
357   @properties['more_info']
358 end
request_method() click to toggle source

@return [String] HTTP method used with the request url

    # File lib/twilio-ruby/rest/api/v2010/account/call/notification.rb
362 def request_method
363   @properties['request_method']
364 end
request_url() click to toggle source

@return [String] URL of the resource that generated the notification

    # File lib/twilio-ruby/rest/api/v2010/account/call/notification.rb
368 def request_url
369   @properties['request_url']
370 end
request_variables() click to toggle source

@return [String] Twilio-generated HTTP variables sent to the server

    # File lib/twilio-ruby/rest/api/v2010/account/call/notification.rb
374 def request_variables
375   @properties['request_variables']
376 end
response_body() click to toggle source

@return [String] The HTTP body returned by your server

    # File lib/twilio-ruby/rest/api/v2010/account/call/notification.rb
380 def response_body
381   @properties['response_body']
382 end
response_headers() click to toggle source

@return [String] The HTTP headers returned by your server

    # File lib/twilio-ruby/rest/api/v2010/account/call/notification.rb
386 def response_headers
387   @properties['response_headers']
388 end
sid() click to toggle source

@return [String] The unique string that identifies the resource

    # File lib/twilio-ruby/rest/api/v2010/account/call/notification.rb
392 def sid
393   @properties['sid']
394 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/api/v2010/account/call/notification.rb
411 def to_s
412   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
413   "<Twilio.Api.V2010.NotificationInstance #{values}>"
414 end
uri() click to toggle source

@return [String] The URI of the resource, relative to `api.twilio.com`

    # File lib/twilio-ruby/rest/api/v2010/account/call/notification.rb
398 def uri
399   @properties['uri']
400 end