lib/twilio-ruby/rest/autopilot/v1/assistant/defaults.rb in twilio-ruby-5.77.0 vs lib/twilio-ruby/rest/autopilot/v1/assistant/defaults.rb in twilio-ruby-6.0.0.pre.rc.1
- old
+ new
@@ -1,220 +1,241 @@
##
-# This code was generated by
-# \ / _ _ _| _ _
-# | (_)\/(_)(_|\/| |(/_ v1.0.0
-# / /
+# This code was generated by
+# ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
+# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
+# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
#
-# frozen_string_literal: true
+# Twilio - Autopilot
+# 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 Autopilot < Domain
- class V1 < 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 DefaultsList < ListResource
- ##
- # Initialize the DefaultsList
- # @param [Version] version Version that contains the resource
- # @param [String] assistant_sid The SID of the
- # {Assistant}[https://www.twilio.com/docs/autopilot/api/assistant] that is the
- # parent of the resource.
- # @return [DefaultsList] DefaultsList
- def initialize(version, assistant_sid: nil)
- super(version)
+ module REST
+ class Autopilot < AutopilotBase
+ class V1 < Version
+ class AssistantContext < InstanceContext
- # Path Solution
- @solution = {assistant_sid: assistant_sid}
- end
+ class DefaultsList < ListResource
+ ##
+ # Initialize the DefaultsList
+ # @param [Version] version Version that contains the resource
+ # @return [DefaultsList] DefaultsList
+ def initialize(version, assistant_sid: nil)
+ super(version)
+ # Path Solution
+ @solution = { assistant_sid: assistant_sid }
+
+
+ end
+
- ##
- # Provide a user friendly representation
- def to_s
- '#<Twilio.Autopilot.V1.DefaultsList>'
- 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 DefaultsPage < Page
- ##
- # Initialize the DefaultsPage
- # @param [Version] version Version that contains the resource
- # @param [Response] response Response from the API
- # @param [Hash] solution Path solution for the resource
- # @return [DefaultsPage] DefaultsPage
- def initialize(version, response, solution)
- super(version, response)
+ # Provide a user friendly representation
+ def to_s
+ '#<Twilio.Autopilot.V1.DefaultsList>'
+ end
+ end
- # Path Solution
- @solution = solution
- end
- ##
- # Build an instance of DefaultsInstance
- # @param [Hash] payload Payload response from the API
- # @return [DefaultsInstance] DefaultsInstance
- def get_instance(payload)
- DefaultsInstance.new(@version, payload, assistant_sid: @solution[:assistant_sid], )
- 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 DefaultsContext < InstanceContext
+ ##
+ # Initialize the DefaultsContext
+ # @param [Version] version Version that contains the resource
+ # @param [String] assistant_sid The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to update.
+ # @return [DefaultsContext] DefaultsContext
+ def initialize(version, assistant_sid)
+ super(version)
- ##
- # Provide a user friendly representation
- def to_s
- '<Twilio.Autopilot.V1.DefaultsPage>'
- end
- end
+ # Path Solution
+ @solution = { assistant_sid: assistant_sid, }
+ @uri = "/Assistants/#{@solution[:assistant_sid]}/Defaults"
- ##
- # 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 DefaultsContext < InstanceContext
- ##
- # Initialize the DefaultsContext
- # @param [Version] version Version that contains the resource
- # @param [String] assistant_sid The SID of the
- # {Assistant}[https://www.twilio.com/docs/autopilot/api/assistant] that is the
- # parent of the resource to fetch.
- # @return [DefaultsContext] DefaultsContext
- def initialize(version, assistant_sid)
- super(version)
+
+ end
+ ##
+ # Fetch the DefaultsInstance
+ # @return [DefaultsInstance] Fetched DefaultsInstance
+ def fetch
- # Path Solution
- @solution = {assistant_sid: assistant_sid, }
- @uri = "/Assistants/#{@solution[:assistant_sid]}/Defaults"
- end
+ payload = @version.fetch('GET', @uri)
+ DefaultsInstance.new(
+ @version,
+ payload,
+ assistant_sid: @solution[:assistant_sid],
+ )
+ end
- ##
- # Fetch the DefaultsInstance
- # @return [DefaultsInstance] Fetched DefaultsInstance
- def fetch
- payload = @version.fetch('GET', @uri)
+ ##
+ # Update the DefaultsInstance
+ # @param [Object] defaults A JSON string that describes the default task links for the `assistant_initiation`, `collect`, and `fallback` situations.
+ # @return [DefaultsInstance] Updated DefaultsInstance
+ def update(
+ defaults: :unset
+ )
- DefaultsInstance.new(@version, payload, assistant_sid: @solution[:assistant_sid], )
- end
+ data = Twilio::Values.of({
+ 'Defaults' => Twilio.serialize_object(defaults),
+ })
- ##
- # Update the DefaultsInstance
- # @param [Hash] defaults A JSON string that describes the default task links for
- # the `assistant_initiation`, `collect`, and `fallback` situations.
- # @return [DefaultsInstance] Updated DefaultsInstance
- def update(defaults: :unset)
- data = Twilio::Values.of({'Defaults' => Twilio.serialize_object(defaults), })
+ payload = @version.update('POST', @uri, data: data)
+ DefaultsInstance.new(
+ @version,
+ payload,
+ assistant_sid: @solution[:assistant_sid],
+ )
+ end
- payload = @version.update('POST', @uri, data: data)
- DefaultsInstance.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(',')
+ "#<Twilio.Autopilot.V1.DefaultsContext #{context}>"
+ end
- ##
- # Provide a user friendly representation
- def to_s
- context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
- "#<Twilio.Autopilot.V1.DefaultsContext #{context}>"
- end
+ ##
+ # Provide a detailed, user friendly representation
+ def inspect
+ context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
+ "#<Twilio.Autopilot.V1.DefaultsContext #{context}>"
+ end
+ end
- ##
- # Provide a detailed, user friendly representation
- def inspect
- context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
- "#<Twilio.Autopilot.V1.DefaultsContext #{context}>"
- end
- end
+ class DefaultsPage < Page
+ ##
+ # Initialize the DefaultsPage
+ # @param [Version] version Version that contains the resource
+ # @param [Response] response Response from the API
+ # @param [Hash] solution Path solution for the resource
+ # @return [DefaultsPage] DefaultsPage
+ def initialize(version, response, solution)
+ super(version, response)
- ##
- # 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 DefaultsInstance < InstanceResource
- ##
- # Initialize the DefaultsInstance
- # @param [Version] version Version that contains the resource
- # @param [Hash] payload payload that contains response from Twilio
- # @param [String] assistant_sid The SID of the
- # {Assistant}[https://www.twilio.com/docs/autopilot/api/assistant] that is the
- # parent of the resource.
- # @return [DefaultsInstance] DefaultsInstance
- def initialize(version, payload, assistant_sid: nil)
- super(version)
+ # Path Solution
+ @solution = solution
+ end
- # Marshaled Properties
- @properties = {
- 'account_sid' => payload['account_sid'],
- 'assistant_sid' => payload['assistant_sid'],
- 'url' => payload['url'],
- 'data' => payload['data'],
- }
+ ##
+ # Build an instance of DefaultsInstance
+ # @param [Hash] payload Payload response from the API
+ # @return [DefaultsInstance] DefaultsInstance
+ def get_instance(payload)
+ DefaultsInstance.new(@version, payload, assistant_sid: @solution[:assistant_sid])
+ end
- # Context
- @instance_context = nil
- @params = {'assistant_sid' => assistant_sid, }
- end
+ ##
+ # Provide a user friendly representation
+ def to_s
+ '<Twilio.Autopilot.V1.DefaultsPage>'
+ end
+ end
+ class DefaultsInstance < InstanceResource
+ ##
+ # Initialize the DefaultsInstance
+ # @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 Defaults
+ # resource.
+ # @param [String] sid The SID of the Call resource to fetch.
+ # @return [DefaultsInstance] DefaultsInstance
+ 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'],
+ }
- ##
- # Generate an instance context for the instance, the context is capable of
- # performing various actions. All instance actions are proxied to the context
- # @return [DefaultsContext] DefaultsContext for this DefaultsInstance
- def context
- unless @instance_context
- @instance_context = DefaultsContext.new(@version, @params['assistant_sid'], )
- end
- @instance_context
- end
+ # Context
+ @instance_context = nil
+ @params = { 'assistant_sid' => assistant_sid || @properties['assistant_sid'] , }
+ end
- ##
- # @return [String] The SID of the Account that created the resource
- def account_sid
- @properties['account_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 [DefaultsContext] CallContext for this CallInstance
+ def context
+ unless @instance_context
+ @instance_context = DefaultsContext.new(@version , @params['assistant_sid'])
+ end
+ @instance_context
+ end
+
+ ##
+ # @return [String] The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Defaults resource.
+ def account_sid
+ @properties['account_sid']
+ end
+
+ ##
+ # @return [String] The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource.
+ def assistant_sid
+ @properties['assistant_sid']
+ end
+
+ ##
+ # @return [String] The absolute URL of the Defaults resource.
+ def url
+ @properties['url']
+ end
+
+ ##
+ # @return [Hash] The JSON string that describes the default task links for the `assistant_initiation`, `collect`, and `fallback` situations.
+ def data
+ @properties['data']
+ end
+
+ ##
+ # Fetch the DefaultsInstance
+ # @return [DefaultsInstance] Fetched DefaultsInstance
+ def fetch
- ##
- # @return [String] The SID of the Assistant that is the parent of the resource
- def assistant_sid
- @properties['assistant_sid']
- end
+ context.fetch
+ end
- ##
- # @return [String] The absolute URL of the Defaults resource
- def url
- @properties['url']
- end
+ ##
+ # Update the DefaultsInstance
+ # @param [Object] defaults A JSON string that describes the default task links for the `assistant_initiation`, `collect`, and `fallback` situations.
+ # @return [DefaultsInstance] Updated DefaultsInstance
+ def update(
+ defaults: :unset
+ )
- ##
- # @return [Hash] The JSON string that describes the default task links
- def data
- @properties['data']
- end
+ context.update(
+ defaults: defaults,
+ )
+ end
- ##
- # Fetch the DefaultsInstance
- # @return [DefaultsInstance] Fetched DefaultsInstance
- def fetch
- context.fetch
- end
+ ##
+ # Provide a user friendly representation
+ def to_s
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
+ "<Twilio.Autopilot.V1.DefaultsInstance #{values}>"
+ end
- ##
- # Update the DefaultsInstance
- # @param [Hash] defaults A JSON string that describes the default task links for
- # the `assistant_initiation`, `collect`, and `fallback` situations.
- # @return [DefaultsInstance] Updated DefaultsInstance
- def update(defaults: :unset)
- context.update(defaults: defaults, )
- end
+ ##
+ # Provide a detailed, user friendly representation
+ def inspect
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
+ "<Twilio.Autopilot.V1.DefaultsInstance #{values}>"
+ end
+ end
- ##
- # Provide a user friendly representation
- def to_s
- values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
- "<Twilio.Autopilot.V1.DefaultsInstance #{values}>"
+ end
end
-
- ##
- # Provide a detailed, user friendly representation
- def inspect
- values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
- "<Twilio.Autopilot.V1.DefaultsInstance #{values}>"
- end
- end
end
- end
end
- end
-end
\ No newline at end of file
+end
+
+