Skip to content

Commit c99147a

Browse files
committed
[Librarian] Regenerated @ 480d240ca25b1c4186b4f9485e0f0debf1e14978
1 parent 50b4436 commit c99147a

File tree

16 files changed

+1037
-26
lines changed

16 files changed

+1037
-26
lines changed

CHANGES.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,31 @@
11
twilio-ruby changelog
22
=====================
33

4+
[2021-08-25] Version 5.58.1
5+
---------------------------
6+
**Api**
7+
- Add Programmabled Voice SIP Refer call transfers (`calls-transfers`) to usage records
8+
- Add Flex Voice Usage category (`flex-usage`) to usage records
9+
10+
**Conversations**
11+
- Add `Order` query parameter to Message resource read operation
12+
13+
**Insights**
14+
- Added `partial` to enum processing_state_request
15+
- Added abnormal session filter in Call Summaries
16+
17+
**Messaging**
18+
- Add brand_registration_sid as an optional query param for us_app_to_person_usecase api
19+
20+
**Pricing**
21+
- add trunking_numbers resource (v2)
22+
- add trunking_country resource (v2)
23+
24+
**Verify**
25+
- Changed to private beta the `TemplateSid` optional parameter on Verification creation.
26+
- Added the optional parameter `Order` to the list Challenges endpoint to define the list order.
27+
28+
429
[2021-08-11] Version 5.58.0
530
---------------------------
631
**Library - Chore**

lib/twilio-ruby/rest/conversations/v1/conversation/message.rb

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,32 +63,36 @@ def create(author: :unset, body: :unset, date_created: :unset, date_updated: :un
6363
# Lists MessageInstance records from the API as a list.
6464
# Unlike stream(), this operation is eager and will load `limit` records into
6565
# memory before returning.
66+
# @param [message.OrderType] order The sort order of the returned messages. Can
67+
# be: `asc` (ascending) or `desc` (descending), with `asc` as the default.
6668
# @param [Integer] limit Upper limit for the number of records to return. stream()
6769
# guarantees to never return more than limit. Default is no limit
6870
# @param [Integer] page_size Number of records to fetch per request, when
6971
# not set will use the default value of 50 records. If no page_size is defined
7072
# but a limit is defined, stream() will attempt to read the limit with the most
7173
# efficient page size, i.e. min(limit, 1000)
7274
# @return [Array] Array of up to limit results
73-
def list(limit: nil, page_size: nil)
74-
self.stream(limit: limit, page_size: page_size).entries
75+
def list(order: :unset, limit: nil, page_size: nil)
76+
self.stream(order: order, limit: limit, page_size: page_size).entries
7577
end
7678

7779
##
7880
# Streams MessageInstance records from the API as an Enumerable.
7981
# This operation lazily loads records as efficiently as possible until the limit
8082
# is reached.
83+
# @param [message.OrderType] order The sort order of the returned messages. Can
84+
# be: `asc` (ascending) or `desc` (descending), with `asc` as the default.
8185
# @param [Integer] limit Upper limit for the number of records to return. stream()
8286
# guarantees to never return more than limit. Default is no limit.
8387
# @param [Integer] page_size Number of records to fetch per request, when
8488
# not set will use the default value of 50 records. If no page_size is defined
8589
# but a limit is defined, stream() will attempt to read the limit with the most
8690
# efficient page size, i.e. min(limit, 1000)
8791
# @return [Enumerable] Enumerable that will yield up to limit results
88-
def stream(limit: nil, page_size: nil)
92+
def stream(order: :unset, limit: nil, page_size: nil)
8993
limits = @version.read_limits(limit, page_size)
9094

91-
page = self.page(page_size: limits[:page_size], )
95+
page = self.page(order: order, page_size: limits[:page_size], )
9296

9397
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
9498
end
@@ -110,12 +114,15 @@ def each
110114
##
111115
# Retrieve a single page of MessageInstance records from the API.
112116
# Request is executed immediately.
117+
# @param [message.OrderType] order The sort order of the returned messages. Can
118+
# be: `asc` (ascending) or `desc` (descending), with `asc` as the default.
113119
# @param [String] page_token PageToken provided by the API
114120
# @param [Integer] page_number Page Number, this value is simply for client state
115121
# @param [Integer] page_size Number of records to return, defaults to 50
116122
# @return [Page] Page of MessageInstance
117-
def page(page_token: :unset, page_number: :unset, page_size: :unset)
123+
def page(order: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
118124
params = Twilio::Values.of({
125+
'Order' => order,
119126
'PageToken' => page_token,
120127
'Page' => page_number,
121128
'PageSize' => page_size,

lib/twilio-ruby/rest/conversations/v1/service/conversation/message.rb

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,32 +72,36 @@ def create(author: :unset, body: :unset, date_created: :unset, date_updated: :un
7272
# Lists MessageInstance records from the API as a list.
7373
# Unlike stream(), this operation is eager and will load `limit` records into
7474
# memory before returning.
75+
# @param [message.OrderType] order The sort order of the returned messages. Can
76+
# be: `asc` (ascending) or `desc` (descending), with `asc` as the default.
7577
# @param [Integer] limit Upper limit for the number of records to return. stream()
7678
# guarantees to never return more than limit. Default is no limit
7779
# @param [Integer] page_size Number of records to fetch per request, when
7880
# not set will use the default value of 50 records. If no page_size is defined
7981
# but a limit is defined, stream() will attempt to read the limit with the most
8082
# efficient page size, i.e. min(limit, 1000)
8183
# @return [Array] Array of up to limit results
82-
def list(limit: nil, page_size: nil)
83-
self.stream(limit: limit, page_size: page_size).entries
84+
def list(order: :unset, limit: nil, page_size: nil)
85+
self.stream(order: order, limit: limit, page_size: page_size).entries
8486
end
8587

8688
##
8789
# Streams MessageInstance records from the API as an Enumerable.
8890
# This operation lazily loads records as efficiently as possible until the limit
8991
# is reached.
92+
# @param [message.OrderType] order The sort order of the returned messages. Can
93+
# be: `asc` (ascending) or `desc` (descending), with `asc` as the default.
9094
# @param [Integer] limit Upper limit for the number of records to return. stream()
9195
# guarantees to never return more than limit. Default is no limit.
9296
# @param [Integer] page_size Number of records to fetch per request, when
9397
# not set will use the default value of 50 records. If no page_size is defined
9498
# but a limit is defined, stream() will attempt to read the limit with the most
9599
# efficient page size, i.e. min(limit, 1000)
96100
# @return [Enumerable] Enumerable that will yield up to limit results
97-
def stream(limit: nil, page_size: nil)
101+
def stream(order: :unset, limit: nil, page_size: nil)
98102
limits = @version.read_limits(limit, page_size)
99103

100-
page = self.page(page_size: limits[:page_size], )
104+
page = self.page(order: order, page_size: limits[:page_size], )
101105

102106
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
103107
end
@@ -119,12 +123,15 @@ def each
119123
##
120124
# Retrieve a single page of MessageInstance records from the API.
121125
# Request is executed immediately.
126+
# @param [message.OrderType] order The sort order of the returned messages. Can
127+
# be: `asc` (ascending) or `desc` (descending), with `asc` as the default.
122128
# @param [String] page_token PageToken provided by the API
123129
# @param [Integer] page_number Page Number, this value is simply for client state
124130
# @param [Integer] page_size Number of records to return, defaults to 50
125131
# @return [Page] Page of MessageInstance
126-
def page(page_token: :unset, page_number: :unset, page_size: :unset)
132+
def page(order: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
127133
params = Twilio::Values.of({
134+
'Order' => order,
128135
'PageToken' => page_token,
129136
'Page' => page_number,
130137
'PageSize' => page_size,

lib/twilio-ruby/rest/insights/v1/call_summaries.rb

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,15 @@ def initialize(version)
4545
# processing_state
4646
# @param [call_summaries.SortBy] sort_by The sort_by
4747
# @param [String] subaccount The subaccount
48+
# @param [Boolean] abnormal_session The abnormal_session
4849
# @param [Integer] limit Upper limit for the number of records to return. stream()
4950
# guarantees to never return more than limit. Default is no limit
5051
# @param [Integer] page_size Number of records to fetch per request, when
5152
# not set will use the default value of 50 records. If no page_size is defined
5253
# but a limit is defined, stream() will attempt to read the limit with the most
5354
# efficient page size, i.e. min(limit, 1000)
5455
# @return [Array] Array of up to limit results
55-
def list(from: :unset, to: :unset, from_carrier: :unset, to_carrier: :unset, from_country_code: :unset, to_country_code: :unset, branded: :unset, verified_caller: :unset, has_tag: :unset, start_time: :unset, end_time: :unset, call_type: :unset, call_state: :unset, direction: :unset, processing_state: :unset, sort_by: :unset, subaccount: :unset, limit: nil, page_size: nil)
56+
def list(from: :unset, to: :unset, from_carrier: :unset, to_carrier: :unset, from_country_code: :unset, to_country_code: :unset, branded: :unset, verified_caller: :unset, has_tag: :unset, start_time: :unset, end_time: :unset, call_type: :unset, call_state: :unset, direction: :unset, processing_state: :unset, sort_by: :unset, subaccount: :unset, abnormal_session: :unset, limit: nil, page_size: nil)
5657
self.stream(
5758
from: from,
5859
to: to,
@@ -71,6 +72,7 @@ def list(from: :unset, to: :unset, from_carrier: :unset, to_carrier: :unset, fro
7172
processing_state: processing_state,
7273
sort_by: sort_by,
7374
subaccount: subaccount,
75+
abnormal_session: abnormal_session,
7476
limit: limit,
7577
page_size: page_size
7678
).entries
@@ -98,14 +100,15 @@ def list(from: :unset, to: :unset, from_carrier: :unset, to_carrier: :unset, fro
98100
# processing_state
99101
# @param [call_summaries.SortBy] sort_by The sort_by
100102
# @param [String] subaccount The subaccount
103+
# @param [Boolean] abnormal_session The abnormal_session
101104
# @param [Integer] limit Upper limit for the number of records to return. stream()
102105
# guarantees to never return more than limit. Default is no limit.
103106
# @param [Integer] page_size Number of records to fetch per request, when
104107
# not set will use the default value of 50 records. If no page_size is defined
105108
# but a limit is defined, stream() will attempt to read the limit with the most
106109
# efficient page size, i.e. min(limit, 1000)
107110
# @return [Enumerable] Enumerable that will yield up to limit results
108-
def stream(from: :unset, to: :unset, from_carrier: :unset, to_carrier: :unset, from_country_code: :unset, to_country_code: :unset, branded: :unset, verified_caller: :unset, has_tag: :unset, start_time: :unset, end_time: :unset, call_type: :unset, call_state: :unset, direction: :unset, processing_state: :unset, sort_by: :unset, subaccount: :unset, limit: nil, page_size: nil)
111+
def stream(from: :unset, to: :unset, from_carrier: :unset, to_carrier: :unset, from_country_code: :unset, to_country_code: :unset, branded: :unset, verified_caller: :unset, has_tag: :unset, start_time: :unset, end_time: :unset, call_type: :unset, call_state: :unset, direction: :unset, processing_state: :unset, sort_by: :unset, subaccount: :unset, abnormal_session: :unset, limit: nil, page_size: nil)
109112
limits = @version.read_limits(limit, page_size)
110113

111114
page = self.page(
@@ -126,6 +129,7 @@ def stream(from: :unset, to: :unset, from_carrier: :unset, to_carrier: :unset, f
126129
processing_state: processing_state,
127130
sort_by: sort_by,
128131
subaccount: subaccount,
132+
abnormal_session: abnormal_session,
129133
page_size: limits[:page_size],
130134
)
131135

@@ -167,11 +171,12 @@ def each
167171
# processing_state
168172
# @param [call_summaries.SortBy] sort_by The sort_by
169173
# @param [String] subaccount The subaccount
174+
# @param [Boolean] abnormal_session The abnormal_session
170175
# @param [String] page_token PageToken provided by the API
171176
# @param [Integer] page_number Page Number, this value is simply for client state
172177
# @param [Integer] page_size Number of records to return, defaults to 50
173178
# @return [Page] Page of CallSummariesInstance
174-
def page(from: :unset, to: :unset, from_carrier: :unset, to_carrier: :unset, from_country_code: :unset, to_country_code: :unset, branded: :unset, verified_caller: :unset, has_tag: :unset, start_time: :unset, end_time: :unset, call_type: :unset, call_state: :unset, direction: :unset, processing_state: :unset, sort_by: :unset, subaccount: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
179+
def page(from: :unset, to: :unset, from_carrier: :unset, to_carrier: :unset, from_country_code: :unset, to_country_code: :unset, branded: :unset, verified_caller: :unset, has_tag: :unset, start_time: :unset, end_time: :unset, call_type: :unset, call_state: :unset, direction: :unset, processing_state: :unset, sort_by: :unset, subaccount: :unset, abnormal_session: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
175180
params = Twilio::Values.of({
176181
'From' => Twilio.serialize_list(from) { |e| e },
177182
'To' => Twilio.serialize_list(to) { |e| e },
@@ -190,6 +195,7 @@ def page(from: :unset, to: :unset, from_carrier: :unset, to_carrier: :unset, fro
190195
'ProcessingState' => processing_state,
191196
'SortBy' => sort_by,
192197
'Subaccount' => subaccount,
198+
'AbnormalSession' => abnormal_session,
193199
'PageToken' => page_token,
194200
'Page' => page_number,
195201
'PageSize' => page_size,

lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person_usecase.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,13 @@ def initialize(version, messaging_service_sid: nil)
3030

3131
##
3232
# Fetch the UsAppToPersonUsecaseInstance
33+
# @param [String] brand_registration_sid The unique string to identify the A2P
34+
# brand.
3335
# @return [UsAppToPersonUsecaseInstance] Fetched UsAppToPersonUsecaseInstance
34-
def fetch
35-
payload = @version.fetch('GET', @uri)
36+
def fetch(brand_registration_sid: :unset)
37+
params = Twilio::Values.of({'BrandRegistrationSid' => brand_registration_sid, })
38+
39+
payload = @version.fetch('GET', @uri, params: params)
3640

3741
UsAppToPersonUsecaseInstance.new(
3842
@version,

lib/twilio-ruby/rest/pricing.rb

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,25 @@ def voice
5353
self.v2.voice()
5454
end
5555

56+
##
57+
# @param [String] iso_country The {ISO country
58+
# code}[https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2].
59+
# @return [Twilio::REST::Pricing::V2::CountryInstance] if iso_country was passed.
60+
# @return [Twilio::REST::Pricing::V2::CountryList]
61+
def countries(iso_country=:unset)
62+
self.v2.countries(iso_country)
63+
end
64+
65+
##
66+
# @param [String] destination_number The destination phone number in
67+
# {E.164}[https://www.twilio.com/docs/glossary/what-e164] format, which consists
68+
# of a + followed by the country code and subscriber number.
69+
# @return [Twilio::REST::Pricing::V2::NumberInstance] if destination_number was passed.
70+
# @return [Twilio::REST::Pricing::V2::NumberList]
71+
def numbers(destination_number=:unset)
72+
self.v2.numbers(destination_number)
73+
end
74+
5675
##
5776
# Provide a user friendly representation
5877
def to_s

lib/twilio-ruby/rest/pricing/v2.rb

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,46 @@ class V2 < Version
1515
def initialize(domain)
1616
super
1717
@version = 'v2'
18+
@countries = nil
19+
@numbers = nil
1820
@voice = nil
1921
end
2022

23+
##
24+
# @param [String] iso_country The {ISO country
25+
# code}[https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2] of the origin-based
26+
# voice pricing information to fetch.
27+
# @return [Twilio::REST::Pricing::V2::CountryContext] if iso_country was passed.
28+
# @return [Twilio::REST::Pricing::V2::CountryList]
29+
def countries(iso_country=:unset)
30+
if iso_country.nil?
31+
raise ArgumentError, 'iso_country cannot be nil'
32+
end
33+
if iso_country == :unset
34+
@countries ||= CountryList.new self
35+
else
36+
CountryContext.new(self, iso_country)
37+
end
38+
end
39+
40+
##
41+
# @param [String] destination_number The destination phone number, in
42+
# {E.164}[https://www.twilio.com/docs/glossary/what-e164] format, for which to
43+
# fetch the origin-based voice pricing information. E.164 format consists of a +
44+
# followed by the country code and subscriber number.
45+
# @return [Twilio::REST::Pricing::V2::NumberContext] if destination_number was passed.
46+
# @return [Twilio::REST::Pricing::V2::NumberList]
47+
def numbers(destination_number=:unset)
48+
if destination_number.nil?
49+
raise ArgumentError, 'destination_number cannot be nil'
50+
end
51+
if destination_number == :unset
52+
@numbers ||= NumberList.new self
53+
else
54+
NumberContext.new(self, destination_number)
55+
end
56+
end
57+
2158
##
2259
# @return [Twilio::REST::Pricing::V2::VoiceContext]
2360
def voice

0 commit comments

Comments
 (0)