Skip to content

Commit

Permalink
Merge branch 'main' into public-oauth
Browse files Browse the repository at this point in the history
  • Loading branch information
manisha1997 authored Dec 9, 2024
2 parents 7635646 + 9877912 commit 447a3af
Show file tree
Hide file tree
Showing 17 changed files with 291 additions and 53 deletions.
16 changes: 16 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -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 `<Transcription>`
- Add support for new `<ConversationRelay>` and `<Assistant>` noun
- Add `events` attribute to `<Dial>` verb


[2024-11-15] Version 7.3.6
--------------------------
**Library - Chore**
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 4 additions & 1 deletion lib/twilio-ruby/rest/api/v2010/account/call/transcription.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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({
Expand All @@ -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', })
Expand Down
12 changes: 6 additions & 6 deletions lib/twilio-ruby/rest/numbers/v1.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

##
Expand Down Expand Up @@ -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
'<Twilio::REST::Numbers::V1>';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
)
Expand All @@ -49,17 +49,17 @@ def fetch

# Provide a user friendly representation
def to_s
'#<Twilio.Numbers.V1.WebhookList>'
'#<Twilio.Numbers.V1.PortingWebhookConfigurationFetchList>'
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)

Expand All @@ -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
'<Twilio.Numbers.V1.WebhookPage>'
'<Twilio.Numbers.V1.PortingWebhookConfigurationFetchPage>'
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)

Expand Down Expand Up @@ -145,13 +145,13 @@ def port_out_target_date_created
##
# Provide a user friendly representation
def to_s
"<Twilio.Numbers.V1.WebhookInstance>"
"<Twilio.Numbers.V1.PortingWebhookConfigurationFetchInstance>"
end

##
# Provide a detailed, user friendly representation
def inspect
"<Twilio.Numbers.V1.WebhookInstance>"
"<Twilio.Numbers.V1.PortingWebhookConfigurationFetchInstance>"
end
end

Expand Down
91 changes: 90 additions & 1 deletion lib/twilio-ruby/rest/numbers/v2/hosted_number_order.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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<String>] 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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/twilio-ruby/rest/preview/sync/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/twilio-ruby/rest/preview/sync/service/document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/twilio-ruby/rest/preview/sync/service/sync_list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/twilio-ruby/rest/preview/sync/service/sync_map.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Loading

0 comments on commit 447a3af

Please sign in to comment.