diff --git a/CHANGES.md b/CHANGES.md index 56d2ab6c1..245364a13 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,22 @@ twilio-ruby changelog ===================== +[2024-12-05] Version 7.3.7 +-------------------------- +**Api** +- Add optional parameter `intelligence_service` to `transcription` +- Updated `phone_number_sid` to be populated for sip trunking terminating calls. + +**Numbers** +- Add Update Hosted Number Order V2 API endpoint +- Update Port in docs + +**Twiml** +- Add optional parameter `intelligence_service` to `` +- Add support for new `` and `` noun +- Add `events` attribute to `` verb + + [2024-11-15] Version 7.3.6 -------------------------- **Library - Chore** diff --git a/README.md b/README.md index 784df4256..d05ee571a 100644 --- a/README.md +++ b/README.md @@ -39,13 +39,13 @@ This library supports the following Ruby implementations: To install using [Bundler][bundler] grab the latest stable version: ```ruby -gem 'twilio-ruby', '~> 7.3.6' +gem 'twilio-ruby', '~> 7.3.7' ``` To manually install `twilio-ruby` via [Rubygems][rubygems] simply gem install: ```bash -gem install twilio-ruby -v 7.3.6 +gem install twilio-ruby -v 7.3.7 ``` To build and install the development branch yourself from the latest source: 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 eca455749..1359c7d1b 100644 --- a/lib/twilio-ruby/rest/api/v2010/account/call/transcription.rb +++ b/lib/twilio-ruby/rest/api/v2010/account/call/transcription.rb @@ -48,6 +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 or the unique name of the [IntelligentService](https://www.twilio.com/docs/voice/intelligence/api/service-resource) to process the transcription. # @return [TranscriptionInstance] Created TranscriptionInstance def create( name: :unset, @@ -62,7 +63,8 @@ def create( profanity_filter: :unset, speech_model: :unset, hints: :unset, - enable_automatic_punctuation: :unset + enable_automatic_punctuation: :unset, + intelligence_service: :unset ) data = Twilio::Values.of({ @@ -79,6 +81,7 @@ def create( 'SpeechModel' => speech_model, 'Hints' => hints, 'EnableAutomaticPunctuation' => enable_automatic_punctuation, + 'IntelligenceService' => intelligence_service, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) diff --git a/lib/twilio-ruby/rest/numbers/v1.rb b/lib/twilio-ruby/rest/numbers/v1.rb index feb87fe09..b2bc9d3fe 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/webhook.rb b/lib/twilio-ruby/rest/numbers/v1/porting_webhook_configuration_fetch.rb similarity index 77% rename from lib/twilio-ruby/rest/numbers/v1/webhook.rb rename to lib/twilio-ruby/rest/numbers/v1/porting_webhook_configuration_fetch.rb index 4a1cc0bd6..f7828065b 100644 --- a/lib/twilio-ruby/rest/numbers/v1/webhook.rb +++ b/lib/twilio-ruby/rest/numbers/v1/porting_webhook_configuration_fetch.rb @@ -17,12 +17,12 @@ module Twilio module REST class Numbers < NumbersBase class V1 < Version - class WebhookList < ListResource + class PortingWebhookConfigurationFetchList < ListResource ## - # Initialize the WebhookList + # Initialize the PortingWebhookConfigurationFetchList # @param [Version] version Version that contains the resource - # @return [WebhookList] WebhookList + # @return [PortingWebhookConfigurationFetchList] PortingWebhookConfigurationFetchList def initialize(version) super(version) # Path Solution @@ -31,14 +31,14 @@ def initialize(version) end ## - # Fetch the WebhookInstance - # @return [WebhookInstance] Fetched WebhookInstance + # Fetch the PortingWebhookConfigurationFetchInstance + # @return [PortingWebhookConfigurationFetchInstance] Fetched PortingWebhookConfigurationFetchInstance def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) - WebhookInstance.new( + PortingWebhookConfigurationFetchInstance.new( @version, payload, ) @@ -49,17 +49,17 @@ def fetch # Provide a user friendly representation def to_s - '#' + '#' end end - class WebhookPage < Page + class PortingWebhookConfigurationFetchPage < Page ## - # Initialize the WebhookPage + # Initialize the PortingWebhookConfigurationFetchPage # @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 + # @return [PortingWebhookConfigurationFetchPage] PortingWebhookConfigurationFetchPage def initialize(version, response, solution) super(version, response) @@ -68,29 +68,29 @@ def initialize(version, response, solution) end ## - # Build an instance of WebhookInstance + # Build an instance of PortingWebhookConfigurationFetchInstance # @param [Hash] payload Payload response from the API - # @return [WebhookInstance] WebhookInstance + # @return [PortingWebhookConfigurationFetchInstance] PortingWebhookConfigurationFetchInstance def get_instance(payload) - WebhookInstance.new(@version, payload) + PortingWebhookConfigurationFetchInstance.new(@version, payload) end ## # Provide a user friendly representation def to_s - '' + '' end end - class WebhookInstance < InstanceResource + class PortingWebhookConfigurationFetchInstance < InstanceResource ## - # Initialize the WebhookInstance + # Initialize the PortingWebhookConfigurationFetchInstance # @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 + # {Account}[https://www.twilio.com/docs/iam/api/account] that created this PortingWebhookConfigurationFetch # resource. # @param [String] sid The SID of the Call resource to fetch. - # @return [WebhookInstance] WebhookInstance + # @return [PortingWebhookConfigurationFetchInstance] PortingWebhookConfigurationFetchInstance def initialize(version, payload ) super(version) @@ -145,13 +145,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 diff --git a/lib/twilio-ruby/rest/numbers/v2/hosted_number_order.rb b/lib/twilio-ruby/rest/numbers/v2/hosted_number_order.rb index 9c10ce481..1949ba785 100644 --- a/lib/twilio-ruby/rest/numbers/v2/hosted_number_order.rb +++ b/lib/twilio-ruby/rest/numbers/v2/hosted_number_order.rb @@ -224,7 +224,7 @@ class HostedNumberOrderContext < InstanceContext ## # Initialize the HostedNumberOrderContext # @param [Version] version Version that contains the resource - # @param [String] sid A 34 character string that uniquely identifies this HostedNumberOrder. + # @param [String] sid The SID of the HostedNumberOrder resource to update. # @return [HostedNumberOrderContext] HostedNumberOrderContext def initialize(version, sid) super(version) @@ -260,6 +260,34 @@ def fetch ) end + ## + # Update the HostedNumberOrderInstance + # @param [Status] status + # @param [String] verification_call_delay The number of seconds to wait before initiating the ownership verification call. Can be a value between 0 and 60, inclusive. + # @param [String] verification_call_extension The numerical extension to dial when making the ownership verification call. + # @return [HostedNumberOrderInstance] Updated HostedNumberOrderInstance + def update( + status: nil, + verification_call_delay: :unset, + verification_call_extension: :unset + ) + + data = Twilio::Values.of({ + 'Status' => status, + 'VerificationCallDelay' => verification_call_delay, + 'VerificationCallExtension' => verification_call_extension, + }) + + headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) + + payload = @version.update('POST', @uri, data: data, headers: headers) + HostedNumberOrderInstance.new( + @version, + payload, + sid: @solution[:sid], + ) + end + ## # Provide a user friendly representation @@ -338,6 +366,12 @@ def initialize(version, payload , sid: nil) 'contact_phone_number' => payload['contact_phone_number'], 'bulk_hosting_request_sid' => payload['bulk_hosting_request_sid'], 'next_step' => payload['next_step'], + 'verification_attempts' => payload['verification_attempts'] == nil ? payload['verification_attempts'] : payload['verification_attempts'].to_i, + 'verification_call_sids' => payload['verification_call_sids'], + 'verification_call_delay' => payload['verification_call_delay'] == nil ? payload['verification_call_delay'] : payload['verification_call_delay'].to_i, + 'verification_call_extension' => payload['verification_call_extension'], + 'verification_code' => payload['verification_code'], + 'verification_type' => payload['verification_type'], } # Context @@ -470,6 +504,42 @@ def next_step @properties['next_step'] end + ## + # @return [String] The number of attempts made to verify ownership via a call for the hosted phone number. + def verification_attempts + @properties['verification_attempts'] + end + + ## + # @return [Array] The Call SIDs that identify the calls placed to verify ownership. + def verification_call_sids + @properties['verification_call_sids'] + end + + ## + # @return [String] The number of seconds to wait before initiating the ownership verification call. Can be a value between 0 and 60, inclusive. + def verification_call_delay + @properties['verification_call_delay'] + end + + ## + # @return [String] The numerical extension to dial when making the ownership verification call. + def verification_call_extension + @properties['verification_call_extension'] + end + + ## + # @return [String] The digits the user must pass in the ownership verification call. + def verification_code + @properties['verification_code'] + end + + ## + # @return [VerificationType] + def verification_type + @properties['verification_type'] + end + ## # Delete the HostedNumberOrderInstance # @return [Boolean] True if delete succeeds, false otherwise @@ -486,6 +556,25 @@ def fetch context.fetch end + ## + # Update the HostedNumberOrderInstance + # @param [Status] status + # @param [String] verification_call_delay The number of seconds to wait before initiating the ownership verification call. Can be a value between 0 and 60, inclusive. + # @param [String] verification_call_extension The numerical extension to dial when making the ownership verification call. + # @return [HostedNumberOrderInstance] Updated HostedNumberOrderInstance + def update( + status: nil, + verification_call_delay: :unset, + verification_call_extension: :unset + ) + + context.update( + status: status, + verification_call_delay: verification_call_delay, + verification_call_extension: verification_call_extension, + ) + end + ## # Provide a user friendly representation def to_s diff --git a/lib/twilio-ruby/rest/preview/sync/service.rb b/lib/twilio-ruby/rest/preview/sync/service.rb index 7f3f48e49..601ed1bae 100644 --- a/lib/twilio-ruby/rest/preview/sync/service.rb +++ b/lib/twilio-ruby/rest/preview/sync/service.rb @@ -242,7 +242,7 @@ def sync_maps(sid=:unset) unless @sync_maps @sync_maps = SyncMapList.new( - @version, ) + @version, service_sid: @solution[:sid], ) end @sync_maps @@ -280,7 +280,7 @@ def sync_lists(sid=:unset) unless @sync_lists @sync_lists = SyncListList.new( - @version, ) + @version, service_sid: @solution[:sid], ) end @sync_lists diff --git a/lib/twilio-ruby/rest/preview/sync/service/document.rb b/lib/twilio-ruby/rest/preview/sync/service/document.rb index 914427a07..38b080e73 100644 --- a/lib/twilio-ruby/rest/preview/sync/service/document.rb +++ b/lib/twilio-ruby/rest/preview/sync/service/document.rb @@ -233,7 +233,7 @@ def document_permissions(identity=:unset) unless @document_permissions @document_permissions = DocumentPermissionList.new( - @version, ) + @version, service_sid: @solution[:service_sid], document_sid: @solution[:sid], ) end @document_permissions diff --git a/lib/twilio-ruby/rest/preview/sync/service/sync_list.rb b/lib/twilio-ruby/rest/preview/sync/service/sync_list.rb index 90e9ca071..49c18ba64 100644 --- a/lib/twilio-ruby/rest/preview/sync/service/sync_list.rb +++ b/lib/twilio-ruby/rest/preview/sync/service/sync_list.rb @@ -206,7 +206,7 @@ def sync_list_permissions(identity=:unset) unless @sync_list_permissions @sync_list_permissions = SyncListPermissionList.new( - @version, ) + @version, service_sid: @solution[:service_sid], list_sid: @solution[:sid], ) end @sync_list_permissions @@ -225,7 +225,7 @@ def sync_list_items(index=:unset) unless @sync_list_items @sync_list_items = SyncListItemList.new( - @version, ) + @version, service_sid: @solution[:service_sid], list_sid: @solution[:sid], ) end @sync_list_items diff --git a/lib/twilio-ruby/rest/preview/sync/service/sync_map.rb b/lib/twilio-ruby/rest/preview/sync/service/sync_map.rb index 2f07ce63f..ed51084ce 100644 --- a/lib/twilio-ruby/rest/preview/sync/service/sync_map.rb +++ b/lib/twilio-ruby/rest/preview/sync/service/sync_map.rb @@ -206,7 +206,7 @@ def sync_map_items(key=:unset) unless @sync_map_items @sync_map_items = SyncMapItemList.new( - @version, ) + @version, service_sid: @solution[:service_sid], map_sid: @solution[:sid], ) end @sync_map_items @@ -225,7 +225,7 @@ def sync_map_permissions(identity=:unset) unless @sync_map_permissions @sync_map_permissions = SyncMapPermissionList.new( - @version, ) + @version, service_sid: @solution[:service_sid], map_sid: @solution[:sid], ) end @sync_map_permissions diff --git a/lib/twilio-ruby/rest/sync/v1/service.rb b/lib/twilio-ruby/rest/sync/v1/service.rb index f0da6252c..a57bfbce1 100644 --- a/lib/twilio-ruby/rest/sync/v1/service.rb +++ b/lib/twilio-ruby/rest/sync/v1/service.rb @@ -261,7 +261,7 @@ def sync_streams(sid=:unset) unless @sync_streams @sync_streams = SyncStreamList.new( - @version, ) + @version, service_sid: @solution[:sid], ) end @sync_streams @@ -280,7 +280,7 @@ def sync_lists(sid=:unset) unless @sync_lists @sync_lists = SyncListList.new( - @version, ) + @version, service_sid: @solution[:sid], ) end @sync_lists @@ -299,7 +299,7 @@ def sync_maps(sid=:unset) unless @sync_maps @sync_maps = SyncMapList.new( - @version, ) + @version, service_sid: @solution[:sid], ) end @sync_maps diff --git a/lib/twilio-ruby/rest/sync/v1/service/document.rb b/lib/twilio-ruby/rest/sync/v1/service/document.rb index 196b35ac5..5e0e2e4c8 100644 --- a/lib/twilio-ruby/rest/sync/v1/service/document.rb +++ b/lib/twilio-ruby/rest/sync/v1/service/document.rb @@ -239,7 +239,7 @@ def document_permissions(identity=:unset) unless @document_permissions @document_permissions = DocumentPermissionList.new( - @version, ) + @version, service_sid: @solution[:service_sid], document_sid: @solution[:sid], ) end @document_permissions diff --git a/lib/twilio-ruby/rest/sync/v1/service/sync_list.rb b/lib/twilio-ruby/rest/sync/v1/service/sync_list.rb index caa6d93d1..0e245350b 100644 --- a/lib/twilio-ruby/rest/sync/v1/service/sync_list.rb +++ b/lib/twilio-ruby/rest/sync/v1/service/sync_list.rb @@ -238,7 +238,7 @@ def sync_list_permissions(identity=:unset) unless @sync_list_permissions @sync_list_permissions = SyncListPermissionList.new( - @version, ) + @version, service_sid: @solution[:service_sid], list_sid: @solution[:sid], ) end @sync_list_permissions @@ -257,7 +257,7 @@ def sync_list_items(index=:unset) unless @sync_list_items @sync_list_items = SyncListItemList.new( - @version, ) + @version, service_sid: @solution[:service_sid], list_sid: @solution[:sid], ) end @sync_list_items diff --git a/lib/twilio-ruby/rest/sync/v1/service/sync_map.rb b/lib/twilio-ruby/rest/sync/v1/service/sync_map.rb index b2f2df57a..038e209c2 100644 --- a/lib/twilio-ruby/rest/sync/v1/service/sync_map.rb +++ b/lib/twilio-ruby/rest/sync/v1/service/sync_map.rb @@ -238,7 +238,7 @@ def sync_map_items(key=:unset) unless @sync_map_items @sync_map_items = SyncMapItemList.new( - @version, ) + @version, service_sid: @solution[:service_sid], map_sid: @solution[:sid], ) end @sync_map_items @@ -257,7 +257,7 @@ def sync_map_permissions(identity=:unset) unless @sync_map_permissions @sync_map_permissions = SyncMapPermissionList.new( - @version, ) + @version, service_sid: @solution[:service_sid], map_sid: @solution[:sid], ) end @sync_map_permissions diff --git a/lib/twilio-ruby/rest/sync/v1/service/sync_stream.rb b/lib/twilio-ruby/rest/sync/v1/service/sync_stream.rb index bc781789e..d38aae1a3 100644 --- a/lib/twilio-ruby/rest/sync/v1/service/sync_stream.rb +++ b/lib/twilio-ruby/rest/sync/v1/service/sync_stream.rb @@ -224,7 +224,7 @@ def update( def stream_messages unless @stream_messages @stream_messages = StreamMessageList.new( - @version, ) + @version, service_sid: @solution[:service_sid], stream_sid: @solution[:sid], ) end @stream_messages end diff --git a/lib/twilio-ruby/twiml/voice_response.rb b/lib/twilio-ruby/twiml/voice_response.rb index 7488f0052..f81e1f946 100644 --- a/lib/twilio-ruby/twiml/voice_response.rb +++ b/lib/twilio-ruby/twiml/voice_response.rb @@ -50,9 +50,10 @@ def connect(action: nil, method: nil, **keyword_args) # sequential:: Used to determine if child TwiML nouns should be dialed in order, one after the other (sequential) or dial all at once (parallel). Default is false, parallel # refer_url:: Webhook that will receive future SIP REFER requests # refer_method:: The HTTP method to use for the refer Webhook + # events:: Subscription to events # keyword_args:: additional attributes - def dial(number: nil, action: nil, method: nil, timeout: nil, hangup_on_star: nil, time_limit: nil, caller_id: nil, record: nil, trim: nil, recording_status_callback: nil, recording_status_callback_method: nil, recording_status_callback_event: nil, answer_on_bridge: nil, ring_tone: nil, recording_track: nil, sequential: nil, refer_url: nil, refer_method: nil, **keyword_args) - dial = Dial.new(number: number, action: action, method: method, timeout: timeout, hangup_on_star: hangup_on_star, time_limit: time_limit, caller_id: caller_id, record: record, trim: trim, recording_status_callback: recording_status_callback, recording_status_callback_method: recording_status_callback_method, recording_status_callback_event: recording_status_callback_event, answer_on_bridge: answer_on_bridge, ring_tone: ring_tone, recording_track: recording_track, sequential: sequential, refer_url: refer_url, refer_method: refer_method, **keyword_args) + def dial(number: nil, action: nil, method: nil, timeout: nil, hangup_on_star: nil, time_limit: nil, caller_id: nil, record: nil, trim: nil, recording_status_callback: nil, recording_status_callback_method: nil, recording_status_callback_event: nil, answer_on_bridge: nil, ring_tone: nil, recording_track: nil, sequential: nil, refer_url: nil, refer_method: nil, events: nil, **keyword_args) + dial = Dial.new(number: number, action: action, method: method, timeout: timeout, hangup_on_star: hangup_on_star, time_limit: time_limit, caller_id: caller_id, record: record, trim: trim, recording_status_callback: recording_status_callback, recording_status_callback_method: recording_status_callback_method, recording_status_callback_event: recording_status_callback_event, answer_on_bridge: answer_on_bridge, ring_tone: ring_tone, recording_track: recording_track, sequential: sequential, refer_url: refer_url, refer_method: refer_method, events: events, **keyword_args) yield(dial) if block_given? append(dial) @@ -387,9 +388,10 @@ def siprec(name: nil, connector_name: nil, track: nil, status_callback: nil, sta # speech_model:: Speech Model used by the transcription engine # hints:: Hints to be provided to the transcription engine # enable_automatic_punctuation:: Enable Automatic Punctuation + # intelligence_service:: The SID or the unique name of the Intelligence Service to be used # keyword_args:: additional attributes - def transcription(name: nil, track: nil, status_callback_url: nil, status_callback_method: nil, inbound_track_label: nil, outbound_track_label: nil, partial_results: nil, language_code: nil, transcription_engine: nil, profanity_filter: nil, speech_model: nil, hints: nil, enable_automatic_punctuation: nil, **keyword_args) - transcription = Transcription.new(name: name, track: track, status_callback_url: status_callback_url, status_callback_method: status_callback_method, inbound_track_label: inbound_track_label, outbound_track_label: outbound_track_label, partial_results: partial_results, language_code: language_code, transcription_engine: transcription_engine, profanity_filter: profanity_filter, speech_model: speech_model, hints: hints, enable_automatic_punctuation: enable_automatic_punctuation, **keyword_args) + def transcription(name: nil, track: nil, status_callback_url: nil, status_callback_method: nil, inbound_track_label: nil, outbound_track_label: nil, partial_results: nil, language_code: nil, transcription_engine: nil, profanity_filter: nil, speech_model: nil, hints: nil, enable_automatic_punctuation: nil, intelligence_service: nil, **keyword_args) + transcription = Transcription.new(name: name, track: track, status_callback_url: status_callback_url, status_callback_method: status_callback_method, inbound_track_label: inbound_track_label, outbound_track_label: outbound_track_label, partial_results: partial_results, language_code: language_code, transcription_engine: transcription_engine, profanity_filter: profanity_filter, speech_model: speech_model, hints: hints, enable_automatic_punctuation: enable_automatic_punctuation, intelligence_service: intelligence_service, **keyword_args) yield(transcription) if block_given? append(transcription) @@ -543,9 +545,10 @@ def siprec(name: nil, connector_name: nil, track: nil, status_callback: nil, sta # speech_model:: Speech Model used by the transcription engine # hints:: Hints to be provided to the transcription engine # enable_automatic_punctuation:: Enable Automatic Punctuation + # intelligence_service:: The SID or the unique name of the Intelligence Service to be used # keyword_args:: additional attributes - def transcription(name: nil, track: nil, status_callback_url: nil, status_callback_method: nil, inbound_track_label: nil, outbound_track_label: nil, partial_results: nil, language_code: nil, transcription_engine: nil, profanity_filter: nil, speech_model: nil, hints: nil, enable_automatic_punctuation: nil, **keyword_args) - transcription = Transcription.new(name: name, track: track, status_callback_url: status_callback_url, status_callback_method: status_callback_method, inbound_track_label: inbound_track_label, outbound_track_label: outbound_track_label, partial_results: partial_results, language_code: language_code, transcription_engine: transcription_engine, profanity_filter: profanity_filter, speech_model: speech_model, hints: hints, enable_automatic_punctuation: enable_automatic_punctuation, **keyword_args) + def transcription(name: nil, track: nil, status_callback_url: nil, status_callback_method: nil, inbound_track_label: nil, outbound_track_label: nil, partial_results: nil, language_code: nil, transcription_engine: nil, profanity_filter: nil, speech_model: nil, hints: nil, enable_automatic_punctuation: nil, intelligence_service: nil, **keyword_args) + transcription = Transcription.new(name: name, track: track, status_callback_url: status_callback_url, status_callback_method: status_callback_method, inbound_track_label: inbound_track_label, outbound_track_label: outbound_track_label, partial_results: partial_results, language_code: language_code, transcription_engine: transcription_engine, profanity_filter: profanity_filter, speech_model: speech_model, hints: hints, enable_automatic_punctuation: enable_automatic_punctuation, intelligence_service: intelligence_service, **keyword_args) yield(transcription) if block_given? append(transcription) @@ -1960,6 +1963,133 @@ def virtual_agent(connector_name: nil, language: nil, sentiment_analysis: nil, s def conversation(service_instance_sid: nil, inbound_autocreation: nil, routing_assignment_timeout: nil, inbound_timeout: nil, url: nil, method: nil, record: nil, trim: nil, recording_status_callback: nil, recording_status_callback_method: nil, recording_status_callback_event: nil, status_callback: nil, status_callback_method: nil, status_callback_event: nil, **keyword_args) append(Conversation.new(service_instance_sid: service_instance_sid, inbound_autocreation: inbound_autocreation, routing_assignment_timeout: routing_assignment_timeout, inbound_timeout: inbound_timeout, url: url, method: method, record: record, trim: trim, recording_status_callback: recording_status_callback, recording_status_callback_method: recording_status_callback_method, recording_status_callback_event: recording_status_callback_event, status_callback: status_callback, status_callback_method: status_callback_method, status_callback_event: status_callback_event, **keyword_args)) end + + ## + # Create a new element + # url:: URL of the remote service where the session is connected to + # language:: Language to be used for both text-to-speech and transcription + # tts_language:: Language to be used for text-to-speech + # transcription_language:: Language to be used for transcription + # tts_provider:: Provider to be used for text-to-speech + # voice:: Voice to be used for text-to-speech + # transcription_provider:: Provider to be used for transcription + # speech_model:: Speech model to be used for transcription + # profanity_filter:: Whether profanities should be filtered out of the speech transcription + # dtmf_detection:: Whether DTMF tones should be detected and reported in speech transcription + # welcome_greeting:: The sentence to be played automatically when the session is connected + # partial_prompts:: Whether partial prompts should be reported to WebSocket server before the caller finishes speaking + # interruptible:: Whether caller's speaking can interrupt the play of text-to-speech + # interrupt_by_dtmf:: Whether DTMF tone can interrupt the play of text-to-speech + # welcome_greeting_interruptible:: Whether caller's speaking can interrupt the welcome greeting + # debug:: Whether debugging on the session is enabled + # keyword_args:: additional attributes + def conversation_relay(url: nil, language: nil, tts_language: nil, transcription_language: nil, tts_provider: nil, voice: nil, transcription_provider: nil, speech_model: nil, profanity_filter: nil, dtmf_detection: nil, welcome_greeting: nil, partial_prompts: nil, interruptible: nil, interrupt_by_dtmf: nil, welcome_greeting_interruptible: nil, debug: nil, **keyword_args) + conversation_relay = ConversationRelay.new(url: url, language: language, tts_language: tts_language, transcription_language: transcription_language, tts_provider: tts_provider, voice: voice, transcription_provider: transcription_provider, speech_model: speech_model, profanity_filter: profanity_filter, dtmf_detection: dtmf_detection, welcome_greeting: welcome_greeting, partial_prompts: partial_prompts, interruptible: interruptible, interrupt_by_dtmf: interrupt_by_dtmf, welcome_greeting_interruptible: welcome_greeting_interruptible, debug: debug, **keyword_args) + + yield(conversation_relay) if block_given? + append(conversation_relay) + end + + ## + # Create a new element + # id:: The assistant ID of the AI Assistant + # language:: Language to be used for both text-to-speech and transcription + # tts_language:: Language to be used for text-to-speech + # transcription_language:: Language to be used for transcription + # tts_provider:: Provider to be used for text-to-speech + # voice:: Voice to be used for text-to-speech + # transcription_provider:: Provider to be used for transcription + # speech_model:: Speech model to be used for transcription + # profanity_filter:: Whether profanities should be filtered out of the speech transcription + # dtmf_detection:: Whether DTMF tones should be detected and reported in speech transcription + # welcome_greeting:: The sentence to be played automatically when the session is connected + # partial_prompts:: Whether partial prompts should be reported to WebSocket server before the caller finishes speaking + # interruptible:: Whether caller's speaking can interrupt the play of text-to-speech + # interrupt_by_dtmf:: Whether DTMF tone can interrupt the play of text-to-speech + # welcome_greeting_interruptible:: Whether caller's speaking can interrupt the welcome greeting + # debug:: Whether debugging on the session is enabled + # keyword_args:: additional attributes + def assistant(id: nil, language: nil, tts_language: nil, transcription_language: nil, tts_provider: nil, voice: nil, transcription_provider: nil, speech_model: nil, profanity_filter: nil, dtmf_detection: nil, welcome_greeting: nil, partial_prompts: nil, interruptible: nil, interrupt_by_dtmf: nil, welcome_greeting_interruptible: nil, debug: nil, **keyword_args) + assistant = Assistant.new(id: id, language: language, tts_language: tts_language, transcription_language: transcription_language, tts_provider: tts_provider, voice: voice, transcription_provider: transcription_provider, speech_model: speech_model, profanity_filter: profanity_filter, dtmf_detection: dtmf_detection, welcome_greeting: welcome_greeting, partial_prompts: partial_prompts, interruptible: interruptible, interrupt_by_dtmf: interrupt_by_dtmf, welcome_greeting_interruptible: welcome_greeting_interruptible, debug: debug, **keyword_args) + + yield(assistant) if block_given? + append(assistant) + end + end + + ## + # TwiML Noun + class Assistant < TwiML + def initialize(**keyword_args) + super(**keyword_args) + @name = 'Assistant' + + yield(self) if block_given? + end + + ## + # Create a new element + # code:: Language code of this language setting is for + # tts_provider:: Provider to be used for text-to-speech of this language + # voice:: Voice to be used for text-to-speech of this language + # transcription_provider:: Provider to be used for transcription of this language + # speech_model:: Speech model to be used for transcription of this language + # keyword_args:: additional attributes + def language(code: nil, tts_provider: nil, voice: nil, transcription_provider: nil, speech_model: nil, **keyword_args) + append(Language.new(code: code, tts_provider: tts_provider, voice: voice, transcription_provider: transcription_provider, speech_model: speech_model, **keyword_args)) + end + + ## + # Create a new element + # name:: The name of the custom parameter + # value:: The value of the custom parameter + # keyword_args:: additional attributes + def parameter(name: nil, value: nil, **keyword_args) + append(Parameter.new(name: name, value: value, **keyword_args)) + end + end + + ## + # TwiML Noun + class Language < TwiML + def initialize(**keyword_args) + super(**keyword_args) + @name = 'Language' + + yield(self) if block_given? + end + end + + ## + # TwiML Noun + class ConversationRelay < TwiML + def initialize(**keyword_args) + super(**keyword_args) + @name = 'ConversationRelay' + + yield(self) if block_given? + end + + ## + # Create a new element + # code:: Language code of this language setting is for + # tts_provider:: Provider to be used for text-to-speech of this language + # voice:: Voice to be used for text-to-speech of this language + # transcription_provider:: Provider to be used for transcription of this language + # speech_model:: Speech model to be used for transcription of this language + # keyword_args:: additional attributes + def language(code: nil, tts_provider: nil, voice: nil, transcription_provider: nil, speech_model: nil, **keyword_args) + append(Language.new(code: code, tts_provider: tts_provider, voice: voice, transcription_provider: transcription_provider, speech_model: speech_model, **keyword_args)) + end + + ## + # Create a new element + # name:: The name of the custom parameter + # value:: The value of the custom parameter + # keyword_args:: additional attributes + def parameter(name: nil, value: nil, **keyword_args) + append(Parameter.new(name: name, value: value, **keyword_args)) + end end ## diff --git a/lib/twilio-ruby/version.rb b/lib/twilio-ruby/version.rb index 3419118eb..4fcfbd9ac 100644 --- a/lib/twilio-ruby/version.rb +++ b/lib/twilio-ruby/version.rb @@ -1,3 +1,3 @@ module Twilio - VERSION = '7.3.6' + VERSION = '7.3.7' end