Class: Twilio::REST::Api::V2010::AccountContext::RecordingContext::AddOnResultContext::PayloadInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, account_sid: nil, reference_sid: nil, add_on_result_sid: nil, sid: nil) ⇒ PayloadInstance

Initialize the PayloadInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • account_sid (String) (defaults to: nil)

    The SID of the Account that created the Recording AddOnResult Payload resource.

  • reference_sid (String) (defaults to: nil)

    The SID of the recording to which the AddOnResult resource that contains the payload belongs.

  • add_on_result_sid (String) (defaults to: nil)

    The SID of the AddOnResult to which the payload belongs.

  • sid (String) (defaults to: nil)

    The Twilio-provided string that uniquely identifies the Recording AddOnResult Payload resource to fetch.


242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload.rb', line 242

def initialize(version, payload, account_sid: nil, reference_sid: nil, add_on_result_sid: nil, sid: nil)
  super(version)

  # Marshaled Properties
  @properties = {
      'sid' => payload['sid'],
      'add_on_result_sid' => payload['add_on_result_sid'],
      'account_sid' => payload['account_sid'],
      'label' => payload['label'],
      'add_on_sid' => payload['add_on_sid'],
      'add_on_configuration_sid' => payload['add_on_configuration_sid'],
      'content_type' => payload['content_type'],
      'date_created' => Twilio.deserialize_rfc2822(payload['date_created']),
      'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']),
      'reference_sid' => payload['reference_sid'],
      'subresource_uris' => payload['subresource_uris'],
  }

  # Context
  @instance_context = nil
  @params = {
      'account_sid' => ,
      'reference_sid' => reference_sid,
      'add_on_result_sid' => add_on_result_sid,
      'sid' => sid || @properties['sid'],
  }
end

Instance Method Details

#account_sidString

Returns The SID of the Account that created the resource.

Returns:

  • (String)

    The SID of the Account that created the resource


301
302
303
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload.rb', line 301

def 
  @properties['account_sid']
end

#add_on_configuration_sidString

Returns The SID of the Add-on configuration.

Returns:

  • (String)

    The SID of the Add-on configuration


319
320
321
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload.rb', line 319

def add_on_configuration_sid
  @properties['add_on_configuration_sid']
end

#add_on_result_sidString

Returns The SID of the AddOnResult to which the payload belongs.

Returns:

  • (String)

    The SID of the AddOnResult to which the payload belongs


295
296
297
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload.rb', line 295

def add_on_result_sid
  @properties['add_on_result_sid']
end

#add_on_sidString

Returns The SID of the Add-on to which the result belongs.

Returns:

  • (String)

    The SID of the Add-on to which the result belongs


313
314
315
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload.rb', line 313

def add_on_sid
  @properties['add_on_sid']
end

#content_typeString

Returns The MIME type of the payload.

Returns:

  • (String)

    The MIME type of the payload


325
326
327
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload.rb', line 325

def content_type
  @properties['content_type']
end

#contextPayloadContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context

Returns:


274
275
276
277
278
279
280
281
282
283
284
285
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload.rb', line 274

def context
  unless @instance_context
    @instance_context = PayloadContext.new(
        @version,
        @params['account_sid'],
        @params['reference_sid'],
        @params['add_on_result_sid'],
        @params['sid'],
    )
  end
  @instance_context
end

#date_createdTime

Returns The RFC 2822 date and time in GMT that the resource was created.

Returns:

  • (Time)

    The RFC 2822 date and time in GMT that the resource was created


331
332
333
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload.rb', line 331

def date_created
  @properties['date_created']
end

#date_updatedTime

Returns The RFC 2822 date and time in GMT that the resource was last updated.

Returns:

  • (Time)

    The RFC 2822 date and time in GMT that the resource was last updated


337
338
339
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload.rb', line 337

def date_updated
  @properties['date_updated']
end

#deleteBoolean

Delete the PayloadInstance

Returns:

  • (Boolean)

    true if delete succeeds, false otherwise


363
364
365
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload.rb', line 363

def delete
  context.delete
end

#fetchPayloadInstance

Fetch the PayloadInstance

Returns:


356
357
358
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload.rb', line 356

def fetch
  context.fetch
end

#inspectObject

Provide a detailed, user friendly representation


376
377
378
379
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload.rb', line 376

def inspect
  values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
  "<Twilio.Api.V2010.PayloadInstance #{values}>"
end

#labelString

Returns The string that describes the payload.

Returns:

  • (String)

    The string that describes the payload


307
308
309
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload.rb', line 307

def label
  @properties['label']
end

#reference_sidString

Returns The SID of the recording to which the AddOnResult resource that contains the payload belongs.

Returns:

  • (String)

    The SID of the recording to which the AddOnResult resource that contains the payload belongs


343
344
345
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload.rb', line 343

def reference_sid
  @properties['reference_sid']
end

#sidString

Returns The unique string that identifies the resource.

Returns:

  • (String)

    The unique string that identifies the resource


289
290
291
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload.rb', line 289

def sid
  @properties['sid']
end

#subresource_urisString

Returns A list of related resources identified by their relative URIs.

Returns:

  • (String)

    A list of related resources identified by their relative URIs


349
350
351
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload.rb', line 349

def subresource_uris
  @properties['subresource_uris']
end

#to_sObject

Provide a user friendly representation


369
370
371
372
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload.rb', line 369

def to_s
  values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
  "<Twilio.Api.V2010.PayloadInstance #{values}>"
end