## # This code was generated by # \ / _ _ _| _ _ # | (_)\/(_)(_|\/| |(/_ v1.0.0 # / / # # frozen_string_literal: true module Twilio module REST class Preview < Domain class Understand < Version class AssistantContext < InstanceContext ## # 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 help@twilio.com. class AssistantInitiationActionsList < ListResource ## # Initialize the AssistantInitiationActionsList # @param [Version] version Version that contains the resource # @param [String] assistant_sid The assistant_sid # @return [AssistantInitiationActionsList] AssistantInitiationActionsList def initialize(version, assistant_sid: nil) super(version) # Path Solution @solution = {assistant_sid: assistant_sid} end ## # Provide a user friendly representation def to_s '#' end end ## # 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 help@twilio.com. class AssistantInitiationActionsPage < Page ## # Initialize the AssistantInitiationActionsPage # @param [Version] version Version that contains the resource # @param [Response] response Response from the API # @param [Hash] solution Path solution for the resource # @return [AssistantInitiationActionsPage] AssistantInitiationActionsPage def initialize(version, response, solution) super(version, response) # Path Solution @solution = solution end ## # Build an instance of AssistantInitiationActionsInstance # @param [Hash] payload Payload response from the API # @return [AssistantInitiationActionsInstance] AssistantInitiationActionsInstance def get_instance(payload) AssistantInitiationActionsInstance.new(@version, payload, assistant_sid: @solution[:assistant_sid], ) end ## # Provide a user friendly representation def to_s '' end end ## # 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 help@twilio.com. class AssistantInitiationActionsContext < InstanceContext ## # Initialize the AssistantInitiationActionsContext # @param [Version] version Version that contains the resource # @param [String] assistant_sid The assistant_sid # @return [AssistantInitiationActionsContext] AssistantInitiationActionsContext def initialize(version, assistant_sid) super(version) # Path Solution @solution = {assistant_sid: assistant_sid, } @uri = "/Assistants/#{@solution[:assistant_sid]}/InitiationActions" end ## # Fetch a AssistantInitiationActionsInstance # @return [AssistantInitiationActionsInstance] Fetched AssistantInitiationActionsInstance def fetch params = Twilio::Values.of({}) payload = @version.fetch( 'GET', @uri, params, ) AssistantInitiationActionsInstance.new(@version, payload, assistant_sid: @solution[:assistant_sid], ) end ## # Update the AssistantInitiationActionsInstance # @param [Hash] initiation_actions The initiation_actions # @return [AssistantInitiationActionsInstance] Updated AssistantInitiationActionsInstance 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 ## # Provide a user friendly representation def to_s context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#" end ## # Provide a detailed, user friendly representation def inspect context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#" end end ## # 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 help@twilio.com. class AssistantInitiationActionsInstance < InstanceResource ## # Initialize the AssistantInitiationActionsInstance # @param [Version] version Version that contains the resource # @param [Hash] payload payload that contains response from Twilio # @param [String] assistant_sid The assistant_sid # @return [AssistantInitiationActionsInstance] AssistantInitiationActionsInstance def initialize(version, payload, assistant_sid: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'assistant_sid' => payload['assistant_sid'], 'url' => payload['url'], 'data' => payload['data'], } # Context @instance_context = nil @params = {'assistant_sid' => assistant_sid, } end ## # Generate an instance context for the instance, the context is capable of # performing various actions. All instance actions are proxied to the context # @return [AssistantInitiationActionsContext] AssistantInitiationActionsContext for this AssistantInitiationActionsInstance def context unless @instance_context @instance_context = AssistantInitiationActionsContext.new(@version, @params['assistant_sid'], ) end @instance_context end ## # @return [String] The account_sid def account_sid @properties['account_sid'] end ## # @return [String] The assistant_sid def assistant_sid @properties['assistant_sid'] end ## # @return [String] The url def url @properties['url'] end ## # @return [Hash] The data def data @properties['data'] end ## # Fetch a AssistantInitiationActionsInstance # @return [AssistantInitiationActionsInstance] Fetched AssistantInitiationActionsInstance def fetch context.fetch end ## # Update the AssistantInitiationActionsInstance # @param [Hash] initiation_actions The initiation_actions # @return [AssistantInitiationActionsInstance] Updated AssistantInitiationActionsInstance def update(initiation_actions: :unset) context.update(initiation_actions: initiation_actions, ) end ## # Provide a user friendly representation def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "" end ## # Provide a detailed, user friendly representation def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "" end end end end end end end