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 sid



216
217
218
219
220
221
222
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 216

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



242
243
244
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 242

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

#fetchCompositionInstance

Fetch a CompositionInstance

Returns:



227
228
229
230
231
232
233
234
235
236
237
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 227

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

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

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

#to_sObject

Provide a user friendly representation



248
249
250
251
# File 'lib/twilio-ruby/rest/video/v1/composition.rb', line 248

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