From fcafde7c584b495e014f67e3f84e13ff6c501c2f Mon Sep 17 00:00:00 2001 From: Twilio Date: Thu, 20 Feb 2025 14:12:52 +0000 Subject: [PATCH] [Librarian] Regenerated @ 125dc871b4170bce0faca169f8a588f6ff356a88 0c222649d98edbac6858ea253f9b77fc22386e47 --- CHANGES.md | 12 + .../api/v2010/account/call/transcription.rb | 2 +- .../v1/interaction/interaction_channel.rb | 27 ++ .../interaction_transfer.rb | 352 ++++++++++++++++++ lib/twilio-ruby/rest/iam/v1.rb | 8 +- .../rest/iam/v1/{new_api_key.rb => key.rb} | 40 +- lib/twilio-ruby/rest/numbers/v1.rb | 12 +- ...hook_configuration_fetch.rb => webhook.rb} | 40 +- 8 files changed, 442 insertions(+), 51 deletions(-) create mode 100644 lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel/interaction_transfer.rb rename lib/twilio-ruby/rest/iam/v1/{new_api_key.rb => key.rb} (86%) rename lib/twilio-ruby/rest/numbers/v1/{porting_webhook_configuration_fetch.rb => webhook.rb} (77%) diff --git a/CHANGES.md b/CHANGES.md index bcfff1aa3..19fe8e9b6 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,18 @@ twilio-ruby changelog ===================== +[2025-02-20] Version 7.4.5 +-------------------------- +**Flex** +- Adding Digital Transfers APIs under v1/Interactions + +**Numbers** +- Convert webhook_type to ienum type in v1/Porting/Configuration/Webhook/{webhook_type} + +**Trusthub** +- Changing TrustHub SupportingDocument status enum from lowercase to uppercase since kyc-orch returns status capitalized and rest proxy requires strict casing + + [2025-02-11] Version 7.4.4 -------------------------- **Api** diff --git a/lib/twilio-ruby/rest/api/v2010/account/call/transcription.rb b/lib/twilio-ruby/rest/api/v2010/account/call/transcription.rb index 5cf7044f7..50f21fa3e 100644 --- a/lib/twilio-ruby/rest/api/v2010/account/call/transcription.rb +++ b/lib/twilio-ruby/rest/api/v2010/account/call/transcription.rb @@ -48,7 +48,7 @@ def initialize(version, account_sid: nil, call_sid: nil) # @param [String] speech_model Recognition model used by the transcription engine, among those supported by the provider # @param [String] hints A Phrase contains words and phrase \\\"hints\\\" so that the speech recognition engine is more likely to recognize them. # @param [Boolean] enable_automatic_punctuation The provider will add punctuation to recognition result - # @param [String] intelligence_service The SID of the [Voice Intelligence Service](https://www.twilio.com/docs/voice/intelligence/api/service-resource) for persisting transcripts and running post-call Language Operators . + # @param [String] intelligence_service The SID or unique name of the [Voice Intelligence Service](https://www.twilio.com/docs/voice/intelligence/api/service-resource) for persisting transcripts and running post-call Language Operators . # @return [TranscriptionInstance] Created TranscriptionInstance def create( name: :unset, diff --git a/lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb b/lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb index 8a3c64754..320bcf2fa 100644 --- a/lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb +++ b/lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel.rb @@ -145,6 +145,7 @@ def initialize(version, interaction_sid, sid) # Dependents @invites = nil + @transfers = nil @participants = nil end ## @@ -209,6 +210,25 @@ def invites @invites end ## + # Access the transfers + # @return [InteractionTransferList] + # @return [InteractionTransferContext] if sid was passed. + def transfers(sid=:unset) + + raise ArgumentError, 'sid cannot be nil' if sid.nil? + + if sid != :unset + return InteractionTransferContext.new(@version, @solution[:interaction_sid], @solution[:sid],sid ) + end + + unless @transfers + @transfers = InteractionTransferList.new( + @version, interaction_sid: @solution[:interaction_sid], channel_sid: @solution[:sid], ) + end + + @transfers + end + ## # Access the participants # @return [InteractionChannelParticipantList] # @return [InteractionChannelParticipantContext] if sid was passed. @@ -391,6 +411,13 @@ def invites context.invites end + ## + # Access the transfers + # @return [transfers] transfers + def transfers + context.transfers + end + ## # Access the participants # @return [participants] participants diff --git a/lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel/interaction_transfer.rb b/lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel/interaction_transfer.rb new file mode 100644 index 000000000..c2479a9a7 --- /dev/null +++ b/lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel/interaction_transfer.rb @@ -0,0 +1,352 @@ +## +# This code was generated by +# ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ +# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ +# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ +# +# Twilio - Flex +# 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 FlexApi < FlexApiBase + class V1 < Version + class InteractionContext < InstanceContext + class InteractionChannelContext < InstanceContext + + class InteractionTransferList < ListResource + + ## + # Initialize the InteractionTransferList + # @param [Version] version Version that contains the resource + # @return [InteractionTransferList] InteractionTransferList + def initialize(version, interaction_sid: nil, channel_sid: nil) + super(version) + # Path Solution + @solution = { interaction_sid: interaction_sid, channel_sid: channel_sid } + @uri = "/Interactions/#{@solution[:interaction_sid]}/Channels/#{@solution[:channel_sid]}/Transfers" + + end + ## + # Create the InteractionTransferInstance + # @param [Object] body + # @return [InteractionTransferInstance] Created InteractionTransferInstance + def create(body: :unset + ) + + headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) + headers['Content-Type'] = 'application/json' + + + + + payload = @version.create('POST', @uri, headers: headers, data: body.to_json) + InteractionTransferInstance.new( + @version, + payload, + interaction_sid: @solution[:interaction_sid], + channel_sid: @solution[:channel_sid], + ) + end + + + + + # Provide a user friendly representation + def to_s + '#' + end + end + + + class InteractionTransferContext < InstanceContext + ## + # Initialize the InteractionTransferContext + # @param [Version] version Version that contains the resource + # @param [String] interaction_sid The Interaction Sid for this channel. + # @param [String] channel_sid The Channel Sid for this Transfer. + # @param [String] sid The unique string created by Twilio to identify a Transfer resource. + # @return [InteractionTransferContext] InteractionTransferContext + def initialize(version, interaction_sid, channel_sid, sid) + super(version) + + # Path Solution + @solution = { interaction_sid: interaction_sid, channel_sid: channel_sid, sid: sid, } + @uri = "/Interactions/#{@solution[:interaction_sid]}/Channels/#{@solution[:channel_sid]}/Transfers/#{@solution[:sid]}" + + + end + ## + # Fetch the InteractionTransferInstance + # @return [InteractionTransferInstance] Fetched InteractionTransferInstance + def fetch + + headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) + + + + + + payload = @version.fetch('GET', @uri, headers: headers) + InteractionTransferInstance.new( + @version, + payload, + interaction_sid: @solution[:interaction_sid], + channel_sid: @solution[:channel_sid], + sid: @solution[:sid], + ) + end + + ## + # Update the InteractionTransferInstance + # @param [Object] body + # @return [InteractionTransferInstance] Updated InteractionTransferInstance + def update(body: :unset + ) + + headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) + headers['Content-Type'] = 'application/json' + + + + + payload = @version.update('POST', @uri, headers: headers, data: body.to_json) + InteractionTransferInstance.new( + @version, + payload, + interaction_sid: @solution[:interaction_sid], + channel_sid: @solution[:channel_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 InteractionTransferPage < Page + ## + # Initialize the InteractionTransferPage + # @param [Version] version Version that contains the resource + # @param [Response] response Response from the API + # @param [Hash] solution Path solution for the resource + # @return [InteractionTransferPage] InteractionTransferPage + def initialize(version, response, solution) + super(version, response) + + # Path Solution + @solution = solution + end + + ## + # Build an instance of InteractionTransferInstance + # @param [Hash] payload Payload response from the API + # @return [InteractionTransferInstance] InteractionTransferInstance + def get_instance(payload) + InteractionTransferInstance.new(@version, payload, interaction_sid: @solution[:interaction_sid], channel_sid: @solution[:channel_sid]) + end + + ## + # Provide a user friendly representation + def to_s + '' + end + end + class InteractionTransferInstance < InstanceResource + ## + # Initialize the InteractionTransferInstance + # @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 InteractionTransfer + # resource. + # @param [String] sid The SID of the Call resource to fetch. + # @return [InteractionTransferInstance] InteractionTransferInstance + def initialize(version, payload , interaction_sid: nil, channel_sid: nil, sid: nil) + super(version) + + # Marshaled Properties + @properties = { + 'sid' => payload['sid'], + 'instance_sid' => payload['instance_sid'], + 'account_sid' => payload['account_sid'], + 'interaction_sid' => payload['interaction_sid'], + 'channel_sid' => payload['channel_sid'], + 'execution_sid' => payload['execution_sid'], + 'type' => payload['type'], + 'status' => payload['status'], + 'from' => payload['from'], + 'to' => payload['to'], + 'note_sid' => payload['note_sid'], + 'summary_sid' => payload['summary_sid'], + 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), + 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), + 'url' => payload['url'], + } + + # Context + @instance_context = nil + @params = { 'interaction_sid' => interaction_sid || @properties['interaction_sid'] ,'channel_sid' => channel_sid || @properties['channel_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 [InteractionTransferContext] CallContext for this CallInstance + def context + unless @instance_context + @instance_context = InteractionTransferContext.new(@version , @params['interaction_sid'], @params['channel_sid'], @params['sid']) + end + @instance_context + end + + ## + # @return [String] The unique string created by Twilio to identify an Interaction Transfer resource. + def sid + @properties['sid'] + end + + ## + # @return [String] The SID of the Instance associated with the Transfer. + def instance_sid + @properties['instance_sid'] + end + + ## + # @return [String] The SID of the Account that created the Transfer. + def account_sid + @properties['account_sid'] + end + + ## + # @return [String] The Interaction Sid for this channel. + def interaction_sid + @properties['interaction_sid'] + end + + ## + # @return [String] The Channel Sid for this Transfer. + def channel_sid + @properties['channel_sid'] + end + + ## + # @return [String] The Execution SID associated with the Transfer. + def execution_sid + @properties['execution_sid'] + end + + ## + # @return [TransferType] + def type + @properties['type'] + end + + ## + # @return [TransferStatus] + def status + @properties['status'] + end + + ## + # @return [String] The SID of the Participant initiating the Transfer. + def from + @properties['from'] + end + + ## + # @return [String] The SID of the Participant receiving the Transfer. + def to + @properties['to'] + end + + ## + # @return [String] The SID of the Note associated with the Transfer. + def note_sid + @properties['note_sid'] + end + + ## + # @return [String] The SID of the Summary associated with the Transfer. + def summary_sid + @properties['summary_sid'] + end + + ## + # @return [Time] The date and time when the Transfer was created. + def date_created + @properties['date_created'] + end + + ## + # @return [Time] The date and time when the Transfer was last updated. + def date_updated + @properties['date_updated'] + end + + ## + # @return [String] + def url + @properties['url'] + end + + ## + # Fetch the InteractionTransferInstance + # @return [InteractionTransferInstance] Fetched InteractionTransferInstance + def fetch + + context.fetch + end + + ## + # Update the InteractionTransferInstance + # @param [Object] body + # @return [InteractionTransferInstance] Updated InteractionTransferInstance + def update(body: :unset + ) + + context.update( + ) + 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/iam/v1.rb b/lib/twilio-ruby/rest/iam/v1.rb index 3ac6fc8fe..7f37c9e19 100644 --- a/lib/twilio-ruby/rest/iam/v1.rb +++ b/lib/twilio-ruby/rest/iam/v1.rb @@ -23,7 +23,7 @@ def initialize(domain) @version = 'v1' @api_key = nil @get_api_keys = nil - @new_api_key = nil + @keys = nil end ## @@ -46,9 +46,9 @@ def get_api_keys @get_api_keys ||= GetApiKeysList.new self end ## - # @return [Twilio::REST::Iam::V1::NewApiKeyList] - def new_api_key - @new_api_key ||= NewApiKeyList.new self + # @return [Twilio::REST::Iam::V1::KeyList] + def keys + @keys ||= KeyList.new self end ## # Provide a user friendly representation diff --git a/lib/twilio-ruby/rest/iam/v1/new_api_key.rb b/lib/twilio-ruby/rest/iam/v1/key.rb similarity index 86% rename from lib/twilio-ruby/rest/iam/v1/new_api_key.rb rename to lib/twilio-ruby/rest/iam/v1/key.rb index b5f962c3a..22387c31a 100644 --- a/lib/twilio-ruby/rest/iam/v1/new_api_key.rb +++ b/lib/twilio-ruby/rest/iam/v1/key.rb @@ -17,12 +17,12 @@ module Twilio module REST class Iam < IamBase class V1 < Version - class NewApiKeyList < ListResource + class KeyList < ListResource ## - # Initialize the NewApiKeyList + # Initialize the KeyList # @param [Version] version Version that contains the resource - # @return [NewApiKeyList] NewApiKeyList + # @return [KeyList] KeyList def initialize(version) super(version) # Path Solution @@ -31,12 +31,12 @@ def initialize(version) end ## - # Create the NewApiKeyInstance + # Create the KeyInstance # @param [String] account_sid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Payments resource. # @param [String] friendly_name A descriptive string that you create to describe the resource. It can be up to 64 characters long. # @param [Keytype] key_type # @param [Object] policy The \\\\`Policy\\\\` object is a collection that specifies the allowed Twilio permissions for the restricted key. For more information on the permissions available with restricted API keys, refer to the [Twilio documentation](https://www.twilio.com/docs/iam/api-keys/restricted-api-keys#permissions-available-with-restricted-api-keys). - # @return [NewApiKeyInstance] Created NewApiKeyInstance + # @return [KeyInstance] Created KeyInstance def create( account_sid: nil, friendly_name: :unset, @@ -58,7 +58,7 @@ def create( payload = @version.create('POST', @uri, data: data, headers: headers) - NewApiKeyInstance.new( + KeyInstance.new( @version, payload, ) @@ -69,17 +69,17 @@ def create( # Provide a user friendly representation def to_s - '#' + '#' end end - class NewApiKeyPage < Page + class KeyPage < Page ## - # Initialize the NewApiKeyPage + # Initialize the KeyPage # @param [Version] version Version that contains the resource # @param [Response] response Response from the API # @param [Hash] solution Path solution for the resource - # @return [NewApiKeyPage] NewApiKeyPage + # @return [KeyPage] KeyPage def initialize(version, response, solution) super(version, response) @@ -88,29 +88,29 @@ def initialize(version, response, solution) end ## - # Build an instance of NewApiKeyInstance + # Build an instance of KeyInstance # @param [Hash] payload Payload response from the API - # @return [NewApiKeyInstance] NewApiKeyInstance + # @return [KeyInstance] KeyInstance def get_instance(payload) - NewApiKeyInstance.new(@version, payload) + KeyInstance.new(@version, payload) end ## # Provide a user friendly representation def to_s - '' + '' end end - class NewApiKeyInstance < InstanceResource + class KeyInstance < InstanceResource ## - # Initialize the NewApiKeyInstance + # Initialize the KeyInstance # @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 NewApiKey + # {Account}[https://www.twilio.com/docs/iam/api/account] that created this Key # resource. # @param [String] sid The SID of the Call resource to fetch. - # @return [NewApiKeyInstance] NewApiKeyInstance + # @return [KeyInstance] KeyInstance def initialize(version, payload ) super(version) @@ -165,13 +165,13 @@ def policy ## # Provide a user friendly representation def to_s - "" + "" end ## # Provide a detailed, user friendly representation def inspect - "" + "" end end diff --git a/lib/twilio-ruby/rest/numbers/v1.rb b/lib/twilio-ruby/rest/numbers/v1.rb index b2bc9d3fe..feb87fe09 100644 --- a/lib/twilio-ruby/rest/numbers/v1.rb +++ b/lib/twilio-ruby/rest/numbers/v1.rb @@ -28,8 +28,8 @@ def initialize(domain) @porting_portabilities = nil @porting_webhook_configurations = nil @porting_webhook_configurations_delete = nil - @porting_webhook_configuration_fetch = nil @signing_request_configurations = nil + @webhook = nil end ## @@ -135,16 +135,16 @@ def porting_webhook_configurations_delete(webhook_type=:unset) end end ## - # @return [Twilio::REST::Numbers::V1::PortingWebhookConfigurationFetchList] - def porting_webhook_configuration_fetch - @porting_webhook_configuration_fetch ||= PortingWebhookConfigurationFetchList.new self - end - ## # @return [Twilio::REST::Numbers::V1::SigningRequestConfigurationList] def signing_request_configurations @signing_request_configurations ||= SigningRequestConfigurationList.new self end ## + # @return [Twilio::REST::Numbers::V1::WebhookList] + def webhook + @webhook ||= WebhookList.new self + end + ## # Provide a user friendly representation def to_s ''; diff --git a/lib/twilio-ruby/rest/numbers/v1/porting_webhook_configuration_fetch.rb b/lib/twilio-ruby/rest/numbers/v1/webhook.rb similarity index 77% rename from lib/twilio-ruby/rest/numbers/v1/porting_webhook_configuration_fetch.rb rename to lib/twilio-ruby/rest/numbers/v1/webhook.rb index 7b690b53b..16aa57d57 100644 --- a/lib/twilio-ruby/rest/numbers/v1/porting_webhook_configuration_fetch.rb +++ b/lib/twilio-ruby/rest/numbers/v1/webhook.rb @@ -17,12 +17,12 @@ module Twilio module REST class Numbers < NumbersBase class V1 < Version - class PortingWebhookConfigurationFetchList < ListResource + class WebhookList < ListResource ## - # Initialize the PortingWebhookConfigurationFetchList + # Initialize the WebhookList # @param [Version] version Version that contains the resource - # @return [PortingWebhookConfigurationFetchList] PortingWebhookConfigurationFetchList + # @return [WebhookList] WebhookList def initialize(version) super(version) # Path Solution @@ -31,8 +31,8 @@ def initialize(version) end ## - # Fetch the PortingWebhookConfigurationFetchInstance - # @return [PortingWebhookConfigurationFetchInstance] Fetched PortingWebhookConfigurationFetchInstance + # Fetch the WebhookInstance + # @return [WebhookInstance] Fetched WebhookInstance def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @@ -42,7 +42,7 @@ def fetch payload = @version.fetch('GET', @uri, headers: headers) - PortingWebhookConfigurationFetchInstance.new( + WebhookInstance.new( @version, payload, ) @@ -53,17 +53,17 @@ def fetch # Provide a user friendly representation def to_s - '#' + '#' end end - class PortingWebhookConfigurationFetchPage < Page + class WebhookPage < Page ## - # Initialize the PortingWebhookConfigurationFetchPage + # 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 [PortingWebhookConfigurationFetchPage] PortingWebhookConfigurationFetchPage + # @return [WebhookPage] WebhookPage def initialize(version, response, solution) super(version, response) @@ -72,29 +72,29 @@ def initialize(version, response, solution) end ## - # Build an instance of PortingWebhookConfigurationFetchInstance + # Build an instance of WebhookInstance # @param [Hash] payload Payload response from the API - # @return [PortingWebhookConfigurationFetchInstance] PortingWebhookConfigurationFetchInstance + # @return [WebhookInstance] WebhookInstance def get_instance(payload) - PortingWebhookConfigurationFetchInstance.new(@version, payload) + WebhookInstance.new(@version, payload) end ## # Provide a user friendly representation def to_s - '' + '' end end - class PortingWebhookConfigurationFetchInstance < InstanceResource + class WebhookInstance < InstanceResource ## - # Initialize the PortingWebhookConfigurationFetchInstance + # 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 PortingWebhookConfigurationFetch + # {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 [PortingWebhookConfigurationFetchInstance] PortingWebhookConfigurationFetchInstance + # @return [WebhookInstance] WebhookInstance def initialize(version, payload ) super(version) @@ -149,13 +149,13 @@ def port_out_target_date_created ## # Provide a user friendly representation def to_s - "" + "" end ## # Provide a detailed, user friendly representation def inspect - "" + "" end end