Class: Twilio::REST::Intelligence::V2::CustomOperatorInstance
- Inherits:
-
Twilio::REST::InstanceResource
- Object
- Twilio::REST::InstanceResource
- Twilio::REST::Intelligence::V2::CustomOperatorInstance
- Defined in:
- lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The unique SID identifier of the Account the Custom Operator belongs to.
-
#author ⇒ String
The creator of the Custom Operator.
- #availability ⇒ Availability
-
#config ⇒ Hash
Operator configuration, following the schema defined by the Operator Type.
-
#context ⇒ CustomOperatorContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date that this Custom Operator was created, given in ISO 8601 format.
-
#date_updated ⇒ Time
The date that this Custom Operator was updated, given in ISO 8601 format.
-
#delete ⇒ Boolean
Delete the CustomOperatorInstance.
-
#description ⇒ String
A human-readable description of this resource, longer than the friendly name.
-
#fetch ⇒ CustomOperatorInstance
Fetch the CustomOperatorInstance.
-
#friendly_name ⇒ String
A human-readable name of this resource, up to 64 characters.
-
#initialize(version, payload, sid: nil) ⇒ CustomOperatorInstance
constructor
Initialize the CustomOperatorInstance.
-
#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 Custom Operator.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(friendly_name: nil, config: nil, if_match: :unset) ⇒ CustomOperatorInstance
Update the CustomOperatorInstance.
-
#url ⇒ String
The URL of this resource.
-
#version ⇒ String
Numeric Custom Operator version.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ CustomOperatorInstance
Initialize the CustomOperatorInstance
559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 |
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 559 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 Custom Operator belongs to.
597 598 599 |
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 597 def account_sid @properties['account_sid'] end |
#author ⇒ String
Returns The creator of the Custom Operator. Custom Operators can only be created by a Twilio Account.
621 622 623 |
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 621 def @properties['author'] end |
#availability ⇒ Availability
639 640 641 |
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 639 def availability @properties['availability'] end |
#config ⇒ Hash
Returns Operator configuration, following the schema defined by the Operator Type. Only available on Operators created by the Account.
645 646 647 |
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 645 def config @properties['config'] end |
#context ⇒ CustomOperatorContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
588 589 590 591 592 593 |
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 588 def context unless @instance_context @instance_context = CustomOperatorContext.new(@version , @params['sid']) end @instance_context end |
#date_created ⇒ Time
Returns The date that this Custom Operator was created, given in ISO 8601 format.
651 652 653 |
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 651 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date that this Custom Operator was updated, given in ISO 8601 format.
657 658 659 |
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 657 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the CustomOperatorInstance
670 671 672 673 |
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 670 def delete context.delete end |
#description ⇒ String
Returns A human-readable description of this resource, longer than the friendly name.
615 616 617 |
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 615 def description @properties['description'] end |
#fetch ⇒ CustomOperatorInstance
Fetch the CustomOperatorInstance
678 679 680 681 |
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 678 def fetch context.fetch end |
#friendly_name ⇒ String
Returns A human-readable name of this resource, up to 64 characters.
609 610 611 |
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 609 def friendly_name @properties['friendly_name'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
711 712 713 714 |
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 711 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Intelligence.V2.CustomOperatorInstance #{values}>" end |
#operator_type ⇒ String
Returns Operator Type for this Operator. References an existing Operator Type resource.
627 628 629 |
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 627 def operator_type @properties['operator_type'] end |
#sid ⇒ String
Returns A 34 character string that uniquely identifies this Custom Operator.
603 604 605 |
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 603 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
704 705 706 707 |
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 704 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Intelligence.V2.CustomOperatorInstance #{values}>" end |
#update(friendly_name: nil, config: nil, if_match: :unset) ⇒ CustomOperatorInstance
Update the CustomOperatorInstance
689 690 691 692 693 694 695 696 697 698 699 700 |
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 689 def update( friendly_name: nil, config: nil, if_match: :unset ) context.update( friendly_name: friendly_name, config: config, if_match: if_match, ) end |
#url ⇒ String
Returns The URL of this resource.
663 664 665 |
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 663 def url @properties['url'] end |
#version ⇒ String
Returns Numeric Custom Operator version. Incremented with each update on the resource, used to ensure integrity when updating the Custom Operator.
633 634 635 |
# File 'lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb', line 633 def version @properties['version'] end |