twilio-ruby 7.13.1 → 7.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -21,20 +21,36 @@ module Twilio
21
21
 
22
22
  class InsightsQueryRequest
23
23
  # @param [domain]: [String] The business domain to execute the query against
24
+ # @param [properties]: [QueryList.InsightsQueryRequestProperties]
24
25
  # @param [query]: [QueryList.QueryDefinition]
25
- attr_accessor :domain, :query
26
+ attr_accessor :domain, :properties, :query
26
27
  def initialize(payload)
27
28
  @domain = payload["domain"]
29
+ @properties = payload["properties"]
28
30
  @query = payload["query"]
29
31
  end
30
32
  def to_json(options = {})
31
33
  {
32
34
  "domain": @domain,
35
+ "properties": @properties,
33
36
  "query": @query,
34
37
  }.to_json(options)
35
38
  end
36
39
  end
37
40
 
41
+ class InsightsQueryRequestProperties
42
+ # @param [timezone]: [String] Optional IANA timezone identifier used to evaluate and group time-based fields. Defaults to `UTC`.
43
+ attr_accessor :timezone
44
+ def initialize(payload)
45
+ @timezone = payload["timezone"]
46
+ end
47
+ def to_json(options = {})
48
+ {
49
+ "timezone": @timezone,
50
+ }.to_json(options)
51
+ end
52
+ end
53
+
38
54
  class QueryDefinition
39
55
  # @param [measures]: [Array<String>] Array of measures to retrieve, representing quantitative values or metrics to be calculated
40
56
  # @param [dimensions]: [Array<String>] Array of dimensions to retrieve, representing categorical attributes for grouping and organizing data
@@ -21,20 +21,36 @@ module Twilio
21
21
 
22
22
  class InsightsQueryRequest
23
23
  # @param [domain]: [String] The business domain to execute the query against
24
+ # @param [properties]: [QueryList.InsightsQueryRequestProperties]
24
25
  # @param [query]: [QueryList.QueryDefinition]
25
- attr_accessor :domain, :query
26
+ attr_accessor :domain, :properties, :query
26
27
  def initialize(payload)
27
28
  @domain = payload["domain"]
29
+ @properties = payload["properties"]
28
30
  @query = payload["query"]
29
31
  end
30
32
  def to_json(options = {})
31
33
  {
32
34
  "domain": @domain,
35
+ "properties": @properties,
33
36
  "query": @query,
34
37
  }.to_json(options)
35
38
  end
36
39
  end
37
40
 
41
+ class InsightsQueryRequestProperties
42
+ # @param [timezone]: [String] Optional IANA timezone identifier used to evaluate and group time-based fields. Defaults to `UTC`.
43
+ attr_accessor :timezone
44
+ def initialize(payload)
45
+ @timezone = payload["timezone"]
46
+ end
47
+ def to_json(options = {})
48
+ {
49
+ "timezone": @timezone,
50
+ }.to_json(options)
51
+ end
52
+ end
53
+
38
54
  class QueryDefinition
39
55
  # @param [measures]: [Array<String>] Array of measures to retrieve, representing quantitative values or metrics to be calculated
40
56
  # @param [dimensions]: [Array<String>] Array of dimensions to retrieve, representing categorical attributes for grouping and organizing data
@@ -330,6 +346,43 @@ module Twilio
330
346
 
331
347
 
332
348
  end
349
+ ##
350
+ # Delete the QueryJobInstance
351
+ # @return [Boolean] True if delete succeeds, false otherwise
352
+ def delete
353
+
354
+ headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
355
+
356
+
357
+
358
+ response = @version.delete_with_metadata('DELETE', @uri, headers: headers)
359
+ QueryJobInstance.new(
360
+ @version,
361
+ response.body,
362
+ operation_id: @solution[:operation_id],
363
+ )
364
+
365
+ end
366
+
367
+ ##
368
+ # Delete the QueryJobInstanceMetadata
369
+ # @return [Boolean] True if delete succeeds, false otherwise
370
+ def delete_with_metadata
371
+
372
+ headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
373
+
374
+
375
+
376
+ response = @version.delete_with_metadata('DELETE', @uri, headers: headers)
377
+ queryJob_instance = QueryJobInstance.new(
378
+ @version,
379
+ response.body,
380
+ account_sid: @solution[:account_sid],
381
+ sid: @solution[:sid],
382
+ )
383
+ QueryJobInstanceMetadata.new(@version, queryJob_instance, response.headers, response.status_code)
384
+ end
385
+
333
386
  ##
334
387
  # Fetch the QueryJobInstance
335
388
  # @return [QueryJobInstance] Fetched QueryJobInstance
@@ -625,6 +678,14 @@ module Twilio
625
678
  @properties['result_retention_period']
626
679
  end
627
680
 
681
+ ##
682
+ # Delete the QueryJobInstance
683
+ # @return [Boolean] True if delete succeeds, false otherwise
684
+ def delete
685
+
686
+ context.delete
687
+ end
688
+
628
689
  ##
629
690
  # Fetch the QueryJobInstance
630
691
  # @return [QueryJobInstance] Fetched QueryJobInstance
@@ -182,6 +182,8 @@ module Twilio
182
182
  # Lists ServiceInstance records from the API as a list.
183
183
  # Unlike stream(), this operation is eager and will load `limit` records into
184
184
  # memory before returning.
185
+ # @param [String] friendly_name_query Optional case-insensitive filter on the Messaging Service friendly name, between 3 and 255 characters; returns an empty list if none match. Matches any substring of the name. Not supported for accounts with 100,000 or more Messaging Services; those requests are rejected with a 400.
186
+ # @param [String] sender_sid_query Optional filter returning only the Messaging Service the given sender is currently associated with; returns an empty list if the sender is not associated with any service. Accepts a Phone Number (PN), Short Code (SC), Alpha Sender (AI), or Channel Sender (XE) sid.
185
187
  # @param [Integer] limit Upper limit for the number of records to return. stream()
186
188
  # guarantees to never return more than limit. Default is no limit
187
189
  # @param [Integer] page_size Number of records to fetch per request, when
@@ -189,8 +191,10 @@ module Twilio
189
191
  # but a limit is defined, stream() will attempt to read the limit with the most
190
192
  # efficient page size, i.e. min(limit, 1000)
191
193
  # @return [Array] Array of up to limit results
192
- def list(limit: nil, page_size: nil)
194
+ def list(friendly_name_query: :unset, sender_sid_query: :unset, limit: nil, page_size: nil)
193
195
  self.stream(
196
+ friendly_name_query: friendly_name_query,
197
+ sender_sid_query: sender_sid_query,
194
198
  limit: limit,
195
199
  page_size: page_size
196
200
  ).entries
@@ -200,6 +204,8 @@ module Twilio
200
204
  # Streams Instance records from the API as an Enumerable.
201
205
  # This operation lazily loads records as efficiently as possible until the limit
202
206
  # is reached.
207
+ # @param [String] friendly_name_query Optional case-insensitive filter on the Messaging Service friendly name, between 3 and 255 characters; returns an empty list if none match. Matches any substring of the name. Not supported for accounts with 100,000 or more Messaging Services; those requests are rejected with a 400.
208
+ # @param [String] sender_sid_query Optional filter returning only the Messaging Service the given sender is currently associated with; returns an empty list if the sender is not associated with any service. Accepts a Phone Number (PN), Short Code (SC), Alpha Sender (AI), or Channel Sender (XE) sid.
203
209
  # @param [Integer] limit Upper limit for the number of records to return. stream()
204
210
  # guarantees to never return more than limit. Default is no limit
205
211
  # @param [Integer] page_size Number of records to fetch per request, when
@@ -207,10 +213,12 @@ module Twilio
207
213
  # but a limit is defined, stream() will attempt to read the limit with the most
208
214
  # efficient page size, i.e. min(limit, 1000)
209
215
  # @return [Enumerable] Enumerable that will yield up to limit results
210
- def stream(limit: nil, page_size: nil)
216
+ def stream(friendly_name_query: :unset, sender_sid_query: :unset, limit: nil, page_size: nil)
211
217
  limits = @version.read_limits(limit, page_size)
212
218
 
213
219
  page = self.page(
220
+ friendly_name_query: friendly_name_query,
221
+ sender_sid_query: sender_sid_query,
214
222
  page_size: limits[:page_size], )
215
223
 
216
224
  return [].each if page.nil?
@@ -222,6 +230,8 @@ module Twilio
222
230
 
223
231
  ##
224
232
  # Lists ServicePageMetadata records from the API as a list.
233
+ # @param [String] friendly_name_query Optional case-insensitive filter on the Messaging Service friendly name, between 3 and 255 characters; returns an empty list if none match. Matches any substring of the name. Not supported for accounts with 100,000 or more Messaging Services; those requests are rejected with a 400.
234
+ # @param [String] sender_sid_query Optional filter returning only the Messaging Service the given sender is currently associated with; returns an empty list if the sender is not associated with any service. Accepts a Phone Number (PN), Short Code (SC), Alpha Sender (AI), or Channel Sender (XE) sid.
225
235
  # @param [Integer] limit Upper limit for the number of records to return. stream()
226
236
  # guarantees to never return more than limit. Default is no limit
227
237
  # @param [Integer] page_size Number of records to fetch per request, when
@@ -229,9 +239,11 @@ module Twilio
229
239
  # but a limit is defined, stream() will attempt to read the limit with the most
230
240
  # efficient page size, i.e. min(limit, 1000)
231
241
  # @return [Array] Array of up to limit results
232
- def list_with_metadata(limit: nil, page_size: nil)
242
+ def list_with_metadata(friendly_name_query: :unset, sender_sid_query: :unset, limit: nil, page_size: nil)
233
243
  limits = @version.read_limits(limit, page_size)
234
244
  params = Twilio::Values.of({
245
+ 'FriendlyNameQuery' => friendly_name_query,
246
+ 'SenderSidQuery' => sender_sid_query,
235
247
 
236
248
  'PageSize' => limits[:page_size],
237
249
  });
@@ -263,12 +275,16 @@ module Twilio
263
275
  ##
264
276
  # Retrieve a single page of ServiceInstance records from the API.
265
277
  # Request is executed immediately.
278
+ # @param [String] friendly_name_query Optional case-insensitive filter on the Messaging Service friendly name, between 3 and 255 characters; returns an empty list if none match. Matches any substring of the name. Not supported for accounts with 100,000 or more Messaging Services; those requests are rejected with a 400.
279
+ # @param [String] sender_sid_query Optional filter returning only the Messaging Service the given sender is currently associated with; returns an empty list if the sender is not associated with any service. Accepts a Phone Number (PN), Short Code (SC), Alpha Sender (AI), or Channel Sender (XE) sid.
266
280
  # @param [String] page_token PageToken provided by the API
267
281
  # @param [Integer] page_number Page Number, this value is simply for client state
268
282
  # @param [Integer] page_size Number of records to return, defaults to 50
269
283
  # @return [Page] Page of ServiceInstance
270
- def page(page_token: :unset, page_number: :unset,page_size: :unset)
284
+ def page(friendly_name_query: :unset, sender_sid_query: :unset, page_token: :unset, page_number: :unset,page_size: :unset)
271
285
  params = Twilio::Values.of({
286
+ 'FriendlyNameQuery' => friendly_name_query,
287
+ 'SenderSidQuery' => sender_sid_query,
272
288
  'PageToken' => page_token,
273
289
  'Page' => page_number,
274
290
  'PageSize' => page_size,
@@ -0,0 +1,316 @@
1
+ ##
2
+ # This code was generated by
3
+ # ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
4
+ # | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
5
+ # | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
6
+ #
7
+ # Twilio - Serverless
8
+ # This is the public Twilio REST API.
9
+ #
10
+ # NOTE: This class is auto generated by OpenAPI Generator.
11
+ # https://openapi-generator.tech
12
+ # Do not edit the class manually.
13
+ #
14
+
15
+
16
+ module Twilio
17
+ module REST
18
+ class Serverless < ServerlessBase
19
+ class V1 < Version
20
+ class ServiceContext < InstanceContext
21
+ class BuildContext < InstanceContext
22
+
23
+ class BuildStatusDetailList < ListResource
24
+
25
+ ##
26
+ # Initialize the BuildStatusDetailList
27
+ # @param [Version] version Version that contains the resource
28
+ # @return [BuildStatusDetailList] BuildStatusDetailList
29
+ def initialize(version, service_sid: nil, sid: nil)
30
+ super(version)
31
+
32
+ # Path Solution
33
+ @solution = { service_sid: service_sid, sid: sid }
34
+
35
+
36
+ end
37
+
38
+
39
+
40
+ # Provide a user friendly representation
41
+ def to_s
42
+ '#<Twilio.Serverless.V1.BuildStatusDetailList>'
43
+ end
44
+ end
45
+
46
+
47
+ class BuildStatusDetailContext < InstanceContext
48
+ ##
49
+ # Initialize the BuildStatusDetailContext
50
+ # @param [Version] version Version that contains the resource
51
+ # @param [String] service_sid The SID of the Service to fetch the Build resource from.
52
+ # @param [String] sid The SID of the Build resource to fetch.
53
+ # @return [BuildStatusDetailContext] BuildStatusDetailContext
54
+ def initialize(version, service_sid, sid)
55
+ super(version)
56
+
57
+
58
+ # Path Solution
59
+ @solution = { service_sid: service_sid, sid: sid, }
60
+ @uri = "/Services/#{@solution[:service_sid]}/Builds/#{@solution[:sid]}/StatusDetails"
61
+
62
+
63
+ end
64
+ ##
65
+ # Fetch the BuildStatusDetailInstance
66
+ # @return [BuildStatusDetailInstance] Fetched BuildStatusDetailInstance
67
+ def fetch
68
+
69
+ headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
70
+
71
+
72
+
73
+
74
+
75
+ payload = @version.fetch('GET', @uri, headers: headers)
76
+ BuildStatusDetailInstance.new(
77
+ @version,
78
+ payload,
79
+ service_sid: @solution[:service_sid],
80
+ sid: @solution[:sid],
81
+ )
82
+ end
83
+
84
+ ##
85
+ # Fetch the BuildStatusDetailInstanceMetadata
86
+ # @return [BuildStatusDetailInstance] Fetched BuildStatusDetailInstance
87
+ def fetch_with_metadata
88
+
89
+ headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
90
+
91
+
92
+
93
+
94
+
95
+ response = @version.fetch_with_metadata('GET', @uri, headers: headers)
96
+ build_status_detail_instance = BuildStatusDetailInstance.new(
97
+ @version,
98
+ response.body,
99
+ service_sid: @solution[:service_sid],
100
+ sid: @solution[:sid],
101
+ )
102
+ BuildStatusDetailInstanceMetadata.new(
103
+ @version,
104
+ build_status_detail_instance,
105
+ response.headers,
106
+ response.status_code
107
+ )
108
+ end
109
+
110
+
111
+ ##
112
+ # Provide a user friendly representation
113
+ def to_s
114
+ context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
115
+ "#<Twilio.Serverless.V1.BuildStatusDetailContext #{context}>"
116
+ end
117
+
118
+ ##
119
+ # Provide a detailed, user friendly representation
120
+ def inspect
121
+ context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
122
+ "#<Twilio.Serverless.V1.BuildStatusDetailContext #{context}>"
123
+ end
124
+ end
125
+
126
+ class BuildStatusDetailInstanceMetadata < InstanceResourceMetadata
127
+ ##
128
+ # Initializes a new BuildStatusDetailInstanceMetadata.
129
+ # @param [Version] version Version that contains the resource
130
+ # @param [}BuildStatusDetailInstance] build_status_detail_instance The instance associated with the metadata.
131
+ # @param [Hash] headers Header object with response headers.
132
+ # @param [Integer] status_code The HTTP status code of the response.
133
+ # @return [BuildStatusDetailInstanceMetadata] The initialized instance with metadata.
134
+ def initialize(version, build_status_detail_instance, headers, status_code)
135
+ super(version, headers, status_code)
136
+ @build_status_detail_instance = build_status_detail_instance
137
+ end
138
+
139
+ def build_status_detail
140
+ @build_status_detail_instance
141
+ end
142
+
143
+ def headers
144
+ @headers
145
+ end
146
+
147
+ def status_code
148
+ @status_code
149
+ end
150
+
151
+ def to_s
152
+ "<Twilio.Api.V2010.BuildStatusDetailInstanceMetadata status=#{@status_code}>"
153
+ end
154
+ end
155
+
156
+ class BuildStatusDetailListResponse < InstanceListResource
157
+ # @param [Array<BuildStatusDetailInstance>] instance
158
+ # @param [Hash{String => Object}] headers
159
+ # @param [Integer] status_code
160
+ def initialize(version, payload, key)
161
+ @build_status_detail_instance = payload.body[key].map do |data|
162
+ BuildStatusDetailInstance.new(version, data)
163
+ end
164
+ @headers = payload.headers
165
+ @status_code = payload.status_code
166
+ end
167
+
168
+ def build_status_detail_instance
169
+ @instance
170
+ end
171
+ end
172
+
173
+ class BuildStatusDetailPage < Page
174
+ ##
175
+ # Initialize the BuildStatusDetailPage
176
+ # @param [Version] version Version that contains the resource
177
+ # @param [Response] response Response from the API
178
+ # @param [Hash] solution Path solution for the resource
179
+ # @return [BuildStatusDetailPage] BuildStatusDetailPage
180
+ def initialize(version, response, solution)
181
+ super(version, response)
182
+
183
+
184
+ # Path Solution
185
+ @solution = solution
186
+ end
187
+
188
+ ##
189
+ # Build an instance of BuildStatusDetailInstance
190
+ # @param [Hash] payload Payload response from the API
191
+ # @return [BuildStatusDetailInstance] BuildStatusDetailInstance
192
+ def get_instance(payload)
193
+ BuildStatusDetailInstance.new(@version, payload, service_sid: @solution[:service_sid], sid: @solution[:sid])
194
+ end
195
+
196
+ ##
197
+ # Provide a user friendly representation
198
+ def to_s
199
+ '<Twilio.Serverless.V1.BuildStatusDetailPage>'
200
+ end
201
+ end
202
+
203
+ class BuildStatusDetailInstance < InstanceResource
204
+ ##
205
+ # Initialize the BuildStatusDetailInstance
206
+ # @param [Version] version Version that contains the resource
207
+ # @param [Hash] payload payload that contains response from Twilio
208
+ # @param [String] account_sid The SID of the
209
+ # {Account}[https://www.twilio.com/docs/iam/api/account] that created this BuildStatusDetail
210
+ # resource.
211
+ # @param [String] sid The SID of the Call resource to fetch.
212
+ # @return [BuildStatusDetailInstance] BuildStatusDetailInstance
213
+ def initialize(version, payload , service_sid: nil, sid: nil)
214
+ super(version)
215
+
216
+
217
+ # Marshaled Properties
218
+ @properties = {
219
+ 'sid' => payload['sid'],
220
+ 'account_sid' => payload['account_sid'],
221
+ 'service_sid' => payload['service_sid'],
222
+ 'status' => payload['status'],
223
+ 'error_code' => payload['error_code'] == nil ? payload['error_code'] : payload['error_code'].to_i,
224
+ 'error_message' => payload['error_message'],
225
+ 'url' => payload['url'],
226
+ }
227
+
228
+ # Context
229
+ @instance_context = nil
230
+ @params = { 'service_sid' => service_sid || @properties['service_sid'] ,'sid' => sid || @properties['sid'] , }
231
+ end
232
+
233
+ ##
234
+ # Generate an instance context for the instance, the context is capable of
235
+ # performing various actions. All instance actions are proxied to the context
236
+ # @return [BuildStatusDetailContext] CallContext for this CallInstance
237
+ def context
238
+ unless @instance_context
239
+ @instance_context = BuildStatusDetailContext.new(@version , @params['service_sid'], @params['sid'])
240
+ end
241
+ @instance_context
242
+ end
243
+
244
+ ##
245
+ # @return [String] The unique string that we created to identify the Build resource.
246
+ def sid
247
+ @properties['sid']
248
+ end
249
+
250
+ ##
251
+ # @return [String] The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Build resource.
252
+ def account_sid
253
+ @properties['account_sid']
254
+ end
255
+
256
+ ##
257
+ # @return [String] The SID of the Service that the Build resource is associated with.
258
+ def service_sid
259
+ @properties['service_sid']
260
+ end
261
+
262
+ ##
263
+ # @return [Status]
264
+ def status
265
+ @properties['status']
266
+ end
267
+
268
+ ##
269
+ # @return [String] The code of the error that failed the build. Only present when `status` is `failed`, otherwise `null`. See the [Twilio error codes](https://www.twilio.com/docs/api/errors) for the meaning of each code.
270
+ def error_code
271
+ @properties['error_code']
272
+ end
273
+
274
+ ##
275
+ # @return [String] A message that describes why the build failed. Only present when `status` is `failed`, otherwise `null`. It does not include stack traces or internal paths.
276
+ def error_message
277
+ @properties['error_message']
278
+ end
279
+
280
+ ##
281
+ # @return [String] The absolute URL of the Build Status Details resource.
282
+ def url
283
+ @properties['url']
284
+ end
285
+
286
+ ##
287
+ # Fetch the BuildStatusDetailInstance
288
+ # @return [BuildStatusDetailInstance] Fetched BuildStatusDetailInstance
289
+ def fetch
290
+
291
+ context.fetch
292
+ end
293
+
294
+ ##
295
+ # Provide a user friendly representation
296
+ def to_s
297
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
298
+ "<Twilio.Serverless.V1.BuildStatusDetailInstance #{values}>"
299
+ end
300
+
301
+ ##
302
+ # Provide a detailed, user friendly representation
303
+ def inspect
304
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
305
+ "<Twilio.Serverless.V1.BuildStatusDetailInstance #{values}>"
306
+ end
307
+ end
308
+
309
+ end
310
+ end
311
+ end
312
+ end
313
+ end
314
+ end
315
+
316
+
@@ -252,6 +252,7 @@ module Twilio
252
252
  @uri = "/Services/#{@solution[:service_sid]}/Builds/#{@solution[:sid]}"
253
253
 
254
254
  # Dependents
255
+ @build_status_details = nil
255
256
  @build_status = nil
256
257
  end
257
258
  ##
@@ -332,6 +333,17 @@ module Twilio
332
333
  )
333
334
  end
334
335
 
336
+ ##
337
+ # Access the build_status_details
338
+ # @return [BuildStatusDetailList]
339
+ # @return [BuildStatusDetailContext]
340
+ def build_status_details
341
+ BuildStatusDetailContext.new(
342
+ @version,
343
+ @solution[:service_sid],
344
+ @solution[:sid]
345
+ )
346
+ end
335
347
  ##
336
348
  # Access the build_status
337
349
  # @return [BuildStatusList]
@@ -629,6 +641,13 @@ module Twilio
629
641
  context.fetch
630
642
  end
631
643
 
644
+ ##
645
+ # Access the build_status_details
646
+ # @return [build_status_details] build_status_details
647
+ def build_status_details
648
+ context.build_status_details
649
+ end
650
+
632
651
  ##
633
652
  # Access the build_status
634
653
  # @return [build_status] build_status
@@ -54,6 +54,7 @@ module Twilio
54
54
  # @param [Boolean] enable_sna_client_token An optional Boolean value to indicate the requirement of sna client token in the SNA URL invocation response for added security. This token must match in the Verification Check request to confirm phone number verification.
55
55
  # @param [RiskCheck] risk_check
56
56
  # @param [String] tags A string containing a JSON map of key value pairs of tags to be recorded as metadata for the message. The tags will also be included as part of the verification and message status event type payloads. The object may contain up to 10 tags. Keys and values can each be up to 128 characters in length. **This value should not contain PII.**
57
+ # @param [String] risk_telemetry_id The device telemetry identifier produced by the Twilio device fingerprinting SDK for the session requesting the verification. When provided, Verify requests a device risk evaluation before sending the verification and returns its outcome in `risk_response`. Each value can be evaluated only once, so a new one is required for every request, including resends; a reused value is blocked. **This value should not contain PII.**
57
58
  # @return [VerificationInstance] Created VerificationInstance
58
59
  def create(
59
60
  to: nil,
@@ -74,7 +75,8 @@ module Twilio
74
75
  device_ip: :unset,
75
76
  enable_sna_client_token: :unset,
76
77
  risk_check: :unset,
77
- tags: :unset
78
+ tags: :unset,
79
+ risk_telemetry_id: :unset
78
80
  )
79
81
 
80
82
  data = Twilio::Values.of({
@@ -97,6 +99,7 @@ module Twilio
97
99
  'EnableSnaClientToken' => enable_sna_client_token,
98
100
  'RiskCheck' => risk_check,
99
101
  'Tags' => tags,
102
+ 'Risk.TelemetryId' => risk_telemetry_id,
100
103
  })
101
104
 
102
105
  headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
@@ -134,6 +137,7 @@ module Twilio
134
137
  # @param [Boolean] enable_sna_client_token An optional Boolean value to indicate the requirement of sna client token in the SNA URL invocation response for added security. This token must match in the Verification Check request to confirm phone number verification.
135
138
  # @param [RiskCheck] risk_check
136
139
  # @param [String] tags A string containing a JSON map of key value pairs of tags to be recorded as metadata for the message. The tags will also be included as part of the verification and message status event type payloads. The object may contain up to 10 tags. Keys and values can each be up to 128 characters in length. **This value should not contain PII.**
140
+ # @param [String] risk_telemetry_id The device telemetry identifier produced by the Twilio device fingerprinting SDK for the session requesting the verification. When provided, Verify requests a device risk evaluation before sending the verification and returns its outcome in `risk_response`. Each value can be evaluated only once, so a new one is required for every request, including resends; a reused value is blocked. **This value should not contain PII.**
137
141
  # @return [VerificationInstance] Created VerificationInstance
138
142
  def create_with_metadata(
139
143
  to: nil,
@@ -154,7 +158,8 @@ module Twilio
154
158
  device_ip: :unset,
155
159
  enable_sna_client_token: :unset,
156
160
  risk_check: :unset,
157
- tags: :unset
161
+ tags: :unset,
162
+ risk_telemetry_id: :unset
158
163
  )
159
164
 
160
165
  data = Twilio::Values.of({
@@ -177,6 +182,7 @@ module Twilio
177
182
  'EnableSnaClientToken' => enable_sna_client_token,
178
183
  'RiskCheck' => risk_check,
179
184
  'Tags' => tags,
185
+ 'Risk.TelemetryId' => risk_telemetry_id,
180
186
  })
181
187
 
182
188
  headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
@@ -455,6 +461,7 @@ module Twilio
455
461
  'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
456
462
  'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
457
463
  'sna' => payload['sna'],
464
+ 'risk_response' => payload['risk_response'],
458
465
  'url' => payload['url'],
459
466
  }
460
467
 
@@ -558,6 +565,12 @@ module Twilio
558
565
  @properties['sna']
559
566
  end
560
567
 
568
+ ##
569
+ # @return [String] The outcome of the device risk evaluation requested with `Risk.TelemetryId`. Can be: `allow`, `block`, `unavailable` (the risk engine could not be reached in time) or `error` (the risk engine returned an error). Whether a `block` is enforced depends on the service configuration: in log only mode it is recorded and the verification proceeds; when enforced, no verification is created and create returns a 403. Omitted when no evaluation was attempted, either because `Risk.TelemetryId` was not provided or because the account is not enabled for device risk evaluation.
570
+ def risk_response
571
+ @properties['risk_response']
572
+ end
573
+
561
574
  ##
562
575
  # @return [String] The absolute URL of the Verification resource.
563
576
  def url