## # This code was generated by # ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ # | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ # | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ # # Twilio - Preview # This is the public Twilio REST API. # # NOTE: This class is auto generated by OpenAPI Generator. # https://openapi-generator.tech # Do not edit the class manually. # module Twilio module REST class Preview < PreviewBase class Understand < Version class AssistantContext < InstanceContext class AssistantFallbackActionsList < ListResource ## # Initialize the AssistantFallbackActionsList # @param [Version] version Version that contains the resource # @return [AssistantFallbackActionsList] AssistantFallbackActionsList 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 AssistantFallbackActionsContext < InstanceContext ## # Initialize the AssistantFallbackActionsContext # @param [Version] version Version that contains the resource # @param [String] assistant_sid # @return [AssistantFallbackActionsContext] AssistantFallbackActionsContext def initialize(version, assistant_sid) super(version) # Path Solution @solution = { assistant_sid: assistant_sid, } @uri = "/Assistants/#{@solution[:assistant_sid]}/FallbackActions" end ## # Fetch the AssistantFallbackActionsInstance # @return [AssistantFallbackActionsInstance] Fetched AssistantFallbackActionsInstance def fetch payload = @version.fetch('GET', @uri) AssistantFallbackActionsInstance.new( @version, payload, assistant_sid: @solution[:assistant_sid], ) end ## # Update the AssistantFallbackActionsInstance # @param [Object] fallback_actions # @return [AssistantFallbackActionsInstance] Updated AssistantFallbackActionsInstance def update( fallback_actions: :unset ) data = Twilio::Values.of({ 'FallbackActions' => Twilio.serialize_object(fallback_actions), }) payload = @version.update('POST', @uri, data: data) AssistantFallbackActionsInstance.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 class AssistantFallbackActionsPage < Page ## # Initialize the AssistantFallbackActionsPage # @param [Version] version Version that contains the resource # @param [Response] response Response from the API # @param [Hash] solution Path solution for the resource # @return [AssistantFallbackActionsPage] AssistantFallbackActionsPage def initialize(version, response, solution) super(version, response) # Path Solution @solution = solution end ## # Build an instance of AssistantFallbackActionsInstance # @param [Hash] payload Payload response from the API # @return [AssistantFallbackActionsInstance] AssistantFallbackActionsInstance def get_instance(payload) AssistantFallbackActionsInstance.new(@version, payload, assistant_sid: @solution[:assistant_sid]) end ## # Provide a user friendly representation def to_s '' end end class AssistantFallbackActionsInstance < InstanceResource ## # Initialize the AssistantFallbackActionsInstance # @param [Version] version Version that contains the resource # @param [Hash] payload payload that contains response from Twilio # @param [String] account_sid The SID of the # {Account}[https://www.twilio.com/docs/iam/api/account] that created this AssistantFallbackActions # resource. # @param [String] sid The SID of the Call resource to fetch. # @return [AssistantFallbackActionsInstance] AssistantFallbackActionsInstance 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 || @properties['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 [AssistantFallbackActionsContext] CallContext for this CallInstance def context unless @instance_context @instance_context = AssistantFallbackActionsContext.new(@version , @params['assistant_sid']) end @instance_context end ## # @return [String] def account_sid @properties['account_sid'] end ## # @return [String] def assistant_sid @properties['assistant_sid'] end ## # @return [String] def url @properties['url'] end ## # @return [Hash] def data @properties['data'] end ## # Fetch the AssistantFallbackActionsInstance # @return [AssistantFallbackActionsInstance] Fetched AssistantFallbackActionsInstance def fetch context.fetch end ## # Update the AssistantFallbackActionsInstance # @param [Object] fallback_actions # @return [AssistantFallbackActionsInstance] Updated AssistantFallbackActionsInstance def update( fallback_actions: :unset ) context.update( fallback_actions: fallback_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