Class: Twilio::REST::Intelligence::V3::OperatorResultInstance
- Inherits:
-
Twilio::REST::InstanceResource
- Object
- Twilio::REST::InstanceResource
- Twilio::REST::Intelligence::V3::OperatorResultInstance
- Defined in:
- lib/twilio-ruby/rest/intelligence/v3/operator_result.rb
Instance Method Summary collapse
-
#account_id ⇒ String
The ID of the Account that created the Language Operator.
-
#code ⇒ String
Twilio-specific error code.
-
#context ⇒ OperatorResultContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#conversation_id ⇒ String
The ‘id` of the Conversation attached to the Operator Result.
-
#date_created ⇒ Time
Timestamp for when the Operator Result was created.
-
#delete ⇒ Boolean
Delete the OperatorResultInstance.
- #execution_details ⇒ ExecutionDetails
-
#fetch ⇒ OperatorResultInstance
Fetch the OperatorResultInstance.
-
#http_status_code ⇒ String
HTTP response status code.
-
#id ⇒ String
A unique identifier for the Operator Result.
-
#initialize(version, payload, operator_result_id: nil) ⇒ OperatorResultInstance
constructor
Initialize the OperatorResultInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
- #intelligence_configuration ⇒ IntelligenceConfigurationReference
-
#message ⇒ String
A human readable error message.
- #metadata ⇒ OperatorResultsResponseBaseMetadata
- #operator ⇒ OperatorReference
-
#output_format ⇒ String
The output format set on the Operator that generated this result.
-
#params ⇒ Hash<String, String>
A map of parameters related to the error, for example, a ‘params.twilioErrorCodeUrl` might hold a URL or link to additional information.
-
#reference_ids ⇒ Array<String>
The ‘id`s of objects related to this Operator Result.
- #result ⇒ ExtractionResultResult
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#user_error ⇒ Boolean
Whether the error is a user error (true) or a system error (false).
Constructor Details
#initialize(version, payload, operator_result_id: nil) ⇒ OperatorResultInstance
Initialize the OperatorResultInstance
451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 |
# File 'lib/twilio-ruby/rest/intelligence/v3/operator_result.rb', line 451 def initialize(version, payload , operator_result_id: nil) apiV1Version = ApiV1Version.new version.domain, version super(apiV1Version) # Marshaled Properties @properties = { 'code' => payload['code'], 'message' => payload['message'], 'http_status_code' => payload['http_status_code'], 'user_error' => payload['user_error'], 'params' => payload['params'], 'output_format' => payload['output_format'], 'id' => payload['id'], 'account_id' => payload['account_id'], 'intelligence_configuration' => payload['intelligence_configuration'], 'conversation_id' => payload['conversation_id'], 'operator' => payload['operator'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'reference_ids' => payload['reference_ids'], 'execution_details' => payload['execution_details'], 'metadata' => payload['metadata'], 'result' => payload['result'], } # Context @instance_context = nil @params = { 'operator_result_id' => operator_result_id || @properties['operator_result_id'] , } end |
Instance Method Details
#account_id ⇒ String
Returns The ID of the Account that created the Language Operator.
536 537 538 |
# File 'lib/twilio-ruby/rest/intelligence/v3/operator_result.rb', line 536 def account_id @properties['account_id'] end |
#code ⇒ String
Returns Twilio-specific error code.
494 495 496 |
# File 'lib/twilio-ruby/rest/intelligence/v3/operator_result.rb', line 494 def code @properties['code'] end |
#context ⇒ OperatorResultContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
485 486 487 488 489 490 |
# File 'lib/twilio-ruby/rest/intelligence/v3/operator_result.rb', line 485 def context unless @instance_context @instance_context = OperatorResultContext.new(@version , @params['operator_result_id']) end @instance_context end |
#conversation_id ⇒ String
Returns The ‘id` of the Conversation attached to the Operator Result.
548 549 550 |
# File 'lib/twilio-ruby/rest/intelligence/v3/operator_result.rb', line 548 def conversation_id @properties['conversation_id'] end |
#date_created ⇒ Time
Returns Timestamp for when the Operator Result was created.
560 561 562 |
# File 'lib/twilio-ruby/rest/intelligence/v3/operator_result.rb', line 560 def date_created @properties['date_created'] end |
#delete ⇒ Boolean
Delete the OperatorResultInstance
591 592 593 594 |
# File 'lib/twilio-ruby/rest/intelligence/v3/operator_result.rb', line 591 def delete context.delete end |
#execution_details ⇒ ExecutionDetails
572 573 574 |
# File 'lib/twilio-ruby/rest/intelligence/v3/operator_result.rb', line 572 def execution_details @properties['execution_details'] end |
#fetch ⇒ OperatorResultInstance
Fetch the OperatorResultInstance
599 600 601 602 |
# File 'lib/twilio-ruby/rest/intelligence/v3/operator_result.rb', line 599 def fetch context.fetch end |
#http_status_code ⇒ String
Returns HTTP response status code.
506 507 508 |
# File 'lib/twilio-ruby/rest/intelligence/v3/operator_result.rb', line 506 def http_status_code @properties['http_status_code'] end |
#id ⇒ String
Returns A unique identifier for the Operator Result. Assigned by Twilio (TTID).
530 531 532 |
# File 'lib/twilio-ruby/rest/intelligence/v3/operator_result.rb', line 530 def id @properties['id'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
613 614 615 616 |
# File 'lib/twilio-ruby/rest/intelligence/v3/operator_result.rb', line 613 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Intelligence.V3.OperatorResultInstance #{values}>" end |
#intelligence_configuration ⇒ IntelligenceConfigurationReference
542 543 544 |
# File 'lib/twilio-ruby/rest/intelligence/v3/operator_result.rb', line 542 def intelligence_configuration @properties['intelligence_configuration'] end |
#message ⇒ String
Returns A human readable error message.
500 501 502 |
# File 'lib/twilio-ruby/rest/intelligence/v3/operator_result.rb', line 500 def @properties['message'] end |
#metadata ⇒ OperatorResultsResponseBaseMetadata
578 579 580 |
# File 'lib/twilio-ruby/rest/intelligence/v3/operator_result.rb', line 578 def @properties['metadata'] end |
#operator ⇒ OperatorReference
554 555 556 |
# File 'lib/twilio-ruby/rest/intelligence/v3/operator_result.rb', line 554 def operator @properties['operator'] end |
#output_format ⇒ String
Returns The output format set on the Operator that generated this result. Determines the structure of the ‘result` object.
524 525 526 |
# File 'lib/twilio-ruby/rest/intelligence/v3/operator_result.rb', line 524 def output_format @properties['output_format'] end |
#params ⇒ Hash<String, String>
Returns A map of parameters related to the error, for example, a ‘params.twilioErrorCodeUrl` might hold a URL or link to additional information.
518 519 520 |
# File 'lib/twilio-ruby/rest/intelligence/v3/operator_result.rb', line 518 def params @properties['params'] end |
#reference_ids ⇒ Array<String>
Returns The ‘id`s of objects related to this Operator Result.
566 567 568 |
# File 'lib/twilio-ruby/rest/intelligence/v3/operator_result.rb', line 566 def reference_ids @properties['reference_ids'] end |
#result ⇒ ExtractionResultResult
584 585 586 |
# File 'lib/twilio-ruby/rest/intelligence/v3/operator_result.rb', line 584 def result @properties['result'] end |
#to_s ⇒ Object
Provide a user friendly representation
606 607 608 609 |
# File 'lib/twilio-ruby/rest/intelligence/v3/operator_result.rb', line 606 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Intelligence.V3.OperatorResultInstance #{values}>" end |
#user_error ⇒ Boolean
Returns Whether the error is a user error (true) or a system error (false).
512 513 514 |
# File 'lib/twilio-ruby/rest/intelligence/v3/operator_result.rb', line 512 def user_error @properties['user_error'] end |