Class: Twilio::REST::Preview::Understand::AssistantContext::AssistantInitiationActionsContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/preview/understand/assistant/assistant_initiation_actions.rb

Overview

PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact [email protected]

Instance Method Summary collapse

Constructor Details

#initialize(version, assistant_sid) ⇒ AssistantInitiationActionsContext

Initialize the AssistantInitiationActionsContext

Parameters:

  • version (Version)

    Version that contains the resource

  • assistant_sid (String)

    The assistant_sid


75
76
77
78
79
80
81
# File 'lib/twilio-ruby/rest/preview/understand/assistant/assistant_initiation_actions.rb', line 75

def initialize(version, assistant_sid)
  super(version)

  # Path Solution
  @solution = {assistant_sid: assistant_sid, }
  @uri = "/Assistants/#{@solution[:assistant_sid]}/InitiationActions"
end

Instance Method Details

#fetchAssistantInitiationActionsInstance

Fetch the AssistantInitiationActionsInstance

Returns:


86
87
88
89
90
# File 'lib/twilio-ruby/rest/preview/understand/assistant/assistant_initiation_actions.rb', line 86

def fetch
  payload = @version.fetch('GET', @uri)

  AssistantInitiationActionsInstance.new(@version, payload, assistant_sid: @solution[:assistant_sid], )
end

#inspectObject

Provide a detailed, user friendly representation


113
114
115
116
# File 'lib/twilio-ruby/rest/preview/understand/assistant/assistant_initiation_actions.rb', line 113

def inspect
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.Preview.Understand.AssistantInitiationActionsContext #{context}>"
end

#to_sObject

Provide a user friendly representation


106
107
108
109
# File 'lib/twilio-ruby/rest/preview/understand/assistant/assistant_initiation_actions.rb', line 106

def to_s
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.Preview.Understand.AssistantInitiationActionsContext #{context}>"
end

#update(initiation_actions: :unset) ⇒ AssistantInitiationActionsInstance

Update the AssistantInitiationActionsInstance

Parameters:

  • initiation_actions (Hash) (defaults to: :unset)

    The initiation_actions

Returns:


96
97
98
99
100
101
102
# File 'lib/twilio-ruby/rest/preview/understand/assistant/assistant_initiation_actions.rb', line 96

def update(initiation_actions: :unset)
  data = Twilio::Values.of({'InitiationActions' => Twilio.serialize_object(initiation_actions), })

  payload = @version.update('POST', @uri, data: data)

  AssistantInitiationActionsInstance.new(@version, payload, assistant_sid: @solution[:assistant_sid], )
end