Class: Twilio::REST::Intelligence::V2::TranscriptContext::OperatorResultInstance

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

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, transcript_sid: nil, operator_sid: nil) ⇒ OperatorResultInstance

Initialize the OperatorResultInstance



226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 226

def initialize(version, payload , transcript_sid: nil, operator_sid: nil)
    super(version)
    
    # Marshaled Properties
    @properties = { 
        'operator_type' => payload['operator_type'],
        'name' => payload['name'],
        'operator_sid' => payload['operator_sid'],
        'extract_match' => payload['extract_match'],
        'match_probability' => payload['match_probability'],
        'normalized_result' => payload['normalized_result'],
        'utterance_results' => payload['utterance_results'],
        'utterance_match' => payload['utterance_match'],
        'predicted_label' => payload['predicted_label'],
        'predicted_probability' => payload['predicted_probability'],
        'label_probabilities' => payload['label_probabilities'],
        'extract_results' => payload['extract_results'],
        'text_generation_results' => payload['text_generation_results'],
        'transcript_sid' => payload['transcript_sid'],
        'url' => payload['url'],
    }

    # Context
    @instance_context = nil
    @params = { 'transcript_sid' => transcript_sid  || @properties['transcript_sid']  ,'operator_sid' => operator_sid  || @properties['operator_sid']  , }
end

Instance Method Details

#contextOperatorResultContext

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



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

def context
    unless @instance_context
        @instance_context = OperatorResultContext.new(@version , @params['transcript_sid'], @params['operator_sid'])
    end
    @instance_context
end

#extract_matchBoolean



284
285
286
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 284

def extract_match
    @properties['extract_match']
end

#extract_resultsHash



332
333
334
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 332

def extract_results
    @properties['extract_results']
end

#fetch(redacted: :unset) ⇒ OperatorResultInstance

Fetch the OperatorResultInstance



358
359
360
361
362
363
364
365
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 358

def fetch(
    redacted: :unset
)

    context.fetch(
        redacted: redacted, 
    )
end

#inspectObject

Provide a detailed, user friendly representation



376
377
378
379
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 376

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

#label_probabilitiesHash



326
327
328
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 326

def label_probabilities
    @properties['label_probabilities']
end

#match_probabilityFloat



290
291
292
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 290

def match_probability
    @properties['match_probability']
end

#nameString



272
273
274
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 272

def name
    @properties['name']
end

#normalized_resultString



296
297
298
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 296

def normalized_result
    @properties['normalized_result']
end

#operator_sidString



278
279
280
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 278

def operator_sid
    @properties['operator_sid']
end

#operator_typeOperatorType



266
267
268
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 266

def operator_type
    @properties['operator_type']
end

#predicted_labelString



314
315
316
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 314

def predicted_label
    @properties['predicted_label']
end

#predicted_probabilityFloat



320
321
322
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 320

def predicted_probability
    @properties['predicted_probability']
end

#text_generation_resultsHash



338
339
340
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 338

def text_generation_results
    @properties['text_generation_results']
end

#to_sObject

Provide a user friendly representation



369
370
371
372
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 369

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

#transcript_sidString



344
345
346
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 344

def transcript_sid
    @properties['transcript_sid']
end

#urlString



350
351
352
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 350

def url
    @properties['url']
end

#utterance_matchBoolean



308
309
310
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 308

def utterance_match
    @properties['utterance_match']
end

#utterance_resultsArray<Hash>



302
303
304
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/operator_result.rb', line 302

def utterance_results
    @properties['utterance_results']
end