Skip to content

Commit

Permalink
[Librarian] Regenerated @ 9419ae9766a1f3421c32308ef0a457ca0c0248fd
Browse files Browse the repository at this point in the history
  • Loading branch information
twilio-dx committed Aug 24, 2022
1 parent a52274c commit dc562c4
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 193 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
=====================

[2022-08-24] Version 5.71.0
---------------------------
**Library - Test**
- [PR #615](https://github.com/twilio/twilio-ruby/pull/615): add test-docker rule. Thanks to [@beebzz](https://github.com/beebzz)!

**Api**
- Remove `beta feature` from scheduling params and remove optimize parameters. **(breaking change)**

**Routes**
- Remove Duplicate Create Method - Update Method will work even if Inbound Processing Region is currently empty/404. **(breaking change)**

**Twiml**
- Add new Polly Neural voices
- Add new languages to SSML `<lang>`.


[2022-08-10] Version 5.70.1
---------------------------
**Library - Fix**
Expand Down
30 changes: 2 additions & 28 deletions lib/twilio-ruby/rest/routes/v2/phone_number.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,29 +72,14 @@ def initialize(version, phone_number)
@uri = "/PhoneNumbers/#{@solution[:phone_number]}"
end

##
# Create the PhoneNumberInstance
# @param [String] voice_region The Inbound Processing Region used for this phone
# number for voice
# @param [String] friendly_name A human readable description of this resource, up
# to 64 characters.
# @return [PhoneNumberInstance] Created PhoneNumberInstance
def create(voice_region: :unset, friendly_name: :unset)
data = Twilio::Values.of({'VoiceRegion' => voice_region, 'FriendlyName' => friendly_name, })

payload = @version.create('POST', @uri, data: data)

PhoneNumberInstance.new(@version, payload, phone_number: @solution[:phone_number], )
end

##
# Update the PhoneNumberInstance
# @param [String] voice_region The Inbound Processing Region used for this phone
# number for voice
# @param [String] friendly_name A human readable description of this resource, up
# to 64 characters.
# @return [PhoneNumberInstance] Updated PhoneNumberInstance
def update(voice_region: nil, friendly_name: nil)
def update(voice_region: :unset, friendly_name: :unset)
data = Twilio::Values.of({'VoiceRegion' => voice_region, 'FriendlyName' => friendly_name, })

payload = @version.update('POST', @uri, data: data)
Expand Down Expand Up @@ -212,25 +197,14 @@ def date_updated
@properties['date_updated']
end

##
# Create the PhoneNumberInstance
# @param [String] voice_region The Inbound Processing Region used for this phone
# number for voice
# @param [String] friendly_name A human readable description of this resource, up
# to 64 characters.
# @return [PhoneNumberInstance] Created PhoneNumberInstance
def create(voice_region: :unset, friendly_name: :unset)
context.create(voice_region: voice_region, friendly_name: friendly_name, )
end

##
# Update the PhoneNumberInstance
# @param [String] voice_region The Inbound Processing Region used for this phone
# number for voice
# @param [String] friendly_name A human readable description of this resource, up
# to 64 characters.
# @return [PhoneNumberInstance] Updated PhoneNumberInstance
def update(voice_region: nil, friendly_name: nil)
def update(voice_region: :unset, friendly_name: :unset)
context.update(voice_region: voice_region, friendly_name: friendly_name, )
end

Expand Down
22 changes: 0 additions & 22 deletions lib/twilio-ruby/rest/routes/v2/sip_domain.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,19 +72,6 @@ def initialize(version, sip_domain)
@uri = "/SipDomains/#{@solution[:sip_domain]}"
end

##
# Create the SipDomainInstance
# @param [String] voice_region The voice_region
# @param [String] friendly_name The friendly_name
# @return [SipDomainInstance] Created SipDomainInstance
def create(voice_region: :unset, friendly_name: :unset)
data = Twilio::Values.of({'VoiceRegion' => voice_region, 'FriendlyName' => friendly_name, })

payload = @version.create('POST', @uri, data: data)

SipDomainInstance.new(@version, payload, sip_domain: @solution[:sip_domain], )
end

##
# Update the SipDomainInstance
# @param [String] voice_region The voice_region
Expand Down Expand Up @@ -208,15 +195,6 @@ def date_updated
@properties['date_updated']
end

##
# Create the SipDomainInstance
# @param [String] voice_region The voice_region
# @param [String] friendly_name The friendly_name
# @return [SipDomainInstance] Created SipDomainInstance
def create(voice_region: :unset, friendly_name: :unset)
context.create(voice_region: voice_region, friendly_name: friendly_name, )
end

##
# Update the SipDomainInstance
# @param [String] voice_region The voice_region
Expand Down
26 changes: 0 additions & 26 deletions lib/twilio-ruby/rest/routes/v2/trunk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,21 +72,6 @@ def initialize(version, sip_trunk_domain)
@uri = "/Trunks/#{@solution[:sip_trunk_domain]}"
end

##
# Create the TrunkInstance
# @param [String] voice_region The Inbound Processing Region used for this SIP
# Trunk for voice
# @param [String] friendly_name A human readable description of this resource, up
# to 64 characters.
# @return [TrunkInstance] Created TrunkInstance
def create(voice_region: :unset, friendly_name: :unset)
data = Twilio::Values.of({'VoiceRegion' => voice_region, 'FriendlyName' => friendly_name, })

payload = @version.create('POST', @uri, data: data)

TrunkInstance.new(@version, payload, sip_trunk_domain: @solution[:sip_trunk_domain], )
end

##
# Update the TrunkInstance
# @param [String] voice_region The Inbound Processing Region used for this SIP
Expand Down Expand Up @@ -212,17 +197,6 @@ def date_updated
@properties['date_updated']
end

##
# Create the TrunkInstance
# @param [String] voice_region The Inbound Processing Region used for this SIP
# Trunk for voice
# @param [String] friendly_name A human readable description of this resource, up
# to 64 characters.
# @return [TrunkInstance] Created TrunkInstance
def create(voice_region: :unset, friendly_name: :unset)
context.create(voice_region: voice_region, friendly_name: friendly_name, )
end

##
# Update the TrunkInstance
# @param [String] voice_region The Inbound Processing Region used for this SIP
Expand Down
9 changes: 4 additions & 5 deletions lib/twilio-ruby/rest/verify/v2/service/verification.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,10 @@ def initialize(version, service_sid: nil)
# for example, to dial an extension. For more information, see the Programmable
# Voice documentation of
# {sendDigits}[https://www.twilio.com/docs/voice/twiml/number#attributes-sendDigits].
# @param [String] locale The locale to use for the verification SMS, WhatsApp or
# call. Can be: `af`, `ar`, `ca`, `cs`, `da`, `de`, `el`, `en`, `en-GB`, `es`,
# `fi`, `fr`, `he`, `hi`, `hr`, `hu`, `id`, `it`, `ja`, `ko`, `ms`, `nb`, `nl`,
# `pl`, `pt`, `pr-BR`, `ro`, `ru`, `sv`, `th`, `tl`, `tr`, `vi`, `zh`, `zh-CN`, or
# `zh-HK.`
# @param [String] locale Locale will automatically resolve based on phone number
# country code for SMS, WhatsApp and call channel verifications. This parameter
# will override the automatic locale. {See supported languages and more
# information here.}[https://www.twilio.com/docs/verify/supported-languages].
# @param [String] custom_code A pre-generated code to use for verification. The
# code can be between 4 and 10 characters, inclusive.
# @param [String] amount The amount of the associated PSD2 compliant transaction.
Expand Down
42 changes: 2 additions & 40 deletions spec/integration/routes/v2/phone_number_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,55 +9,17 @@
require 'spec_helper.rb'

describe 'PhoneNumber' do
it "can create" do
@holodeck.mock(Twilio::Response.new(500, ''))

expect {
@client.routes.v2.phone_numbers('phone_number').create()
}.to raise_exception(Twilio::REST::TwilioError)

expect(
@holodeck.has_request?(Holodeck::Request.new(
method: 'post',
url: 'https://routes.twilio.com/v2/PhoneNumbers/phone_number',
))).to eq(true)
end

it "receives create responses" do
@holodeck.mock(Twilio::Response.new(
201,
%q[
{
"phone_number": "+18001234567",
"url": "https://routes.twilio.com/v2/PhoneNumbers/+18001234567",
"sid": "QQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"friendly_name": "friendly_name",
"voice_region": "au1",
"date_created": "2015-07-30T20:00:00Z",
"date_updated": "2015-07-30T20:00:00Z"
}
]
))

actual = @client.routes.v2.phone_numbers('phone_number').create()

expect(actual).to_not eq(nil)
end

it "can update" do
@holodeck.mock(Twilio::Response.new(500, ''))

expect {
@client.routes.v2.phone_numbers('phone_number').update(voice_region: 'voice_region', friendly_name: 'friendly_name')
@client.routes.v2.phone_numbers('phone_number').update()
}.to raise_exception(Twilio::REST::TwilioError)

values = {'VoiceRegion' => 'voice_region', 'FriendlyName' => 'friendly_name', }
expect(
@holodeck.has_request?(Holodeck::Request.new(
method: 'post',
url: 'https://routes.twilio.com/v2/PhoneNumbers/phone_number',
data: values,
))).to eq(true)
end

Expand All @@ -78,7 +40,7 @@
]
))

actual = @client.routes.v2.phone_numbers('phone_number').update(voice_region: 'voice_region', friendly_name: 'friendly_name')
actual = @client.routes.v2.phone_numbers('phone_number').update()

expect(actual).to_not eq(nil)
end
Expand Down
36 changes: 0 additions & 36 deletions spec/integration/routes/v2/sip_domain_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,42 +9,6 @@
require 'spec_helper.rb'

describe 'SipDomain' do
it "can create" do
@holodeck.mock(Twilio::Response.new(500, ''))

expect {
@client.routes.v2.sip_domains('sip_domain').create()
}.to raise_exception(Twilio::REST::TwilioError)

expect(
@holodeck.has_request?(Holodeck::Request.new(
method: 'post',
url: 'https://routes.twilio.com/v2/SipDomains/sip_domain',
))).to eq(true)
end

it "receives create responses" do
@holodeck.mock(Twilio::Response.new(
201,
%q[
{
"url": "https://routes.twilio.com/v2/SipDomains/test.sip.twilio.com",
"sip_domain": "test.sip.twilio.com",
"sid": "QQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"friendly_name": "friendly_name",
"voice_region": "au1",
"date_created": "2020-08-07T22:29:24Z",
"date_updated": "2020-08-07T22:29:24Z"
}
]
))

actual = @client.routes.v2.sip_domains('sip_domain').create()

expect(actual).to_not eq(nil)
end

it "can update" do
@holodeck.mock(Twilio::Response.new(500, ''))

Expand Down
36 changes: 0 additions & 36 deletions spec/integration/routes/v2/trunk_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,42 +9,6 @@
require 'spec_helper.rb'

describe 'Trunk' do
it "can create" do
@holodeck.mock(Twilio::Response.new(500, ''))

expect {
@client.routes.v2.trunks('sip_trunk_domain').create()
}.to raise_exception(Twilio::REST::TwilioError)

expect(
@holodeck.has_request?(Holodeck::Request.new(
method: 'post',
url: 'https://routes.twilio.com/v2/Trunks/sip_trunk_domain',
))).to eq(true)
end

it "receives create responses" do
@holodeck.mock(Twilio::Response.new(
201,
%q[
{
"sip_trunk_domain": "test.pstn.twilio.com",
"url": "https://routes.twilio.com/v2/Trunks/test.pstn.twilio.com",
"sid": "QQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"friendly_name": "friendly_name",
"voice_region": "au1",
"date_created": "2020-08-07T22:29:24Z",
"date_updated": "2020-08-07T22:29:24Z"
}
]
))

actual = @client.routes.v2.trunks('sip_trunk_domain').create()

expect(actual).to_not eq(nil)
end

it "can update" do
@holodeck.mock(Twilio::Response.new(500, ''))

Expand Down

0 comments on commit dc562c4

Please sign in to comment.