Class: Twilio::REST::Video::V1::RoomContext::RoomRecordingContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/video/v1/room/room_recording.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, room_sid, sid) ⇒ RoomRecordingContext

Initialize the RoomRecordingContext

Parameters:

  • version (Version)

    Version that contains the resource

  • room_sid (String)

    The SID of the Room resource with the recording to fetch.

  • sid (String)

    The SID of the RoomRecording resource to fetch.



163
164
165
166
167
168
169
170
171
# File 'lib/twilio-ruby/rest/video/v1/room/room_recording.rb', line 163

def initialize(version, room_sid, sid)
    super(version)

    # Path Solution
    @solution = { room_sid: room_sid, sid: sid,  }
    @uri = "/Rooms/#{@solution[:room_sid]}/Recordings/#{@solution[:sid]}"

    
end

Instance Method Details

#deleteBoolean

Delete the RoomRecordingInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



175
176
177
178
179
180
181
182
# File 'lib/twilio-ruby/rest/video/v1/room/room_recording.rb', line 175

def delete

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    @version.delete('DELETE', @uri, headers: headers)
end

#fetchRoomRecordingInstance

Fetch the RoomRecordingInstance

Returns:



187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
# File 'lib/twilio-ruby/rest/video/v1/room/room_recording.rb', line 187

def fetch

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    payload = @version.fetch('GET', @uri, headers: headers)
    RoomRecordingInstance.new(
        @version,
        payload,
        room_sid: @solution[:room_sid],
        sid: @solution[:sid],
    )
end

#inspectObject

Provide a detailed, user friendly representation



214
215
216
217
# File 'lib/twilio-ruby/rest/video/v1/room/room_recording.rb', line 214

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

#to_sObject

Provide a user friendly representation



207
208
209
210
# File 'lib/twilio-ruby/rest/video/v1/room/room_recording.rb', line 207

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