Class: Twilio::REST::Api::V2010::AccountContext::RecordingContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Api::V2010::AccountContext::RecordingContext
- Defined in:
- lib/twilio-ruby/rest/api/v2010/account/recording.rb,
lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result.rb,
lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb,
lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload.rb,
lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload/data.rb
Defined Under Namespace
Classes: AddOnResultContext, AddOnResultInstance, AddOnResultList, AddOnResultPage, TranscriptionContext, TranscriptionInstance, TranscriptionList, TranscriptionPage
Instance Method Summary collapse
-
#add_on_results(sid = :unset) ⇒ AddOnResultList, AddOnResultContext
Access the add_on_results.
-
#delete ⇒ Boolean
Delete the RecordingInstance.
-
#fetch(include_soft_deleted: :unset) ⇒ RecordingInstance
Fetch the RecordingInstance.
-
#initialize(version, account_sid, sid) ⇒ RecordingContext
constructor
Initialize the RecordingContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#transcriptions(sid = :unset) ⇒ TranscriptionList, TranscriptionContext
Access the transcriptions.
Constructor Details
#initialize(version, account_sid, sid) ⇒ RecordingContext
Initialize the RecordingContext
175 176 177 178 179 180 181 182 183 184 185 |
# File 'lib/twilio-ruby/rest/api/v2010/account/recording.rb', line 175 def initialize(version, account_sid, sid) super(version) # Path Solution @solution = { account_sid: account_sid, sid: sid, } @uri = "/Accounts/#{@solution[:account_sid]}/Recordings/#{@solution[:sid]}.json" # Dependents @add_on_results = nil @transcriptions = nil end |
Instance Method Details
#add_on_results(sid = :unset) ⇒ AddOnResultList, AddOnResultContext
Access the add_on_results
228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 |
# File 'lib/twilio-ruby/rest/api/v2010/account/recording.rb', line 228 def add_on_results(sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset return AddOnResultContext.new(@version, @solution[:account_sid], @solution[:sid],sid ) end unless @add_on_results @add_on_results = AddOnResultList.new( @version, account_sid: @solution[:account_sid], reference_sid: @solution[:sid], ) end @add_on_results end |
#delete ⇒ Boolean
Delete the RecordingInstance
189 190 191 192 193 194 195 196 |
# File 'lib/twilio-ruby/rest/api/v2010/account/recording.rb', line 189 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @version.delete('DELETE', @uri, headers: headers) end |
#fetch(include_soft_deleted: :unset) ⇒ RecordingInstance
Fetch the RecordingInstance
202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 |
# File 'lib/twilio-ruby/rest/api/v2010/account/recording.rb', line 202 def fetch( include_soft_deleted: :unset ) params = Twilio::Values.of({ 'IncludeSoftDeleted' => include_soft_deleted, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, params: params, headers: headers) RecordingInstance.new( @version, payload, account_sid: @solution[:account_sid], sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
272 273 274 275 |
# File 'lib/twilio-ruby/rest/api/v2010/account/recording.rb', line 272 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Api.V2010.RecordingContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
265 266 267 268 |
# File 'lib/twilio-ruby/rest/api/v2010/account/recording.rb', line 265 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Api.V2010.RecordingContext #{context}>" end |
#transcriptions(sid = :unset) ⇒ TranscriptionList, TranscriptionContext
Access the transcriptions
247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 |
# File 'lib/twilio-ruby/rest/api/v2010/account/recording.rb', line 247 def transcriptions(sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset return TranscriptionContext.new(@version, @solution[:account_sid], @solution[:sid],sid ) end unless @transcriptions @transcriptions = TranscriptionList.new( @version, account_sid: @solution[:account_sid], recording_sid: @solution[:sid], ) end @transcriptions end |