From 17616ec7fb44c14a65930b441364765f835d656a Mon Sep 17 00:00:00 2001 From: Shubham Date: Mon, 29 Jan 2024 11:19:44 +0530 Subject: [PATCH] chore: removing oauth and autopilot references (#708) * chore: removing oauth and autopilot references * chore: run linter * chore: added base64 to Gemfile * Update Gemfile --- Gemfile | 2 + lib/twilio-ruby/rest/autopilot.rb | 6 - lib/twilio-ruby/rest/autopilot/v1.rb | 55 -- .../rest/autopilot/v1/assistant.rb | 683 ------------------ .../rest/autopilot/v1/assistant/defaults.rb | 241 ------ .../rest/autopilot/v1/assistant/dialogue.rb | 217 ------ .../rest/autopilot/v1/assistant/field_type.rb | 435 ----------- .../v1/assistant/field_type/field_value.rb | 389 ---------- .../autopilot/v1/assistant/model_build.rb | 409 ----------- .../rest/autopilot/v1/assistant/query.rb | 473 ------------ .../autopilot/v1/assistant/style_sheet.rb | 241 ------ .../rest/autopilot/v1/assistant/task.rb | 525 -------------- .../rest/autopilot/v1/assistant/task/field.rb | 373 ---------- .../autopilot/v1/assistant/task/sample.rb | 436 ----------- .../v1/assistant/task/task_actions.rb | 253 ------- .../v1/assistant/task/task_statistics.rb | 226 ------ .../rest/autopilot/v1/assistant/webhook.rb | 433 ----------- .../rest/autopilot/v1/restore_assistant.rb | 207 ------ lib/twilio-ruby/rest/autopilot_base.rb | 38 - lib/twilio-ruby/rest/client.rb | 24 +- lib/twilio-ruby/rest/oauth.rb | 6 - lib/twilio-ruby/rest/oauth/v1.rb | 64 -- lib/twilio-ruby/rest/oauth/v1/device_code.rb | 171 ----- lib/twilio-ruby/rest/oauth/v1/oauth.rb | 185 ----- .../rest/oauth/v1/openid_discovery.rb | 262 ------- lib/twilio-ruby/rest/oauth/v1/token.rb | 179 ----- lib/twilio-ruby/rest/oauth/v1/user_info.rb | 213 ------ lib/twilio-ruby/rest/oauth_base.rb | 38 - 28 files changed, 9 insertions(+), 6775 deletions(-) delete mode 100644 lib/twilio-ruby/rest/autopilot.rb delete mode 100644 lib/twilio-ruby/rest/autopilot/v1.rb delete mode 100644 lib/twilio-ruby/rest/autopilot/v1/assistant.rb delete mode 100644 lib/twilio-ruby/rest/autopilot/v1/assistant/defaults.rb delete mode 100644 lib/twilio-ruby/rest/autopilot/v1/assistant/dialogue.rb delete mode 100644 lib/twilio-ruby/rest/autopilot/v1/assistant/field_type.rb delete mode 100644 lib/twilio-ruby/rest/autopilot/v1/assistant/field_type/field_value.rb delete mode 100644 lib/twilio-ruby/rest/autopilot/v1/assistant/model_build.rb delete mode 100644 lib/twilio-ruby/rest/autopilot/v1/assistant/query.rb delete mode 100644 lib/twilio-ruby/rest/autopilot/v1/assistant/style_sheet.rb delete mode 100644 lib/twilio-ruby/rest/autopilot/v1/assistant/task.rb delete mode 100644 lib/twilio-ruby/rest/autopilot/v1/assistant/task/field.rb delete mode 100644 lib/twilio-ruby/rest/autopilot/v1/assistant/task/sample.rb delete mode 100644 lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_actions.rb delete mode 100644 lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_statistics.rb delete mode 100644 lib/twilio-ruby/rest/autopilot/v1/assistant/webhook.rb delete mode 100644 lib/twilio-ruby/rest/autopilot/v1/restore_assistant.rb delete mode 100644 lib/twilio-ruby/rest/autopilot_base.rb delete mode 100644 lib/twilio-ruby/rest/oauth.rb delete mode 100644 lib/twilio-ruby/rest/oauth/v1.rb delete mode 100644 lib/twilio-ruby/rest/oauth/v1/device_code.rb delete mode 100644 lib/twilio-ruby/rest/oauth/v1/oauth.rb delete mode 100644 lib/twilio-ruby/rest/oauth/v1/openid_discovery.rb delete mode 100644 lib/twilio-ruby/rest/oauth/v1/token.rb delete mode 100644 lib/twilio-ruby/rest/oauth/v1/user_info.rb delete mode 100644 lib/twilio-ruby/rest/oauth_base.rb diff --git a/Gemfile b/Gemfile index 93f770641..695328909 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,5 @@ source 'https://rubygems.org' gem 'simplecov', require: false, group: :test gemspec + +gem "base64" diff --git a/lib/twilio-ruby/rest/autopilot.rb b/lib/twilio-ruby/rest/autopilot.rb deleted file mode 100644 index c38fa3a7c..000000000 --- a/lib/twilio-ruby/rest/autopilot.rb +++ /dev/null @@ -1,6 +0,0 @@ -module Twilio - module REST - class Autopilot < AutopilotBase; - end - end -end diff --git a/lib/twilio-ruby/rest/autopilot/v1.rb b/lib/twilio-ruby/rest/autopilot/v1.rb deleted file mode 100644 index 8e1a0bee1..000000000 --- a/lib/twilio-ruby/rest/autopilot/v1.rb +++ /dev/null @@ -1,55 +0,0 @@ -## -# This code was generated by -# ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ -# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ -# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ -# -# 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 - class V1 < Version - ## - # Initialize the V1 version of Autopilot - def initialize(domain) - super - @version = 'v1' - @assistants = nil - @restore_assistant = nil - end - - ## - # @param [String] sid The Twilio-provided string that uniquely identifies the Assistant resource to fetch. - # @return [Twilio::REST::Autopilot::V1::AssistantContext] if sid was passed. - # @return [Twilio::REST::Autopilot::V1::AssistantList] - def assistants(sid=:unset) - if sid.nil? - raise ArgumentError, 'sid cannot be nil' - end - if sid == :unset - @assistants ||= AssistantList.new self - else - AssistantContext.new(self, sid) - end - end - ## - # @return [Twilio::REST::Autopilot::V1::RestoreAssistantList] - def restore_assistant - @restore_assistant ||= RestoreAssistantList.new self - end - ## - # Provide a user friendly representation - def to_s - ''; - end - end - end - end -end diff --git a/lib/twilio-ruby/rest/autopilot/v1/assistant.rb b/lib/twilio-ruby/rest/autopilot/v1/assistant.rb deleted file mode 100644 index db4aec470..000000000 --- a/lib/twilio-ruby/rest/autopilot/v1/assistant.rb +++ /dev/null @@ -1,683 +0,0 @@ -## -# This code was generated by -# ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ -# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ -# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ -# -# 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 < AutopilotBase - class V1 < Version - class AssistantList < ListResource - ## - # Initialize the AssistantList - # @param [Version] version Version that contains the resource - # @return [AssistantList] AssistantList - def initialize(version) - super(version) - # Path Solution - @solution = { } - @uri = "/Assistants" - - end - ## - # Create the AssistantInstance - # @param [String] friendly_name A descriptive string that you create to describe the new resource. It is not unique and can be up to 255 characters long. - # @param [Boolean] log_queries Whether queries should be logged and kept after training. Can be: `true` or `false` and defaults to `true`. If `true`, queries are stored for 30 days, and then deleted. If `false`, no queries are stored. - # @param [String] unique_name An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the `sid` in the URL path to address the resource. The first 64 characters must be unique. - # @param [String] callback_url Reserved. - # @param [String] callback_events Reserved. - # @param [Object] style_sheet The JSON string that defines the Assistant's [style sheet](https://www.twilio.com/docs/autopilot/api/assistant/stylesheet) - # @param [Object] defaults A JSON object that defines the Assistant's [default tasks](https://www.twilio.com/docs/autopilot/api/assistant/defaults) for various scenarios, including initiation actions and fallback tasks. - # @return [AssistantInstance] Created AssistantInstance - def create( - friendly_name: :unset, - log_queries: :unset, - unique_name: :unset, - callback_url: :unset, - callback_events: :unset, - style_sheet: :unset, - defaults: :unset - ) - - data = Twilio::Values.of({ - 'FriendlyName' => friendly_name, - 'LogQueries' => log_queries, - 'UniqueName' => unique_name, - 'CallbackUrl' => callback_url, - 'CallbackEvents' => callback_events, - 'StyleSheet' => Twilio.serialize_object(style_sheet), - 'Defaults' => Twilio.serialize_object(defaults), - }) - - payload = @version.create('POST', @uri, data: data) - AssistantInstance.new( - @version, - payload, - ) - end - - - ## - # Lists AssistantInstance records from the API as a list. - # Unlike stream(), this operation is eager and will load `limit` records into - # memory before returning. - # @param [Integer] limit Upper limit for the number of records to return. stream() - # guarantees to never return more than limit. Default is no limit - # @param [Integer] page_size Number of records to fetch per request, when - # not set will use the default value of 50 records. If no page_size is defined - # but a limit is defined, stream() will attempt to read the limit with the most - # efficient page size, i.e. min(limit, 1000) - # @return [Array] Array of up to limit results - def list(limit: nil, page_size: nil) - self.stream( - limit: limit, - page_size: page_size - ).entries - end - - ## - # Streams Instance records from the API as an Enumerable. - # This operation lazily loads records as efficiently as possible until the limit - # is reached. - # @param [Integer] limit Upper limit for the number of records to return. stream() - # guarantees to never return more than limit. Default is no limit - # @param [Integer] page_size Number of records to fetch per request, when - # not set will use the default value of 50 records. If no page_size is defined - # but a limit is defined, stream() will attempt to read the limit with the most - # efficient page size, i.e. min(limit, 1000) - # @return [Enumerable] Enumerable that will yield up to limit results - def stream(limit: nil, page_size: nil) - limits = @version.read_limits(limit, page_size) - - page = self.page( - page_size: limits[:page_size], ) - - @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit]) - end - - ## - # When passed a block, yields AssistantInstance records from the API. - # This operation lazily loads records as efficiently as possible until the limit - # is reached. - def each - limits = @version.read_limits - - page = self.page(page_size: limits[:page_size], ) - - @version.stream(page, - limit: limits[:limit], - page_limit: limits[:page_limit]).each {|x| yield x} - end - - ## - # Retrieve a single page of AssistantInstance records from the API. - # Request is executed immediately. - # @param [String] page_token PageToken provided by the API - # @param [Integer] page_number Page Number, this value is simply for client state - # @param [Integer] page_size Number of records to return, defaults to 50 - # @return [Page] Page of AssistantInstance - def page(page_token: :unset, page_number: :unset, page_size: :unset) - params = Twilio::Values.of({ - 'PageToken' => page_token, - 'Page' => page_number, - 'PageSize' => page_size, - }) - - response = @version.page('GET', @uri, params: params) - - AssistantPage.new(@version, response, @solution) - end - - ## - # Retrieve a single page of AssistantInstance records from the API. - # Request is executed immediately. - # @param [String] target_url API-generated URL for the requested results page - # @return [Page] Page of AssistantInstance - def get_page(target_url) - response = @version.domain.request( - 'GET', - target_url - ) - AssistantPage.new(@version, response, @solution) - 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 AssistantContext < InstanceContext - ## - # Initialize the AssistantContext - # @param [Version] version Version that contains the resource - # @param [String] sid The Twilio-provided string that uniquely identifies the Assistant resource to update. - # @return [AssistantContext] AssistantContext - def initialize(version, sid) - super(version) - - # Path Solution - @solution = { sid: sid, } - @uri = "/Assistants/#{@solution[:sid]}" - - # Dependents - @tasks = nil - @defaults = nil - @webhooks = nil - @dialogues = nil - @model_builds = nil - @field_types = nil - @style_sheet = nil - @queries = nil - end - ## - # Delete the AssistantInstance - # @return [Boolean] True if delete succeeds, false otherwise - def delete - - @version.delete('DELETE', @uri) - end - - ## - # Fetch the AssistantInstance - # @return [AssistantInstance] Fetched AssistantInstance - def fetch - - payload = @version.fetch('GET', @uri) - AssistantInstance.new( - @version, - payload, - sid: @solution[:sid], - ) - end - - ## - # Update the AssistantInstance - # @param [String] friendly_name A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. - # @param [Boolean] log_queries Whether queries should be logged and kept after training. Can be: `true` or `false` and defaults to `true`. If `true`, queries are stored for 30 days, and then deleted. If `false`, no queries are stored. - # @param [String] unique_name An application-defined string that uniquely identifies the resource. It can be used as an alternative to the `sid` in the URL path to address the resource. The first 64 characters must be unique. - # @param [String] callback_url Reserved. - # @param [String] callback_events Reserved. - # @param [Object] style_sheet The JSON string that defines the Assistant's [style sheet](https://www.twilio.com/docs/autopilot/api/assistant/stylesheet) - # @param [Object] defaults A JSON object that defines the Assistant's [default tasks](https://www.twilio.com/docs/autopilot/api/assistant/defaults) for various scenarios, including initiation actions and fallback tasks. - # @param [String] development_stage A string describing the state of the assistant. - # @return [AssistantInstance] Updated AssistantInstance - def update( - friendly_name: :unset, - log_queries: :unset, - unique_name: :unset, - callback_url: :unset, - callback_events: :unset, - style_sheet: :unset, - defaults: :unset, - development_stage: :unset - ) - - data = Twilio::Values.of({ - 'FriendlyName' => friendly_name, - 'LogQueries' => log_queries, - 'UniqueName' => unique_name, - 'CallbackUrl' => callback_url, - 'CallbackEvents' => callback_events, - 'StyleSheet' => Twilio.serialize_object(style_sheet), - 'Defaults' => Twilio.serialize_object(defaults), - 'DevelopmentStage' => development_stage, - }) - - payload = @version.update('POST', @uri, data: data) - AssistantInstance.new( - @version, - payload, - sid: @solution[:sid], - ) - end - - ## - # Access the tasks - # @return [TaskList] - # @return [TaskContext] if sid was passed. - def tasks(sid=:unset) - - raise ArgumentError, 'sid cannot be nil' if sid.nil? - - if sid != :unset - return TaskContext.new(@version, @solution[:sid],sid ) - end - - unless @tasks - @tasks = TaskList.new( - @version, assistant_sid: @solution[:sid], ) - end - - @tasks - end - ## - # Access the defaults - # @return [DefaultsList] - # @return [DefaultsContext] - def defaults - DefaultsContext.new( - @version, - @solution[:sid] - ) - end - ## - # Access the webhooks - # @return [WebhookList] - # @return [WebhookContext] if sid was passed. - def webhooks(sid=:unset) - - raise ArgumentError, 'sid cannot be nil' if sid.nil? - - if sid != :unset - return WebhookContext.new(@version, @solution[:sid],sid ) - end - - unless @webhooks - @webhooks = WebhookList.new( - @version, assistant_sid: @solution[:sid], ) - end - - @webhooks - end - ## - # Access the dialogues - # @return [DialogueList] - # @return [DialogueContext] if sid was passed. - def dialogues(sid=:unset) - - raise ArgumentError, 'sid cannot be nil' if sid.nil? - - if sid != :unset - return DialogueContext.new(@version, @solution[:sid],sid ) - end - - unless @dialogues - @dialogues = DialogueList.new( - @version, assistant_sid: @solution[:sid], ) - end - - @dialogues - end - ## - # Access the model_builds - # @return [ModelBuildList] - # @return [ModelBuildContext] if sid was passed. - def model_builds(sid=:unset) - - raise ArgumentError, 'sid cannot be nil' if sid.nil? - - if sid != :unset - return ModelBuildContext.new(@version, @solution[:sid],sid ) - end - - unless @model_builds - @model_builds = ModelBuildList.new( - @version, assistant_sid: @solution[:sid], ) - end - - @model_builds - end - ## - # Access the field_types - # @return [FieldTypeList] - # @return [FieldTypeContext] if sid was passed. - def field_types(sid=:unset) - - raise ArgumentError, 'sid cannot be nil' if sid.nil? - - if sid != :unset - return FieldTypeContext.new(@version, @solution[:sid],sid ) - end - - unless @field_types - @field_types = FieldTypeList.new( - @version, assistant_sid: @solution[:sid], ) - end - - @field_types - end - ## - # Access the style_sheet - # @return [StyleSheetList] - # @return [StyleSheetContext] - def style_sheet - StyleSheetContext.new( - @version, - @solution[:sid] - ) - end - ## - # Access the queries - # @return [QueryList] - # @return [QueryContext] if sid was passed. - def queries(sid=:unset) - - raise ArgumentError, 'sid cannot be nil' if sid.nil? - - if sid != :unset - return QueryContext.new(@version, @solution[:sid],sid ) - end - - unless @queries - @queries = QueryList.new( - @version, assistant_sid: @solution[:sid], ) - end - - @queries - 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 AssistantPage < Page - ## - # Initialize the AssistantPage - # @param [Version] version Version that contains the resource - # @param [Response] response Response from the API - # @param [Hash] solution Path solution for the resource - # @return [AssistantPage] AssistantPage - def initialize(version, response, solution) - super(version, response) - - # Path Solution - @solution = solution - end - - ## - # Build an instance of AssistantInstance - # @param [Hash] payload Payload response from the API - # @return [AssistantInstance] AssistantInstance - def get_instance(payload) - AssistantInstance.new(@version, payload) - end - - ## - # Provide a user friendly representation - def to_s - '' - end - end - class AssistantInstance < InstanceResource - ## - # Initialize the AssistantInstance - # @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 Assistant - # resource. - # @param [String] sid The SID of the Call resource to fetch. - # @return [AssistantInstance] AssistantInstance - def initialize(version, payload , sid: nil) - super(version) - - # Marshaled Properties - @properties = { - 'account_sid' => payload['account_sid'], - 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), - 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), - 'friendly_name' => payload['friendly_name'], - 'latest_model_build_sid' => payload['latest_model_build_sid'], - 'links' => payload['links'], - 'log_queries' => payload['log_queries'], - 'development_stage' => payload['development_stage'], - 'needs_model_build' => payload['needs_model_build'], - 'sid' => payload['sid'], - 'unique_name' => payload['unique_name'], - 'url' => payload['url'], - 'callback_url' => payload['callback_url'], - 'callback_events' => payload['callback_events'], - } - - # Context - @instance_context = nil - @params = { 'sid' => sid || @properties['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 [AssistantContext] CallContext for this CallInstance - def context - unless @instance_context - @instance_context = AssistantContext.new(@version , @params['sid']) - end - @instance_context - end - - ## - # @return [String] The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Assistant resource. - def account_sid - @properties['account_sid'] - end - - ## - # @return [Time] The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - def date_created - @properties['date_created'] - end - - ## - # @return [Time] The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - def date_updated - @properties['date_updated'] - end - - ## - # @return [String] The string that you assigned to describe the resource. It is not unique and can be up to 255 characters long. - def friendly_name - @properties['friendly_name'] - end - - ## - # @return [String] Reserved. - def latest_model_build_sid - @properties['latest_model_build_sid'] - end - - ## - # @return [Hash] A list of the URLs of the Assistant's related resources. - def links - @properties['links'] - end - - ## - # @return [Boolean] Whether queries should be logged and kept after training. Can be: `true` or `false` and defaults to `true`. If `true`, queries are stored for 30 days, and then deleted. If `false`, no queries are stored. - def log_queries - @properties['log_queries'] - end - - ## - # @return [String] A string describing the state of the assistant. - def development_stage - @properties['development_stage'] - end - - ## - # @return [Boolean] Whether model needs to be rebuilt. - def needs_model_build - @properties['needs_model_build'] - end - - ## - # @return [String] The unique string that we created to identify the Assistant resource. - def sid - @properties['sid'] - end - - ## - # @return [String] An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. It can be up to 64 characters long. - def unique_name - @properties['unique_name'] - end - - ## - # @return [String] The absolute URL of the Assistant resource. - def url - @properties['url'] - end - - ## - # @return [String] Reserved. - def callback_url - @properties['callback_url'] - end - - ## - # @return [String] Reserved. - def callback_events - @properties['callback_events'] - end - - ## - # Delete the AssistantInstance - # @return [Boolean] True if delete succeeds, false otherwise - def delete - - context.delete - end - - ## - # Fetch the AssistantInstance - # @return [AssistantInstance] Fetched AssistantInstance - def fetch - - context.fetch - end - - ## - # Update the AssistantInstance - # @param [String] friendly_name A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. - # @param [Boolean] log_queries Whether queries should be logged and kept after training. Can be: `true` or `false` and defaults to `true`. If `true`, queries are stored for 30 days, and then deleted. If `false`, no queries are stored. - # @param [String] unique_name An application-defined string that uniquely identifies the resource. It can be used as an alternative to the `sid` in the URL path to address the resource. The first 64 characters must be unique. - # @param [String] callback_url Reserved. - # @param [String] callback_events Reserved. - # @param [Object] style_sheet The JSON string that defines the Assistant's [style sheet](https://www.twilio.com/docs/autopilot/api/assistant/stylesheet) - # @param [Object] defaults A JSON object that defines the Assistant's [default tasks](https://www.twilio.com/docs/autopilot/api/assistant/defaults) for various scenarios, including initiation actions and fallback tasks. - # @param [String] development_stage A string describing the state of the assistant. - # @return [AssistantInstance] Updated AssistantInstance - def update( - friendly_name: :unset, - log_queries: :unset, - unique_name: :unset, - callback_url: :unset, - callback_events: :unset, - style_sheet: :unset, - defaults: :unset, - development_stage: :unset - ) - - context.update( - friendly_name: friendly_name, - log_queries: log_queries, - unique_name: unique_name, - callback_url: callback_url, - callback_events: callback_events, - style_sheet: style_sheet, - defaults: defaults, - development_stage: development_stage, - ) - end - - ## - # Access the tasks - # @return [tasks] tasks - def tasks - context.tasks - end - - ## - # Access the defaults - # @return [defaults] defaults - def defaults - context.defaults - end - - ## - # Access the webhooks - # @return [webhooks] webhooks - def webhooks - context.webhooks - end - - ## - # Access the dialogues - # @return [dialogues] dialogues - def dialogues - context.dialogues - end - - ## - # Access the model_builds - # @return [model_builds] model_builds - def model_builds - context.model_builds - end - - ## - # Access the field_types - # @return [field_types] field_types - def field_types - context.field_types - end - - ## - # Access the style_sheet - # @return [style_sheet] style_sheet - def style_sheet - context.style_sheet - end - - ## - # Access the queries - # @return [queries] queries - def queries - context.queries - 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 diff --git a/lib/twilio-ruby/rest/autopilot/v1/assistant/defaults.rb b/lib/twilio-ruby/rest/autopilot/v1/assistant/defaults.rb deleted file mode 100644 index 4aa23e443..000000000 --- a/lib/twilio-ruby/rest/autopilot/v1/assistant/defaults.rb +++ /dev/null @@ -1,241 +0,0 @@ -## -# This code was generated by -# ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ -# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ -# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ -# -# 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 < AutopilotBase - class V1 < Version - class AssistantContext < InstanceContext - - 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 - '#' - 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 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) - - # Path Solution - @solution = { assistant_sid: assistant_sid, } - @uri = "/Assistants/#{@solution[:assistant_sid]}/Defaults" - - - end - ## - # Fetch the DefaultsInstance - # @return [DefaultsInstance] Fetched DefaultsInstance - def fetch - - payload = @version.fetch('GET', @uri) - DefaultsInstance.new( - @version, - payload, - assistant_sid: @solution[:assistant_sid], - ) - 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 - ) - - 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 - - - ## - # 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 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) - - # 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 - - ## - # Provide a user friendly representation - def to_s - '' - 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'], - } - - # 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 [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 - - context.fetch - 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 - ) - - context.update( - defaults: defaults, - ) - 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 - - diff --git a/lib/twilio-ruby/rest/autopilot/v1/assistant/dialogue.rb b/lib/twilio-ruby/rest/autopilot/v1/assistant/dialogue.rb deleted file mode 100644 index c8cbfe9a7..000000000 --- a/lib/twilio-ruby/rest/autopilot/v1/assistant/dialogue.rb +++ /dev/null @@ -1,217 +0,0 @@ -## -# This code was generated by -# ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ -# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ -# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ -# -# 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 < AutopilotBase - class V1 < Version - class AssistantContext < InstanceContext - - class DialogueList < ListResource - ## - # Initialize the DialogueList - # @param [Version] version Version that contains the resource - # @return [DialogueList] DialogueList - 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 DialogueContext < InstanceContext - ## - # Initialize the DialogueContext - # @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. - # @param [String] sid The Twilio-provided string that uniquely identifies the Dialogue resource to fetch. - # @return [DialogueContext] DialogueContext - def initialize(version, assistant_sid, sid) - super(version) - - # Path Solution - @solution = { assistant_sid: assistant_sid, sid: sid, } - @uri = "/Assistants/#{@solution[:assistant_sid]}/Dialogues/#{@solution[:sid]}" - - - end - ## - # Fetch the DialogueInstance - # @return [DialogueInstance] Fetched DialogueInstance - def fetch - - payload = @version.fetch('GET', @uri) - DialogueInstance.new( - @version, - payload, - assistant_sid: @solution[:assistant_sid], - sid: @solution[: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 DialoguePage < Page - ## - # Initialize the DialoguePage - # @param [Version] version Version that contains the resource - # @param [Response] response Response from the API - # @param [Hash] solution Path solution for the resource - # @return [DialoguePage] DialoguePage - def initialize(version, response, solution) - super(version, response) - - # Path Solution - @solution = solution - end - - ## - # Build an instance of DialogueInstance - # @param [Hash] payload Payload response from the API - # @return [DialogueInstance] DialogueInstance - def get_instance(payload) - DialogueInstance.new(@version, payload, assistant_sid: @solution[:assistant_sid]) - end - - ## - # Provide a user friendly representation - def to_s - '' - end - end - class DialogueInstance < InstanceResource - ## - # Initialize the DialogueInstance - # @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 Dialogue - # resource. - # @param [String] sid The SID of the Call resource to fetch. - # @return [DialogueInstance] DialogueInstance - def initialize(version, payload , assistant_sid: nil, sid: nil) - super(version) - - # Marshaled Properties - @properties = { - 'account_sid' => payload['account_sid'], - 'assistant_sid' => payload['assistant_sid'], - 'sid' => payload['sid'], - 'data' => payload['data'], - 'url' => payload['url'], - } - - # Context - @instance_context = nil - @params = { 'assistant_sid' => assistant_sid || @properties['assistant_sid'] ,'sid' => sid || @properties['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 [DialogueContext] CallContext for this CallInstance - def context - unless @instance_context - @instance_context = DialogueContext.new(@version , @params['assistant_sid'], @params['sid']) - end - @instance_context - end - - ## - # @return [String] The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Dialogue 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 unique string that we created to identify the Dialogue resource. - def sid - @properties['sid'] - end - - ## - # @return [Hash] The JSON string that describes the dialogue session object. - def data - @properties['data'] - end - - ## - # @return [String] The absolute URL of the Dialogue resource. - def url - @properties['url'] - end - - ## - # Fetch the DialogueInstance - # @return [DialogueInstance] Fetched DialogueInstance - def fetch - - context.fetch - 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 - - diff --git a/lib/twilio-ruby/rest/autopilot/v1/assistant/field_type.rb b/lib/twilio-ruby/rest/autopilot/v1/assistant/field_type.rb deleted file mode 100644 index 050084257..000000000 --- a/lib/twilio-ruby/rest/autopilot/v1/assistant/field_type.rb +++ /dev/null @@ -1,435 +0,0 @@ -## -# This code was generated by -# ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ -# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ -# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ -# -# 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 < AutopilotBase - class V1 < Version - class AssistantContext < InstanceContext - - class FieldTypeList < ListResource - ## - # Initialize the FieldTypeList - # @param [Version] version Version that contains the resource - # @return [FieldTypeList] FieldTypeList - def initialize(version, assistant_sid: nil) - super(version) - # Path Solution - @solution = { assistant_sid: assistant_sid } - @uri = "/Assistants/#{@solution[:assistant_sid]}/FieldTypes" - - end - ## - # Create the FieldTypeInstance - # @param [String] unique_name An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the `sid` in the URL path to address the resource. The first 64 characters must be unique. - # @param [String] friendly_name A descriptive string that you create to describe the new resource. It is not unique and can be up to 255 characters long. - # @return [FieldTypeInstance] Created FieldTypeInstance - def create( - unique_name: nil, - friendly_name: :unset - ) - - data = Twilio::Values.of({ - 'UniqueName' => unique_name, - 'FriendlyName' => friendly_name, - }) - - payload = @version.create('POST', @uri, data: data) - FieldTypeInstance.new( - @version, - payload, - assistant_sid: @solution[:assistant_sid], - ) - end - - - ## - # Lists FieldTypeInstance records from the API as a list. - # Unlike stream(), this operation is eager and will load `limit` records into - # memory before returning. - # @param [Integer] limit Upper limit for the number of records to return. stream() - # guarantees to never return more than limit. Default is no limit - # @param [Integer] page_size Number of records to fetch per request, when - # not set will use the default value of 50 records. If no page_size is defined - # but a limit is defined, stream() will attempt to read the limit with the most - # efficient page size, i.e. min(limit, 1000) - # @return [Array] Array of up to limit results - def list(limit: nil, page_size: nil) - self.stream( - limit: limit, - page_size: page_size - ).entries - end - - ## - # Streams Instance records from the API as an Enumerable. - # This operation lazily loads records as efficiently as possible until the limit - # is reached. - # @param [Integer] limit Upper limit for the number of records to return. stream() - # guarantees to never return more than limit. Default is no limit - # @param [Integer] page_size Number of records to fetch per request, when - # not set will use the default value of 50 records. If no page_size is defined - # but a limit is defined, stream() will attempt to read the limit with the most - # efficient page size, i.e. min(limit, 1000) - # @return [Enumerable] Enumerable that will yield up to limit results - def stream(limit: nil, page_size: nil) - limits = @version.read_limits(limit, page_size) - - page = self.page( - page_size: limits[:page_size], ) - - @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit]) - end - - ## - # When passed a block, yields FieldTypeInstance records from the API. - # This operation lazily loads records as efficiently as possible until the limit - # is reached. - def each - limits = @version.read_limits - - page = self.page(page_size: limits[:page_size], ) - - @version.stream(page, - limit: limits[:limit], - page_limit: limits[:page_limit]).each {|x| yield x} - end - - ## - # Retrieve a single page of FieldTypeInstance records from the API. - # Request is executed immediately. - # @param [String] page_token PageToken provided by the API - # @param [Integer] page_number Page Number, this value is simply for client state - # @param [Integer] page_size Number of records to return, defaults to 50 - # @return [Page] Page of FieldTypeInstance - def page(page_token: :unset, page_number: :unset, page_size: :unset) - params = Twilio::Values.of({ - 'PageToken' => page_token, - 'Page' => page_number, - 'PageSize' => page_size, - }) - - response = @version.page('GET', @uri, params: params) - - FieldTypePage.new(@version, response, @solution) - end - - ## - # Retrieve a single page of FieldTypeInstance records from the API. - # Request is executed immediately. - # @param [String] target_url API-generated URL for the requested results page - # @return [Page] Page of FieldTypeInstance - def get_page(target_url) - response = @version.domain.request( - 'GET', - target_url - ) - FieldTypePage.new(@version, response, @solution) - 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 FieldTypeContext < InstanceContext - ## - # Initialize the FieldTypeContext - # @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 to update. - # @param [String] sid The Twilio-provided string that uniquely identifies the FieldType resource to update. - # @return [FieldTypeContext] FieldTypeContext - def initialize(version, assistant_sid, sid) - super(version) - - # Path Solution - @solution = { assistant_sid: assistant_sid, sid: sid, } - @uri = "/Assistants/#{@solution[:assistant_sid]}/FieldTypes/#{@solution[:sid]}" - - # Dependents - @field_values = nil - end - ## - # Delete the FieldTypeInstance - # @return [Boolean] True if delete succeeds, false otherwise - def delete - - @version.delete('DELETE', @uri) - end - - ## - # Fetch the FieldTypeInstance - # @return [FieldTypeInstance] Fetched FieldTypeInstance - def fetch - - payload = @version.fetch('GET', @uri) - FieldTypeInstance.new( - @version, - payload, - assistant_sid: @solution[:assistant_sid], - sid: @solution[:sid], - ) - end - - ## - # Update the FieldTypeInstance - # @param [String] friendly_name A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. - # @param [String] unique_name An application-defined string that uniquely identifies the resource. It can be used as an alternative to the `sid` in the URL path to address the resource. The first 64 characters must be unique. - # @return [FieldTypeInstance] Updated FieldTypeInstance - def update( - friendly_name: :unset, - unique_name: :unset - ) - - data = Twilio::Values.of({ - 'FriendlyName' => friendly_name, - 'UniqueName' => unique_name, - }) - - payload = @version.update('POST', @uri, data: data) - FieldTypeInstance.new( - @version, - payload, - assistant_sid: @solution[:assistant_sid], - sid: @solution[:sid], - ) - end - - ## - # Access the field_values - # @return [FieldValueList] - # @return [FieldValueContext] if sid was passed. - def field_values(sid=:unset) - - raise ArgumentError, 'sid cannot be nil' if sid.nil? - - if sid != :unset - return FieldValueContext.new(@version, @solution[:assistant_sid], @solution[:sid],sid ) - end - - unless @field_values - @field_values = FieldValueList.new( - @version, assistant_sid: @solution[:assistant_sid], field_type_sid: @solution[:sid], ) - end - - @field_values - 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 FieldTypePage < Page - ## - # Initialize the FieldTypePage - # @param [Version] version Version that contains the resource - # @param [Response] response Response from the API - # @param [Hash] solution Path solution for the resource - # @return [FieldTypePage] FieldTypePage - def initialize(version, response, solution) - super(version, response) - - # Path Solution - @solution = solution - end - - ## - # Build an instance of FieldTypeInstance - # @param [Hash] payload Payload response from the API - # @return [FieldTypeInstance] FieldTypeInstance - def get_instance(payload) - FieldTypeInstance.new(@version, payload, assistant_sid: @solution[:assistant_sid]) - end - - ## - # Provide a user friendly representation - def to_s - '' - end - end - class FieldTypeInstance < InstanceResource - ## - # Initialize the FieldTypeInstance - # @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 FieldType - # resource. - # @param [String] sid The SID of the Call resource to fetch. - # @return [FieldTypeInstance] FieldTypeInstance - def initialize(version, payload , assistant_sid: nil, sid: nil) - super(version) - - # Marshaled Properties - @properties = { - 'account_sid' => payload['account_sid'], - 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), - 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), - 'friendly_name' => payload['friendly_name'], - 'links' => payload['links'], - 'assistant_sid' => payload['assistant_sid'], - 'sid' => payload['sid'], - 'unique_name' => payload['unique_name'], - 'url' => payload['url'], - } - - # Context - @instance_context = nil - @params = { 'assistant_sid' => assistant_sid || @properties['assistant_sid'] ,'sid' => sid || @properties['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 [FieldTypeContext] CallContext for this CallInstance - def context - unless @instance_context - @instance_context = FieldTypeContext.new(@version , @params['assistant_sid'], @params['sid']) - end - @instance_context - end - - ## - # @return [String] The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the FieldType resource. - def account_sid - @properties['account_sid'] - end - - ## - # @return [Time] The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - def date_created - @properties['date_created'] - end - - ## - # @return [Time] The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - def date_updated - @properties['date_updated'] - end - - ## - # @return [String] The string that you assigned to describe the resource. It is not unique and can be up to 255 characters long. - def friendly_name - @properties['friendly_name'] - end - - ## - # @return [Hash] A list of the URLs of related resources. - def links - @properties['links'] - 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 unique string that we created to identify the FieldType resource. - def sid - @properties['sid'] - end - - ## - # @return [String] An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. - def unique_name - @properties['unique_name'] - end - - ## - # @return [String] The absolute URL of the FieldType resource. - def url - @properties['url'] - end - - ## - # Delete the FieldTypeInstance - # @return [Boolean] True if delete succeeds, false otherwise - def delete - - context.delete - end - - ## - # Fetch the FieldTypeInstance - # @return [FieldTypeInstance] Fetched FieldTypeInstance - def fetch - - context.fetch - end - - ## - # Update the FieldTypeInstance - # @param [String] friendly_name A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. - # @param [String] unique_name An application-defined string that uniquely identifies the resource. It can be used as an alternative to the `sid` in the URL path to address the resource. The first 64 characters must be unique. - # @return [FieldTypeInstance] Updated FieldTypeInstance - def update( - friendly_name: :unset, - unique_name: :unset - ) - - context.update( - friendly_name: friendly_name, - unique_name: unique_name, - ) - end - - ## - # Access the field_values - # @return [field_values] field_values - def field_values - context.field_values - 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 - - diff --git a/lib/twilio-ruby/rest/autopilot/v1/assistant/field_type/field_value.rb b/lib/twilio-ruby/rest/autopilot/v1/assistant/field_type/field_value.rb deleted file mode 100644 index 1fab8c6bb..000000000 --- a/lib/twilio-ruby/rest/autopilot/v1/assistant/field_type/field_value.rb +++ /dev/null @@ -1,389 +0,0 @@ -## -# This code was generated by -# ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ -# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ -# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ -# -# 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 < AutopilotBase - class V1 < Version - class AssistantContext < InstanceContext - class FieldTypeContext < InstanceContext - - class FieldValueList < ListResource - ## - # Initialize the FieldValueList - # @param [Version] version Version that contains the resource - # @return [FieldValueList] FieldValueList - def initialize(version, assistant_sid: nil, field_type_sid: nil) - super(version) - # Path Solution - @solution = { assistant_sid: assistant_sid, field_type_sid: field_type_sid } - @uri = "/Assistants/#{@solution[:assistant_sid]}/FieldTypes/#{@solution[:field_type_sid]}/FieldValues" - - end - ## - # Create the FieldValueInstance - # @param [String] language The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) tag that specifies the language of the value. Currently supported tags: `en-US` - # @param [String] value The Field Value data. - # @param [String] synonym_of The string value that indicates which word the field value is a synonym of. - # @return [FieldValueInstance] Created FieldValueInstance - def create( - language: nil, - value: nil, - synonym_of: :unset - ) - - data = Twilio::Values.of({ - 'Language' => language, - 'Value' => value, - 'SynonymOf' => synonym_of, - }) - - payload = @version.create('POST', @uri, data: data) - FieldValueInstance.new( - @version, - payload, - assistant_sid: @solution[:assistant_sid], - field_type_sid: @solution[:field_type_sid], - ) - end - - - ## - # Lists FieldValueInstance records from the API as a list. - # Unlike stream(), this operation is eager and will load `limit` records into - # memory before returning. - # @param [String] language The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) tag that specifies the language of the value. Currently supported tags: `en-US` - # @param [Integer] limit Upper limit for the number of records to return. stream() - # guarantees to never return more than limit. Default is no limit - # @param [Integer] page_size Number of records to fetch per request, when - # not set will use the default value of 50 records. If no page_size is defined - # but a limit is defined, stream() will attempt to read the limit with the most - # efficient page size, i.e. min(limit, 1000) - # @return [Array] Array of up to limit results - def list(language: :unset, limit: nil, page_size: nil) - self.stream( - language: language, - limit: limit, - page_size: page_size - ).entries - end - - ## - # Streams Instance records from the API as an Enumerable. - # This operation lazily loads records as efficiently as possible until the limit - # is reached. - # @param [String] language The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) tag that specifies the language of the value. Currently supported tags: `en-US` - # @param [Integer] limit Upper limit for the number of records to return. stream() - # guarantees to never return more than limit. Default is no limit - # @param [Integer] page_size Number of records to fetch per request, when - # not set will use the default value of 50 records. If no page_size is defined - # but a limit is defined, stream() will attempt to read the limit with the most - # efficient page size, i.e. min(limit, 1000) - # @return [Enumerable] Enumerable that will yield up to limit results - def stream(language: :unset, limit: nil, page_size: nil) - limits = @version.read_limits(limit, page_size) - - page = self.page( - language: language, - page_size: limits[:page_size], ) - - @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit]) - end - - ## - # When passed a block, yields FieldValueInstance records from the API. - # This operation lazily loads records as efficiently as possible until the limit - # is reached. - def each - limits = @version.read_limits - - page = self.page(page_size: limits[:page_size], ) - - @version.stream(page, - limit: limits[:limit], - page_limit: limits[:page_limit]).each {|x| yield x} - end - - ## - # Retrieve a single page of FieldValueInstance records from the API. - # Request is executed immediately. - # @param [String] language The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) tag that specifies the language of the value. Currently supported tags: `en-US` - # @param [String] page_token PageToken provided by the API - # @param [Integer] page_number Page Number, this value is simply for client state - # @param [Integer] page_size Number of records to return, defaults to 50 - # @return [Page] Page of FieldValueInstance - def page(language: :unset, page_token: :unset, page_number: :unset, page_size: :unset) - params = Twilio::Values.of({ - 'Language' => language, - 'PageToken' => page_token, - 'Page' => page_number, - 'PageSize' => page_size, - }) - - response = @version.page('GET', @uri, params: params) - - FieldValuePage.new(@version, response, @solution) - end - - ## - # Retrieve a single page of FieldValueInstance records from the API. - # Request is executed immediately. - # @param [String] target_url API-generated URL for the requested results page - # @return [Page] Page of FieldValueInstance - def get_page(target_url) - response = @version.domain.request( - 'GET', - target_url - ) - FieldValuePage.new(@version, response, @solution) - 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 FieldValueContext < InstanceContext - ## - # Initialize the FieldValueContext - # @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 FieldType associated with the resource to fetch. - # @param [String] field_type_sid The SID of the Field Type associated with the Field Value to fetch. - # @param [String] sid The Twilio-provided string that uniquely identifies the FieldValue resource to fetch. - # @return [FieldValueContext] FieldValueContext - def initialize(version, assistant_sid, field_type_sid, sid) - super(version) - - # Path Solution - @solution = { assistant_sid: assistant_sid, field_type_sid: field_type_sid, sid: sid, } - @uri = "/Assistants/#{@solution[:assistant_sid]}/FieldTypes/#{@solution[:field_type_sid]}/FieldValues/#{@solution[:sid]}" - - - end - ## - # Delete the FieldValueInstance - # @return [Boolean] True if delete succeeds, false otherwise - def delete - - @version.delete('DELETE', @uri) - end - - ## - # Fetch the FieldValueInstance - # @return [FieldValueInstance] Fetched FieldValueInstance - def fetch - - payload = @version.fetch('GET', @uri) - FieldValueInstance.new( - @version, - payload, - assistant_sid: @solution[:assistant_sid], - field_type_sid: @solution[:field_type_sid], - sid: @solution[: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 FieldValuePage < Page - ## - # Initialize the FieldValuePage - # @param [Version] version Version that contains the resource - # @param [Response] response Response from the API - # @param [Hash] solution Path solution for the resource - # @return [FieldValuePage] FieldValuePage - def initialize(version, response, solution) - super(version, response) - - # Path Solution - @solution = solution - end - - ## - # Build an instance of FieldValueInstance - # @param [Hash] payload Payload response from the API - # @return [FieldValueInstance] FieldValueInstance - def get_instance(payload) - FieldValueInstance.new(@version, payload, assistant_sid: @solution[:assistant_sid], field_type_sid: @solution[:field_type_sid]) - end - - ## - # Provide a user friendly representation - def to_s - '' - end - end - class FieldValueInstance < InstanceResource - ## - # Initialize the FieldValueInstance - # @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 FieldValue - # resource. - # @param [String] sid The SID of the Call resource to fetch. - # @return [FieldValueInstance] FieldValueInstance - def initialize(version, payload , assistant_sid: nil, field_type_sid: nil, sid: nil) - super(version) - - # Marshaled Properties - @properties = { - 'account_sid' => payload['account_sid'], - 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), - 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), - 'field_type_sid' => payload['field_type_sid'], - 'language' => payload['language'], - 'assistant_sid' => payload['assistant_sid'], - 'sid' => payload['sid'], - 'value' => payload['value'], - 'url' => payload['url'], - 'synonym_of' => payload['synonym_of'], - } - - # Context - @instance_context = nil - @params = { 'assistant_sid' => assistant_sid || @properties['assistant_sid'] ,'field_type_sid' => field_type_sid || @properties['field_type_sid'] ,'sid' => sid || @properties['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 [FieldValueContext] CallContext for this CallInstance - def context - unless @instance_context - @instance_context = FieldValueContext.new(@version , @params['assistant_sid'], @params['field_type_sid'], @params['sid']) - end - @instance_context - end - - ## - # @return [String] The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the FieldValue resource. - def account_sid - @properties['account_sid'] - end - - ## - # @return [Time] The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - def date_created - @properties['date_created'] - end - - ## - # @return [Time] The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - def date_updated - @properties['date_updated'] - end - - ## - # @return [String] The SID of the Field Type associated with the Field Value. - def field_type_sid - @properties['field_type_sid'] - end - - ## - # @return [String] The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) tag that specifies the language of the value. Currently supported tags: `en-US` - def language - @properties['language'] - end - - ## - # @return [String] The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the FieldType associated with the resource. - def assistant_sid - @properties['assistant_sid'] - end - - ## - # @return [String] The unique string that we created to identify the FieldValue resource. - def sid - @properties['sid'] - end - - ## - # @return [String] The Field Value data. - def value - @properties['value'] - end - - ## - # @return [String] The absolute URL of the FieldValue resource. - def url - @properties['url'] - end - - ## - # @return [String] The word for which the field value is a synonym of. - def synonym_of - @properties['synonym_of'] - end - - ## - # Delete the FieldValueInstance - # @return [Boolean] True if delete succeeds, false otherwise - def delete - - context.delete - end - - ## - # Fetch the FieldValueInstance - # @return [FieldValueInstance] Fetched FieldValueInstance - def fetch - - context.fetch - 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 -end - - diff --git a/lib/twilio-ruby/rest/autopilot/v1/assistant/model_build.rb b/lib/twilio-ruby/rest/autopilot/v1/assistant/model_build.rb deleted file mode 100644 index ecc5d22c2..000000000 --- a/lib/twilio-ruby/rest/autopilot/v1/assistant/model_build.rb +++ /dev/null @@ -1,409 +0,0 @@ -## -# This code was generated by -# ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ -# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ -# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ -# -# 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 < AutopilotBase - class V1 < Version - class AssistantContext < InstanceContext - - class ModelBuildList < ListResource - ## - # Initialize the ModelBuildList - # @param [Version] version Version that contains the resource - # @return [ModelBuildList] ModelBuildList - def initialize(version, assistant_sid: nil) - super(version) - # Path Solution - @solution = { assistant_sid: assistant_sid } - @uri = "/Assistants/#{@solution[:assistant_sid]}/ModelBuilds" - - end - ## - # Create the ModelBuildInstance - # @param [String] status_callback The URL we should call using a POST method to send status information to your application. - # @param [String] unique_name An application-defined string that uniquely identifies the new resource. This value must be a unique string of no more than 64 characters. It can be used as an alternative to the `sid` in the URL path to address the resource. - # @return [ModelBuildInstance] Created ModelBuildInstance - def create( - status_callback: :unset, - unique_name: :unset - ) - - data = Twilio::Values.of({ - 'StatusCallback' => status_callback, - 'UniqueName' => unique_name, - }) - - payload = @version.create('POST', @uri, data: data) - ModelBuildInstance.new( - @version, - payload, - assistant_sid: @solution[:assistant_sid], - ) - end - - - ## - # Lists ModelBuildInstance records from the API as a list. - # Unlike stream(), this operation is eager and will load `limit` records into - # memory before returning. - # @param [Integer] limit Upper limit for the number of records to return. stream() - # guarantees to never return more than limit. Default is no limit - # @param [Integer] page_size Number of records to fetch per request, when - # not set will use the default value of 50 records. If no page_size is defined - # but a limit is defined, stream() will attempt to read the limit with the most - # efficient page size, i.e. min(limit, 1000) - # @return [Array] Array of up to limit results - def list(limit: nil, page_size: nil) - self.stream( - limit: limit, - page_size: page_size - ).entries - end - - ## - # Streams Instance records from the API as an Enumerable. - # This operation lazily loads records as efficiently as possible until the limit - # is reached. - # @param [Integer] limit Upper limit for the number of records to return. stream() - # guarantees to never return more than limit. Default is no limit - # @param [Integer] page_size Number of records to fetch per request, when - # not set will use the default value of 50 records. If no page_size is defined - # but a limit is defined, stream() will attempt to read the limit with the most - # efficient page size, i.e. min(limit, 1000) - # @return [Enumerable] Enumerable that will yield up to limit results - def stream(limit: nil, page_size: nil) - limits = @version.read_limits(limit, page_size) - - page = self.page( - page_size: limits[:page_size], ) - - @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit]) - end - - ## - # When passed a block, yields ModelBuildInstance records from the API. - # This operation lazily loads records as efficiently as possible until the limit - # is reached. - def each - limits = @version.read_limits - - page = self.page(page_size: limits[:page_size], ) - - @version.stream(page, - limit: limits[:limit], - page_limit: limits[:page_limit]).each {|x| yield x} - end - - ## - # Retrieve a single page of ModelBuildInstance records from the API. - # Request is executed immediately. - # @param [String] page_token PageToken provided by the API - # @param [Integer] page_number Page Number, this value is simply for client state - # @param [Integer] page_size Number of records to return, defaults to 50 - # @return [Page] Page of ModelBuildInstance - def page(page_token: :unset, page_number: :unset, page_size: :unset) - params = Twilio::Values.of({ - 'PageToken' => page_token, - 'Page' => page_number, - 'PageSize' => page_size, - }) - - response = @version.page('GET', @uri, params: params) - - ModelBuildPage.new(@version, response, @solution) - end - - ## - # Retrieve a single page of ModelBuildInstance records from the API. - # Request is executed immediately. - # @param [String] target_url API-generated URL for the requested results page - # @return [Page] Page of ModelBuildInstance - def get_page(target_url) - response = @version.domain.request( - 'GET', - target_url - ) - ModelBuildPage.new(@version, response, @solution) - 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 ModelBuildContext < InstanceContext - ## - # Initialize the ModelBuildContext - # @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. - # @param [String] sid The Twilio-provided string that uniquely identifies the ModelBuild resource to update. - # @return [ModelBuildContext] ModelBuildContext - def initialize(version, assistant_sid, sid) - super(version) - - # Path Solution - @solution = { assistant_sid: assistant_sid, sid: sid, } - @uri = "/Assistants/#{@solution[:assistant_sid]}/ModelBuilds/#{@solution[:sid]}" - - - end - ## - # Delete the ModelBuildInstance - # @return [Boolean] True if delete succeeds, false otherwise - def delete - - @version.delete('DELETE', @uri) - end - - ## - # Fetch the ModelBuildInstance - # @return [ModelBuildInstance] Fetched ModelBuildInstance - def fetch - - payload = @version.fetch('GET', @uri) - ModelBuildInstance.new( - @version, - payload, - assistant_sid: @solution[:assistant_sid], - sid: @solution[:sid], - ) - end - - ## - # Update the ModelBuildInstance - # @param [String] unique_name An application-defined string that uniquely identifies the resource. This value must be a unique string of no more than 64 characters. It can be used as an alternative to the `sid` in the URL path to address the resource. - # @return [ModelBuildInstance] Updated ModelBuildInstance - def update( - unique_name: :unset - ) - - data = Twilio::Values.of({ - 'UniqueName' => unique_name, - }) - - payload = @version.update('POST', @uri, data: data) - ModelBuildInstance.new( - @version, - payload, - assistant_sid: @solution[:assistant_sid], - sid: @solution[: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 ModelBuildPage < Page - ## - # Initialize the ModelBuildPage - # @param [Version] version Version that contains the resource - # @param [Response] response Response from the API - # @param [Hash] solution Path solution for the resource - # @return [ModelBuildPage] ModelBuildPage - def initialize(version, response, solution) - super(version, response) - - # Path Solution - @solution = solution - end - - ## - # Build an instance of ModelBuildInstance - # @param [Hash] payload Payload response from the API - # @return [ModelBuildInstance] ModelBuildInstance - def get_instance(payload) - ModelBuildInstance.new(@version, payload, assistant_sid: @solution[:assistant_sid]) - end - - ## - # Provide a user friendly representation - def to_s - '' - end - end - class ModelBuildInstance < InstanceResource - ## - # Initialize the ModelBuildInstance - # @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 ModelBuild - # resource. - # @param [String] sid The SID of the Call resource to fetch. - # @return [ModelBuildInstance] ModelBuildInstance - def initialize(version, payload , assistant_sid: nil, sid: nil) - super(version) - - # Marshaled Properties - @properties = { - 'account_sid' => payload['account_sid'], - 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), - 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), - 'assistant_sid' => payload['assistant_sid'], - 'sid' => payload['sid'], - 'status' => payload['status'], - 'unique_name' => payload['unique_name'], - 'url' => payload['url'], - 'build_duration' => payload['build_duration'] == nil ? payload['build_duration'] : payload['build_duration'].to_i, - 'error_code' => payload['error_code'] == nil ? payload['error_code'] : payload['error_code'].to_i, - } - - # Context - @instance_context = nil - @params = { 'assistant_sid' => assistant_sid || @properties['assistant_sid'] ,'sid' => sid || @properties['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 [ModelBuildContext] CallContext for this CallInstance - def context - unless @instance_context - @instance_context = ModelBuildContext.new(@version , @params['assistant_sid'], @params['sid']) - end - @instance_context - end - - ## - # @return [String] The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the ModelBuild resource. - def account_sid - @properties['account_sid'] - end - - ## - # @return [Time] The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - def date_created - @properties['date_created'] - end - - ## - # @return [Time] The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - def date_updated - @properties['date_updated'] - 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 unique string that we created to identify the ModelBuild resource. - def sid - @properties['sid'] - end - - ## - # @return [Status] - def status - @properties['status'] - end - - ## - # @return [String] An application-defined string that uniquely identifies the resource. It can be used as an alternative to the `sid` in the URL path to address the resource. - def unique_name - @properties['unique_name'] - end - - ## - # @return [String] The absolute URL of the ModelBuild resource. - def url - @properties['url'] - end - - ## - # @return [String] The time in seconds it took to build the model. - def build_duration - @properties['build_duration'] - end - - ## - # @return [String] If the `status` for the model build is `failed`, this value is a code to more information about the failure. This value will be null for all other statuses. See [error code dictionary](https://www.twilio.com/docs/api/errors) for a description of the error. - def error_code - @properties['error_code'] - end - - ## - # Delete the ModelBuildInstance - # @return [Boolean] True if delete succeeds, false otherwise - def delete - - context.delete - end - - ## - # Fetch the ModelBuildInstance - # @return [ModelBuildInstance] Fetched ModelBuildInstance - def fetch - - context.fetch - end - - ## - # Update the ModelBuildInstance - # @param [String] unique_name An application-defined string that uniquely identifies the resource. This value must be a unique string of no more than 64 characters. It can be used as an alternative to the `sid` in the URL path to address the resource. - # @return [ModelBuildInstance] Updated ModelBuildInstance - def update( - unique_name: :unset - ) - - context.update( - unique_name: unique_name, - ) - 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 - - diff --git a/lib/twilio-ruby/rest/autopilot/v1/assistant/query.rb b/lib/twilio-ruby/rest/autopilot/v1/assistant/query.rb deleted file mode 100644 index 4ae6de95d..000000000 --- a/lib/twilio-ruby/rest/autopilot/v1/assistant/query.rb +++ /dev/null @@ -1,473 +0,0 @@ -## -# This code was generated by -# ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ -# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ -# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ -# -# 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 < AutopilotBase - class V1 < Version - class AssistantContext < InstanceContext - - class QueryList < ListResource - ## - # Initialize the QueryList - # @param [Version] version Version that contains the resource - # @return [QueryList] QueryList - def initialize(version, assistant_sid: nil) - super(version) - # Path Solution - @solution = { assistant_sid: assistant_sid } - @uri = "/Assistants/#{@solution[:assistant_sid]}/Queries" - - end - ## - # Create the QueryInstance - # @param [String] language The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the new query. For example: `en-US`. - # @param [String] query The end-user's natural language input. It can be up to 2048 characters long. - # @param [String] tasks The list of tasks to limit the new query to. Tasks are expressed as a comma-separated list of task `unique_name` values. For example, `task-unique_name-1, task-unique_name-2`. Listing specific tasks is useful to constrain the paths that a user can take. - # @param [String] model_build The SID or unique name of the [Model Build](https://www.twilio.com/docs/autopilot/api/model-build) to be queried. - # @return [QueryInstance] Created QueryInstance - def create( - language: nil, - query: nil, - tasks: :unset, - model_build: :unset - ) - - data = Twilio::Values.of({ - 'Language' => language, - 'Query' => query, - 'Tasks' => tasks, - 'ModelBuild' => model_build, - }) - - payload = @version.create('POST', @uri, data: data) - QueryInstance.new( - @version, - payload, - assistant_sid: @solution[:assistant_sid], - ) - end - - - ## - # Lists QueryInstance records from the API as a list. - # Unlike stream(), this operation is eager and will load `limit` records into - # memory before returning. - # @param [String] language The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used by the Query resources to read. For example: `en-US`. - # @param [String] model_build The SID or unique name of the [Model Build](https://www.twilio.com/docs/autopilot/api/model-build) to be queried. - # @param [String] status The status of the resources to read. Can be: `pending-review`, `reviewed`, or `discarded` - # @param [String] dialogue_sid The SID of the [Dialogue](https://www.twilio.com/docs/autopilot/api/dialogue). - # @param [Integer] limit Upper limit for the number of records to return. stream() - # guarantees to never return more than limit. Default is no limit - # @param [Integer] page_size Number of records to fetch per request, when - # not set will use the default value of 50 records. If no page_size is defined - # but a limit is defined, stream() will attempt to read the limit with the most - # efficient page size, i.e. min(limit, 1000) - # @return [Array] Array of up to limit results - def list(language: :unset, model_build: :unset, status: :unset, dialogue_sid: :unset, limit: nil, page_size: nil) - self.stream( - language: language, - model_build: model_build, - status: status, - dialogue_sid: dialogue_sid, - limit: limit, - page_size: page_size - ).entries - end - - ## - # Streams Instance records from the API as an Enumerable. - # This operation lazily loads records as efficiently as possible until the limit - # is reached. - # @param [String] language The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used by the Query resources to read. For example: `en-US`. - # @param [String] model_build The SID or unique name of the [Model Build](https://www.twilio.com/docs/autopilot/api/model-build) to be queried. - # @param [String] status The status of the resources to read. Can be: `pending-review`, `reviewed`, or `discarded` - # @param [String] dialogue_sid The SID of the [Dialogue](https://www.twilio.com/docs/autopilot/api/dialogue). - # @param [Integer] limit Upper limit for the number of records to return. stream() - # guarantees to never return more than limit. Default is no limit - # @param [Integer] page_size Number of records to fetch per request, when - # not set will use the default value of 50 records. If no page_size is defined - # but a limit is defined, stream() will attempt to read the limit with the most - # efficient page size, i.e. min(limit, 1000) - # @return [Enumerable] Enumerable that will yield up to limit results - def stream(language: :unset, model_build: :unset, status: :unset, dialogue_sid: :unset, limit: nil, page_size: nil) - limits = @version.read_limits(limit, page_size) - - page = self.page( - language: language, - model_build: model_build, - status: status, - dialogue_sid: dialogue_sid, - page_size: limits[:page_size], ) - - @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit]) - end - - ## - # When passed a block, yields QueryInstance records from the API. - # This operation lazily loads records as efficiently as possible until the limit - # is reached. - def each - limits = @version.read_limits - - page = self.page(page_size: limits[:page_size], ) - - @version.stream(page, - limit: limits[:limit], - page_limit: limits[:page_limit]).each {|x| yield x} - end - - ## - # Retrieve a single page of QueryInstance records from the API. - # Request is executed immediately. - # @param [String] language The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used by the Query resources to read. For example: `en-US`. - # @param [String] model_build The SID or unique name of the [Model Build](https://www.twilio.com/docs/autopilot/api/model-build) to be queried. - # @param [String] status The status of the resources to read. Can be: `pending-review`, `reviewed`, or `discarded` - # @param [String] dialogue_sid The SID of the [Dialogue](https://www.twilio.com/docs/autopilot/api/dialogue). - # @param [String] page_token PageToken provided by the API - # @param [Integer] page_number Page Number, this value is simply for client state - # @param [Integer] page_size Number of records to return, defaults to 50 - # @return [Page] Page of QueryInstance - def page(language: :unset, model_build: :unset, status: :unset, dialogue_sid: :unset, page_token: :unset, page_number: :unset, page_size: :unset) - params = Twilio::Values.of({ - 'Language' => language, - 'ModelBuild' => model_build, - 'Status' => status, - 'DialogueSid' => dialogue_sid, - 'PageToken' => page_token, - 'Page' => page_number, - 'PageSize' => page_size, - }) - - response = @version.page('GET', @uri, params: params) - - QueryPage.new(@version, response, @solution) - end - - ## - # Retrieve a single page of QueryInstance records from the API. - # Request is executed immediately. - # @param [String] target_url API-generated URL for the requested results page - # @return [Page] Page of QueryInstance - def get_page(target_url) - response = @version.domain.request( - 'GET', - target_url - ) - QueryPage.new(@version, response, @solution) - 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 QueryContext < InstanceContext - ## - # Initialize the QueryContext - # @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. - # @param [String] sid The Twilio-provided string that uniquely identifies the Query resource to update. - # @return [QueryContext] QueryContext - def initialize(version, assistant_sid, sid) - super(version) - - # Path Solution - @solution = { assistant_sid: assistant_sid, sid: sid, } - @uri = "/Assistants/#{@solution[:assistant_sid]}/Queries/#{@solution[:sid]}" - - - end - ## - # Delete the QueryInstance - # @return [Boolean] True if delete succeeds, false otherwise - def delete - - @version.delete('DELETE', @uri) - end - - ## - # Fetch the QueryInstance - # @return [QueryInstance] Fetched QueryInstance - def fetch - - payload = @version.fetch('GET', @uri) - QueryInstance.new( - @version, - payload, - assistant_sid: @solution[:assistant_sid], - sid: @solution[:sid], - ) - end - - ## - # Update the QueryInstance - # @param [String] sample_sid The SID of an optional reference to the [Sample](https://www.twilio.com/docs/autopilot/api/task-sample) created from the query. - # @param [String] status The new status of the resource. Can be: `pending-review`, `reviewed`, or `discarded` - # @return [QueryInstance] Updated QueryInstance - def update( - sample_sid: :unset, - status: :unset - ) - - data = Twilio::Values.of({ - 'SampleSid' => sample_sid, - 'Status' => status, - }) - - payload = @version.update('POST', @uri, data: data) - QueryInstance.new( - @version, - payload, - assistant_sid: @solution[:assistant_sid], - sid: @solution[: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 QueryPage < Page - ## - # Initialize the QueryPage - # @param [Version] version Version that contains the resource - # @param [Response] response Response from the API - # @param [Hash] solution Path solution for the resource - # @return [QueryPage] QueryPage - def initialize(version, response, solution) - super(version, response) - - # Path Solution - @solution = solution - end - - ## - # Build an instance of QueryInstance - # @param [Hash] payload Payload response from the API - # @return [QueryInstance] QueryInstance - def get_instance(payload) - QueryInstance.new(@version, payload, assistant_sid: @solution[:assistant_sid]) - end - - ## - # Provide a user friendly representation - def to_s - '' - end - end - class QueryInstance < InstanceResource - ## - # Initialize the QueryInstance - # @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 Query - # resource. - # @param [String] sid The SID of the Call resource to fetch. - # @return [QueryInstance] QueryInstance - def initialize(version, payload , assistant_sid: nil, sid: nil) - super(version) - - # Marshaled Properties - @properties = { - 'account_sid' => payload['account_sid'], - 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), - 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), - 'results' => payload['results'], - 'language' => payload['language'], - 'model_build_sid' => payload['model_build_sid'], - 'query' => payload['query'], - 'sample_sid' => payload['sample_sid'], - 'assistant_sid' => payload['assistant_sid'], - 'sid' => payload['sid'], - 'status' => payload['status'], - 'url' => payload['url'], - 'source_channel' => payload['source_channel'], - 'dialogue_sid' => payload['dialogue_sid'], - } - - # Context - @instance_context = nil - @params = { 'assistant_sid' => assistant_sid || @properties['assistant_sid'] ,'sid' => sid || @properties['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 [QueryContext] CallContext for this CallInstance - def context - unless @instance_context - @instance_context = QueryContext.new(@version , @params['assistant_sid'], @params['sid']) - end - @instance_context - end - - ## - # @return [String] The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Query resource. - def account_sid - @properties['account_sid'] - end - - ## - # @return [Time] The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - def date_created - @properties['date_created'] - end - - ## - # @return [Time] The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - def date_updated - @properties['date_updated'] - end - - ## - # @return [Hash] The natural language analysis results that include the [Task](https://www.twilio.com/docs/autopilot/api/task) recognized and a list of identified [Fields](https://www.twilio.com/docs/autopilot/api/task-field). - def results - @properties['results'] - end - - ## - # @return [String] The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used by the Query. For example: `en-US`. - def language - @properties['language'] - end - - ## - # @return [String] The SID of the [Model Build](https://www.twilio.com/docs/autopilot/api/model-build) queried. - def model_build_sid - @properties['model_build_sid'] - end - - ## - # @return [String] The end-user's natural language input. - def query - @properties['query'] - end - - ## - # @return [String] The SID of an optional reference to the [Sample](https://www.twilio.com/docs/autopilot/api/task-sample) created from the query. - def sample_sid - @properties['sample_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 unique string that we created to identify the Query resource. - def sid - @properties['sid'] - end - - ## - # @return [String] The status of the Query. Can be: `pending-review`, `reviewed`, or `discarded` - def status - @properties['status'] - end - - ## - # @return [String] The absolute URL of the Query resource. - def url - @properties['url'] - end - - ## - # @return [String] The communication channel from where the end-user input came. - def source_channel - @properties['source_channel'] - end - - ## - # @return [String] The SID of the [Dialogue](https://www.twilio.com/docs/autopilot/api/dialogue). - def dialogue_sid - @properties['dialogue_sid'] - end - - ## - # Delete the QueryInstance - # @return [Boolean] True if delete succeeds, false otherwise - def delete - - context.delete - end - - ## - # Fetch the QueryInstance - # @return [QueryInstance] Fetched QueryInstance - def fetch - - context.fetch - end - - ## - # Update the QueryInstance - # @param [String] sample_sid The SID of an optional reference to the [Sample](https://www.twilio.com/docs/autopilot/api/task-sample) created from the query. - # @param [String] status The new status of the resource. Can be: `pending-review`, `reviewed`, or `discarded` - # @return [QueryInstance] Updated QueryInstance - def update( - sample_sid: :unset, - status: :unset - ) - - context.update( - sample_sid: sample_sid, - status: status, - ) - 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 - - diff --git a/lib/twilio-ruby/rest/autopilot/v1/assistant/style_sheet.rb b/lib/twilio-ruby/rest/autopilot/v1/assistant/style_sheet.rb deleted file mode 100644 index 95ec9c36c..000000000 --- a/lib/twilio-ruby/rest/autopilot/v1/assistant/style_sheet.rb +++ /dev/null @@ -1,241 +0,0 @@ -## -# This code was generated by -# ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ -# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ -# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ -# -# 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 < AutopilotBase - class V1 < Version - class AssistantContext < InstanceContext - - class StyleSheetList < ListResource - ## - # Initialize the StyleSheetList - # @param [Version] version Version that contains the resource - # @return [StyleSheetList] StyleSheetList - 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 StyleSheetContext < InstanceContext - ## - # Initialize the StyleSheetContext - # @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 [StyleSheetContext] StyleSheetContext - def initialize(version, assistant_sid) - super(version) - - # Path Solution - @solution = { assistant_sid: assistant_sid, } - @uri = "/Assistants/#{@solution[:assistant_sid]}/StyleSheet" - - - end - ## - # Fetch the StyleSheetInstance - # @return [StyleSheetInstance] Fetched StyleSheetInstance - def fetch - - payload = @version.fetch('GET', @uri) - StyleSheetInstance.new( - @version, - payload, - assistant_sid: @solution[:assistant_sid], - ) - end - - ## - # Update the StyleSheetInstance - # @param [Object] style_sheet The JSON string that describes the style sheet object. - # @return [StyleSheetInstance] Updated StyleSheetInstance - def update( - style_sheet: :unset - ) - - data = Twilio::Values.of({ - 'StyleSheet' => Twilio.serialize_object(style_sheet), - }) - - payload = @version.update('POST', @uri, data: data) - StyleSheetInstance.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 StyleSheetPage < Page - ## - # Initialize the StyleSheetPage - # @param [Version] version Version that contains the resource - # @param [Response] response Response from the API - # @param [Hash] solution Path solution for the resource - # @return [StyleSheetPage] StyleSheetPage - def initialize(version, response, solution) - super(version, response) - - # Path Solution - @solution = solution - end - - ## - # Build an instance of StyleSheetInstance - # @param [Hash] payload Payload response from the API - # @return [StyleSheetInstance] StyleSheetInstance - def get_instance(payload) - StyleSheetInstance.new(@version, payload, assistant_sid: @solution[:assistant_sid]) - end - - ## - # Provide a user friendly representation - def to_s - '' - end - end - class StyleSheetInstance < InstanceResource - ## - # Initialize the StyleSheetInstance - # @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 StyleSheet - # resource. - # @param [String] sid The SID of the Call resource to fetch. - # @return [StyleSheetInstance] StyleSheetInstance - 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 [StyleSheetContext] CallContext for this CallInstance - def context - unless @instance_context - @instance_context = StyleSheetContext.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 StyleSheet 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 StyleSheet resource. - def url - @properties['url'] - end - - ## - # @return [Hash] The JSON string that describes the style sheet object. - def data - @properties['data'] - end - - ## - # Fetch the StyleSheetInstance - # @return [StyleSheetInstance] Fetched StyleSheetInstance - def fetch - - context.fetch - end - - ## - # Update the StyleSheetInstance - # @param [Object] style_sheet The JSON string that describes the style sheet object. - # @return [StyleSheetInstance] Updated StyleSheetInstance - def update( - style_sheet: :unset - ) - - context.update( - style_sheet: style_sheet, - ) - 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 - - diff --git a/lib/twilio-ruby/rest/autopilot/v1/assistant/task.rb b/lib/twilio-ruby/rest/autopilot/v1/assistant/task.rb deleted file mode 100644 index 7f9a0dc5d..000000000 --- a/lib/twilio-ruby/rest/autopilot/v1/assistant/task.rb +++ /dev/null @@ -1,525 +0,0 @@ -## -# This code was generated by -# ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ -# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ -# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ -# -# 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 < AutopilotBase - class V1 < Version - class AssistantContext < InstanceContext - - class TaskList < ListResource - ## - # Initialize the TaskList - # @param [Version] version Version that contains the resource - # @return [TaskList] TaskList - def initialize(version, assistant_sid: nil) - super(version) - # Path Solution - @solution = { assistant_sid: assistant_sid } - @uri = "/Assistants/#{@solution[:assistant_sid]}/Tasks" - - end - ## - # Create the TaskInstance - # @param [String] unique_name An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the `sid` in the URL path to address the resource. This value must be unique and 64 characters or less in length. - # @param [String] friendly_name A descriptive string that you create to describe the new resource. It is not unique and can be up to 255 characters long. - # @param [Object] actions The JSON string that specifies the [actions](https://www.twilio.com/docs/autopilot/actions) that instruct the Assistant on how to perform the task. It is optional and not unique. - # @param [String] actions_url The URL from which the Assistant can fetch actions. - # @return [TaskInstance] Created TaskInstance - def create( - unique_name: nil, - friendly_name: :unset, - actions: :unset, - actions_url: :unset - ) - - data = Twilio::Values.of({ - 'UniqueName' => unique_name, - 'FriendlyName' => friendly_name, - 'Actions' => Twilio.serialize_object(actions), - 'ActionsUrl' => actions_url, - }) - - payload = @version.create('POST', @uri, data: data) - TaskInstance.new( - @version, - payload, - assistant_sid: @solution[:assistant_sid], - ) - end - - - ## - # Lists TaskInstance records from the API as a list. - # Unlike stream(), this operation is eager and will load `limit` records into - # memory before returning. - # @param [Integer] limit Upper limit for the number of records to return. stream() - # guarantees to never return more than limit. Default is no limit - # @param [Integer] page_size Number of records to fetch per request, when - # not set will use the default value of 50 records. If no page_size is defined - # but a limit is defined, stream() will attempt to read the limit with the most - # efficient page size, i.e. min(limit, 1000) - # @return [Array] Array of up to limit results - def list(limit: nil, page_size: nil) - self.stream( - limit: limit, - page_size: page_size - ).entries - end - - ## - # Streams Instance records from the API as an Enumerable. - # This operation lazily loads records as efficiently as possible until the limit - # is reached. - # @param [Integer] limit Upper limit for the number of records to return. stream() - # guarantees to never return more than limit. Default is no limit - # @param [Integer] page_size Number of records to fetch per request, when - # not set will use the default value of 50 records. If no page_size is defined - # but a limit is defined, stream() will attempt to read the limit with the most - # efficient page size, i.e. min(limit, 1000) - # @return [Enumerable] Enumerable that will yield up to limit results - def stream(limit: nil, page_size: nil) - limits = @version.read_limits(limit, page_size) - - page = self.page( - page_size: limits[:page_size], ) - - @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit]) - end - - ## - # When passed a block, yields TaskInstance records from the API. - # This operation lazily loads records as efficiently as possible until the limit - # is reached. - def each - limits = @version.read_limits - - page = self.page(page_size: limits[:page_size], ) - - @version.stream(page, - limit: limits[:limit], - page_limit: limits[:page_limit]).each {|x| yield x} - end - - ## - # Retrieve a single page of TaskInstance records from the API. - # Request is executed immediately. - # @param [String] page_token PageToken provided by the API - # @param [Integer] page_number Page Number, this value is simply for client state - # @param [Integer] page_size Number of records to return, defaults to 50 - # @return [Page] Page of TaskInstance - def page(page_token: :unset, page_number: :unset, page_size: :unset) - params = Twilio::Values.of({ - 'PageToken' => page_token, - 'Page' => page_number, - 'PageSize' => page_size, - }) - - response = @version.page('GET', @uri, params: params) - - TaskPage.new(@version, response, @solution) - end - - ## - # Retrieve a single page of TaskInstance records from the API. - # Request is executed immediately. - # @param [String] target_url API-generated URL for the requested results page - # @return [Page] Page of TaskInstance - def get_page(target_url) - response = @version.domain.request( - 'GET', - target_url - ) - TaskPage.new(@version, response, @solution) - 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 TaskContext < InstanceContext - ## - # Initialize the TaskContext - # @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. - # @param [String] sid The Twilio-provided string that uniquely identifies the Task resource to update. - # @return [TaskContext] TaskContext - def initialize(version, assistant_sid, sid) - super(version) - - # Path Solution - @solution = { assistant_sid: assistant_sid, sid: sid, } - @uri = "/Assistants/#{@solution[:assistant_sid]}/Tasks/#{@solution[:sid]}" - - # Dependents - @samples = nil - @task_actions = nil - @statistics = nil - @fields = nil - end - ## - # Delete the TaskInstance - # @return [Boolean] True if delete succeeds, false otherwise - def delete - - @version.delete('DELETE', @uri) - end - - ## - # Fetch the TaskInstance - # @return [TaskInstance] Fetched TaskInstance - def fetch - - payload = @version.fetch('GET', @uri) - TaskInstance.new( - @version, - payload, - assistant_sid: @solution[:assistant_sid], - sid: @solution[:sid], - ) - end - - ## - # Update the TaskInstance - # @param [String] friendly_name A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. - # @param [String] unique_name An application-defined string that uniquely identifies the resource. This value must be 64 characters or less in length and be unique. It can be used as an alternative to the `sid` in the URL path to address the resource. - # @param [Object] actions The JSON string that specifies the [actions](https://www.twilio.com/docs/autopilot/actions) that instruct the Assistant on how to perform the task. - # @param [String] actions_url The URL from which the Assistant can fetch actions. - # @return [TaskInstance] Updated TaskInstance - def update( - friendly_name: :unset, - unique_name: :unset, - actions: :unset, - actions_url: :unset - ) - - data = Twilio::Values.of({ - 'FriendlyName' => friendly_name, - 'UniqueName' => unique_name, - 'Actions' => Twilio.serialize_object(actions), - 'ActionsUrl' => actions_url, - }) - - payload = @version.update('POST', @uri, data: data) - TaskInstance.new( - @version, - payload, - assistant_sid: @solution[:assistant_sid], - sid: @solution[:sid], - ) - end - - ## - # Access the samples - # @return [SampleList] - # @return [SampleContext] if sid was passed. - def samples(sid=:unset) - - raise ArgumentError, 'sid cannot be nil' if sid.nil? - - if sid != :unset - return SampleContext.new(@version, @solution[:assistant_sid], @solution[:sid],sid ) - end - - unless @samples - @samples = SampleList.new( - @version, assistant_sid: @solution[:assistant_sid], task_sid: @solution[:sid], ) - end - - @samples - end - ## - # Access the task_actions - # @return [TaskActionsList] - # @return [TaskActionsContext] - def task_actions - TaskActionsContext.new( - @version, - @solution[:assistant_sid], - @solution[:sid] - ) - end - ## - # Access the statistics - # @return [TaskStatisticsList] - # @return [TaskStatisticsContext] - def statistics - TaskStatisticsContext.new( - @version, - @solution[:assistant_sid], - @solution[:sid] - ) - end - ## - # Access the fields - # @return [FieldList] - # @return [FieldContext] if sid was passed. - def fields(sid=:unset) - - raise ArgumentError, 'sid cannot be nil' if sid.nil? - - if sid != :unset - return FieldContext.new(@version, @solution[:assistant_sid], @solution[:sid],sid ) - end - - unless @fields - @fields = FieldList.new( - @version, assistant_sid: @solution[:assistant_sid], task_sid: @solution[:sid], ) - end - - @fields - 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 TaskPage < Page - ## - # Initialize the TaskPage - # @param [Version] version Version that contains the resource - # @param [Response] response Response from the API - # @param [Hash] solution Path solution for the resource - # @return [TaskPage] TaskPage - def initialize(version, response, solution) - super(version, response) - - # Path Solution - @solution = solution - end - - ## - # Build an instance of TaskInstance - # @param [Hash] payload Payload response from the API - # @return [TaskInstance] TaskInstance - def get_instance(payload) - TaskInstance.new(@version, payload, assistant_sid: @solution[:assistant_sid]) - end - - ## - # Provide a user friendly representation - def to_s - '' - end - end - class TaskInstance < InstanceResource - ## - # Initialize the TaskInstance - # @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 Task - # resource. - # @param [String] sid The SID of the Call resource to fetch. - # @return [TaskInstance] TaskInstance - def initialize(version, payload , assistant_sid: nil, sid: nil) - super(version) - - # Marshaled Properties - @properties = { - 'account_sid' => payload['account_sid'], - 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), - 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), - 'friendly_name' => payload['friendly_name'], - 'links' => payload['links'], - 'assistant_sid' => payload['assistant_sid'], - 'sid' => payload['sid'], - 'unique_name' => payload['unique_name'], - 'actions_url' => payload['actions_url'], - 'url' => payload['url'], - } - - # Context - @instance_context = nil - @params = { 'assistant_sid' => assistant_sid || @properties['assistant_sid'] ,'sid' => sid || @properties['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 [TaskContext] CallContext for this CallInstance - def context - unless @instance_context - @instance_context = TaskContext.new(@version , @params['assistant_sid'], @params['sid']) - end - @instance_context - end - - ## - # @return [String] The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Task resource. - def account_sid - @properties['account_sid'] - end - - ## - # @return [Time] The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - def date_created - @properties['date_created'] - end - - ## - # @return [Time] The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - def date_updated - @properties['date_updated'] - end - - ## - # @return [String] The string that you assigned to describe the resource. It is not unique and can be up to 255 characters long. - def friendly_name - @properties['friendly_name'] - end - - ## - # @return [Hash] A list of the URLs of related resources. - def links - @properties['links'] - 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 unique string that we created to identify the Task resource. - def sid - @properties['sid'] - end - - ## - # @return [String] An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. - def unique_name - @properties['unique_name'] - end - - ## - # @return [String] The URL from which the Assistant can fetch actions. - def actions_url - @properties['actions_url'] - end - - ## - # @return [String] The absolute URL of the Task resource. - def url - @properties['url'] - end - - ## - # Delete the TaskInstance - # @return [Boolean] True if delete succeeds, false otherwise - def delete - - context.delete - end - - ## - # Fetch the TaskInstance - # @return [TaskInstance] Fetched TaskInstance - def fetch - - context.fetch - end - - ## - # Update the TaskInstance - # @param [String] friendly_name A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. - # @param [String] unique_name An application-defined string that uniquely identifies the resource. This value must be 64 characters or less in length and be unique. It can be used as an alternative to the `sid` in the URL path to address the resource. - # @param [Object] actions The JSON string that specifies the [actions](https://www.twilio.com/docs/autopilot/actions) that instruct the Assistant on how to perform the task. - # @param [String] actions_url The URL from which the Assistant can fetch actions. - # @return [TaskInstance] Updated TaskInstance - def update( - friendly_name: :unset, - unique_name: :unset, - actions: :unset, - actions_url: :unset - ) - - context.update( - friendly_name: friendly_name, - unique_name: unique_name, - actions: actions, - actions_url: actions_url, - ) - end - - ## - # Access the samples - # @return [samples] samples - def samples - context.samples - end - - ## - # Access the task_actions - # @return [task_actions] task_actions - def task_actions - context.task_actions - end - - ## - # Access the statistics - # @return [statistics] statistics - def statistics - context.statistics - end - - ## - # Access the fields - # @return [fields] fields - def fields - context.fields - 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 - - diff --git a/lib/twilio-ruby/rest/autopilot/v1/assistant/task/field.rb b/lib/twilio-ruby/rest/autopilot/v1/assistant/task/field.rb deleted file mode 100644 index 501ea3dfd..000000000 --- a/lib/twilio-ruby/rest/autopilot/v1/assistant/task/field.rb +++ /dev/null @@ -1,373 +0,0 @@ -## -# This code was generated by -# ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ -# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ -# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ -# -# 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 < AutopilotBase - class V1 < Version - class AssistantContext < InstanceContext - class TaskContext < InstanceContext - - class FieldList < ListResource - ## - # Initialize the FieldList - # @param [Version] version Version that contains the resource - # @return [FieldList] FieldList - def initialize(version, assistant_sid: nil, task_sid: nil) - super(version) - # Path Solution - @solution = { assistant_sid: assistant_sid, task_sid: task_sid } - @uri = "/Assistants/#{@solution[:assistant_sid]}/Tasks/#{@solution[:task_sid]}/Fields" - - end - ## - # Create the FieldInstance - # @param [String] field_type The Field Type of the new field. Can be: a [Built-in Field Type](https://www.twilio.com/docs/autopilot/built-in-field-types), the `unique_name`, or the `sid` of a custom Field Type. - # @param [String] unique_name An application-defined string that uniquely identifies the new resource. This value must be a unique string of no more than 64 characters. It can be used as an alternative to the `sid` in the URL path to address the resource. - # @return [FieldInstance] Created FieldInstance - def create( - field_type: nil, - unique_name: nil - ) - - data = Twilio::Values.of({ - 'FieldType' => field_type, - 'UniqueName' => unique_name, - }) - - payload = @version.create('POST', @uri, data: data) - FieldInstance.new( - @version, - payload, - assistant_sid: @solution[:assistant_sid], - task_sid: @solution[:task_sid], - ) - end - - - ## - # Lists FieldInstance records from the API as a list. - # Unlike stream(), this operation is eager and will load `limit` records into - # memory before returning. - # @param [Integer] limit Upper limit for the number of records to return. stream() - # guarantees to never return more than limit. Default is no limit - # @param [Integer] page_size Number of records to fetch per request, when - # not set will use the default value of 50 records. If no page_size is defined - # but a limit is defined, stream() will attempt to read the limit with the most - # efficient page size, i.e. min(limit, 1000) - # @return [Array] Array of up to limit results - def list(limit: nil, page_size: nil) - self.stream( - limit: limit, - page_size: page_size - ).entries - end - - ## - # Streams Instance records from the API as an Enumerable. - # This operation lazily loads records as efficiently as possible until the limit - # is reached. - # @param [Integer] limit Upper limit for the number of records to return. stream() - # guarantees to never return more than limit. Default is no limit - # @param [Integer] page_size Number of records to fetch per request, when - # not set will use the default value of 50 records. If no page_size is defined - # but a limit is defined, stream() will attempt to read the limit with the most - # efficient page size, i.e. min(limit, 1000) - # @return [Enumerable] Enumerable that will yield up to limit results - def stream(limit: nil, page_size: nil) - limits = @version.read_limits(limit, page_size) - - page = self.page( - page_size: limits[:page_size], ) - - @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit]) - end - - ## - # When passed a block, yields FieldInstance records from the API. - # This operation lazily loads records as efficiently as possible until the limit - # is reached. - def each - limits = @version.read_limits - - page = self.page(page_size: limits[:page_size], ) - - @version.stream(page, - limit: limits[:limit], - page_limit: limits[:page_limit]).each {|x| yield x} - end - - ## - # Retrieve a single page of FieldInstance records from the API. - # Request is executed immediately. - # @param [String] page_token PageToken provided by the API - # @param [Integer] page_number Page Number, this value is simply for client state - # @param [Integer] page_size Number of records to return, defaults to 50 - # @return [Page] Page of FieldInstance - def page(page_token: :unset, page_number: :unset, page_size: :unset) - params = Twilio::Values.of({ - 'PageToken' => page_token, - 'Page' => page_number, - 'PageSize' => page_size, - }) - - response = @version.page('GET', @uri, params: params) - - FieldPage.new(@version, response, @solution) - end - - ## - # Retrieve a single page of FieldInstance records from the API. - # Request is executed immediately. - # @param [String] target_url API-generated URL for the requested results page - # @return [Page] Page of FieldInstance - def get_page(target_url) - response = @version.domain.request( - 'GET', - target_url - ) - FieldPage.new(@version, response, @solution) - 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 FieldContext < InstanceContext - ## - # Initialize the FieldContext - # @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 Task associated with the resource to fetch. - # @param [String] task_sid The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) resource associated with the Field resource to fetch. - # @param [String] sid The Twilio-provided string that uniquely identifies the Field resource to fetch. - # @return [FieldContext] FieldContext - def initialize(version, assistant_sid, task_sid, sid) - super(version) - - # Path Solution - @solution = { assistant_sid: assistant_sid, task_sid: task_sid, sid: sid, } - @uri = "/Assistants/#{@solution[:assistant_sid]}/Tasks/#{@solution[:task_sid]}/Fields/#{@solution[:sid]}" - - - end - ## - # Delete the FieldInstance - # @return [Boolean] True if delete succeeds, false otherwise - def delete - - @version.delete('DELETE', @uri) - end - - ## - # Fetch the FieldInstance - # @return [FieldInstance] Fetched FieldInstance - def fetch - - payload = @version.fetch('GET', @uri) - FieldInstance.new( - @version, - payload, - assistant_sid: @solution[:assistant_sid], - task_sid: @solution[:task_sid], - sid: @solution[: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 FieldPage < Page - ## - # Initialize the FieldPage - # @param [Version] version Version that contains the resource - # @param [Response] response Response from the API - # @param [Hash] solution Path solution for the resource - # @return [FieldPage] FieldPage - def initialize(version, response, solution) - super(version, response) - - # Path Solution - @solution = solution - end - - ## - # Build an instance of FieldInstance - # @param [Hash] payload Payload response from the API - # @return [FieldInstance] FieldInstance - def get_instance(payload) - FieldInstance.new(@version, payload, assistant_sid: @solution[:assistant_sid], task_sid: @solution[:task_sid]) - end - - ## - # Provide a user friendly representation - def to_s - '' - end - end - class FieldInstance < InstanceResource - ## - # Initialize the FieldInstance - # @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 Field - # resource. - # @param [String] sid The SID of the Call resource to fetch. - # @return [FieldInstance] FieldInstance - def initialize(version, payload , assistant_sid: nil, task_sid: nil, sid: nil) - super(version) - - # Marshaled Properties - @properties = { - 'account_sid' => payload['account_sid'], - 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), - 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), - 'field_type' => payload['field_type'], - 'task_sid' => payload['task_sid'], - 'assistant_sid' => payload['assistant_sid'], - 'sid' => payload['sid'], - 'unique_name' => payload['unique_name'], - 'url' => payload['url'], - } - - # Context - @instance_context = nil - @params = { 'assistant_sid' => assistant_sid || @properties['assistant_sid'] ,'task_sid' => task_sid || @properties['task_sid'] ,'sid' => sid || @properties['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 [FieldContext] CallContext for this CallInstance - def context - unless @instance_context - @instance_context = FieldContext.new(@version , @params['assistant_sid'], @params['task_sid'], @params['sid']) - end - @instance_context - end - - ## - # @return [String] The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Field resource. - def account_sid - @properties['account_sid'] - end - - ## - # @return [Time] The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - def date_created - @properties['date_created'] - end - - ## - # @return [Time] The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - def date_updated - @properties['date_updated'] - end - - ## - # @return [String] The Field Type of the field. Can be: a [Built-in Field Type](https://www.twilio.com/docs/autopilot/built-in-field-types), the unique_name, or the SID of a custom Field Type. - def field_type - @properties['field_type'] - end - - ## - # @return [String] The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) resource associated with this Field. - def task_sid - @properties['task_sid'] - end - - ## - # @return [String] The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task associated with the resource. - def assistant_sid - @properties['assistant_sid'] - end - - ## - # @return [String] The unique string that we created to identify the Field resource. - def sid - @properties['sid'] - end - - ## - # @return [String] An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. - def unique_name - @properties['unique_name'] - end - - ## - # @return [String] The absolute URL of the Field resource. - def url - @properties['url'] - end - - ## - # Delete the FieldInstance - # @return [Boolean] True if delete succeeds, false otherwise - def delete - - context.delete - end - - ## - # Fetch the FieldInstance - # @return [FieldInstance] Fetched FieldInstance - def fetch - - context.fetch - 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 -end - - diff --git a/lib/twilio-ruby/rest/autopilot/v1/assistant/task/sample.rb b/lib/twilio-ruby/rest/autopilot/v1/assistant/task/sample.rb deleted file mode 100644 index 9cfc855d8..000000000 --- a/lib/twilio-ruby/rest/autopilot/v1/assistant/task/sample.rb +++ /dev/null @@ -1,436 +0,0 @@ -## -# This code was generated by -# ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ -# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ -# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ -# -# 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 < AutopilotBase - class V1 < Version - class AssistantContext < InstanceContext - class TaskContext < InstanceContext - - class SampleList < ListResource - ## - # Initialize the SampleList - # @param [Version] version Version that contains the resource - # @return [SampleList] SampleList - def initialize(version, assistant_sid: nil, task_sid: nil) - super(version) - # Path Solution - @solution = { assistant_sid: assistant_sid, task_sid: task_sid } - @uri = "/Assistants/#{@solution[:assistant_sid]}/Tasks/#{@solution[:task_sid]}/Samples" - - end - ## - # Create the SampleInstance - # @param [String] language The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the new sample. For example: `en-US`. - # @param [String] tagged_text The text example of how end users might express the task. The sample can contain [Field tag blocks](https://www.twilio.com/docs/autopilot/api/task-sample#field-tagging). - # @param [String] source_channel The communication channel from which the new sample was captured. Can be: `voice`, `sms`, `chat`, `alexa`, `google-assistant`, `slack`, or null if not included. - # @return [SampleInstance] Created SampleInstance - def create( - language: nil, - tagged_text: nil, - source_channel: :unset - ) - - data = Twilio::Values.of({ - 'Language' => language, - 'TaggedText' => tagged_text, - 'SourceChannel' => source_channel, - }) - - payload = @version.create('POST', @uri, data: data) - SampleInstance.new( - @version, - payload, - assistant_sid: @solution[:assistant_sid], - task_sid: @solution[:task_sid], - ) - end - - - ## - # Lists SampleInstance records from the API as a list. - # Unlike stream(), this operation is eager and will load `limit` records into - # memory before returning. - # @param [String] language The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the sample. For example: `en-US`. - # @param [Integer] limit Upper limit for the number of records to return. stream() - # guarantees to never return more than limit. Default is no limit - # @param [Integer] page_size Number of records to fetch per request, when - # not set will use the default value of 50 records. If no page_size is defined - # but a limit is defined, stream() will attempt to read the limit with the most - # efficient page size, i.e. min(limit, 1000) - # @return [Array] Array of up to limit results - def list(language: :unset, limit: nil, page_size: nil) - self.stream( - language: language, - limit: limit, - page_size: page_size - ).entries - end - - ## - # Streams Instance records from the API as an Enumerable. - # This operation lazily loads records as efficiently as possible until the limit - # is reached. - # @param [String] language The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the sample. For example: `en-US`. - # @param [Integer] limit Upper limit for the number of records to return. stream() - # guarantees to never return more than limit. Default is no limit - # @param [Integer] page_size Number of records to fetch per request, when - # not set will use the default value of 50 records. If no page_size is defined - # but a limit is defined, stream() will attempt to read the limit with the most - # efficient page size, i.e. min(limit, 1000) - # @return [Enumerable] Enumerable that will yield up to limit results - def stream(language: :unset, limit: nil, page_size: nil) - limits = @version.read_limits(limit, page_size) - - page = self.page( - language: language, - page_size: limits[:page_size], ) - - @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit]) - end - - ## - # When passed a block, yields SampleInstance records from the API. - # This operation lazily loads records as efficiently as possible until the limit - # is reached. - def each - limits = @version.read_limits - - page = self.page(page_size: limits[:page_size], ) - - @version.stream(page, - limit: limits[:limit], - page_limit: limits[:page_limit]).each {|x| yield x} - end - - ## - # Retrieve a single page of SampleInstance records from the API. - # Request is executed immediately. - # @param [String] language The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the sample. For example: `en-US`. - # @param [String] page_token PageToken provided by the API - # @param [Integer] page_number Page Number, this value is simply for client state - # @param [Integer] page_size Number of records to return, defaults to 50 - # @return [Page] Page of SampleInstance - def page(language: :unset, page_token: :unset, page_number: :unset, page_size: :unset) - params = Twilio::Values.of({ - 'Language' => language, - 'PageToken' => page_token, - 'Page' => page_number, - 'PageSize' => page_size, - }) - - response = @version.page('GET', @uri, params: params) - - SamplePage.new(@version, response, @solution) - end - - ## - # Retrieve a single page of SampleInstance records from the API. - # Request is executed immediately. - # @param [String] target_url API-generated URL for the requested results page - # @return [Page] Page of SampleInstance - def get_page(target_url) - response = @version.domain.request( - 'GET', - target_url - ) - SamplePage.new(@version, response, @solution) - 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 SampleContext < InstanceContext - ## - # Initialize the SampleContext - # @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 Task associated with the resource to update. - # @param [String] task_sid The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) associated with the Sample resource to update. - # @param [String] sid The Twilio-provided string that uniquely identifies the Sample resource to update. - # @return [SampleContext] SampleContext - def initialize(version, assistant_sid, task_sid, sid) - super(version) - - # Path Solution - @solution = { assistant_sid: assistant_sid, task_sid: task_sid, sid: sid, } - @uri = "/Assistants/#{@solution[:assistant_sid]}/Tasks/#{@solution[:task_sid]}/Samples/#{@solution[:sid]}" - - - end - ## - # Delete the SampleInstance - # @return [Boolean] True if delete succeeds, false otherwise - def delete - - @version.delete('DELETE', @uri) - end - - ## - # Fetch the SampleInstance - # @return [SampleInstance] Fetched SampleInstance - def fetch - - payload = @version.fetch('GET', @uri) - SampleInstance.new( - @version, - payload, - assistant_sid: @solution[:assistant_sid], - task_sid: @solution[:task_sid], - sid: @solution[:sid], - ) - end - - ## - # Update the SampleInstance - # @param [String] language The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the sample. For example: `en-US`. - # @param [String] tagged_text The text example of how end users might express the task. The sample can contain [Field tag blocks](https://www.twilio.com/docs/autopilot/api/task-sample#field-tagging). - # @param [String] source_channel The communication channel from which the sample was captured. Can be: `voice`, `sms`, `chat`, `alexa`, `google-assistant`, `slack`, or null if not included. - # @return [SampleInstance] Updated SampleInstance - def update( - language: :unset, - tagged_text: :unset, - source_channel: :unset - ) - - data = Twilio::Values.of({ - 'Language' => language, - 'TaggedText' => tagged_text, - 'SourceChannel' => source_channel, - }) - - payload = @version.update('POST', @uri, data: data) - SampleInstance.new( - @version, - payload, - assistant_sid: @solution[:assistant_sid], - task_sid: @solution[:task_sid], - sid: @solution[: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 SamplePage < Page - ## - # Initialize the SamplePage - # @param [Version] version Version that contains the resource - # @param [Response] response Response from the API - # @param [Hash] solution Path solution for the resource - # @return [SamplePage] SamplePage - def initialize(version, response, solution) - super(version, response) - - # Path Solution - @solution = solution - end - - ## - # Build an instance of SampleInstance - # @param [Hash] payload Payload response from the API - # @return [SampleInstance] SampleInstance - def get_instance(payload) - SampleInstance.new(@version, payload, assistant_sid: @solution[:assistant_sid], task_sid: @solution[:task_sid]) - end - - ## - # Provide a user friendly representation - def to_s - '' - end - end - class SampleInstance < InstanceResource - ## - # Initialize the SampleInstance - # @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 Sample - # resource. - # @param [String] sid The SID of the Call resource to fetch. - # @return [SampleInstance] SampleInstance - def initialize(version, payload , assistant_sid: nil, task_sid: nil, sid: nil) - super(version) - - # Marshaled Properties - @properties = { - 'account_sid' => payload['account_sid'], - 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), - 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), - 'task_sid' => payload['task_sid'], - 'language' => payload['language'], - 'assistant_sid' => payload['assistant_sid'], - 'sid' => payload['sid'], - 'tagged_text' => payload['tagged_text'], - 'url' => payload['url'], - 'source_channel' => payload['source_channel'], - } - - # Context - @instance_context = nil - @params = { 'assistant_sid' => assistant_sid || @properties['assistant_sid'] ,'task_sid' => task_sid || @properties['task_sid'] ,'sid' => sid || @properties['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 [SampleContext] CallContext for this CallInstance - def context - unless @instance_context - @instance_context = SampleContext.new(@version , @params['assistant_sid'], @params['task_sid'], @params['sid']) - end - @instance_context - end - - ## - # @return [String] The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Sample resource. - def account_sid - @properties['account_sid'] - end - - ## - # @return [Time] The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - def date_created - @properties['date_created'] - end - - ## - # @return [Time] The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - def date_updated - @properties['date_updated'] - end - - ## - # @return [String] The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) associated with the resource. - def task_sid - @properties['task_sid'] - end - - ## - # @return [String] The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the sample. For example: `en-US`. - def language - @properties['language'] - end - - ## - # @return [String] The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task associated with the resource. - def assistant_sid - @properties['assistant_sid'] - end - - ## - # @return [String] The unique string that we created to identify the Sample resource. - def sid - @properties['sid'] - end - - ## - # @return [String] The text example of how end users might express the task. The sample can contain [Field tag blocks](https://www.twilio.com/docs/autopilot/api/task-sample#field-tagging). - def tagged_text - @properties['tagged_text'] - end - - ## - # @return [String] The absolute URL of the Sample resource. - def url - @properties['url'] - end - - ## - # @return [String] The communication channel from which the sample was captured. Can be: `voice`, `sms`, `chat`, `alexa`, `google-assistant`, `slack`, or null if not included. - def source_channel - @properties['source_channel'] - end - - ## - # Delete the SampleInstance - # @return [Boolean] True if delete succeeds, false otherwise - def delete - - context.delete - end - - ## - # Fetch the SampleInstance - # @return [SampleInstance] Fetched SampleInstance - def fetch - - context.fetch - end - - ## - # Update the SampleInstance - # @param [String] language The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the sample. For example: `en-US`. - # @param [String] tagged_text The text example of how end users might express the task. The sample can contain [Field tag blocks](https://www.twilio.com/docs/autopilot/api/task-sample#field-tagging). - # @param [String] source_channel The communication channel from which the sample was captured. Can be: `voice`, `sms`, `chat`, `alexa`, `google-assistant`, `slack`, or null if not included. - # @return [SampleInstance] Updated SampleInstance - def update( - language: :unset, - tagged_text: :unset, - source_channel: :unset - ) - - context.update( - language: language, - tagged_text: tagged_text, - source_channel: source_channel, - ) - 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 -end - - diff --git a/lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_actions.rb b/lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_actions.rb deleted file mode 100644 index 54d524950..000000000 --- a/lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_actions.rb +++ /dev/null @@ -1,253 +0,0 @@ -## -# This code was generated by -# ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ -# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ -# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ -# -# 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 < AutopilotBase - class V1 < Version - class AssistantContext < InstanceContext - class TaskContext < InstanceContext - - class TaskActionsList < ListResource - ## - # Initialize the TaskActionsList - # @param [Version] version Version that contains the resource - # @return [TaskActionsList] TaskActionsList - def initialize(version, assistant_sid: nil, task_sid: nil) - super(version) - # Path Solution - @solution = { assistant_sid: assistant_sid, task_sid: task_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 TaskActionsContext < InstanceContext - ## - # Initialize the TaskActionsContext - # @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 Task for which the task actions to update were defined. - # @param [String] task_sid The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) for which the task actions to update were defined. - # @return [TaskActionsContext] TaskActionsContext - def initialize(version, assistant_sid, task_sid) - super(version) - - # Path Solution - @solution = { assistant_sid: assistant_sid, task_sid: task_sid, } - @uri = "/Assistants/#{@solution[:assistant_sid]}/Tasks/#{@solution[:task_sid]}/Actions" - - - end - ## - # Fetch the TaskActionsInstance - # @return [TaskActionsInstance] Fetched TaskActionsInstance - def fetch - - payload = @version.fetch('GET', @uri) - TaskActionsInstance.new( - @version, - payload, - assistant_sid: @solution[:assistant_sid], - task_sid: @solution[:task_sid], - ) - end - - ## - # Update the TaskActionsInstance - # @param [Object] actions The JSON string that specifies the [actions](https://www.twilio.com/docs/autopilot/actions) that instruct the Assistant on how to perform the task. - # @return [TaskActionsInstance] Updated TaskActionsInstance - def update( - actions: :unset - ) - - data = Twilio::Values.of({ - 'Actions' => Twilio.serialize_object(actions), - }) - - payload = @version.update('POST', @uri, data: data) - TaskActionsInstance.new( - @version, - payload, - assistant_sid: @solution[:assistant_sid], - task_sid: @solution[:task_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 TaskActionsPage < Page - ## - # Initialize the TaskActionsPage - # @param [Version] version Version that contains the resource - # @param [Response] response Response from the API - # @param [Hash] solution Path solution for the resource - # @return [TaskActionsPage] TaskActionsPage - def initialize(version, response, solution) - super(version, response) - - # Path Solution - @solution = solution - end - - ## - # Build an instance of TaskActionsInstance - # @param [Hash] payload Payload response from the API - # @return [TaskActionsInstance] TaskActionsInstance - def get_instance(payload) - TaskActionsInstance.new(@version, payload, assistant_sid: @solution[:assistant_sid], task_sid: @solution[:task_sid]) - end - - ## - # Provide a user friendly representation - def to_s - '' - end - end - class TaskActionsInstance < InstanceResource - ## - # Initialize the TaskActionsInstance - # @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 TaskActions - # resource. - # @param [String] sid The SID of the Call resource to fetch. - # @return [TaskActionsInstance] TaskActionsInstance - def initialize(version, payload , assistant_sid: nil, task_sid: nil) - super(version) - - # Marshaled Properties - @properties = { - 'account_sid' => payload['account_sid'], - 'assistant_sid' => payload['assistant_sid'], - 'task_sid' => payload['task_sid'], - 'url' => payload['url'], - 'data' => payload['data'], - } - - # Context - @instance_context = nil - @params = { 'assistant_sid' => assistant_sid || @properties['assistant_sid'] ,'task_sid' => task_sid || @properties['task_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 [TaskActionsContext] CallContext for this CallInstance - def context - unless @instance_context - @instance_context = TaskActionsContext.new(@version , @params['assistant_sid'], @params['task_sid']) - end - @instance_context - end - - ## - # @return [String] The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the TaskActions 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 Task associated with the resource. - def assistant_sid - @properties['assistant_sid'] - end - - ## - # @return [String] The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) associated with the resource. - def task_sid - @properties['task_sid'] - end - - ## - # @return [String] The absolute URL of the TaskActions resource. - def url - @properties['url'] - end - - ## - # @return [Hash] The JSON string that specifies the [actions](https://www.twilio.com/docs/autopilot/actions) that instruct the Assistant on how to perform the task. - def data - @properties['data'] - end - - ## - # Fetch the TaskActionsInstance - # @return [TaskActionsInstance] Fetched TaskActionsInstance - def fetch - - context.fetch - end - - ## - # Update the TaskActionsInstance - # @param [Object] actions The JSON string that specifies the [actions](https://www.twilio.com/docs/autopilot/actions) that instruct the Assistant on how to perform the task. - # @return [TaskActionsInstance] Updated TaskActionsInstance - def update( - actions: :unset - ) - - context.update( - actions: 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 -end - - diff --git a/lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_statistics.rb b/lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_statistics.rb deleted file mode 100644 index 8e263221f..000000000 --- a/lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_statistics.rb +++ /dev/null @@ -1,226 +0,0 @@ -## -# This code was generated by -# ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ -# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ -# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ -# -# 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 < AutopilotBase - class V1 < Version - class AssistantContext < InstanceContext - class TaskContext < InstanceContext - - class TaskStatisticsList < ListResource - ## - # Initialize the TaskStatisticsList - # @param [Version] version Version that contains the resource - # @return [TaskStatisticsList] TaskStatisticsList - def initialize(version, assistant_sid: nil, task_sid: nil) - super(version) - # Path Solution - @solution = { assistant_sid: assistant_sid, task_sid: task_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 TaskStatisticsContext < InstanceContext - ## - # Initialize the TaskStatisticsContext - # @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. - # @param [String] task_sid The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) that is associated with the resource to fetch. - # @return [TaskStatisticsContext] TaskStatisticsContext - def initialize(version, assistant_sid, task_sid) - super(version) - - # Path Solution - @solution = { assistant_sid: assistant_sid, task_sid: task_sid, } - @uri = "/Assistants/#{@solution[:assistant_sid]}/Tasks/#{@solution[:task_sid]}/Statistics" - - - end - ## - # Fetch the TaskStatisticsInstance - # @return [TaskStatisticsInstance] Fetched TaskStatisticsInstance - def fetch - - payload = @version.fetch('GET', @uri) - TaskStatisticsInstance.new( - @version, - payload, - assistant_sid: @solution[:assistant_sid], - task_sid: @solution[:task_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 TaskStatisticsPage < Page - ## - # Initialize the TaskStatisticsPage - # @param [Version] version Version that contains the resource - # @param [Response] response Response from the API - # @param [Hash] solution Path solution for the resource - # @return [TaskStatisticsPage] TaskStatisticsPage - def initialize(version, response, solution) - super(version, response) - - # Path Solution - @solution = solution - end - - ## - # Build an instance of TaskStatisticsInstance - # @param [Hash] payload Payload response from the API - # @return [TaskStatisticsInstance] TaskStatisticsInstance - def get_instance(payload) - TaskStatisticsInstance.new(@version, payload, assistant_sid: @solution[:assistant_sid], task_sid: @solution[:task_sid]) - end - - ## - # Provide a user friendly representation - def to_s - '' - end - end - class TaskStatisticsInstance < InstanceResource - ## - # Initialize the TaskStatisticsInstance - # @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 TaskStatistics - # resource. - # @param [String] sid The SID of the Call resource to fetch. - # @return [TaskStatisticsInstance] TaskStatisticsInstance - def initialize(version, payload , assistant_sid: nil, task_sid: nil) - super(version) - - # Marshaled Properties - @properties = { - 'account_sid' => payload['account_sid'], - 'assistant_sid' => payload['assistant_sid'], - 'task_sid' => payload['task_sid'], - 'samples_count' => payload['samples_count'] == nil ? payload['samples_count'] : payload['samples_count'].to_i, - 'fields_count' => payload['fields_count'] == nil ? payload['fields_count'] : payload['fields_count'].to_i, - 'url' => payload['url'], - } - - # Context - @instance_context = nil - @params = { 'assistant_sid' => assistant_sid || @properties['assistant_sid'] ,'task_sid' => task_sid || @properties['task_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 [TaskStatisticsContext] CallContext for this CallInstance - def context - unless @instance_context - @instance_context = TaskStatisticsContext.new(@version , @params['assistant_sid'], @params['task_sid']) - end - @instance_context - end - - ## - # @return [String] The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the TaskStatistics 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 Task associated with the resource. - def assistant_sid - @properties['assistant_sid'] - end - - ## - # @return [String] The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) for which the statistics were collected. - def task_sid - @properties['task_sid'] - end - - ## - # @return [String] The total number of [Samples](https://www.twilio.com/docs/autopilot/api/task-sample) associated with the Task. - def samples_count - @properties['samples_count'] - end - - ## - # @return [String] The total number of [Fields](https://www.twilio.com/docs/autopilot/api/task-field) associated with the Task. - def fields_count - @properties['fields_count'] - end - - ## - # @return [String] The absolute URL of the TaskStatistics resource. - def url - @properties['url'] - end - - ## - # Fetch the TaskStatisticsInstance - # @return [TaskStatisticsInstance] Fetched TaskStatisticsInstance - def fetch - - context.fetch - 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 -end - - diff --git a/lib/twilio-ruby/rest/autopilot/v1/assistant/webhook.rb b/lib/twilio-ruby/rest/autopilot/v1/assistant/webhook.rb deleted file mode 100644 index b2bc29730..000000000 --- a/lib/twilio-ruby/rest/autopilot/v1/assistant/webhook.rb +++ /dev/null @@ -1,433 +0,0 @@ -## -# This code was generated by -# ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ -# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ -# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ -# -# 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 < AutopilotBase - class V1 < Version - class AssistantContext < InstanceContext - - class WebhookList < ListResource - ## - # Initialize the WebhookList - # @param [Version] version Version that contains the resource - # @return [WebhookList] WebhookList - def initialize(version, assistant_sid: nil) - super(version) - # Path Solution - @solution = { assistant_sid: assistant_sid } - @uri = "/Assistants/#{@solution[:assistant_sid]}/Webhooks" - - end - ## - # Create the WebhookInstance - # @param [String] unique_name An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the `sid` in the URL path to address the resource. This value must be unique and 64 characters or less in length. - # @param [String] events The list of space-separated events that this Webhook will subscribe to. - # @param [String] webhook_url The URL associated with this Webhook. - # @param [String] webhook_method The method to be used when calling the webhook's URL. - # @return [WebhookInstance] Created WebhookInstance - def create( - unique_name: nil, - events: nil, - webhook_url: nil, - webhook_method: :unset - ) - - data = Twilio::Values.of({ - 'UniqueName' => unique_name, - 'Events' => events, - 'WebhookUrl' => webhook_url, - 'WebhookMethod' => webhook_method, - }) - - payload = @version.create('POST', @uri, data: data) - WebhookInstance.new( - @version, - payload, - assistant_sid: @solution[:assistant_sid], - ) - end - - - ## - # Lists WebhookInstance records from the API as a list. - # Unlike stream(), this operation is eager and will load `limit` records into - # memory before returning. - # @param [Integer] limit Upper limit for the number of records to return. stream() - # guarantees to never return more than limit. Default is no limit - # @param [Integer] page_size Number of records to fetch per request, when - # not set will use the default value of 50 records. If no page_size is defined - # but a limit is defined, stream() will attempt to read the limit with the most - # efficient page size, i.e. min(limit, 1000) - # @return [Array] Array of up to limit results - def list(limit: nil, page_size: nil) - self.stream( - limit: limit, - page_size: page_size - ).entries - end - - ## - # Streams Instance records from the API as an Enumerable. - # This operation lazily loads records as efficiently as possible until the limit - # is reached. - # @param [Integer] limit Upper limit for the number of records to return. stream() - # guarantees to never return more than limit. Default is no limit - # @param [Integer] page_size Number of records to fetch per request, when - # not set will use the default value of 50 records. If no page_size is defined - # but a limit is defined, stream() will attempt to read the limit with the most - # efficient page size, i.e. min(limit, 1000) - # @return [Enumerable] Enumerable that will yield up to limit results - def stream(limit: nil, page_size: nil) - limits = @version.read_limits(limit, page_size) - - page = self.page( - page_size: limits[:page_size], ) - - @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit]) - end - - ## - # When passed a block, yields WebhookInstance records from the API. - # This operation lazily loads records as efficiently as possible until the limit - # is reached. - def each - limits = @version.read_limits - - page = self.page(page_size: limits[:page_size], ) - - @version.stream(page, - limit: limits[:limit], - page_limit: limits[:page_limit]).each {|x| yield x} - end - - ## - # Retrieve a single page of WebhookInstance records from the API. - # Request is executed immediately. - # @param [String] page_token PageToken provided by the API - # @param [Integer] page_number Page Number, this value is simply for client state - # @param [Integer] page_size Number of records to return, defaults to 50 - # @return [Page] Page of WebhookInstance - def page(page_token: :unset, page_number: :unset, page_size: :unset) - params = Twilio::Values.of({ - 'PageToken' => page_token, - 'Page' => page_number, - 'PageSize' => page_size, - }) - - response = @version.page('GET', @uri, params: params) - - WebhookPage.new(@version, response, @solution) - end - - ## - # Retrieve a single page of WebhookInstance records from the API. - # Request is executed immediately. - # @param [String] target_url API-generated URL for the requested results page - # @return [Page] Page of WebhookInstance - def get_page(target_url) - response = @version.domain.request( - 'GET', - target_url - ) - WebhookPage.new(@version, response, @solution) - 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 WebhookContext < InstanceContext - ## - # Initialize the WebhookContext - # @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. - # @param [String] sid The Twilio-provided string that uniquely identifies the Webhook resource to update. - # @return [WebhookContext] WebhookContext - def initialize(version, assistant_sid, sid) - super(version) - - # Path Solution - @solution = { assistant_sid: assistant_sid, sid: sid, } - @uri = "/Assistants/#{@solution[:assistant_sid]}/Webhooks/#{@solution[:sid]}" - - - end - ## - # Delete the WebhookInstance - # @return [Boolean] True if delete succeeds, false otherwise - def delete - - @version.delete('DELETE', @uri) - end - - ## - # Fetch the WebhookInstance - # @return [WebhookInstance] Fetched WebhookInstance - def fetch - - payload = @version.fetch('GET', @uri) - WebhookInstance.new( - @version, - payload, - assistant_sid: @solution[:assistant_sid], - sid: @solution[:sid], - ) - end - - ## - # Update the WebhookInstance - # @param [String] unique_name An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the `sid` in the URL path to address the resource. This value must be unique and 64 characters or less in length. - # @param [String] events The list of space-separated events that this Webhook will subscribe to. - # @param [String] webhook_url The URL associated with this Webhook. - # @param [String] webhook_method The method to be used when calling the webhook's URL. - # @return [WebhookInstance] Updated WebhookInstance - def update( - unique_name: :unset, - events: :unset, - webhook_url: :unset, - webhook_method: :unset - ) - - data = Twilio::Values.of({ - 'UniqueName' => unique_name, - 'Events' => events, - 'WebhookUrl' => webhook_url, - 'WebhookMethod' => webhook_method, - }) - - payload = @version.update('POST', @uri, data: data) - WebhookInstance.new( - @version, - payload, - assistant_sid: @solution[:assistant_sid], - sid: @solution[: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 WebhookPage < Page - ## - # Initialize the WebhookPage - # @param [Version] version Version that contains the resource - # @param [Response] response Response from the API - # @param [Hash] solution Path solution for the resource - # @return [WebhookPage] WebhookPage - def initialize(version, response, solution) - super(version, response) - - # Path Solution - @solution = solution - end - - ## - # Build an instance of WebhookInstance - # @param [Hash] payload Payload response from the API - # @return [WebhookInstance] WebhookInstance - def get_instance(payload) - WebhookInstance.new(@version, payload, assistant_sid: @solution[:assistant_sid]) - end - - ## - # Provide a user friendly representation - def to_s - '' - end - end - class WebhookInstance < InstanceResource - ## - # Initialize the WebhookInstance - # @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 Webhook - # resource. - # @param [String] sid The SID of the Call resource to fetch. - # @return [WebhookInstance] WebhookInstance - def initialize(version, payload , assistant_sid: nil, sid: nil) - super(version) - - # Marshaled Properties - @properties = { - 'url' => payload['url'], - 'account_sid' => payload['account_sid'], - 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), - 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), - 'assistant_sid' => payload['assistant_sid'], - 'sid' => payload['sid'], - 'unique_name' => payload['unique_name'], - 'events' => payload['events'], - 'webhook_url' => payload['webhook_url'], - 'webhook_method' => payload['webhook_method'], - } - - # Context - @instance_context = nil - @params = { 'assistant_sid' => assistant_sid || @properties['assistant_sid'] ,'sid' => sid || @properties['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 [WebhookContext] CallContext for this CallInstance - def context - unless @instance_context - @instance_context = WebhookContext.new(@version , @params['assistant_sid'], @params['sid']) - end - @instance_context - end - - ## - # @return [String] The absolute URL of the Webhook resource. - def url - @properties['url'] - end - - ## - # @return [String] The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Webhook resource. - def account_sid - @properties['account_sid'] - end - - ## - # @return [Time] The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - def date_created - @properties['date_created'] - end - - ## - # @return [Time] The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - def date_updated - @properties['date_updated'] - 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 unique string that we created to identify the Webhook resource. - def sid - @properties['sid'] - end - - ## - # @return [String] An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. - def unique_name - @properties['unique_name'] - end - - ## - # @return [String] The list of space-separated events that this Webhook is subscribed to. - def events - @properties['events'] - end - - ## - # @return [String] The URL associated with this Webhook. - def webhook_url - @properties['webhook_url'] - end - - ## - # @return [String] The method used when calling the webhook's URL. - def webhook_method - @properties['webhook_method'] - end - - ## - # Delete the WebhookInstance - # @return [Boolean] True if delete succeeds, false otherwise - def delete - - context.delete - end - - ## - # Fetch the WebhookInstance - # @return [WebhookInstance] Fetched WebhookInstance - def fetch - - context.fetch - end - - ## - # Update the WebhookInstance - # @param [String] unique_name An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the `sid` in the URL path to address the resource. This value must be unique and 64 characters or less in length. - # @param [String] events The list of space-separated events that this Webhook will subscribe to. - # @param [String] webhook_url The URL associated with this Webhook. - # @param [String] webhook_method The method to be used when calling the webhook's URL. - # @return [WebhookInstance] Updated WebhookInstance - def update( - unique_name: :unset, - events: :unset, - webhook_url: :unset, - webhook_method: :unset - ) - - context.update( - unique_name: unique_name, - events: events, - webhook_url: webhook_url, - webhook_method: webhook_method, - ) - 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 - - diff --git a/lib/twilio-ruby/rest/autopilot/v1/restore_assistant.rb b/lib/twilio-ruby/rest/autopilot/v1/restore_assistant.rb deleted file mode 100644 index ac380b1cd..000000000 --- a/lib/twilio-ruby/rest/autopilot/v1/restore_assistant.rb +++ /dev/null @@ -1,207 +0,0 @@ -## -# This code was generated by -# ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ -# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ -# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ -# -# 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 < AutopilotBase - class V1 < Version - class RestoreAssistantList < ListResource - ## - # Initialize the RestoreAssistantList - # @param [Version] version Version that contains the resource - # @return [RestoreAssistantList] RestoreAssistantList - def initialize(version) - super(version) - # Path Solution - @solution = { } - @uri = "/Assistants/Restore" - - end - ## - # Update the RestoreAssistantInstance - # @param [String] assistant The Twilio-provided string that uniquely identifies the Assistant resource to restore. - # @return [RestoreAssistantInstance] Updated RestoreAssistantInstance - def update( - assistant: nil - ) - - data = Twilio::Values.of({ - 'Assistant' => assistant, - }) - - payload = @version.update('POST', @uri, data: data) - RestoreAssistantInstance.new( - @version, - payload, - ) - end - - - - - # Provide a user friendly representation - def to_s - '#' - end - end - - class RestoreAssistantPage < Page - ## - # Initialize the RestoreAssistantPage - # @param [Version] version Version that contains the resource - # @param [Response] response Response from the API - # @param [Hash] solution Path solution for the resource - # @return [RestoreAssistantPage] RestoreAssistantPage - def initialize(version, response, solution) - super(version, response) - - # Path Solution - @solution = solution - end - - ## - # Build an instance of RestoreAssistantInstance - # @param [Hash] payload Payload response from the API - # @return [RestoreAssistantInstance] RestoreAssistantInstance - def get_instance(payload) - RestoreAssistantInstance.new(@version, payload) - end - - ## - # Provide a user friendly representation - def to_s - '' - end - end - class RestoreAssistantInstance < InstanceResource - ## - # Initialize the RestoreAssistantInstance - # @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 RestoreAssistant - # resource. - # @param [String] sid The SID of the Call resource to fetch. - # @return [RestoreAssistantInstance] RestoreAssistantInstance - def initialize(version, payload ) - super(version) - - # Marshaled Properties - @properties = { - 'account_sid' => payload['account_sid'], - 'sid' => payload['sid'], - 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), - 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), - 'unique_name' => payload['unique_name'], - 'friendly_name' => payload['friendly_name'], - 'needs_model_build' => payload['needs_model_build'], - 'latest_model_build_sid' => payload['latest_model_build_sid'], - 'log_queries' => payload['log_queries'], - 'development_stage' => payload['development_stage'], - 'callback_url' => payload['callback_url'], - 'callback_events' => payload['callback_events'], - } - end - - - ## - # @return [String] The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Assistant resource. - def account_sid - @properties['account_sid'] - end - - ## - # @return [String] The unique string that we created to identify the Assistant resource. - def sid - @properties['sid'] - end - - ## - # @return [Time] The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - def date_created - @properties['date_created'] - end - - ## - # @return [Time] The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - def date_updated - @properties['date_updated'] - end - - ## - # @return [String] An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. - def unique_name - @properties['unique_name'] - end - - ## - # @return [String] The string that you assigned to describe the resource. It is not unique and can be up to 255 characters long. - def friendly_name - @properties['friendly_name'] - end - - ## - # @return [Boolean] Whether model needs to be rebuilt. - def needs_model_build - @properties['needs_model_build'] - end - - ## - # @return [String] Reserved. - def latest_model_build_sid - @properties['latest_model_build_sid'] - end - - ## - # @return [Boolean] Whether queries should be logged and kept after training. Can be: `true` or `false` and defaults to `true`. If `true`, queries are stored for 30 days, and then deleted. If `false`, no queries are stored. - def log_queries - @properties['log_queries'] - end - - ## - # @return [String] A string describing the state of the assistant. - def development_stage - @properties['development_stage'] - end - - ## - # @return [String] Reserved. - def callback_url - @properties['callback_url'] - end - - ## - # @return [String] Reserved. - def callback_events - @properties['callback_events'] - end - - ## - # Provide a user friendly representation - def to_s - "" - end - - ## - # Provide a detailed, user friendly representation - def inspect - "" - end - end - - end - end - end -end diff --git a/lib/twilio-ruby/rest/autopilot_base.rb b/lib/twilio-ruby/rest/autopilot_base.rb deleted file mode 100644 index 65dc475c1..000000000 --- a/lib/twilio-ruby/rest/autopilot_base.rb +++ /dev/null @@ -1,38 +0,0 @@ -## - # This code was generated by - # ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - # | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - # | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - # - # NOTE: This class is auto generated by OpenAPI Generator. - # https://openapi-generator.tech - # Do not edit the class manually. -# frozen_string_literal: true -module Twilio - module REST - class AutopilotBase < Domain - ## - # Initialize autopilot domain - # - # @param twilio - The twilio client - # - def initialize(twilio) - super(twilio) - @base_url = "https://autopilot.twilio.com" - @host = "autopilot.twilio.com" - @port = 443 - @v1 = nil - end - - def v1 - @v1 ||= Autopilot::V1.new self - end - - ## - # Provide a user friendly representation - def to_s - ''; - end - end - end -end diff --git a/lib/twilio-ruby/rest/client.rb b/lib/twilio-ruby/rest/client.rb index df4423797..6ca6ec5f1 100644 --- a/lib/twilio-ruby/rest/client.rb +++ b/lib/twilio-ruby/rest/client.rb @@ -27,11 +27,6 @@ def api @api ||= Api.new self end ## - # Access the Autopilot Twilio Domain - def autopilot - @autopilot ||= Autopilot.new self - end - ## # Access the Bulkexports Twilio Domain def bulkexports @bulkexports ||= Bulkexports.new self @@ -117,11 +112,6 @@ def numbers @numbers ||= Numbers.new self end ## - # Access the Oauth Twilio Domain - def oauth - @oauth ||= Oauth.new self - end - ## # Access the Preview Twilio Domain def preview @preview ||= Preview.new self @@ -229,7 +219,7 @@ def authorized_connect_apps(connectAppSid=:unset) def available_phone_numbers(countryCode=:unset) self.api.v2010.account.available_phone_numbers(countryCode) end - + ## # @param [string] sid The SID of the Call resource to fetch. @@ -278,8 +268,8 @@ def keys(sid=:unset) def messages(sid=:unset) self.api.v2010.account.messages(sid) end - - + + ## # @param [string] sid The Twilio-provided string that uniquely identifies the Notification resource to fetch. @@ -327,8 +317,8 @@ def short_codes(sid=:unset) def signing_keys(sid=:unset) self.api.v2010.account.signing_keys(sid) end - - + + ## # @param [string] sid The Twilio-provided string that uniquely identifies the Transcription resource to fetch. @@ -337,8 +327,8 @@ def signing_keys(sid=:unset) def transcriptions(sid=:unset) self.api.v2010.account.transcriptions(sid) end - - + + ## # Provide a user friendly representation diff --git a/lib/twilio-ruby/rest/oauth.rb b/lib/twilio-ruby/rest/oauth.rb deleted file mode 100644 index 1c691de83..000000000 --- a/lib/twilio-ruby/rest/oauth.rb +++ /dev/null @@ -1,6 +0,0 @@ -module Twilio - module REST - class Oauth < OauthBase; - end - end -end diff --git a/lib/twilio-ruby/rest/oauth/v1.rb b/lib/twilio-ruby/rest/oauth/v1.rb deleted file mode 100644 index cd1b86b33..000000000 --- a/lib/twilio-ruby/rest/oauth/v1.rb +++ /dev/null @@ -1,64 +0,0 @@ -## -# This code was generated by -# ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ -# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ -# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ -# -# Twilio - Oauth -# 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 Oauth - class V1 < Version - ## - # Initialize the V1 version of Oauth - def initialize(domain) - super - @version = 'v1' - @device_code = nil - @oauth = nil - @openid_discovery = nil - @token = nil - @user_info = nil - end - - ## - # @return [Twilio::REST::Oauth::V1::DeviceCodeList] - def device_code - @device_code ||= DeviceCodeList.new self - end - ## - # @return [Twilio::REST::Oauth::V1::oauthContext] - def oauth - @oauth ||= OauthContext.new self - end - ## - # @return [Twilio::REST::Oauth::V1::openidDiscoveryContext] - def openid_discovery - @openid_discovery ||= OpenidDiscoveryContext.new self - end - ## - # @return [Twilio::REST::Oauth::V1::TokenList] - def token - @token ||= TokenList.new self - end - ## - # @return [Twilio::REST::Oauth::V1::userInfoContext] - def user_info - @user_info ||= UserInfoContext.new self - end - ## - # Provide a user friendly representation - def to_s - ''; - end - end - end - end -end diff --git a/lib/twilio-ruby/rest/oauth/v1/device_code.rb b/lib/twilio-ruby/rest/oauth/v1/device_code.rb deleted file mode 100644 index 55e453081..000000000 --- a/lib/twilio-ruby/rest/oauth/v1/device_code.rb +++ /dev/null @@ -1,171 +0,0 @@ -## -# This code was generated by -# ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ -# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ -# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ -# -# Twilio - Oauth -# 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 Oauth < OauthBase - class V1 < Version - class DeviceCodeList < ListResource - ## - # Initialize the DeviceCodeList - # @param [Version] version Version that contains the resource - # @return [DeviceCodeList] DeviceCodeList - def initialize(version) - super(version) - # Path Solution - @solution = { } - @uri = "/device/code" - - end - ## - # Create the DeviceCodeInstance - # @param [String] client_sid A 34 character string that uniquely identifies this OAuth App. - # @param [Array[String]] scopes An Array of scopes for authorization request - # @param [Array[String]] audiences An array of intended audiences for token requests - # @return [DeviceCodeInstance] Created DeviceCodeInstance - def create( - client_sid: nil, - scopes: nil, - audiences: :unset - ) - - data = Twilio::Values.of({ - 'ClientSid' => client_sid, - 'Scopes' => Twilio.serialize_list(scopes) { |e| e }, - 'Audiences' => Twilio.serialize_list(audiences) { |e| e }, - }) - - payload = @version.create('POST', @uri, data: data) - DeviceCodeInstance.new( - @version, - payload, - ) - end - - - - - # Provide a user friendly representation - def to_s - '#' - end - end - - class DeviceCodePage < Page - ## - # Initialize the DeviceCodePage - # @param [Version] version Version that contains the resource - # @param [Response] response Response from the API - # @param [Hash] solution Path solution for the resource - # @return [DeviceCodePage] DeviceCodePage - def initialize(version, response, solution) - super(version, response) - - # Path Solution - @solution = solution - end - - ## - # Build an instance of DeviceCodeInstance - # @param [Hash] payload Payload response from the API - # @return [DeviceCodeInstance] DeviceCodeInstance - def get_instance(payload) - DeviceCodeInstance.new(@version, payload) - end - - ## - # Provide a user friendly representation - def to_s - '' - end - end - class DeviceCodeInstance < InstanceResource - ## - # Initialize the DeviceCodeInstance - # @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 DeviceCode - # resource. - # @param [String] sid The SID of the Call resource to fetch. - # @return [DeviceCodeInstance] DeviceCodeInstance - def initialize(version, payload ) - super(version) - - # Marshaled Properties - @properties = { - 'device_code' => payload['device_code'], - 'user_code' => payload['user_code'], - 'verification_uri' => payload['verification_uri'], - 'verification_uri_complete' => payload['verification_uri_complete'], - 'expires_in' => payload['expires_in'], - 'interval' => payload['interval'] == nil ? payload['interval'] : payload['interval'].to_i, - } - end - - - ## - # @return [String] The device verification code. - def device_code - @properties['device_code'] - end - - ## - # @return [String] The verification code which end user uses to verify authorization request. - def user_code - @properties['user_code'] - end - - ## - # @return [String] The URI that the end user visits to verify authorization request. - def verification_uri - @properties['verification_uri'] - end - - ## - # @return [String] The URI with user_code that the end-user alternatively visits to verify authorization request. - def verification_uri_complete - @properties['verification_uri_complete'] - end - - ## - # @return [String] The expiration time of the device_code and user_code in seconds. - def expires_in - @properties['expires_in'] - end - - ## - # @return [String] The minimum amount of time in seconds that the client should wait between polling requests to the token endpoint. - def interval - @properties['interval'] - end - - ## - # Provide a user friendly representation - def to_s - "" - end - - ## - # Provide a detailed, user friendly representation - def inspect - "" - end - end - - end - end - end -end diff --git a/lib/twilio-ruby/rest/oauth/v1/oauth.rb b/lib/twilio-ruby/rest/oauth/v1/oauth.rb deleted file mode 100644 index 684666c44..000000000 --- a/lib/twilio-ruby/rest/oauth/v1/oauth.rb +++ /dev/null @@ -1,185 +0,0 @@ -## -# This code was generated by -# ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ -# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ -# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ -# -# Twilio - Oauth -# 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 Oauth < OauthBase - class V1 < Version - class OauthList < ListResource - ## - # Initialize the OauthList - # @param [Version] version Version that contains the resource - # @return [OauthList] OauthList - def initialize(version) - super(version) - # Path Solution - @solution = { } - - - end - - - - # Provide a user friendly representation - def to_s - '#' - end - end - - - class OauthContext < InstanceContext - ## - # Initialize the OauthContext - # @param [Version] version Version that contains the resource - # @return [OauthContext] OauthContext - def initialize(version) - super(version) - - # Path Solution - @solution = { } - @uri = "/certs" - - - end - ## - # Fetch the OauthInstance - # @return [OauthInstance] Fetched OauthInstance - def fetch - - payload = @version.fetch('GET', @uri) - OauthInstance.new( - @version, - payload, - ) - 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 OauthPage < Page - ## - # Initialize the OauthPage - # @param [Version] version Version that contains the resource - # @param [Response] response Response from the API - # @param [Hash] solution Path solution for the resource - # @return [OauthPage] OauthPage - def initialize(version, response, solution) - super(version, response) - - # Path Solution - @solution = solution - end - - ## - # Build an instance of OauthInstance - # @param [Hash] payload Payload response from the API - # @return [OauthInstance] OauthInstance - def get_instance(payload) - OauthInstance.new(@version, payload) - end - - ## - # Provide a user friendly representation - def to_s - '' - end - end - class OauthInstance < InstanceResource - ## - # Initialize the OauthInstance - # @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 Oauth - # resource. - # @param [String] sid The SID of the Call resource to fetch. - # @return [OauthInstance] OauthInstance - def initialize(version, payload ) - super(version) - - # Marshaled Properties - @properties = { - 'keys' => payload['keys'], - 'url' => payload['url'], - } - - # Context - @instance_context = nil - @params = { } - 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 [OauthContext] CallContext for this CallInstance - def context - unless @instance_context - @instance_context = OauthContext.new(@version ) - end - @instance_context - end - - ## - # @return [Hash] A collection of certificates where are signed Twilio-issued tokens. - def keys - @properties['keys'] - end - - ## - # @return [String] - def url - @properties['url'] - end - - ## - # Fetch the OauthInstance - # @return [OauthInstance] Fetched OauthInstance - def fetch - - context.fetch - 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 diff --git a/lib/twilio-ruby/rest/oauth/v1/openid_discovery.rb b/lib/twilio-ruby/rest/oauth/v1/openid_discovery.rb deleted file mode 100644 index ad774d663..000000000 --- a/lib/twilio-ruby/rest/oauth/v1/openid_discovery.rb +++ /dev/null @@ -1,262 +0,0 @@ -## -# This code was generated by -# ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ -# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ -# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ -# -# Twilio - Oauth -# 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 Oauth < OauthBase - class V1 < Version - class OpenidDiscoveryList < ListResource - ## - # Initialize the OpenidDiscoveryList - # @param [Version] version Version that contains the resource - # @return [OpenidDiscoveryList] OpenidDiscoveryList - def initialize(version) - super(version) - # Path Solution - @solution = { } - - - end - - - - # Provide a user friendly representation - def to_s - '#' - end - end - - - class OpenidDiscoveryContext < InstanceContext - ## - # Initialize the OpenidDiscoveryContext - # @param [Version] version Version that contains the resource - # @return [OpenidDiscoveryContext] OpenidDiscoveryContext - def initialize(version) - super(version) - - # Path Solution - @solution = { } - @uri = "/.well-known/openid-configuration" - - - end - ## - # Fetch the OpenidDiscoveryInstance - # @return [OpenidDiscoveryInstance] Fetched OpenidDiscoveryInstance - def fetch - - payload = @version.fetch('GET', @uri) - OpenidDiscoveryInstance.new( - @version, - payload, - ) - 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 OpenidDiscoveryPage < Page - ## - # Initialize the OpenidDiscoveryPage - # @param [Version] version Version that contains the resource - # @param [Response] response Response from the API - # @param [Hash] solution Path solution for the resource - # @return [OpenidDiscoveryPage] OpenidDiscoveryPage - def initialize(version, response, solution) - super(version, response) - - # Path Solution - @solution = solution - end - - ## - # Build an instance of OpenidDiscoveryInstance - # @param [Hash] payload Payload response from the API - # @return [OpenidDiscoveryInstance] OpenidDiscoveryInstance - def get_instance(payload) - OpenidDiscoveryInstance.new(@version, payload) - end - - ## - # Provide a user friendly representation - def to_s - '' - end - end - class OpenidDiscoveryInstance < InstanceResource - ## - # Initialize the OpenidDiscoveryInstance - # @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 OpenidDiscovery - # resource. - # @param [String] sid The SID of the Call resource to fetch. - # @return [OpenidDiscoveryInstance] OpenidDiscoveryInstance - def initialize(version, payload ) - super(version) - - # Marshaled Properties - @properties = { - 'issuer' => payload['issuer'], - 'authorization_endpoint' => payload['authorization_endpoint'], - 'device_authorization_endpoint' => payload['device_authorization_endpoint'], - 'token_endpoint' => payload['token_endpoint'], - 'userinfo_endpoint' => payload['userinfo_endpoint'], - 'revocation_endpoint' => payload['revocation_endpoint'], - 'jwk_uri' => payload['jwk_uri'], - 'response_type_supported' => payload['response_type_supported'], - 'subject_type_supported' => payload['subject_type_supported'], - 'id_token_signing_alg_values_supported' => payload['id_token_signing_alg_values_supported'], - 'scopes_supported' => payload['scopes_supported'], - 'claims_supported' => payload['claims_supported'], - 'url' => payload['url'], - } - - # Context - @instance_context = nil - @params = { } - 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 [OpenidDiscoveryContext] CallContext for this CallInstance - def context - unless @instance_context - @instance_context = OpenidDiscoveryContext.new(@version ) - end - @instance_context - end - - ## - # @return [String] The URL of the party that will create the token and sign it with its private key. - def issuer - @properties['issuer'] - end - - ## - # @return [String] The endpoint that validates all authorization requests. - def authorization_endpoint - @properties['authorization_endpoint'] - end - - ## - # @return [String] The endpoint that validates all device code related authorization requests. - def device_authorization_endpoint - @properties['device_authorization_endpoint'] - end - - ## - # @return [String] The URL of the token endpoint. After a client has received an authorization code, that code is presented to the token endpoint and exchanged for an identity token, an access token, and a refresh token. - def token_endpoint - @properties['token_endpoint'] - end - - ## - # @return [String] The URL of the user info endpoint, which returns user profile information to a client. Keep in mind that the user info endpoint returns only the information that has been requested. - def userinfo_endpoint - @properties['userinfo_endpoint'] - end - - ## - # @return [String] The endpoint used to revoke access or refresh tokens issued by the authorization server. - def revocation_endpoint - @properties['revocation_endpoint'] - end - - ## - # @return [String] The URL of your JSON Web Key Set. This set is a collection of JSON Web Keys, a standard method for representing cryptographic keys in a JSON structure. - def jwk_uri - @properties['jwk_uri'] - end - - ## - # @return [Array] A collection of response type supported by authorization server. - def response_type_supported - @properties['response_type_supported'] - end - - ## - # @return [Array] A collection of subject by authorization server. - def subject_type_supported - @properties['subject_type_supported'] - end - - ## - # @return [Array] A collection of JWS signing algorithms supported by authorization server to sign identity token. - def id_token_signing_alg_values_supported - @properties['id_token_signing_alg_values_supported'] - end - - ## - # @return [Array] A collection of scopes supported by authorization server for identity token - def scopes_supported - @properties['scopes_supported'] - end - - ## - # @return [Array] A collection of claims supported by authorization server for identity token - def claims_supported - @properties['claims_supported'] - end - - ## - # @return [String] - def url - @properties['url'] - end - - ## - # Fetch the OpenidDiscoveryInstance - # @return [OpenidDiscoveryInstance] Fetched OpenidDiscoveryInstance - def fetch - - context.fetch - 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 diff --git a/lib/twilio-ruby/rest/oauth/v1/token.rb b/lib/twilio-ruby/rest/oauth/v1/token.rb deleted file mode 100644 index f1e6e7744..000000000 --- a/lib/twilio-ruby/rest/oauth/v1/token.rb +++ /dev/null @@ -1,179 +0,0 @@ -## -# This code was generated by -# ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ -# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ -# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ -# -# Twilio - Oauth -# 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 Oauth < OauthBase - class V1 < Version - class TokenList < ListResource - ## - # Initialize the TokenList - # @param [Version] version Version that contains the resource - # @return [TokenList] TokenList - def initialize(version) - super(version) - # Path Solution - @solution = { } - @uri = "/token" - - end - ## - # Create the TokenInstance - # @param [String] grant_type Grant type is a credential representing resource owner's authorization which can be used by client to obtain access token. - # @param [String] client_sid A 34 character string that uniquely identifies this OAuth App. - # @param [String] client_secret The credential for confidential OAuth App. - # @param [String] code JWT token related to the authorization code grant type. - # @param [String] code_verifier A code which is generation cryptographically. - # @param [String] device_code JWT token related to the device code grant type. - # @param [String] refresh_token JWT token related to the refresh token grant type. - # @param [String] device_id The Id of the device associated with the token (refresh token). - # @return [TokenInstance] Created TokenInstance - def create( - grant_type: nil, - client_sid: nil, - client_secret: :unset, - code: :unset, - code_verifier: :unset, - device_code: :unset, - refresh_token: :unset, - device_id: :unset - ) - - data = Twilio::Values.of({ - 'GrantType' => grant_type, - 'ClientSid' => client_sid, - 'ClientSecret' => client_secret, - 'Code' => code, - 'CodeVerifier' => code_verifier, - 'DeviceCode' => device_code, - 'RefreshToken' => refresh_token, - 'DeviceId' => device_id, - }) - - payload = @version.create('POST', @uri, data: data) - TokenInstance.new( - @version, - payload, - ) - end - - - - - # Provide a user friendly representation - def to_s - '#' - end - end - - class TokenPage < Page - ## - # Initialize the TokenPage - # @param [Version] version Version that contains the resource - # @param [Response] response Response from the API - # @param [Hash] solution Path solution for the resource - # @return [TokenPage] TokenPage - def initialize(version, response, solution) - super(version, response) - - # Path Solution - @solution = solution - end - - ## - # Build an instance of TokenInstance - # @param [Hash] payload Payload response from the API - # @return [TokenInstance] TokenInstance - def get_instance(payload) - TokenInstance.new(@version, payload) - end - - ## - # Provide a user friendly representation - def to_s - '' - end - end - class TokenInstance < InstanceResource - ## - # Initialize the TokenInstance - # @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 Token - # resource. - # @param [String] sid The SID of the Call resource to fetch. - # @return [TokenInstance] TokenInstance - def initialize(version, payload ) - super(version) - - # Marshaled Properties - @properties = { - 'access_token' => payload['access_token'], - 'refresh_token' => payload['refresh_token'], - 'id_token' => payload['id_token'], - 'refresh_token_expires_at' => Twilio.deserialize_iso8601_datetime(payload['refresh_token_expires_at']), - 'access_token_expires_at' => Twilio.deserialize_iso8601_datetime(payload['access_token_expires_at']), - } - end - - - ## - # @return [String] Token which carries the necessary information to access a Twilio resource directly. - def access_token - @properties['access_token'] - end - - ## - # @return [String] Token which carries the information necessary to get a new access token. - def refresh_token - @properties['refresh_token'] - end - - ## - # @return [String] - def id_token - @properties['id_token'] - end - - ## - # @return [Time] The date and time in GMT when the refresh token expires in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - def refresh_token_expires_at - @properties['refresh_token_expires_at'] - end - - ## - # @return [Time] The date and time in GMT when the refresh token expires in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - def access_token_expires_at - @properties['access_token_expires_at'] - end - - ## - # Provide a user friendly representation - def to_s - "" - end - - ## - # Provide a detailed, user friendly representation - def inspect - "" - end - end - - end - end - end -end diff --git a/lib/twilio-ruby/rest/oauth/v1/user_info.rb b/lib/twilio-ruby/rest/oauth/v1/user_info.rb deleted file mode 100644 index 984782fd1..000000000 --- a/lib/twilio-ruby/rest/oauth/v1/user_info.rb +++ /dev/null @@ -1,213 +0,0 @@ -## -# This code was generated by -# ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ -# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ -# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ -# -# Twilio - Oauth -# 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 Oauth < OauthBase - class V1 < Version - class UserInfoList < ListResource - ## - # Initialize the UserInfoList - # @param [Version] version Version that contains the resource - # @return [UserInfoList] UserInfoList - def initialize(version) - super(version) - # Path Solution - @solution = { } - - - end - - - - # Provide a user friendly representation - def to_s - '#' - end - end - - - class UserInfoContext < InstanceContext - ## - # Initialize the UserInfoContext - # @param [Version] version Version that contains the resource - # @return [UserInfoContext] UserInfoContext - def initialize(version) - super(version) - - # Path Solution - @solution = { } - @uri = "/userinfo" - - - end - ## - # Fetch the UserInfoInstance - # @return [UserInfoInstance] Fetched UserInfoInstance - def fetch - - payload = @version.fetch('GET', @uri) - UserInfoInstance.new( - @version, - payload, - ) - 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 UserInfoPage < Page - ## - # Initialize the UserInfoPage - # @param [Version] version Version that contains the resource - # @param [Response] response Response from the API - # @param [Hash] solution Path solution for the resource - # @return [UserInfoPage] UserInfoPage - def initialize(version, response, solution) - super(version, response) - - # Path Solution - @solution = solution - end - - ## - # Build an instance of UserInfoInstance - # @param [Hash] payload Payload response from the API - # @return [UserInfoInstance] UserInfoInstance - def get_instance(payload) - UserInfoInstance.new(@version, payload) - end - - ## - # Provide a user friendly representation - def to_s - '' - end - end - class UserInfoInstance < InstanceResource - ## - # Initialize the UserInfoInstance - # @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 UserInfo - # resource. - # @param [String] sid The SID of the Call resource to fetch. - # @return [UserInfoInstance] UserInfoInstance - def initialize(version, payload ) - super(version) - - # Marshaled Properties - @properties = { - 'user_sid' => payload['user_sid'], - 'first_name' => payload['first_name'], - 'last_name' => payload['last_name'], - 'friendly_name' => payload['friendly_name'], - 'email' => payload['email'], - 'url' => payload['url'], - } - - # Context - @instance_context = nil - @params = { } - 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 [UserInfoContext] CallContext for this CallInstance - def context - unless @instance_context - @instance_context = UserInfoContext.new(@version ) - end - @instance_context - end - - ## - # @return [String] The URL of the party that will create the token and sign it with its private key. - def user_sid - @properties['user_sid'] - end - - ## - # @return [String] The first name of the end-user. - def first_name - @properties['first_name'] - end - - ## - # @return [String] The last name of the end-user. - def last_name - @properties['last_name'] - end - - ## - # @return [String] The friendly name of the end-user. - def friendly_name - @properties['friendly_name'] - end - - ## - # @return [String] The end-user's preferred email address. - def email - @properties['email'] - end - - ## - # @return [String] - def url - @properties['url'] - end - - ## - # Fetch the UserInfoInstance - # @return [UserInfoInstance] Fetched UserInfoInstance - def fetch - - context.fetch - 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 diff --git a/lib/twilio-ruby/rest/oauth_base.rb b/lib/twilio-ruby/rest/oauth_base.rb deleted file mode 100644 index 55432293d..000000000 --- a/lib/twilio-ruby/rest/oauth_base.rb +++ /dev/null @@ -1,38 +0,0 @@ -## - # This code was generated by - # ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - # | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - # | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - # - # NOTE: This class is auto generated by OpenAPI Generator. - # https://openapi-generator.tech - # Do not edit the class manually. -# frozen_string_literal: true -module Twilio - module REST - class OauthBase < Domain - ## - # Initialize oauth domain - # - # @param twilio - The twilio client - # - def initialize(twilio) - super(twilio) - @base_url = "https://oauth.twilio.com" - @host = "oauth.twilio.com" - @port = 443 - @v1 = nil - end - - def v1 - @v1 ||= Oauth::V1.new self - end - - ## - # Provide a user friendly representation - def to_s - ''; - end - end - end -end