Class: Twilio::REST::Video::V1::CompositionContext

Inherits:
InstanceContext show all
Defined in:
lib/twilio-ruby/rest/video/v1/composition.rb

Overview

PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact [email protected].

Instance Method Summary collapse

Constructor Details

#initialize(version, sid) ⇒ CompositionContext

Initialize the CompositionContext

Parameters:

  • version (Version)

    Version that contains the resource

  • sid (String)

    The Composition Sid that uniquely identifies the Composition to fetch.



285
286
287
288
289
290
291
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 285

def initialize(version, sid)
  super(version)

  # Path Solution
  @solution = {sid: sid, }
  @uri = "/Compositions/#{@solution[:sid]}"
end

Instance Method Details

#deleteBoolean

Deletes the CompositionInstance

Returns:

  • (Boolean)

    true if delete succeeds, true otherwise



311
312
313
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 311

def delete
  @version.delete('delete', @uri)
end

#fetchCompositionInstance

Fetch a CompositionInstance

Returns:



296
297
298
299
300
301
302
303
304
305
306
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 296

def fetch
  params = Twilio::Values.of({})

  payload = @version.fetch(
      'GET',
      @uri,
      params,
  )

  CompositionInstance.new(@version, payload, sid: @solution[:sid], )
end

#inspectObject

Provide a detailed, user friendly representation



324
325
326
327
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 324

def inspect
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.Video.V1.CompositionContext #{context}>"
end

#to_sObject

Provide a user friendly representation



317
318
319
320
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 317

def to_s
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.Video.V1.CompositionContext #{context}>"
end