Class: Twilio::REST::Api::V2010::AccountContext::RecordingContext::AddOnResultContext::PayloadContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, account_sid, reference_sid, add_on_result_sid, sid) ⇒ PayloadContext

Initialize the PayloadContext

Parameters:

  • version (Version)

    Version that contains the resource

  • account_sid (String)

    The SID of the [Account](www.twilio.com/docs/api/rest/account) that created the Recording AddOnResult Payload resource to fetch.

  • reference_sid (String)

    The SID of the recording to which the AddOnResult resource that contains the payload to fetch belongs.

  • add_on_result_sid (String)

    The SID of the AddOnResult to which the payload to fetch belongs.

  • sid (String)

    The Twilio-provided string that uniquely identifies the Recording AddOnResult Payload resource to fetch.



178
179
180
181
182
183
184
185
186
187
188
189
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload.rb', line 178

def initialize(version, , reference_sid, add_on_result_sid, sid)
  super(version)

  # Path Solution
  @solution = {
      account_sid: ,
      reference_sid: reference_sid,
      add_on_result_sid: add_on_result_sid,
      sid: sid,
  }
  @uri = "/Accounts/#{@solution[:account_sid]}/Recordings/#{@solution[:reference_sid]}/AddOnResults/#{@solution[:add_on_result_sid]}/Payloads/#{@solution[:sid]}.json"
end

Instance Method Details

#deleteBoolean

Deletes the PayloadInstance

Returns:

  • (Boolean)

    true if delete succeeds, true otherwise



216
217
218
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload.rb', line 216

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

#fetchPayloadInstance

Fetch a PayloadInstance

Returns:



194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload.rb', line 194

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

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

  PayloadInstance.new(
      @version,
      payload,
      account_sid: @solution[:account_sid],
      reference_sid: @solution[:reference_sid],
      add_on_result_sid: @solution[:add_on_result_sid],
      sid: @solution[:sid],
  )
end

#inspectObject

Provide a detailed, user friendly representation



229
230
231
232
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload.rb', line 229

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

#to_sObject

Provide a user friendly representation



222
223
224
225
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload.rb', line 222

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