Class: Twilio::REST::Video::V1::RecordingContext

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

Instance Method Summary collapse

Constructor Details

#initialize(version, sid) ⇒ RecordingContext

Initialize the RecordingContext

Parameters:

  • version (Version)

    Version that contains the resource

  • sid (String)

    The SID of the Recording resource to fetch.



173
174
175
176
177
178
179
180
181
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 173

def initialize(version, sid)
    super(version)

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

    
end

Instance Method Details

#deleteBoolean

Delete the RecordingInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



185
186
187
188
189
190
191
192
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 185

def delete

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

#fetchRecordingInstance

Fetch the RecordingInstance

Returns:



197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 197

def fetch

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

#inspectObject

Provide a detailed, user friendly representation



223
224
225
226
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 223

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

#to_sObject

Provide a user friendly representation



216
217
218
219
# File 'lib/twilio-ruby/rest/video/v1/recording.rb', line 216

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