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

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

Instance Method Summary collapse

Constructor Details

#initialize(version, account_sid, reference_sid, add_on_result_sid, payload_sid) ⇒ DataContext

Initialize the DataContext

Parameters:

  • version (Version)

    Version that contains the resource

  • account_sid (String)

    The SID of the [Account](www.twilio.com/docs/iam/api/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.

  • payload_sid (String)

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



57
58
59
60
61
62
63
64
65
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload/data.rb', line 57

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

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

    
end

Instance Method Details

#fetchDataInstance

Fetch the DataInstance

Returns:



69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload/data.rb', line 69

def fetch

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

#inspectObject

Provide a detailed, user friendly representation



98
99
100
101
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload/data.rb', line 98

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

#to_sObject

Provide a user friendly representation



91
92
93
94
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload/data.rb', line 91

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