twilio-ruby 5.51.0 → 5.52.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +27 -0
- data/README.md +3 -2
- data/lib/twilio-ruby/rest/bulkexports/v1/export/export_custom_job.rb +1 -1
- data/lib/twilio-ruby/rest/bulkexports/v1/export/job.rb +1 -1
- data/lib/twilio-ruby/rest/events/v1/schema.rb +12 -12
- data/lib/twilio-ruby/rest/events/v1/schema/{schema_version.rb → version.rb} +37 -37
- data/lib/twilio-ruby/rest/events/v1/subscription/subscribed_event.rb +15 -12
- data/lib/twilio-ruby/rest/messaging/v1/service.rb +69 -26
- data/lib/twilio-ruby/rest/supersim/v1/sms_command.rb +6 -6
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +16 -4
- data/lib/twilio-ruby/rest/verify/v2/service.rb +61 -3
- data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb +39 -1
- data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge/notification.rb +202 -0
- data/lib/twilio-ruby/rest/verify/v2/service/entity/new_factor.rb +10 -5
- data/lib/twilio-ruby/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d99e1efb1e1e2c8f1ec1d259ad5b04698f53687fb7458c722a9bc6059ebbf0ad
|
4
|
+
data.tar.gz: 55d03d89201d62c477176cf9a7cc3febfe86af7a10f23803e447b78086ec7c20
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9bf624df014df8c56d9c8bb31d39d436f858ac008d05a501392cf801401f0e6784418c65153117184f4d0c50f494647dd0ba04f1e16d8c99597acfda9c0a69ab
|
7
|
+
data.tar.gz: cda0c92b279012c44b60921e177619c7af1570a2bb6c7afcee165b3c988d7530e18972c8f281c4c71e9f8dc4f58db687dbb0dfd56a1da4d84966e742e2da3cc0
|
data/CHANGES.md
CHANGED
@@ -1,6 +1,33 @@
|
|
1
1
|
twilio-ruby changelog
|
2
2
|
=====================
|
3
3
|
|
4
|
+
[2021-04-21] Version 5.52.0
|
5
|
+
---------------------------
|
6
|
+
**Api**
|
7
|
+
- Revert Update the conference participant create `from` and `to` param to be endpoint type for supporting client identifier and sip address
|
8
|
+
- Update the conference participant create `from` and `to` param to be endpoint type for supporting client identifier and sip address
|
9
|
+
|
10
|
+
**Bulkexports**
|
11
|
+
- moving enum to doc root for auto generating documentation
|
12
|
+
- adding status enum and default output properties
|
13
|
+
|
14
|
+
**Events**
|
15
|
+
- Change schema_versions prop and key to versions **(breaking change)**
|
16
|
+
|
17
|
+
**Messaging**
|
18
|
+
- Add `use_inbound_webhook_on_number` field in Service API for fetch, create, update, read
|
19
|
+
|
20
|
+
**Taskrouter**
|
21
|
+
- Add `If-Match` Header based on ETag for Task Delete
|
22
|
+
|
23
|
+
**Verify**
|
24
|
+
- Add `AuthPayload` parameter to support verifying a `Challenge` upon creation. This is only supported for `totp` factors.
|
25
|
+
- Add support to resend the notifications of a `Challenge`. This is only supported for `push` factors.
|
26
|
+
|
27
|
+
**Twiml**
|
28
|
+
- Add Polly Neural voices.
|
29
|
+
|
30
|
+
|
4
31
|
[2021-04-07] Version 5.51.0
|
5
32
|
---------------------------
|
6
33
|
**Library - Chore**
|
data/README.md
CHANGED
@@ -24,6 +24,7 @@ This library supports the following Ruby implementations:
|
|
24
24
|
* Ruby 2.5
|
25
25
|
* Ruby 2.6
|
26
26
|
* Ruby 2.7
|
27
|
+
* Ruby 3.0
|
27
28
|
|
28
29
|
### Migrating from 4.x
|
29
30
|
|
@@ -34,13 +35,13 @@ This library supports the following Ruby implementations:
|
|
34
35
|
To install using [Bundler][bundler] grab the latest stable version:
|
35
36
|
|
36
37
|
```ruby
|
37
|
-
gem 'twilio-ruby', '~> 5.
|
38
|
+
gem 'twilio-ruby', '~> 5.52.0'
|
38
39
|
```
|
39
40
|
|
40
41
|
To manually install `twilio-ruby` via [Rubygems][rubygems] simply gem install:
|
41
42
|
|
42
43
|
```bash
|
43
|
-
gem install twilio-ruby -v 5.
|
44
|
+
gem install twilio-ruby -v 5.52.0
|
44
45
|
```
|
45
46
|
|
46
47
|
To build and install the development branch yourself from the latest source:
|
@@ -256,7 +256,7 @@ module Twilio
|
|
256
256
|
end
|
257
257
|
|
258
258
|
##
|
259
|
-
# @return [Hash] The details of a job state which is an object that contains a status string, a day count integer, and list of days in the job
|
259
|
+
# @return [Hash] The details of a job state which is an object that contains a `status` string, a day count integer, and list of days in the job
|
260
260
|
def details
|
261
261
|
@properties['details']
|
262
262
|
end
|
@@ -169,7 +169,7 @@ module Twilio
|
|
169
169
|
end
|
170
170
|
|
171
171
|
##
|
172
|
-
# @return [Hash]
|
172
|
+
# @return [Hash] The details of a job state which is an object that contains a `status` string, a day count integer, and list of days in the job
|
173
173
|
def details
|
174
174
|
@properties['details']
|
175
175
|
end
|
@@ -93,17 +93,17 @@ module Twilio
|
|
93
93
|
|
94
94
|
##
|
95
95
|
# Access the versions
|
96
|
-
# @return [
|
97
|
-
# @return [
|
96
|
+
# @return [SchemaVersionList]
|
97
|
+
# @return [SchemaVersionContext] if schema_version was passed.
|
98
98
|
def versions(schema_version=:unset)
|
99
99
|
raise ArgumentError, 'schema_version cannot be nil' if schema_version.nil?
|
100
100
|
|
101
101
|
if schema_version != :unset
|
102
|
-
return
|
102
|
+
return SchemaVersionContext.new(@version, @solution[:id], schema_version, )
|
103
103
|
end
|
104
104
|
|
105
105
|
unless @versions
|
106
|
-
@versions =
|
106
|
+
@versions = SchemaVersionList.new(@version, id: @solution[:id], )
|
107
107
|
end
|
108
108
|
|
109
109
|
@versions
|
@@ -142,8 +142,8 @@ module Twilio
|
|
142
142
|
'id' => payload['id'],
|
143
143
|
'url' => payload['url'],
|
144
144
|
'links' => payload['links'],
|
145
|
-
'
|
146
|
-
'
|
145
|
+
'latest_version_date_created' => Twilio.deserialize_iso8601_datetime(payload['latest_version_date_created']),
|
146
|
+
'latest_version' => payload['latest_version'].to_i,
|
147
147
|
}
|
148
148
|
|
149
149
|
# Context
|
@@ -181,15 +181,15 @@ module Twilio
|
|
181
181
|
end
|
182
182
|
|
183
183
|
##
|
184
|
-
# @return [Time] The date that the
|
185
|
-
def
|
186
|
-
@properties['
|
184
|
+
# @return [Time] The date that the latest schema version was created.
|
185
|
+
def latest_version_date_created
|
186
|
+
@properties['latest_version_date_created']
|
187
187
|
end
|
188
188
|
|
189
189
|
##
|
190
|
-
# @return [String]
|
191
|
-
def
|
192
|
-
@properties['
|
190
|
+
# @return [String] Latest schema version.
|
191
|
+
def latest_version
|
192
|
+
@properties['latest_version']
|
193
193
|
end
|
194
194
|
|
195
195
|
##
|
@@ -13,13 +13,13 @@ module Twilio
|
|
13
13
|
class SchemaContext < InstanceContext
|
14
14
|
##
|
15
15
|
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
16
|
-
class
|
16
|
+
class SchemaVersionList < ListResource
|
17
17
|
##
|
18
|
-
# Initialize the
|
18
|
+
# Initialize the SchemaVersionList
|
19
19
|
# @param [Version] version Version that contains the resource
|
20
20
|
# @param [String] id The unique identifier of the schema. Each schema can have
|
21
21
|
# multiple versions, that share the same id.
|
22
|
-
# @return [
|
22
|
+
# @return [SchemaVersionList] SchemaVersionList
|
23
23
|
def initialize(version, id: nil)
|
24
24
|
super(version)
|
25
25
|
|
@@ -29,7 +29,7 @@ module Twilio
|
|
29
29
|
end
|
30
30
|
|
31
31
|
##
|
32
|
-
# Lists
|
32
|
+
# Lists SchemaVersionInstance records from the API as a list.
|
33
33
|
# Unlike stream(), this operation is eager and will load `limit` records into
|
34
34
|
# memory before returning.
|
35
35
|
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
@@ -44,7 +44,7 @@ module Twilio
|
|
44
44
|
end
|
45
45
|
|
46
46
|
##
|
47
|
-
# Streams
|
47
|
+
# Streams SchemaVersionInstance records from the API as an Enumerable.
|
48
48
|
# This operation lazily loads records as efficiently as possible until the limit
|
49
49
|
# is reached.
|
50
50
|
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
@@ -63,7 +63,7 @@ module Twilio
|
|
63
63
|
end
|
64
64
|
|
65
65
|
##
|
66
|
-
# When passed a block, yields
|
66
|
+
# When passed a block, yields SchemaVersionInstance records from the API.
|
67
67
|
# This operation lazily loads records as efficiently as possible until the limit
|
68
68
|
# is reached.
|
69
69
|
def each
|
@@ -77,12 +77,12 @@ module Twilio
|
|
77
77
|
end
|
78
78
|
|
79
79
|
##
|
80
|
-
# Retrieve a single page of
|
80
|
+
# Retrieve a single page of SchemaVersionInstance records from the API.
|
81
81
|
# Request is executed immediately.
|
82
82
|
# @param [String] page_token PageToken provided by the API
|
83
83
|
# @param [Integer] page_number Page Number, this value is simply for client state
|
84
84
|
# @param [Integer] page_size Number of records to return, defaults to 50
|
85
|
-
# @return [Page] Page of
|
85
|
+
# @return [Page] Page of SchemaVersionInstance
|
86
86
|
def page(page_token: :unset, page_number: :unset, page_size: :unset)
|
87
87
|
params = Twilio::Values.of({
|
88
88
|
'PageToken' => page_token,
|
@@ -92,38 +92,38 @@ module Twilio
|
|
92
92
|
|
93
93
|
response = @version.page('GET', @uri, params: params)
|
94
94
|
|
95
|
-
|
95
|
+
SchemaVersionPage.new(@version, response, @solution)
|
96
96
|
end
|
97
97
|
|
98
98
|
##
|
99
|
-
# Retrieve a single page of
|
99
|
+
# Retrieve a single page of SchemaVersionInstance records from the API.
|
100
100
|
# Request is executed immediately.
|
101
101
|
# @param [String] target_url API-generated URL for the requested results page
|
102
|
-
# @return [Page] Page of
|
102
|
+
# @return [Page] Page of SchemaVersionInstance
|
103
103
|
def get_page(target_url)
|
104
104
|
response = @version.domain.request(
|
105
105
|
'GET',
|
106
106
|
target_url
|
107
107
|
)
|
108
|
-
|
108
|
+
SchemaVersionPage.new(@version, response, @solution)
|
109
109
|
end
|
110
110
|
|
111
111
|
##
|
112
112
|
# Provide a user friendly representation
|
113
113
|
def to_s
|
114
|
-
'#<Twilio.Events.V1.
|
114
|
+
'#<Twilio.Events.V1.SchemaVersionList>'
|
115
115
|
end
|
116
116
|
end
|
117
117
|
|
118
118
|
##
|
119
119
|
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
120
|
-
class
|
120
|
+
class SchemaVersionPage < Page
|
121
121
|
##
|
122
|
-
# Initialize the
|
122
|
+
# Initialize the SchemaVersionPage
|
123
123
|
# @param [Version] version Version that contains the resource
|
124
124
|
# @param [Response] response Response from the API
|
125
125
|
# @param [Hash] solution Path solution for the resource
|
126
|
-
# @return [
|
126
|
+
# @return [SchemaVersionPage] SchemaVersionPage
|
127
127
|
def initialize(version, response, solution)
|
128
128
|
super(version, response)
|
129
129
|
|
@@ -132,30 +132,30 @@ module Twilio
|
|
132
132
|
end
|
133
133
|
|
134
134
|
##
|
135
|
-
# Build an instance of
|
135
|
+
# Build an instance of SchemaVersionInstance
|
136
136
|
# @param [Hash] payload Payload response from the API
|
137
|
-
# @return [
|
137
|
+
# @return [SchemaVersionInstance] SchemaVersionInstance
|
138
138
|
def get_instance(payload)
|
139
|
-
|
139
|
+
SchemaVersionInstance.new(@version, payload, id: @solution[:id], )
|
140
140
|
end
|
141
141
|
|
142
142
|
##
|
143
143
|
# Provide a user friendly representation
|
144
144
|
def to_s
|
145
|
-
'<Twilio.Events.V1.
|
145
|
+
'<Twilio.Events.V1.SchemaVersionPage>'
|
146
146
|
end
|
147
147
|
end
|
148
148
|
|
149
149
|
##
|
150
150
|
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
151
|
-
class
|
151
|
+
class SchemaVersionContext < InstanceContext
|
152
152
|
##
|
153
|
-
# Initialize the
|
153
|
+
# Initialize the SchemaVersionContext
|
154
154
|
# @param [Version] version Version that contains the resource
|
155
155
|
# @param [String] id The unique identifier of the schema. Each schema can have
|
156
156
|
# multiple versions, that share the same id.
|
157
157
|
# @param [String] schema_version The version of the schema
|
158
|
-
# @return [
|
158
|
+
# @return [SchemaVersionContext] SchemaVersionContext
|
159
159
|
def initialize(version, id, schema_version)
|
160
160
|
super(version)
|
161
161
|
|
@@ -165,12 +165,12 @@ module Twilio
|
|
165
165
|
end
|
166
166
|
|
167
167
|
##
|
168
|
-
# Fetch the
|
169
|
-
# @return [
|
168
|
+
# Fetch the SchemaVersionInstance
|
169
|
+
# @return [SchemaVersionInstance] Fetched SchemaVersionInstance
|
170
170
|
def fetch
|
171
171
|
payload = @version.fetch('GET', @uri)
|
172
172
|
|
173
|
-
|
173
|
+
SchemaVersionInstance.new(
|
174
174
|
@version,
|
175
175
|
payload,
|
176
176
|
id: @solution[:id],
|
@@ -182,28 +182,28 @@ module Twilio
|
|
182
182
|
# Provide a user friendly representation
|
183
183
|
def to_s
|
184
184
|
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
185
|
-
"#<Twilio.Events.V1.
|
185
|
+
"#<Twilio.Events.V1.SchemaVersionContext #{context}>"
|
186
186
|
end
|
187
187
|
|
188
188
|
##
|
189
189
|
# Provide a detailed, user friendly representation
|
190
190
|
def inspect
|
191
191
|
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
192
|
-
"#<Twilio.Events.V1.
|
192
|
+
"#<Twilio.Events.V1.SchemaVersionContext #{context}>"
|
193
193
|
end
|
194
194
|
end
|
195
195
|
|
196
196
|
##
|
197
197
|
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
198
|
-
class
|
198
|
+
class SchemaVersionInstance < InstanceResource
|
199
199
|
##
|
200
|
-
# Initialize the
|
200
|
+
# Initialize the SchemaVersionInstance
|
201
201
|
# @param [Version] version Version that contains the resource
|
202
202
|
# @param [Hash] payload payload that contains response from Twilio
|
203
203
|
# @param [String] id The unique identifier of the schema. Each schema can have
|
204
204
|
# multiple versions, that share the same id.
|
205
205
|
# @param [String] schema_version The version of the schema
|
206
|
-
# @return [
|
206
|
+
# @return [SchemaVersionInstance] SchemaVersionInstance
|
207
207
|
def initialize(version, payload, id: nil, schema_version: nil)
|
208
208
|
super(version)
|
209
209
|
|
@@ -224,10 +224,10 @@ module Twilio
|
|
224
224
|
##
|
225
225
|
# Generate an instance context for the instance, the context is capable of
|
226
226
|
# performing various actions. All instance actions are proxied to the context
|
227
|
-
# @return [
|
227
|
+
# @return [SchemaVersionContext] SchemaVersionContext for this SchemaVersionInstance
|
228
228
|
def context
|
229
229
|
unless @instance_context
|
230
|
-
@instance_context =
|
230
|
+
@instance_context = SchemaVersionContext.new(@version, @params['id'], @params['schema_version'], )
|
231
231
|
end
|
232
232
|
@instance_context
|
233
233
|
end
|
@@ -263,8 +263,8 @@ module Twilio
|
|
263
263
|
end
|
264
264
|
|
265
265
|
##
|
266
|
-
# Fetch the
|
267
|
-
# @return [
|
266
|
+
# Fetch the SchemaVersionInstance
|
267
|
+
# @return [SchemaVersionInstance] Fetched SchemaVersionInstance
|
268
268
|
def fetch
|
269
269
|
context.fetch
|
270
270
|
end
|
@@ -273,14 +273,14 @@ module Twilio
|
|
273
273
|
# Provide a user friendly representation
|
274
274
|
def to_s
|
275
275
|
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
276
|
-
"<Twilio.Events.V1.
|
276
|
+
"<Twilio.Events.V1.SchemaVersionInstance #{values}>"
|
277
277
|
end
|
278
278
|
|
279
279
|
##
|
280
280
|
# Provide a detailed, user friendly representation
|
281
281
|
def inspect
|
282
282
|
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
283
|
-
"<Twilio.Events.V1.
|
283
|
+
"<Twilio.Events.V1.SchemaVersionInstance #{values}>"
|
284
284
|
end
|
285
285
|
end
|
286
286
|
end
|
@@ -110,10 +110,11 @@ module Twilio
|
|
110
110
|
##
|
111
111
|
# Create the SubscribedEventInstance
|
112
112
|
# @param [String] type Type of event being subscribed to.
|
113
|
-
# @param [String]
|
113
|
+
# @param [String] schema_version The schema version that the subscription should
|
114
|
+
# use.
|
114
115
|
# @return [SubscribedEventInstance] Created SubscribedEventInstance
|
115
|
-
def create(type: nil,
|
116
|
-
data = Twilio::Values.of({'Type' => type, '
|
116
|
+
def create(type: nil, schema_version: :unset)
|
117
|
+
data = Twilio::Values.of({'Type' => type, 'SchemaVersion' => schema_version, })
|
117
118
|
|
118
119
|
payload = @version.create('POST', @uri, data: data)
|
119
120
|
|
@@ -191,10 +192,11 @@ module Twilio
|
|
191
192
|
|
192
193
|
##
|
193
194
|
# Update the SubscribedEventInstance
|
194
|
-
# @param [String]
|
195
|
+
# @param [String] schema_version The schema version that the subscription should
|
196
|
+
# use.
|
195
197
|
# @return [SubscribedEventInstance] Updated SubscribedEventInstance
|
196
|
-
def update(
|
197
|
-
data = Twilio::Values.of({'
|
198
|
+
def update(schema_version: :unset)
|
199
|
+
data = Twilio::Values.of({'SchemaVersion' => schema_version, })
|
198
200
|
|
199
201
|
payload = @version.update('POST', @uri, data: data)
|
200
202
|
|
@@ -245,7 +247,7 @@ module Twilio
|
|
245
247
|
@properties = {
|
246
248
|
'account_sid' => payload['account_sid'],
|
247
249
|
'type' => payload['type'],
|
248
|
-
'
|
250
|
+
'schema_version' => payload['schema_version'].to_i,
|
249
251
|
'subscription_sid' => payload['subscription_sid'],
|
250
252
|
'url' => payload['url'],
|
251
253
|
}
|
@@ -284,8 +286,8 @@ module Twilio
|
|
284
286
|
|
285
287
|
##
|
286
288
|
# @return [String] The schema version that the subscription should use.
|
287
|
-
def
|
288
|
-
@properties['
|
289
|
+
def schema_version
|
290
|
+
@properties['schema_version']
|
289
291
|
end
|
290
292
|
|
291
293
|
##
|
@@ -309,10 +311,11 @@ module Twilio
|
|
309
311
|
|
310
312
|
##
|
311
313
|
# Update the SubscribedEventInstance
|
312
|
-
# @param [String]
|
314
|
+
# @param [String] schema_version The schema version that the subscription should
|
315
|
+
# use.
|
313
316
|
# @return [SubscribedEventInstance] Updated SubscribedEventInstance
|
314
|
-
def update(
|
315
|
-
context.update(
|
317
|
+
def update(schema_version: :unset)
|
318
|
+
context.update(schema_version: schema_version, )
|
316
319
|
end
|
317
320
|
|
318
321
|
##
|
@@ -29,15 +29,20 @@ module Twilio
|
|
29
29
|
# Create the ServiceInstance
|
30
30
|
# @param [String] friendly_name A descriptive string that you create to describe
|
31
31
|
# the resource. It can be up to 64 characters long.
|
32
|
-
# @param [String] inbound_request_url The URL we
|
33
|
-
#
|
34
|
-
#
|
35
|
-
#
|
32
|
+
# @param [String] inbound_request_url The URL we call using `inbound_method` when
|
33
|
+
# a message is received by any phone number or short code in the Service. When
|
34
|
+
# this property is `null`, receiving inbound messages is disabled. All messages
|
35
|
+
# sent to the Twilio phone number or short code will not be logged and received on
|
36
|
+
# the Account. If the `use_inbound_webhook_on_number` field is enabled then the
|
37
|
+
# webhook url defined on the phone number will override the `inbound_request_url`
|
38
|
+
# defined for the Messaging Service.
|
36
39
|
# @param [String] inbound_method The HTTP method we should use to call
|
37
40
|
# `inbound_request_url`. Can be `GET` or `POST` and the default is `POST`.
|
38
|
-
# @param [String] fallback_url The URL that we
|
39
|
-
#
|
40
|
-
#
|
41
|
+
# @param [String] fallback_url The URL that we call using `fallback_method` if an
|
42
|
+
# error occurs while retrieving or executing the TwiML from the Inbound Request
|
43
|
+
# URL. If the `use_inbound_webhook_on_number` field is enabled then the webhook
|
44
|
+
# url defined on the phone number will override the `fallback_url` defined for the
|
45
|
+
# Messaging Service.
|
41
46
|
# @param [String] fallback_method The HTTP method we should use to call
|
42
47
|
# `fallback_url`. Can be: `GET` or `POST`.
|
43
48
|
# @param [String] status_callback The URL we should call to {pass status
|
@@ -62,8 +67,14 @@ module Twilio
|
|
62
67
|
# @param [String] validity_period How long, in seconds, messages sent from the
|
63
68
|
# Service are valid. Can be an integer from `1` to `14,400`.
|
64
69
|
# @param [Boolean] synchronous_validation Reserved.
|
70
|
+
# @param [Boolean] use_inbound_webhook_on_number A boolean value that indicates
|
71
|
+
# either the webhook url configured on the phone number will be used or
|
72
|
+
# `inbound_request_url`/`fallback_url` url will be called when a message is
|
73
|
+
# received from the phone number. If this field is enabled then the webhook url
|
74
|
+
# defined on the phone number will override the
|
75
|
+
# `inbound_request_url`/`fallback_url` defined for the Messaging Service.
|
65
76
|
# @return [ServiceInstance] Created ServiceInstance
|
66
|
-
def create(friendly_name: nil, inbound_request_url: :unset, inbound_method: :unset, fallback_url: :unset, fallback_method: :unset, status_callback: :unset, sticky_sender: :unset, mms_converter: :unset, smart_encoding: :unset, scan_message_content: :unset, fallback_to_long_code: :unset, area_code_geomatch: :unset, validity_period: :unset, synchronous_validation: :unset)
|
77
|
+
def create(friendly_name: nil, inbound_request_url: :unset, inbound_method: :unset, fallback_url: :unset, fallback_method: :unset, status_callback: :unset, sticky_sender: :unset, mms_converter: :unset, smart_encoding: :unset, scan_message_content: :unset, fallback_to_long_code: :unset, area_code_geomatch: :unset, validity_period: :unset, synchronous_validation: :unset, use_inbound_webhook_on_number: :unset)
|
67
78
|
data = Twilio::Values.of({
|
68
79
|
'FriendlyName' => friendly_name,
|
69
80
|
'InboundRequestUrl' => inbound_request_url,
|
@@ -79,6 +90,7 @@ module Twilio
|
|
79
90
|
'AreaCodeGeomatch' => area_code_geomatch,
|
80
91
|
'ValidityPeriod' => validity_period,
|
81
92
|
'SynchronousValidation' => synchronous_validation,
|
93
|
+
'UseInboundWebhookOnNumber' => use_inbound_webhook_on_number,
|
82
94
|
})
|
83
95
|
|
84
96
|
payload = @version.create('POST', @uri, data: data)
|
@@ -231,15 +243,20 @@ module Twilio
|
|
231
243
|
# Update the ServiceInstance
|
232
244
|
# @param [String] friendly_name A descriptive string that you create to describe
|
233
245
|
# the resource. It can be up to 64 characters long.
|
234
|
-
# @param [String] inbound_request_url The URL we
|
235
|
-
#
|
236
|
-
#
|
237
|
-
#
|
246
|
+
# @param [String] inbound_request_url The URL we call using `inbound_method` when
|
247
|
+
# a message is received by any phone number or short code in the Service. When
|
248
|
+
# this property is `null`, receiving inbound messages is disabled. All messages
|
249
|
+
# sent to the Twilio phone number or short code will not be logged and received on
|
250
|
+
# the Account. If the `use_inbound_webhook_on_number` field is enabled then the
|
251
|
+
# webhook url defined on the phone number will override the `inbound_request_url`
|
252
|
+
# defined for the Messaging Service.
|
238
253
|
# @param [String] inbound_method The HTTP method we should use to call
|
239
254
|
# `inbound_request_url`. Can be `GET` or `POST` and the default is `POST`.
|
240
|
-
# @param [String] fallback_url The URL that we
|
241
|
-
#
|
242
|
-
#
|
255
|
+
# @param [String] fallback_url The URL that we call using `fallback_method` if an
|
256
|
+
# error occurs while retrieving or executing the TwiML from the Inbound Request
|
257
|
+
# URL. If the `use_inbound_webhook_on_number` field is enabled then the webhook
|
258
|
+
# url defined on the phone number will override the `fallback_url` defined for the
|
259
|
+
# Messaging Service.
|
243
260
|
# @param [String] fallback_method The HTTP method we should use to call
|
244
261
|
# `fallback_url`. Can be: `GET` or `POST`.
|
245
262
|
# @param [String] status_callback The URL we should call to {pass status
|
@@ -264,8 +281,14 @@ module Twilio
|
|
264
281
|
# @param [String] validity_period How long, in seconds, messages sent from the
|
265
282
|
# Service are valid. Can be an integer from `1` to `14,400`.
|
266
283
|
# @param [Boolean] synchronous_validation Reserved.
|
284
|
+
# @param [Boolean] use_inbound_webhook_on_number A boolean value that indicates
|
285
|
+
# either the webhook url configured on the phone number will be used or
|
286
|
+
# `inbound_request_url`/`fallback_url` url will be called when a message is
|
287
|
+
# received from the phone number. If this field is enabled then the webhook url
|
288
|
+
# defined on the phone number will override the
|
289
|
+
# `inbound_request_url`/`fallback_url` defined for the Messaging Service.
|
267
290
|
# @return [ServiceInstance] Updated ServiceInstance
|
268
|
-
def update(friendly_name: :unset, inbound_request_url: :unset, inbound_method: :unset, fallback_url: :unset, fallback_method: :unset, status_callback: :unset, sticky_sender: :unset, mms_converter: :unset, smart_encoding: :unset, scan_message_content: :unset, fallback_to_long_code: :unset, area_code_geomatch: :unset, validity_period: :unset, synchronous_validation: :unset)
|
291
|
+
def update(friendly_name: :unset, inbound_request_url: :unset, inbound_method: :unset, fallback_url: :unset, fallback_method: :unset, status_callback: :unset, sticky_sender: :unset, mms_converter: :unset, smart_encoding: :unset, scan_message_content: :unset, fallback_to_long_code: :unset, area_code_geomatch: :unset, validity_period: :unset, synchronous_validation: :unset, use_inbound_webhook_on_number: :unset)
|
269
292
|
data = Twilio::Values.of({
|
270
293
|
'FriendlyName' => friendly_name,
|
271
294
|
'InboundRequestUrl' => inbound_request_url,
|
@@ -281,6 +304,7 @@ module Twilio
|
|
281
304
|
'AreaCodeGeomatch' => area_code_geomatch,
|
282
305
|
'ValidityPeriod' => validity_period,
|
283
306
|
'SynchronousValidation' => synchronous_validation,
|
307
|
+
'UseInboundWebhookOnNumber' => use_inbound_webhook_on_number,
|
284
308
|
})
|
285
309
|
|
286
310
|
payload = @version.update('POST', @uri, data: data)
|
@@ -434,6 +458,7 @@ module Twilio
|
|
434
458
|
'validity_period' => payload['validity_period'].to_i,
|
435
459
|
'url' => payload['url'],
|
436
460
|
'links' => payload['links'],
|
461
|
+
'use_inbound_webhook_on_number' => payload['use_inbound_webhook_on_number'],
|
437
462
|
}
|
438
463
|
|
439
464
|
# Context
|
@@ -483,7 +508,7 @@ module Twilio
|
|
483
508
|
end
|
484
509
|
|
485
510
|
##
|
486
|
-
# @return [String] The URL we call using inbound_method when a message is received by any phone number or short code in the Service
|
511
|
+
# @return [String] The URL we call using inbound_method when a message is received by any phone number or short code in the Service. This field will be overridden if the `use_inbound_webhook_on_number` field is enabled.
|
487
512
|
def inbound_request_url
|
488
513
|
@properties['inbound_request_url']
|
489
514
|
end
|
@@ -495,7 +520,7 @@ module Twilio
|
|
495
520
|
end
|
496
521
|
|
497
522
|
##
|
498
|
-
# @return [String] The URL that we call using fallback_method if an error occurs while retrieving or executing the TwiML from the Inbound Request URL
|
523
|
+
# @return [String] The URL that we call using fallback_method if an error occurs while retrieving or executing the TwiML from the Inbound Request URL. This field will be overridden if the `use_inbound_webhook_on_number` field is enabled.
|
499
524
|
def fallback_url
|
500
525
|
@properties['fallback_url']
|
501
526
|
end
|
@@ -572,19 +597,30 @@ module Twilio
|
|
572
597
|
@properties['links']
|
573
598
|
end
|
574
599
|
|
600
|
+
##
|
601
|
+
# @return [Boolean] If enabled, the webhook url configured on the phone number will be used and will override the `inbound_request_url`/`fallback_url` url called when an inbound message is received.
|
602
|
+
def use_inbound_webhook_on_number
|
603
|
+
@properties['use_inbound_webhook_on_number']
|
604
|
+
end
|
605
|
+
|
575
606
|
##
|
576
607
|
# Update the ServiceInstance
|
577
608
|
# @param [String] friendly_name A descriptive string that you create to describe
|
578
609
|
# the resource. It can be up to 64 characters long.
|
579
|
-
# @param [String] inbound_request_url The URL we
|
580
|
-
#
|
581
|
-
#
|
582
|
-
#
|
610
|
+
# @param [String] inbound_request_url The URL we call using `inbound_method` when
|
611
|
+
# a message is received by any phone number or short code in the Service. When
|
612
|
+
# this property is `null`, receiving inbound messages is disabled. All messages
|
613
|
+
# sent to the Twilio phone number or short code will not be logged and received on
|
614
|
+
# the Account. If the `use_inbound_webhook_on_number` field is enabled then the
|
615
|
+
# webhook url defined on the phone number will override the `inbound_request_url`
|
616
|
+
# defined for the Messaging Service.
|
583
617
|
# @param [String] inbound_method The HTTP method we should use to call
|
584
618
|
# `inbound_request_url`. Can be `GET` or `POST` and the default is `POST`.
|
585
|
-
# @param [String] fallback_url The URL that we
|
586
|
-
#
|
587
|
-
#
|
619
|
+
# @param [String] fallback_url The URL that we call using `fallback_method` if an
|
620
|
+
# error occurs while retrieving or executing the TwiML from the Inbound Request
|
621
|
+
# URL. If the `use_inbound_webhook_on_number` field is enabled then the webhook
|
622
|
+
# url defined on the phone number will override the `fallback_url` defined for the
|
623
|
+
# Messaging Service.
|
588
624
|
# @param [String] fallback_method The HTTP method we should use to call
|
589
625
|
# `fallback_url`. Can be: `GET` or `POST`.
|
590
626
|
# @param [String] status_callback The URL we should call to {pass status
|
@@ -609,8 +645,14 @@ module Twilio
|
|
609
645
|
# @param [String] validity_period How long, in seconds, messages sent from the
|
610
646
|
# Service are valid. Can be an integer from `1` to `14,400`.
|
611
647
|
# @param [Boolean] synchronous_validation Reserved.
|
648
|
+
# @param [Boolean] use_inbound_webhook_on_number A boolean value that indicates
|
649
|
+
# either the webhook url configured on the phone number will be used or
|
650
|
+
# `inbound_request_url`/`fallback_url` url will be called when a message is
|
651
|
+
# received from the phone number. If this field is enabled then the webhook url
|
652
|
+
# defined on the phone number will override the
|
653
|
+
# `inbound_request_url`/`fallback_url` defined for the Messaging Service.
|
612
654
|
# @return [ServiceInstance] Updated ServiceInstance
|
613
|
-
def update(friendly_name: :unset, inbound_request_url: :unset, inbound_method: :unset, fallback_url: :unset, fallback_method: :unset, status_callback: :unset, sticky_sender: :unset, mms_converter: :unset, smart_encoding: :unset, scan_message_content: :unset, fallback_to_long_code: :unset, area_code_geomatch: :unset, validity_period: :unset, synchronous_validation: :unset)
|
655
|
+
def update(friendly_name: :unset, inbound_request_url: :unset, inbound_method: :unset, fallback_url: :unset, fallback_method: :unset, status_callback: :unset, sticky_sender: :unset, mms_converter: :unset, smart_encoding: :unset, scan_message_content: :unset, fallback_to_long_code: :unset, area_code_geomatch: :unset, validity_period: :unset, synchronous_validation: :unset, use_inbound_webhook_on_number: :unset)
|
614
656
|
context.update(
|
615
657
|
friendly_name: friendly_name,
|
616
658
|
inbound_request_url: inbound_request_url,
|
@@ -626,6 +668,7 @@ module Twilio
|
|
626
668
|
area_code_geomatch: area_code_geomatch,
|
627
669
|
validity_period: validity_period,
|
628
670
|
synchronous_validation: synchronous_validation,
|
671
|
+
use_inbound_webhook_on_number: use_inbound_webhook_on_number,
|
629
672
|
)
|
630
673
|
end
|
631
674
|
|
@@ -53,8 +53,8 @@ module Twilio
|
|
53
53
|
# Lists SmsCommandInstance records from the API as a list.
|
54
54
|
# Unlike stream(), this operation is eager and will load `limit` records into
|
55
55
|
# memory before returning.
|
56
|
-
# @param [String] sim The SID or unique name of the Sim that SMS Command
|
57
|
-
# to or from.
|
56
|
+
# @param [String] sim The SID or unique name of the Sim resource that SMS Command
|
57
|
+
# was sent to or from.
|
58
58
|
# @param [sms_command.Status] status The status of the SMS Command. Can be:
|
59
59
|
# `queued`, `sent`, `delivered`, `received` or `failed`. See the {SMS Command
|
60
60
|
# Status
|
@@ -85,8 +85,8 @@ module Twilio
|
|
85
85
|
# Streams SmsCommandInstance records from the API as an Enumerable.
|
86
86
|
# This operation lazily loads records as efficiently as possible until the limit
|
87
87
|
# is reached.
|
88
|
-
# @param [String] sim The SID or unique name of the Sim that SMS Command
|
89
|
-
# to or from.
|
88
|
+
# @param [String] sim The SID or unique name of the Sim resource that SMS Command
|
89
|
+
# was sent to or from.
|
90
90
|
# @param [sms_command.Status] status The status of the SMS Command. Can be:
|
91
91
|
# `queued`, `sent`, `delivered`, `received` or `failed`. See the {SMS Command
|
92
92
|
# Status
|
@@ -128,8 +128,8 @@ module Twilio
|
|
128
128
|
##
|
129
129
|
# Retrieve a single page of SmsCommandInstance records from the API.
|
130
130
|
# Request is executed immediately.
|
131
|
-
# @param [String] sim The SID or unique name of the Sim that SMS Command
|
132
|
-
# to or from.
|
131
|
+
# @param [String] sim The SID or unique name of the Sim resource that SMS Command
|
132
|
+
# was sent to or from.
|
133
133
|
# @param [sms_command.Status] status The status of the SMS Command. Can be:
|
134
134
|
# `queued`, `sent`, `delivered`, `received` or `failed`. See the {SMS Command
|
135
135
|
# Status
|
@@ -360,9 +360,16 @@ module Twilio
|
|
360
360
|
|
361
361
|
##
|
362
362
|
# Delete the TaskInstance
|
363
|
+
# @param [String] if_match If provided, deletes this Task if (and only if) the
|
364
|
+
# {ETag}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag] header of
|
365
|
+
# the Task matches the provided value. This matches the semantics of (and is
|
366
|
+
# implemented with) the HTTP {If-Match
|
367
|
+
# header}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match].
|
363
368
|
# @return [Boolean] true if delete succeeds, false otherwise
|
364
|
-
def delete
|
365
|
-
|
369
|
+
def delete(if_match: :unset)
|
370
|
+
headers = Twilio::Values.of({'If-Match' => if_match, })
|
371
|
+
|
372
|
+
@version.delete('DELETE', @uri, headers: headers)
|
366
373
|
end
|
367
374
|
|
368
375
|
##
|
@@ -623,9 +630,14 @@ module Twilio
|
|
623
630
|
|
624
631
|
##
|
625
632
|
# Delete the TaskInstance
|
633
|
+
# @param [String] if_match If provided, deletes this Task if (and only if) the
|
634
|
+
# {ETag}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag] header of
|
635
|
+
# the Task matches the provided value. This matches the semantics of (and is
|
636
|
+
# implemented with) the HTTP {If-Match
|
637
|
+
# header}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match].
|
626
638
|
# @return [Boolean] true if delete succeeds, false otherwise
|
627
|
-
def delete
|
628
|
-
context.delete
|
639
|
+
def delete(if_match: :unset)
|
640
|
+
context.delete(if_match: if_match, )
|
629
641
|
end
|
630
642
|
|
631
643
|
##
|
@@ -60,8 +60,21 @@ module Twilio
|
|
60
60
|
# factors. Set the FCM Credential for this service. This will allow to send push
|
61
61
|
# notifications to Android devices. See {Credential
|
62
62
|
# Resource}[https://www.twilio.com/docs/notify/api/credential-resource]
|
63
|
+
# @param [String] totp_issuer Optional configuration for the TOTP factors. Set
|
64
|
+
# TOTP Issuer for this service. This will allow to configure the issuer of the
|
65
|
+
# TOTP URI. Defaults to the service friendly name if not provided.
|
66
|
+
# @param [String] totp_time_step Optional configuration for the TOTP factors.
|
67
|
+
# Defines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is
|
68
|
+
# generated every time_step seconds. Must be between 20 and 60 seconds, inclusive.
|
69
|
+
# Defaults to 30 seconds
|
70
|
+
# @param [String] totp_code_length Optional configuration for the TOTP factors.
|
71
|
+
# Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive.
|
72
|
+
# Defaults to 6
|
73
|
+
# @param [String] totp_skew Optional configuration for the TOTP factors. The
|
74
|
+
# number of time-steps, past and future, that are valid for validation of TOTP
|
75
|
+
# codes. Must be between 0 and 2, inclusive. Defaults to 1
|
63
76
|
# @return [ServiceInstance] Created ServiceInstance
|
64
|
-
def create(friendly_name: nil, code_length: :unset, lookup_enabled: :unset, skip_sms_to_landlines: :unset, dtmf_input_required: :unset, tts_name: :unset, psd2_enabled: :unset, do_not_share_warning_enabled: :unset, custom_code_enabled: :unset, push_include_date: :unset, push_apn_credential_sid: :unset, push_fcm_credential_sid: :unset)
|
77
|
+
def create(friendly_name: nil, code_length: :unset, lookup_enabled: :unset, skip_sms_to_landlines: :unset, dtmf_input_required: :unset, tts_name: :unset, psd2_enabled: :unset, do_not_share_warning_enabled: :unset, custom_code_enabled: :unset, push_include_date: :unset, push_apn_credential_sid: :unset, push_fcm_credential_sid: :unset, totp_issuer: :unset, totp_time_step: :unset, totp_code_length: :unset, totp_skew: :unset)
|
65
78
|
data = Twilio::Values.of({
|
66
79
|
'FriendlyName' => friendly_name,
|
67
80
|
'CodeLength' => code_length,
|
@@ -75,6 +88,10 @@ module Twilio
|
|
75
88
|
'Push.IncludeDate' => push_include_date,
|
76
89
|
'Push.ApnCredentialSid' => push_apn_credential_sid,
|
77
90
|
'Push.FcmCredentialSid' => push_fcm_credential_sid,
|
91
|
+
'Totp.Issuer' => totp_issuer,
|
92
|
+
'Totp.TimeStep' => totp_time_step,
|
93
|
+
'Totp.CodeLength' => totp_code_length,
|
94
|
+
'Totp.Skew' => totp_skew,
|
78
95
|
})
|
79
96
|
|
80
97
|
payload = @version.create('POST', @uri, data: data)
|
@@ -273,8 +290,21 @@ module Twilio
|
|
273
290
|
# factors. Set the FCM Credential for this service. This will allow to send push
|
274
291
|
# notifications to Android devices. See {Credential
|
275
292
|
# Resource}[https://www.twilio.com/docs/notify/api/credential-resource]
|
293
|
+
# @param [String] totp_issuer Optional configuration for the TOTP factors. Set
|
294
|
+
# TOTP Issuer for this service. This will allow to configure the issuer of the
|
295
|
+
# TOTP URI.
|
296
|
+
# @param [String] totp_time_step Optional configuration for the TOTP factors.
|
297
|
+
# Defines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is
|
298
|
+
# generated every time_step seconds. Must be between 20 and 60 seconds, inclusive.
|
299
|
+
# Defaults to 30 seconds
|
300
|
+
# @param [String] totp_code_length Optional configuration for the TOTP factors.
|
301
|
+
# Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive.
|
302
|
+
# Defaults to 6
|
303
|
+
# @param [String] totp_skew Optional configuration for the TOTP factors. The
|
304
|
+
# number of time-steps, past and future, that are valid for validation of TOTP
|
305
|
+
# codes. Must be between 0 and 2, inclusive. Defaults to 1
|
276
306
|
# @return [ServiceInstance] Updated ServiceInstance
|
277
|
-
def update(friendly_name: :unset, code_length: :unset, lookup_enabled: :unset, skip_sms_to_landlines: :unset, dtmf_input_required: :unset, tts_name: :unset, psd2_enabled: :unset, do_not_share_warning_enabled: :unset, custom_code_enabled: :unset, push_include_date: :unset, push_apn_credential_sid: :unset, push_fcm_credential_sid: :unset)
|
307
|
+
def update(friendly_name: :unset, code_length: :unset, lookup_enabled: :unset, skip_sms_to_landlines: :unset, dtmf_input_required: :unset, tts_name: :unset, psd2_enabled: :unset, do_not_share_warning_enabled: :unset, custom_code_enabled: :unset, push_include_date: :unset, push_apn_credential_sid: :unset, push_fcm_credential_sid: :unset, totp_issuer: :unset, totp_time_step: :unset, totp_code_length: :unset, totp_skew: :unset)
|
278
308
|
data = Twilio::Values.of({
|
279
309
|
'FriendlyName' => friendly_name,
|
280
310
|
'CodeLength' => code_length,
|
@@ -288,6 +318,10 @@ module Twilio
|
|
288
318
|
'Push.IncludeDate' => push_include_date,
|
289
319
|
'Push.ApnCredentialSid' => push_apn_credential_sid,
|
290
320
|
'Push.FcmCredentialSid' => push_fcm_credential_sid,
|
321
|
+
'Totp.Issuer' => totp_issuer,
|
322
|
+
'Totp.TimeStep' => totp_time_step,
|
323
|
+
'Totp.CodeLength' => totp_code_length,
|
324
|
+
'Totp.Skew' => totp_skew,
|
291
325
|
})
|
292
326
|
|
293
327
|
payload = @version.update('POST', @uri, data: data)
|
@@ -449,6 +483,7 @@ module Twilio
|
|
449
483
|
'do_not_share_warning_enabled' => payload['do_not_share_warning_enabled'],
|
450
484
|
'custom_code_enabled' => payload['custom_code_enabled'],
|
451
485
|
'push' => payload['push'],
|
486
|
+
'totp' => payload['totp'],
|
452
487
|
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
|
453
488
|
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
|
454
489
|
'url' => payload['url'],
|
@@ -543,6 +578,12 @@ module Twilio
|
|
543
578
|
@properties['push']
|
544
579
|
end
|
545
580
|
|
581
|
+
##
|
582
|
+
# @return [Hash] The service level configuration of factor TOTP type.
|
583
|
+
def totp
|
584
|
+
@properties['totp']
|
585
|
+
end
|
586
|
+
|
546
587
|
##
|
547
588
|
# @return [Time] The RFC 2822 date and time in GMT when the resource was created
|
548
589
|
def date_created
|
@@ -616,8 +657,21 @@ module Twilio
|
|
616
657
|
# factors. Set the FCM Credential for this service. This will allow to send push
|
617
658
|
# notifications to Android devices. See {Credential
|
618
659
|
# Resource}[https://www.twilio.com/docs/notify/api/credential-resource]
|
660
|
+
# @param [String] totp_issuer Optional configuration for the TOTP factors. Set
|
661
|
+
# TOTP Issuer for this service. This will allow to configure the issuer of the
|
662
|
+
# TOTP URI.
|
663
|
+
# @param [String] totp_time_step Optional configuration for the TOTP factors.
|
664
|
+
# Defines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is
|
665
|
+
# generated every time_step seconds. Must be between 20 and 60 seconds, inclusive.
|
666
|
+
# Defaults to 30 seconds
|
667
|
+
# @param [String] totp_code_length Optional configuration for the TOTP factors.
|
668
|
+
# Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive.
|
669
|
+
# Defaults to 6
|
670
|
+
# @param [String] totp_skew Optional configuration for the TOTP factors. The
|
671
|
+
# number of time-steps, past and future, that are valid for validation of TOTP
|
672
|
+
# codes. Must be between 0 and 2, inclusive. Defaults to 1
|
619
673
|
# @return [ServiceInstance] Updated ServiceInstance
|
620
|
-
def update(friendly_name: :unset, code_length: :unset, lookup_enabled: :unset, skip_sms_to_landlines: :unset, dtmf_input_required: :unset, tts_name: :unset, psd2_enabled: :unset, do_not_share_warning_enabled: :unset, custom_code_enabled: :unset, push_include_date: :unset, push_apn_credential_sid: :unset, push_fcm_credential_sid: :unset)
|
674
|
+
def update(friendly_name: :unset, code_length: :unset, lookup_enabled: :unset, skip_sms_to_landlines: :unset, dtmf_input_required: :unset, tts_name: :unset, psd2_enabled: :unset, do_not_share_warning_enabled: :unset, custom_code_enabled: :unset, push_include_date: :unset, push_apn_credential_sid: :unset, push_fcm_credential_sid: :unset, totp_issuer: :unset, totp_time_step: :unset, totp_code_length: :unset, totp_skew: :unset)
|
621
675
|
context.update(
|
622
676
|
friendly_name: friendly_name,
|
623
677
|
code_length: code_length,
|
@@ -631,6 +685,10 @@ module Twilio
|
|
631
685
|
push_include_date: push_include_date,
|
632
686
|
push_apn_credential_sid: push_apn_credential_sid,
|
633
687
|
push_fcm_credential_sid: push_fcm_credential_sid,
|
688
|
+
totp_issuer: totp_issuer,
|
689
|
+
totp_time_step: totp_time_step,
|
690
|
+
totp_code_length: totp_code_length,
|
691
|
+
totp_skew: totp_skew,
|
634
692
|
)
|
635
693
|
end
|
636
694
|
|
@@ -45,14 +45,18 @@ module Twilio
|
|
45
45
|
# @param [Hash] hidden_details Details provided to give context about the
|
46
46
|
# Challenge. Not shown to the end user. It must be a stringified JSON with only
|
47
47
|
# strings values eg. `{"ip": "172.168.1.234"}`
|
48
|
+
# @param [String] auth_payload Optional payload used to verify the Challenge upon
|
49
|
+
# creation. Only used with a Factor of type `totp` to carry an OTP used in the
|
50
|
+
# verification.
|
48
51
|
# @return [ChallengeInstance] Created ChallengeInstance
|
49
|
-
def create(factor_sid: nil, expiration_date: :unset, details_message: :unset, details_fields: :unset, hidden_details: :unset)
|
52
|
+
def create(factor_sid: nil, expiration_date: :unset, details_message: :unset, details_fields: :unset, hidden_details: :unset, auth_payload: :unset)
|
50
53
|
data = Twilio::Values.of({
|
51
54
|
'FactorSid' => factor_sid,
|
52
55
|
'ExpirationDate' => Twilio.serialize_iso8601_datetime(expiration_date),
|
53
56
|
'Details.Message' => details_message,
|
54
57
|
'Details.Fields' => Twilio.serialize_list(details_fields) { |e| Twilio.serialize_object(e) },
|
55
58
|
'HiddenDetails' => Twilio.serialize_object(hidden_details),
|
59
|
+
'AuthPayload' => auth_payload,
|
56
60
|
})
|
57
61
|
|
58
62
|
payload = @version.create('POST', @uri, data: data)
|
@@ -219,6 +223,9 @@ module Twilio
|
|
219
223
|
# Path Solution
|
220
224
|
@solution = {service_sid: service_sid, identity: identity, sid: sid, }
|
221
225
|
@uri = "/Services/#{@solution[:service_sid]}/Entities/#{@solution[:identity]}/Challenges/#{@solution[:sid]}"
|
226
|
+
|
227
|
+
# Dependents
|
228
|
+
@notifications = nil
|
222
229
|
end
|
223
230
|
|
224
231
|
##
|
@@ -255,6 +262,23 @@ module Twilio
|
|
255
262
|
)
|
256
263
|
end
|
257
264
|
|
265
|
+
##
|
266
|
+
# Access the notifications
|
267
|
+
# @return [NotificationList]
|
268
|
+
# @return [NotificationContext]
|
269
|
+
def notifications
|
270
|
+
unless @notifications
|
271
|
+
@notifications = NotificationList.new(
|
272
|
+
@version,
|
273
|
+
service_sid: @solution[:service_sid],
|
274
|
+
identity: @solution[:identity],
|
275
|
+
challenge_sid: @solution[:sid],
|
276
|
+
)
|
277
|
+
end
|
278
|
+
|
279
|
+
@notifications
|
280
|
+
end
|
281
|
+
|
258
282
|
##
|
259
283
|
# Provide a user friendly representation
|
260
284
|
def to_s
|
@@ -304,6 +328,7 @@ module Twilio
|
|
304
328
|
'hidden_details' => payload['hidden_details'],
|
305
329
|
'factor_type' => payload['factor_type'],
|
306
330
|
'url' => payload['url'],
|
331
|
+
'links' => payload['links'],
|
307
332
|
}
|
308
333
|
|
309
334
|
# Context
|
@@ -423,6 +448,12 @@ module Twilio
|
|
423
448
|
@properties['url']
|
424
449
|
end
|
425
450
|
|
451
|
+
##
|
452
|
+
# @return [String] Nested resource URLs.
|
453
|
+
def links
|
454
|
+
@properties['links']
|
455
|
+
end
|
456
|
+
|
426
457
|
##
|
427
458
|
# Fetch the ChallengeInstance
|
428
459
|
# @return [ChallengeInstance] Fetched ChallengeInstance
|
@@ -439,6 +470,13 @@ module Twilio
|
|
439
470
|
context.update(auth_payload: auth_payload, )
|
440
471
|
end
|
441
472
|
|
473
|
+
##
|
474
|
+
# Access the notifications
|
475
|
+
# @return [notifications] notifications
|
476
|
+
def notifications
|
477
|
+
context.notifications
|
478
|
+
end
|
479
|
+
|
442
480
|
##
|
443
481
|
# Provide a user friendly representation
|
444
482
|
def to_s
|
@@ -0,0 +1,202 @@
|
|
1
|
+
##
|
2
|
+
# This code was generated by
|
3
|
+
# \ / _ _ _| _ _
|
4
|
+
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
5
|
+
# / /
|
6
|
+
#
|
7
|
+
# frozen_string_literal: true
|
8
|
+
|
9
|
+
module Twilio
|
10
|
+
module REST
|
11
|
+
class Verify < Domain
|
12
|
+
class V2 < Version
|
13
|
+
class ServiceContext < InstanceContext
|
14
|
+
class EntityContext < InstanceContext
|
15
|
+
class ChallengeContext < InstanceContext
|
16
|
+
##
|
17
|
+
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
18
|
+
class NotificationList < ListResource
|
19
|
+
##
|
20
|
+
# Initialize the NotificationList
|
21
|
+
# @param [Version] version Version that contains the resource
|
22
|
+
# @param [String] service_sid The unique SID identifier of the Service.
|
23
|
+
# @param [String] identity Customer unique identity for the Entity owner of the
|
24
|
+
# Challenge. This value must be between 8 and 64 characters long.
|
25
|
+
# @param [String] challenge_sid The unique SID identifier of the Challenge.
|
26
|
+
# @return [NotificationList] NotificationList
|
27
|
+
def initialize(version, service_sid: nil, identity: nil, challenge_sid: nil)
|
28
|
+
super(version)
|
29
|
+
|
30
|
+
# Path Solution
|
31
|
+
@solution = {service_sid: service_sid, identity: identity, challenge_sid: challenge_sid}
|
32
|
+
@uri = "/Services/#{@solution[:service_sid]}/Entities/#{@solution[:identity]}/Challenges/#{@solution[:challenge_sid]}/Notifications"
|
33
|
+
end
|
34
|
+
|
35
|
+
##
|
36
|
+
# Create the NotificationInstance
|
37
|
+
# @param [String] ttl How long, in seconds, the Notification is valid. Delivery
|
38
|
+
# will be attempted if the device is offline until the TTL elapses. 0 means that
|
39
|
+
# the notification delivery is attempted immediately, only once, and is not stored
|
40
|
+
# for future delivery. Must be an integer between 0 and 300 seconds, inclusive.
|
41
|
+
# Defaults to 300 seconds.
|
42
|
+
# @return [NotificationInstance] Created NotificationInstance
|
43
|
+
def create(ttl: :unset)
|
44
|
+
data = Twilio::Values.of({'Ttl' => ttl, })
|
45
|
+
|
46
|
+
payload = @version.create('POST', @uri, data: data)
|
47
|
+
|
48
|
+
NotificationInstance.new(
|
49
|
+
@version,
|
50
|
+
payload,
|
51
|
+
service_sid: @solution[:service_sid],
|
52
|
+
identity: @solution[:identity],
|
53
|
+
challenge_sid: @solution[:challenge_sid],
|
54
|
+
)
|
55
|
+
end
|
56
|
+
|
57
|
+
##
|
58
|
+
# Provide a user friendly representation
|
59
|
+
def to_s
|
60
|
+
'#<Twilio.Verify.V2.NotificationList>'
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
##
|
65
|
+
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
66
|
+
class NotificationPage < Page
|
67
|
+
##
|
68
|
+
# Initialize the NotificationPage
|
69
|
+
# @param [Version] version Version that contains the resource
|
70
|
+
# @param [Response] response Response from the API
|
71
|
+
# @param [Hash] solution Path solution for the resource
|
72
|
+
# @return [NotificationPage] NotificationPage
|
73
|
+
def initialize(version, response, solution)
|
74
|
+
super(version, response)
|
75
|
+
|
76
|
+
# Path Solution
|
77
|
+
@solution = solution
|
78
|
+
end
|
79
|
+
|
80
|
+
##
|
81
|
+
# Build an instance of NotificationInstance
|
82
|
+
# @param [Hash] payload Payload response from the API
|
83
|
+
# @return [NotificationInstance] NotificationInstance
|
84
|
+
def get_instance(payload)
|
85
|
+
NotificationInstance.new(
|
86
|
+
@version,
|
87
|
+
payload,
|
88
|
+
service_sid: @solution[:service_sid],
|
89
|
+
identity: @solution[:identity],
|
90
|
+
challenge_sid: @solution[:challenge_sid],
|
91
|
+
)
|
92
|
+
end
|
93
|
+
|
94
|
+
##
|
95
|
+
# Provide a user friendly representation
|
96
|
+
def to_s
|
97
|
+
'<Twilio.Verify.V2.NotificationPage>'
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
##
|
102
|
+
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
103
|
+
class NotificationInstance < InstanceResource
|
104
|
+
##
|
105
|
+
# Initialize the NotificationInstance
|
106
|
+
# @param [Version] version Version that contains the resource
|
107
|
+
# @param [Hash] payload payload that contains response from Twilio
|
108
|
+
# @param [String] service_sid The unique SID identifier of the Service.
|
109
|
+
# @param [String] identity Customer unique identity for the Entity owner of the
|
110
|
+
# Challenge. This value must be between 8 and 64 characters long.
|
111
|
+
# @param [String] challenge_sid The unique SID identifier of the Challenge.
|
112
|
+
# @return [NotificationInstance] NotificationInstance
|
113
|
+
def initialize(version, payload, service_sid: nil, identity: nil, challenge_sid: nil)
|
114
|
+
super(version)
|
115
|
+
|
116
|
+
# Marshaled Properties
|
117
|
+
@properties = {
|
118
|
+
'sid' => payload['sid'],
|
119
|
+
'account_sid' => payload['account_sid'],
|
120
|
+
'service_sid' => payload['service_sid'],
|
121
|
+
'entity_sid' => payload['entity_sid'],
|
122
|
+
'identity' => payload['identity'],
|
123
|
+
'challenge_sid' => payload['challenge_sid'],
|
124
|
+
'priority' => payload['priority'],
|
125
|
+
'ttl' => payload['ttl'].to_i,
|
126
|
+
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
|
127
|
+
}
|
128
|
+
end
|
129
|
+
|
130
|
+
##
|
131
|
+
# @return [String] A string that uniquely identifies this Notification.
|
132
|
+
def sid
|
133
|
+
@properties['sid']
|
134
|
+
end
|
135
|
+
|
136
|
+
##
|
137
|
+
# @return [String] Account Sid.
|
138
|
+
def account_sid
|
139
|
+
@properties['account_sid']
|
140
|
+
end
|
141
|
+
|
142
|
+
##
|
143
|
+
# @return [String] Service Sid.
|
144
|
+
def service_sid
|
145
|
+
@properties['service_sid']
|
146
|
+
end
|
147
|
+
|
148
|
+
##
|
149
|
+
# @return [String] Entity Sid.
|
150
|
+
def entity_sid
|
151
|
+
@properties['entity_sid']
|
152
|
+
end
|
153
|
+
|
154
|
+
##
|
155
|
+
# @return [String] Unique external identifier of the Entity
|
156
|
+
def identity
|
157
|
+
@properties['identity']
|
158
|
+
end
|
159
|
+
|
160
|
+
##
|
161
|
+
# @return [String] Challenge Sid.
|
162
|
+
def challenge_sid
|
163
|
+
@properties['challenge_sid']
|
164
|
+
end
|
165
|
+
|
166
|
+
##
|
167
|
+
# @return [String] The priority of the Notification.
|
168
|
+
def priority
|
169
|
+
@properties['priority']
|
170
|
+
end
|
171
|
+
|
172
|
+
##
|
173
|
+
# @return [String] How long, in seconds, the Notification is valid.
|
174
|
+
def ttl
|
175
|
+
@properties['ttl']
|
176
|
+
end
|
177
|
+
|
178
|
+
##
|
179
|
+
# @return [Time] The date this Notification was created
|
180
|
+
def date_created
|
181
|
+
@properties['date_created']
|
182
|
+
end
|
183
|
+
|
184
|
+
##
|
185
|
+
# Provide a user friendly representation
|
186
|
+
def to_s
|
187
|
+
"<Twilio.Verify.V2.NotificationInstance>"
|
188
|
+
end
|
189
|
+
|
190
|
+
##
|
191
|
+
# Provide a detailed, user friendly representation
|
192
|
+
def inspect
|
193
|
+
"<Twilio.Verify.V2.NotificationInstance>"
|
194
|
+
end
|
195
|
+
end
|
196
|
+
end
|
197
|
+
end
|
198
|
+
end
|
199
|
+
end
|
200
|
+
end
|
201
|
+
end
|
202
|
+
end
|
@@ -37,7 +37,8 @@ module Twilio
|
|
37
37
|
# @param [String] friendly_name The friendly name of this Factor. It can be up to
|
38
38
|
# 64 characters.
|
39
39
|
# @param [new_factor.FactorTypes] factor_type The Type of this Factor. Currently
|
40
|
-
#
|
40
|
+
# `push` and `totp` are supported. For `totp` to work, you need to contact Twilio
|
41
|
+
# sales first to have the Verify TOTP feature enabled for your Twilio account.
|
41
42
|
# @param [String] binding_alg The algorithm used when `factor_type` is `push`.
|
42
43
|
# Algorithm supported: `ES256`
|
43
44
|
# @param [String] binding_public_key The Ecdsa public key in PKIX, ASN.1 DER
|
@@ -58,12 +59,16 @@ module Twilio
|
|
58
59
|
# Base32
|
59
60
|
# @param [String] config_time_step Defines how often, in seconds, are TOTP codes
|
60
61
|
# generated. i.e, a new TOTP code is generated every time_step seconds. Must be
|
61
|
-
# between 20 and 60 seconds, inclusive.
|
62
|
+
# between 20 and 60 seconds, inclusive. The default value is defined at the
|
63
|
+
# service level in the property totp.time_step. If not configured defaults to 30
|
64
|
+
# seconds
|
62
65
|
# @param [String] config_skew The number of time-steps, past and future, that are
|
63
|
-
# valid for validation of TOTP codes. Must be between 0 and 2, inclusive.
|
64
|
-
#
|
66
|
+
# valid for validation of TOTP codes. Must be between 0 and 2, inclusive. The
|
67
|
+
# default value is defined at the service level in the property totp.skew. If not
|
68
|
+
# configured defaults to 1
|
65
69
|
# @param [String] config_code_length Number of digits for generated TOTP codes.
|
66
|
-
# Must be between 3 and 8, inclusive.
|
70
|
+
# Must be between 3 and 8, inclusive. The default value is defined at the service
|
71
|
+
# level in the property totp.code_length. If not configured defaults to 6
|
67
72
|
# @param [new_factor.TotpAlgorithms] config_alg The algorithm used to derive the
|
68
73
|
# TOTP codes. Can be `sha1`, `sha256` or `sha512`. Defaults to `sha1`
|
69
74
|
# @return [NewFactorInstance] Created NewFactorInstance
|
data/lib/twilio-ruby/version.rb
CHANGED
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.52.0
|
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-04-
|
11
|
+
date: 2021-04-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jwt
|
@@ -413,7 +413,7 @@ files:
|
|
413
413
|
- lib/twilio-ruby/rest/events/v1.rb
|
414
414
|
- lib/twilio-ruby/rest/events/v1/event_type.rb
|
415
415
|
- lib/twilio-ruby/rest/events/v1/schema.rb
|
416
|
-
- lib/twilio-ruby/rest/events/v1/schema/
|
416
|
+
- lib/twilio-ruby/rest/events/v1/schema/version.rb
|
417
417
|
- lib/twilio-ruby/rest/events/v1/sink.rb
|
418
418
|
- lib/twilio-ruby/rest/events/v1/sink/sink_test.rb
|
419
419
|
- lib/twilio-ruby/rest/events/v1/sink/sink_validate.rb
|
@@ -691,6 +691,7 @@ files:
|
|
691
691
|
- lib/twilio-ruby/rest/verify/v2/service/access_token.rb
|
692
692
|
- lib/twilio-ruby/rest/verify/v2/service/entity.rb
|
693
693
|
- lib/twilio-ruby/rest/verify/v2/service/entity/challenge.rb
|
694
|
+
- lib/twilio-ruby/rest/verify/v2/service/entity/challenge/notification.rb
|
694
695
|
- lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb
|
695
696
|
- lib/twilio-ruby/rest/verify/v2/service/entity/new_factor.rb
|
696
697
|
- lib/twilio-ruby/rest/verify/v2/service/messaging_configuration.rb
|