Class: Twilio::REST::Intelligence::V2::TranscriptContext::OperatorResultContext

Inherits:
Twilio::REST::InstanceContext show all
Defined in:
lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, transcript_sid, operator_sid) ⇒ OperatorResultContext

Initialize the OperatorResultContext

Parameters:

  • version (Version)

    Version that contains the resource

  • transcript_sid (String)

    A 34 character string that uniquely identifies this Transcript.

  • operator_sid (String)

    A 34 character string that identifies this Language Understanding operator sid.



178
179
180
181
182
183
184
185
186
187
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 178

def initialize(version, transcript_sid, operator_sid)
    super(version)
    

    # Path Solution
    @solution = { transcript_sid: transcript_sid, operator_sid: operator_sid,  }
    @uri = "/Transcripts/#{@solution[:transcript_sid]}/OperatorResults/#{@solution[:operator_sid]}"

    
end

Instance Method Details

#fetch(redacted: :unset) ⇒ OperatorResultInstance

Fetch the OperatorResultInstance

Parameters:

  • redacted (Boolean) (defaults to: :unset)

    Grant access to PII redacted/unredacted Language Understanding operator. If redaction is enabled, the default is True.

Returns:



192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 192

def fetch(
  redacted: :unset
)

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

#fetch_with_metadata(redacted: :unset) ⇒ OperatorResultInstance

Fetch the OperatorResultInstanceMetadata

Parameters:

  • redacted (Boolean) (defaults to: :unset)

    Grant access to PII redacted/unredacted Language Understanding operator. If redaction is enabled, the default is True.

Returns:



218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 218

def (
  redacted: :unset
)

    params = Twilio::Values.of({
        'Redacted' => redacted,
    })
    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    response = @version.('GET', @uri, params: params, headers: headers)
    operator_result_instance = OperatorResultInstance.new(
        @version,
        response.body,
        transcript_sid: @solution[:transcript_sid],
        operator_sid: @solution[:operator_sid],
    )
    OperatorResultInstanceMetadata.new(
        @version,
        operator_result_instance,
        response.headers,
        response.status_code
    )
end

#inspectObject

Provide a detailed, user friendly representation



256
257
258
259
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 256

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

#to_sObject

Provide a user friendly representation



249
250
251
252
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 249

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