twilio-ruby 5.56.0 → 5.58.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/.travis.yml +24 -7
- data/CHANGES.md +76 -0
- data/Gemfile +1 -0
- data/README.md +2 -2
- data/examples/examples.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/call.rb +12 -3
- data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +4 -1
- data/lib/twilio-ruby/rest/api/v2010/account/conference/recording.rb +1 -1
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/credential_list_mapping.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.rb +11 -11
- data/lib/twilio-ruby/rest/conversations/v1/conversation/message.rb +12 -5
- data/lib/twilio-ruby/rest/conversations/v1/participant_conversation.rb +312 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message.rb +12 -5
- data/lib/twilio-ruby/rest/conversations/v1/service/participant_conversation.rb +324 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/user/user_conversation.rb +466 -0
- data/lib/twilio-ruby/rest/conversations/v1/service/user.rb +44 -0
- data/lib/twilio-ruby/rest/conversations/v1/service.rb +23 -0
- data/lib/twilio-ruby/rest/conversations/v1/user/user_conversation.rb +442 -0
- data/lib/twilio-ruby/rest/conversations/v1/user.rb +35 -0
- data/lib/twilio-ruby/rest/conversations/v1.rb +7 -0
- data/lib/twilio-ruby/rest/conversations.rb +6 -0
- data/lib/twilio-ruby/rest/insights/v1/call_summaries.rb +434 -0
- data/lib/twilio-ruby/rest/insights/v1.rb +7 -0
- data/lib/twilio-ruby/rest/insights.rb +6 -0
- data/lib/twilio-ruby/rest/messaging/v1/brand_registration.rb +19 -1
- data/lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person_usecase.rb +6 -2
- data/lib/twilio-ruby/rest/pricing/v2/country.rb +280 -0
- data/lib/twilio-ruby/rest/pricing/v2/number.rb +225 -0
- data/lib/twilio-ruby/rest/pricing/v2.rb +37 -0
- data/lib/twilio-ruby/rest/pricing.rb +19 -0
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb +7 -0
- data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb +26 -5
- data/lib/twilio-ruby/rest/verify/v2/service/webhook.rb +24 -5
- data/lib/twilio-ruby/version.rb +1 -1
- data/sonar-project.properties +13 -0
- metadata +10 -2
@@ -15,9 +15,46 @@ module Twilio
|
|
15
15
|
def initialize(domain)
|
16
16
|
super
|
17
17
|
@version = 'v2'
|
18
|
+
@countries = nil
|
19
|
+
@numbers = nil
|
18
20
|
@voice = nil
|
19
21
|
end
|
20
22
|
|
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
|
+
|
21
58
|
##
|
22
59
|
# @return [Twilio::REST::Pricing::V2::VoiceContext]
|
23
60
|
def voice
|
@@ -53,6 +53,25 @@ module Twilio
|
|
53
53
|
self.v2.voice()
|
54
54
|
end
|
55
55
|
|
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
|
+
|
56
75
|
##
|
57
76
|
# Provide a user friendly representation
|
58
77
|
def to_s
|
@@ -282,6 +282,7 @@ module Twilio
|
|
282
282
|
'sid' => payload['sid'],
|
283
283
|
'workspace_sid' => payload['workspace_sid'],
|
284
284
|
'url' => payload['url'],
|
285
|
+
'links' => payload['links'],
|
285
286
|
}
|
286
287
|
|
287
288
|
# Context
|
@@ -348,6 +349,12 @@ module Twilio
|
|
348
349
|
@properties['url']
|
349
350
|
end
|
350
351
|
|
352
|
+
##
|
353
|
+
# @return [String] The links
|
354
|
+
def links
|
355
|
+
@properties['links']
|
356
|
+
end
|
357
|
+
|
351
358
|
##
|
352
359
|
# Fetch the ActivityInstance
|
353
360
|
# @return [ActivityInstance] Fetched ActivityInstance
|
@@ -81,6 +81,9 @@ module Twilio
|
|
81
81
|
# @param [String] factor_sid The unique SID identifier of the Factor.
|
82
82
|
# @param [challenge.ChallengeStatuses] status The Status of the Challenges to
|
83
83
|
# fetch. One of `pending`, `expired`, `approved` or `denied`.
|
84
|
+
# @param [challenge.ListOrders] order The desired sort order of the Challenges
|
85
|
+
# list. One of `asc` or `desc` for ascending and descending respectively. Defaults
|
86
|
+
# to `asc`.
|
84
87
|
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
85
88
|
# guarantees to never return more than limit. Default is no limit
|
86
89
|
# @param [Integer] page_size Number of records to fetch per request, when
|
@@ -88,8 +91,14 @@ module Twilio
|
|
88
91
|
# but a limit is defined, stream() will attempt to read the limit with the most
|
89
92
|
# efficient page size, i.e. min(limit, 1000)
|
90
93
|
# @return [Array] Array of up to limit results
|
91
|
-
def list(factor_sid: :unset, status: :unset, limit: nil, page_size: nil)
|
92
|
-
self.stream(
|
94
|
+
def list(factor_sid: :unset, status: :unset, order: :unset, limit: nil, page_size: nil)
|
95
|
+
self.stream(
|
96
|
+
factor_sid: factor_sid,
|
97
|
+
status: status,
|
98
|
+
order: order,
|
99
|
+
limit: limit,
|
100
|
+
page_size: page_size
|
101
|
+
).entries
|
93
102
|
end
|
94
103
|
|
95
104
|
##
|
@@ -99,6 +108,9 @@ module Twilio
|
|
99
108
|
# @param [String] factor_sid The unique SID identifier of the Factor.
|
100
109
|
# @param [challenge.ChallengeStatuses] status The Status of the Challenges to
|
101
110
|
# fetch. One of `pending`, `expired`, `approved` or `denied`.
|
111
|
+
# @param [challenge.ListOrders] order The desired sort order of the Challenges
|
112
|
+
# list. One of `asc` or `desc` for ascending and descending respectively. Defaults
|
113
|
+
# to `asc`.
|
102
114
|
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
103
115
|
# guarantees to never return more than limit. Default is no limit.
|
104
116
|
# @param [Integer] page_size Number of records to fetch per request, when
|
@@ -106,10 +118,15 @@ module Twilio
|
|
106
118
|
# but a limit is defined, stream() will attempt to read the limit with the most
|
107
119
|
# efficient page size, i.e. min(limit, 1000)
|
108
120
|
# @return [Enumerable] Enumerable that will yield up to limit results
|
109
|
-
def stream(factor_sid: :unset, status: :unset, limit: nil, page_size: nil)
|
121
|
+
def stream(factor_sid: :unset, status: :unset, order: :unset, limit: nil, page_size: nil)
|
110
122
|
limits = @version.read_limits(limit, page_size)
|
111
123
|
|
112
|
-
page = self.page(
|
124
|
+
page = self.page(
|
125
|
+
factor_sid: factor_sid,
|
126
|
+
status: status,
|
127
|
+
order: order,
|
128
|
+
page_size: limits[:page_size],
|
129
|
+
)
|
113
130
|
|
114
131
|
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
115
132
|
end
|
@@ -134,14 +151,18 @@ module Twilio
|
|
134
151
|
# @param [String] factor_sid The unique SID identifier of the Factor.
|
135
152
|
# @param [challenge.ChallengeStatuses] status The Status of the Challenges to
|
136
153
|
# fetch. One of `pending`, `expired`, `approved` or `denied`.
|
154
|
+
# @param [challenge.ListOrders] order The desired sort order of the Challenges
|
155
|
+
# list. One of `asc` or `desc` for ascending and descending respectively. Defaults
|
156
|
+
# to `asc`.
|
137
157
|
# @param [String] page_token PageToken provided by the API
|
138
158
|
# @param [Integer] page_number Page Number, this value is simply for client state
|
139
159
|
# @param [Integer] page_size Number of records to return, defaults to 50
|
140
160
|
# @return [Page] Page of ChallengeInstance
|
141
|
-
def page(factor_sid: :unset, status: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
|
161
|
+
def page(factor_sid: :unset, status: :unset, order: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
|
142
162
|
params = Twilio::Values.of({
|
143
163
|
'FactorSid' => factor_sid,
|
144
164
|
'Status' => status,
|
165
|
+
'Order' => order,
|
145
166
|
'PageToken' => page_token,
|
146
167
|
'Page' => page_number,
|
147
168
|
'PageSize' => page_size,
|
@@ -37,13 +37,17 @@ module Twilio
|
|
37
37
|
# @param [String] webhook_url The URL associated with this Webhook.
|
38
38
|
# @param [webhook.Status] status The webhook status. Default value is `enabled`.
|
39
39
|
# One of: `enabled` or `disabled`
|
40
|
+
# @param [webhook.Version] version The webhook version. Default value is `v2`
|
41
|
+
# which includes all the latest fields. Version `v1` is legacy and may be removed
|
42
|
+
# in the future.
|
40
43
|
# @return [WebhookInstance] Created WebhookInstance
|
41
|
-
def create(friendly_name: nil, event_types: nil, webhook_url: nil, status: :unset)
|
44
|
+
def create(friendly_name: nil, event_types: nil, webhook_url: nil, status: :unset, version: :unset)
|
42
45
|
data = Twilio::Values.of({
|
43
46
|
'FriendlyName' => friendly_name,
|
44
47
|
'EventTypes' => Twilio.serialize_list(event_types) { |e| e },
|
45
48
|
'WebhookUrl' => webhook_url,
|
46
49
|
'Status' => status,
|
50
|
+
'Version' => version,
|
47
51
|
})
|
48
52
|
|
49
53
|
payload = @version.create('POST', @uri, data: data)
|
@@ -197,13 +201,17 @@ module Twilio
|
|
197
201
|
# @param [String] webhook_url The URL associated with this Webhook.
|
198
202
|
# @param [webhook.Status] status The webhook status. Default value is `enabled`.
|
199
203
|
# One of: `enabled` or `disabled`
|
204
|
+
# @param [webhook.Version] version The webhook version. Default value is `v2`
|
205
|
+
# which includes all the latest fields. Version `v1` is legacy and may be removed
|
206
|
+
# in the future.
|
200
207
|
# @return [WebhookInstance] Updated WebhookInstance
|
201
|
-
def update(friendly_name: :unset, event_types: :unset, webhook_url: :unset, status: :unset)
|
208
|
+
def update(friendly_name: :unset, event_types: :unset, webhook_url: :unset, status: :unset, version: :unset)
|
202
209
|
data = Twilio::Values.of({
|
203
210
|
'FriendlyName' => friendly_name,
|
204
211
|
'EventTypes' => Twilio.serialize_list(event_types) { |e| e },
|
205
212
|
'WebhookUrl' => webhook_url,
|
206
213
|
'Status' => status,
|
214
|
+
'Version' => version,
|
207
215
|
})
|
208
216
|
|
209
217
|
payload = @version.update('POST', @uri, data: data)
|
@@ -264,6 +272,7 @@ module Twilio
|
|
264
272
|
'friendly_name' => payload['friendly_name'],
|
265
273
|
'event_types' => payload['event_types'],
|
266
274
|
'status' => payload['status'],
|
275
|
+
'version' => payload['version'],
|
267
276
|
'webhook_url' => payload['webhook_url'],
|
268
277
|
'webhook_method' => payload['webhook_method'],
|
269
278
|
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
|
@@ -323,6 +332,12 @@ module Twilio
|
|
323
332
|
@properties['status']
|
324
333
|
end
|
325
334
|
|
335
|
+
##
|
336
|
+
# @return [webhook.Version] The webhook version
|
337
|
+
def version
|
338
|
+
@properties['version']
|
339
|
+
end
|
340
|
+
|
326
341
|
##
|
327
342
|
# @return [String] The URL associated with this Webhook.
|
328
343
|
def webhook_url
|
@@ -336,13 +351,13 @@ module Twilio
|
|
336
351
|
end
|
337
352
|
|
338
353
|
##
|
339
|
-
# @return [Time] The
|
354
|
+
# @return [Time] The ISO 8601 date and time in GMT when the resource was created
|
340
355
|
def date_created
|
341
356
|
@properties['date_created']
|
342
357
|
end
|
343
358
|
|
344
359
|
##
|
345
|
-
# @return [Time] The
|
360
|
+
# @return [Time] The ISO 8601 date and time in GMT when the resource was last updated
|
346
361
|
def date_updated
|
347
362
|
@properties['date_updated']
|
348
363
|
end
|
@@ -363,13 +378,17 @@ module Twilio
|
|
363
378
|
# @param [String] webhook_url The URL associated with this Webhook.
|
364
379
|
# @param [webhook.Status] status The webhook status. Default value is `enabled`.
|
365
380
|
# One of: `enabled` or `disabled`
|
381
|
+
# @param [webhook.Version] version The webhook version. Default value is `v2`
|
382
|
+
# which includes all the latest fields. Version `v1` is legacy and may be removed
|
383
|
+
# in the future.
|
366
384
|
# @return [WebhookInstance] Updated WebhookInstance
|
367
|
-
def update(friendly_name: :unset, event_types: :unset, webhook_url: :unset, status: :unset)
|
385
|
+
def update(friendly_name: :unset, event_types: :unset, webhook_url: :unset, status: :unset, version: :unset)
|
368
386
|
context.update(
|
369
387
|
friendly_name: friendly_name,
|
370
388
|
event_types: event_types,
|
371
389
|
webhook_url: webhook_url,
|
372
390
|
status: status,
|
391
|
+
version: version,
|
373
392
|
)
|
374
393
|
end
|
375
394
|
|
data/lib/twilio-ruby/version.rb
CHANGED
@@ -0,0 +1,13 @@
|
|
1
|
+
sonar.projectKey=twilio_twilio-ruby
|
2
|
+
sonar.projectName=twilio-ruby
|
3
|
+
sonar.organization=twilio
|
4
|
+
|
5
|
+
sonar.sources=lib/twilio-ruby
|
6
|
+
# Exclude any auto-generated source code
|
7
|
+
sonar.exclusions=lib/twilio-ruby/rest/**/*
|
8
|
+
sonar.tests=spec/
|
9
|
+
# Exclude any auto-generated integration tests
|
10
|
+
sonar.test.exclusions=spec/integration/**/*.spec.rb
|
11
|
+
|
12
|
+
# For Code Coverage analysis
|
13
|
+
sonar.ruby.coverage.reportPaths=coverage/.resultset.sonarqube.json
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: twilio-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
4
|
+
version: 5.58.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Twilio API Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-08-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jwt
|
@@ -398,6 +398,7 @@ files:
|
|
398
398
|
- lib/twilio-ruby/rest/conversations/v1/conversation/participant.rb
|
399
399
|
- lib/twilio-ruby/rest/conversations/v1/conversation/webhook.rb
|
400
400
|
- lib/twilio-ruby/rest/conversations/v1/credential.rb
|
401
|
+
- lib/twilio-ruby/rest/conversations/v1/participant_conversation.rb
|
401
402
|
- lib/twilio-ruby/rest/conversations/v1/role.rb
|
402
403
|
- lib/twilio-ruby/rest/conversations/v1/service.rb
|
403
404
|
- lib/twilio-ruby/rest/conversations/v1/service/binding.rb
|
@@ -408,9 +409,12 @@ files:
|
|
408
409
|
- lib/twilio-ruby/rest/conversations/v1/service/conversation/message/delivery_receipt.rb
|
409
410
|
- lib/twilio-ruby/rest/conversations/v1/service/conversation/participant.rb
|
410
411
|
- lib/twilio-ruby/rest/conversations/v1/service/conversation/webhook.rb
|
412
|
+
- lib/twilio-ruby/rest/conversations/v1/service/participant_conversation.rb
|
411
413
|
- lib/twilio-ruby/rest/conversations/v1/service/role.rb
|
412
414
|
- lib/twilio-ruby/rest/conversations/v1/service/user.rb
|
415
|
+
- lib/twilio-ruby/rest/conversations/v1/service/user/user_conversation.rb
|
413
416
|
- lib/twilio-ruby/rest/conversations/v1/user.rb
|
417
|
+
- lib/twilio-ruby/rest/conversations/v1/user/user_conversation.rb
|
414
418
|
- lib/twilio-ruby/rest/events.rb
|
415
419
|
- lib/twilio-ruby/rest/events/v1.rb
|
416
420
|
- lib/twilio-ruby/rest/events/v1/event_type.rb
|
@@ -440,6 +444,7 @@ files:
|
|
440
444
|
- lib/twilio-ruby/rest/insights/v1/call/event.rb
|
441
445
|
- lib/twilio-ruby/rest/insights/v1/call/metric.rb
|
442
446
|
- lib/twilio-ruby/rest/insights/v1/call/summary.rb
|
447
|
+
- lib/twilio-ruby/rest/insights/v1/call_summaries.rb
|
443
448
|
- lib/twilio-ruby/rest/insights/v1/room.rb
|
444
449
|
- lib/twilio-ruby/rest/insights/v1/room/participant.rb
|
445
450
|
- lib/twilio-ruby/rest/ip_messaging.rb
|
@@ -570,6 +575,8 @@ files:
|
|
570
575
|
- lib/twilio-ruby/rest/pricing/v1/voice/country.rb
|
571
576
|
- lib/twilio-ruby/rest/pricing/v1/voice/number.rb
|
572
577
|
- lib/twilio-ruby/rest/pricing/v2.rb
|
578
|
+
- lib/twilio-ruby/rest/pricing/v2/country.rb
|
579
|
+
- lib/twilio-ruby/rest/pricing/v2/number.rb
|
573
580
|
- lib/twilio-ruby/rest/pricing/v2/voice.rb
|
574
581
|
- lib/twilio-ruby/rest/pricing/v2/voice/country.rb
|
575
582
|
- lib/twilio-ruby/rest/pricing/v2/voice/number.rb
|
@@ -749,6 +756,7 @@ files:
|
|
749
756
|
- lib/twilio-ruby/util.rb
|
750
757
|
- lib/twilio-ruby/util/configuration.rb
|
751
758
|
- lib/twilio-ruby/version.rb
|
759
|
+
- sonar-project.properties
|
752
760
|
- twilio-ruby.gemspec
|
753
761
|
homepage: https://github.com/twilio/twilio-ruby
|
754
762
|
licenses:
|