Class: Twilio::REST::Intelligence::V2::OperatorInstance
- Inherits:
-
Twilio::REST::InstanceResource
- Object
- Twilio::REST::InstanceResource
- Twilio::REST::Intelligence::V2::OperatorInstance
- Defined in:
- lib/twilio-ruby/rest/intelligence/v2/operator.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The unique SID identifier of the Account the Operator belongs to.
-
#author ⇒ String
The creator of the Operator.
- #availability ⇒ Availability
-
#config ⇒ Hash
Operator configuration, following the schema defined by the Operator Type.
-
#context ⇒ OperatorContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date that this Operator was created, given in ISO 8601 format.
-
#date_updated ⇒ Time
The date that this Operator was updated, given in ISO 8601 format.
-
#description ⇒ String
A human-readable description of this resource, longer than the friendly name.
-
#fetch ⇒ OperatorInstance
Fetch the OperatorInstance.
-
#friendly_name ⇒ String
A human-readable name of this resource, up to 64 characters.
-
#initialize(version, payload, sid: nil) ⇒ OperatorInstance
constructor
Initialize the OperatorInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#operator_type ⇒ String
Operator Type for this Operator.
-
#sid ⇒ String
A 34 character string that uniquely identifies this Operator.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#url ⇒ String
The URL of this resource.
-
#version ⇒ String
Numeric Operator version.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ OperatorInstance
Initialize the OperatorInstance
399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 |
# File 'lib/twilio-ruby/rest/intelligence/v2/operator.rb', line 399 def initialize(version, payload , sid: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'sid' => payload['sid'], 'friendly_name' => payload['friendly_name'], 'description' => payload['description'], 'author' => payload['author'], 'operator_type' => payload['operator_type'], 'version' => payload['version'] == nil ? payload['version'] : payload['version'].to_i, 'availability' => payload['availability'], 'config' => payload['config'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 'url' => payload['url'], } # Context @instance_context = nil @params = { 'sid' => sid || @properties['sid'] , } end |
Instance Method Details
#account_sid ⇒ String
Returns The unique SID identifier of the Account the Operator belongs to.
437 438 439 |
# File 'lib/twilio-ruby/rest/intelligence/v2/operator.rb', line 437 def account_sid @properties['account_sid'] end |
#author ⇒ String
Returns The creator of the Operator. Either Twilio or the creating Account.
461 462 463 |
# File 'lib/twilio-ruby/rest/intelligence/v2/operator.rb', line 461 def @properties['author'] end |
#availability ⇒ Availability
479 480 481 |
# File 'lib/twilio-ruby/rest/intelligence/v2/operator.rb', line 479 def availability @properties['availability'] end |
#config ⇒ Hash
Returns Operator configuration, following the schema defined by the Operator Type. Only available on Custom Operators created by the Account.
485 486 487 |
# File 'lib/twilio-ruby/rest/intelligence/v2/operator.rb', line 485 def config @properties['config'] end |
#context ⇒ OperatorContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
428 429 430 431 432 433 |
# File 'lib/twilio-ruby/rest/intelligence/v2/operator.rb', line 428 def context unless @instance_context @instance_context = OperatorContext.new(@version , @params['sid']) end @instance_context end |
#date_created ⇒ Time
Returns The date that this Operator was created, given in ISO 8601 format.
491 492 493 |
# File 'lib/twilio-ruby/rest/intelligence/v2/operator.rb', line 491 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date that this Operator was updated, given in ISO 8601 format.
497 498 499 |
# File 'lib/twilio-ruby/rest/intelligence/v2/operator.rb', line 497 def date_updated @properties['date_updated'] end |
#description ⇒ String
Returns A human-readable description of this resource, longer than the friendly name.
455 456 457 |
# File 'lib/twilio-ruby/rest/intelligence/v2/operator.rb', line 455 def description @properties['description'] end |
#fetch ⇒ OperatorInstance
Fetch the OperatorInstance
510 511 512 513 |
# File 'lib/twilio-ruby/rest/intelligence/v2/operator.rb', line 510 def fetch context.fetch end |
#friendly_name ⇒ String
Returns A human-readable name of this resource, up to 64 characters.
449 450 451 |
# File 'lib/twilio-ruby/rest/intelligence/v2/operator.rb', line 449 def friendly_name @properties['friendly_name'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
524 525 526 527 |
# File 'lib/twilio-ruby/rest/intelligence/v2/operator.rb', line 524 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Intelligence.V2.OperatorInstance #{values}>" end |
#operator_type ⇒ String
Returns Operator Type for this Operator. References an existing Operator Type resource.
467 468 469 |
# File 'lib/twilio-ruby/rest/intelligence/v2/operator.rb', line 467 def operator_type @properties['operator_type'] end |
#sid ⇒ String
Returns A 34 character string that uniquely identifies this Operator.
443 444 445 |
# File 'lib/twilio-ruby/rest/intelligence/v2/operator.rb', line 443 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
517 518 519 520 |
# File 'lib/twilio-ruby/rest/intelligence/v2/operator.rb', line 517 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Intelligence.V2.OperatorInstance #{values}>" end |
#url ⇒ String
Returns The URL of this resource.
503 504 505 |
# File 'lib/twilio-ruby/rest/intelligence/v2/operator.rb', line 503 def url @properties['url'] end |
#version ⇒ String
Returns Numeric Operator version. Incremented with each update on the resource, used to ensure integrity when updating the Operator.
473 474 475 |
# File 'lib/twilio-ruby/rest/intelligence/v2/operator.rb', line 473 def version @properties['version'] end |