Class: Twilio::REST::Assistants::V1::ToolInstance

Inherits:
InstanceResource show all
Defined in:
lib/twilio-ruby/rest/assistants/v1/tool.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, id: nil) ⇒ ToolInstance

Initialize the ToolInstance



685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 685

def initialize(version, payload , id: nil)
    super(version)
    
    
    # Marshaled Properties
    @properties = { 
        'account_sid' => payload['account_sid'],
        'description' => payload['description'],
        'enabled' => payload['enabled'],
        'id' => payload['id'],
        'meta' => payload['meta'],
        'name' => payload['name'],
        'requires_auth' => payload['requires_auth'],
        'type' => payload['type'],
        'url' => payload['url'],
        'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
        'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
        'policies' => payload['policies'],
    }

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

Instance Method Details

#account_sidString



723
724
725
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 723

def 
    @properties['account_sid']
end

#contextToolContext

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



714
715
716
717
718
719
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 714

def context
    unless @instance_context
        @instance_context = ToolContext.new(@version , @params['id'])
    end
    @instance_context
end

#date_createdTime



777
778
779
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 777

def date_created
    @properties['date_created']
end

#date_updatedTime



783
784
785
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 783

def date_updated
    @properties['date_updated']
end

#deleteBoolean

Delete the ToolInstance



796
797
798
799
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 796

def delete

    context.delete
end

#descriptionString



729
730
731
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 729

def description
    @properties['description']
end

#enabledBoolean



735
736
737
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 735

def enabled
    @properties['enabled']
end

#fetchToolInstance

Fetch the ToolInstance



804
805
806
807
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 804

def fetch

    context.fetch
end

#idString



741
742
743
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 741

def id
    @properties['id']
end

#inspectObject

Provide a detailed, user friendly representation



829
830
831
832
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 829

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

#metaHash



747
748
749
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 747

def meta
    @properties['meta']
end

#nameString



753
754
755
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 753

def name
    @properties['name']
end

#policiesArray<AssistantsV1ServicePolicy>



789
790
791
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 789

def policies
    @properties['policies']
end

#requires_authBoolean



759
760
761
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 759

def requires_auth
    @properties['requires_auth']
end

#to_sObject

Provide a user friendly representation



822
823
824
825
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 822

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

#typeString



765
766
767
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 765

def type
    @properties['type']
end

#update(assistants_v1_service_update_tool_request: :unset) ⇒ ToolInstance

Update the ToolInstance



813
814
815
816
817
818
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 813

def update(assistants_v1_service_update_tool_request: :unset
)

    context.update(
    )
end

#urlString



771
772
773
# File 'lib/twilio-ruby/rest/assistants/v1/tool.rb', line 771

def url
    @properties['url']
end