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

Inherits:
InstanceResource
  • 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, payload, account_sid: nil, reference_sid: nil, add_on_result_sid: nil, payload_sid: nil) ⇒ DataInstance

Initialize the DataInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • account_sid (String) (defaults to: nil)

    The SID of the Account that created this Data resource.

  • sid (String)

    The SID of the Call resource to fetch.



142
143
144
145
146
147
148
149
150
151
152
153
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload/data.rb', line 142

def initialize(version, payload , account_sid: nil, reference_sid: nil, add_on_result_sid: nil, payload_sid: nil)
    super(version)
    
    # Marshaled Properties
    @properties = { 
        'redirect_to' => payload['redirect_to'],
    }

    # Context
    @instance_context = nil
    @params = { 'account_sid' =>   ,'reference_sid' => reference_sid  || @properties['reference_sid']  ,'add_on_result_sid' => add_on_result_sid  || @properties['add_on_result_sid']  ,'payload_sid' => payload_sid  || @properties['payload_sid']  , }
end

Instance Method Details

#contextDataContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context

Returns:



159
160
161
162
163
164
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload/data.rb', line 159

def context
    unless @instance_context
        @instance_context = DataContext.new(@version , @params['account_sid'], @params['reference_sid'], @params['add_on_result_sid'], @params['payload_sid'])
    end
    @instance_context
end

#fetchDataInstance

Fetch the DataInstance

Returns:



175
176
177
178
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload/data.rb', line 175

def fetch

    context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



189
190
191
192
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload/data.rb', line 189

def inspect
    values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Api.V2010.DataInstance #{values}>"
end

#redirect_toString

Returns The URL to redirect to to get the data returned by the AddOn that was previously stored.

Returns:

  • (String)

    The URL to redirect to to get the data returned by the AddOn that was previously stored.



168
169
170
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload/data.rb', line 168

def redirect_to
    @properties['redirect_to']
end

#to_sObject

Provide a user friendly representation



182
183
184
185
# File 'lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload/data.rb', line 182

def to_s
    values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Api.V2010.DataInstance #{values}>"
end