twilio-ruby 5.66.0 → 5.67.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.
- checksums.yaml +4 -4
- data/.github/workflows/pr-lint.yml +15 -0
- data/CHANGES.md +40 -0
- data/README.md +2 -4
- data/lib/twilio-ruby/http/http_client.rb +8 -4
- data/lib/twilio-ruby/rest/api/v2010/account/call.rb +0 -7
- data/lib/twilio-ruby/rest/api/v2010/account/message.rb +1 -2
- data/lib/twilio-ruby/rest/client.rb +7 -5
- data/lib/twilio-ruby/rest/conversations/v1/address_configuration.rb +12 -5
- data/lib/twilio-ruby/rest/supersim/v1/esim_profile.rb +3 -3
- data/lib/twilio-ruby/rest/supersim/v1/usage_record.rb +14 -0
- data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +2 -1
- data/lib/twilio-ruby/rest/verify/v2/service.rb +10 -6
- data/lib/twilio-ruby/rest/verify/v2/verification_attempts_summary.rb +234 -0
- data/lib/twilio-ruby/rest/verify/v2.rb +7 -0
- data/lib/twilio-ruby/rest/verify.rb +6 -0
- data/lib/twilio-ruby/rest/video/v1/room.rb +11 -1
- data/lib/twilio-ruby/version.rb +1 -1
- data/lib/twilio-ruby.rb +1 -1
- data/twilio-ruby.gemspec +1 -1
- metadata +6 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7701af5fb4015c43f3cb33005487afe3b041e183
|
|
4
|
+
data.tar.gz: ecdf6d5493148b024f336215e37d63b7f81e8bcd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9bcaa3d09a723a6093c8f108c6b3104c66751ca3ccc6c159f88fcd34311b77a6695ea2c7a01ea58136569daae4984cb9f607e34db53b094a8e5b339f5630e9ff
|
|
7
|
+
data.tar.gz: 7ca90f7c1ef070172105178679e1f05ed6f05570b4f8f12437788f8eaa1c333499444aee475f69033fe1411977d5573a1d03c32fae22eb67cacc3d2f6273749a
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
name: Lint PR
|
|
2
|
+
on:
|
|
3
|
+
pull_request_target:
|
|
4
|
+
types: [ opened, edited, synchronize, reopened ]
|
|
5
|
+
|
|
6
|
+
jobs:
|
|
7
|
+
validate:
|
|
8
|
+
name: Validate title
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
steps:
|
|
11
|
+
- uses: amannn/action-semantic-pull-request@v4
|
|
12
|
+
with:
|
|
13
|
+
types: chore docs fix feat test
|
|
14
|
+
env:
|
|
15
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
data/CHANGES.md
CHANGED
|
@@ -1,6 +1,46 @@
|
|
|
1
1
|
twilio-ruby changelog
|
|
2
2
|
=====================
|
|
3
3
|
|
|
4
|
+
[2022-05-04] Version 5.67.0
|
|
5
|
+
---------------------------
|
|
6
|
+
**Library - Fix**
|
|
7
|
+
- [PR #607](https://github.com/twilio/twilio-ruby/pull/607): Retrieval of OS Info with Ruby Config for User Agent string. Thanks to [@claudiachua](https://github.com/claudiachua)!
|
|
8
|
+
- [PR #606](https://github.com/twilio/twilio-ruby/pull/606): Only require twilio_webhook_authentication if Rack version > 2. Thanks to [@jasonnoble](https://github.com/jasonnoble)!
|
|
9
|
+
- [PR #582](https://github.com/twilio/twilio-ruby/pull/582): avoid JSON::ParserError for all server errors. Thanks to [@dan-jensen](https://github.com/dan-jensen)!
|
|
10
|
+
|
|
11
|
+
**Library - Feature**
|
|
12
|
+
- [PR #591](https://github.com/twilio/twilio-ruby/pull/591): Add Faraday 2.0 support. Thanks to [@tconst](https://github.com/tconst)!
|
|
13
|
+
|
|
14
|
+
**Conversations**
|
|
15
|
+
- Expose query parameter `type` in list operation on Address Configurations resource
|
|
16
|
+
|
|
17
|
+
**Supersim**
|
|
18
|
+
- Add `data_total_billed` and `billed_units` fields to Super SIM UsageRecords API response.
|
|
19
|
+
- Change ESimProfiles `Eid` parameter to optional to enable Activation Code download method support **(breaking change)**
|
|
20
|
+
|
|
21
|
+
**Verify**
|
|
22
|
+
- Deprecate `push.include_date` parameter in create and update service.
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
[2022-04-20] Version 5.66.2
|
|
26
|
+
---------------------------
|
|
27
|
+
**Library - Chore**
|
|
28
|
+
- [PR #604](https://github.com/twilio/twilio-ruby/pull/604): update the user agent string for twilio-ruby. Thanks to [@claudiachua](https://github.com/claudiachua)!
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
[2022-04-06] Version 5.66.1
|
|
32
|
+
---------------------------
|
|
33
|
+
**Api**
|
|
34
|
+
- Updated `provider_sid` visibility to private
|
|
35
|
+
|
|
36
|
+
**Verify**
|
|
37
|
+
- Verify List Attempts API summary endpoint added.
|
|
38
|
+
- Update PII documentation for `AccessTokens` `factor_friendly_name` property.
|
|
39
|
+
|
|
40
|
+
**Voice**
|
|
41
|
+
- make annotation parameter from /Calls API private
|
|
42
|
+
|
|
43
|
+
|
|
4
44
|
[2022-03-23] Version 5.66.0
|
|
5
45
|
---------------------------
|
|
6
46
|
**Api**
|
data/README.md
CHANGED
|
@@ -4,8 +4,6 @@
|
|
|
4
4
|
[](https://rubygems.org/gems/twilio-ruby)
|
|
5
5
|
[](https://twil.io/learn-open-source)
|
|
6
6
|
|
|
7
|
-
**The default branch name for this repository has been changed to `main` as of 07/27/2020.**
|
|
8
|
-
|
|
9
7
|
## Documentation
|
|
10
8
|
|
|
11
9
|
The documentation for the Twilio API can be found [here][apidocs].
|
|
@@ -36,13 +34,13 @@ This library supports the following Ruby implementations:
|
|
|
36
34
|
To install using [Bundler][bundler] grab the latest stable version:
|
|
37
35
|
|
|
38
36
|
```ruby
|
|
39
|
-
gem 'twilio-ruby', '~> 5.
|
|
37
|
+
gem 'twilio-ruby', '~> 5.67.0'
|
|
40
38
|
```
|
|
41
39
|
|
|
42
40
|
To manually install `twilio-ruby` via [Rubygems][rubygems] simply gem install:
|
|
43
41
|
|
|
44
42
|
```bash
|
|
45
|
-
gem install twilio-ruby -v 5.
|
|
43
|
+
gem install twilio-ruby -v 5.67.0
|
|
46
44
|
```
|
|
47
45
|
|
|
48
46
|
To build and install the development branch yourself from the latest source:
|
|
@@ -26,12 +26,16 @@ module Twilio
|
|
|
26
26
|
nil
|
|
27
27
|
end
|
|
28
28
|
|
|
29
|
-
def _request(request)
|
|
29
|
+
def _request(request) # rubocop:disable Metrics/MethodLength
|
|
30
30
|
@connection = Faraday.new(url: request.host + ':' + request.port.to_s, ssl: { verify: true }) do |f|
|
|
31
31
|
f.options.params_encoder = Faraday::FlatParamsEncoder
|
|
32
32
|
f.request :url_encoded
|
|
33
33
|
f.headers = request.headers
|
|
34
|
-
|
|
34
|
+
if Faraday::VERSION.start_with?('2.')
|
|
35
|
+
f.request(:authorization, :basic, request.auth[0], request.auth[1])
|
|
36
|
+
else
|
|
37
|
+
f.request(:basic_auth, request.auth[0], request.auth[1])
|
|
38
|
+
end
|
|
35
39
|
f.proxy = "#{@proxy_prot}://#{@proxy_auth}#{@proxy_path}" if @proxy_prot && @proxy_path
|
|
36
40
|
f.options.open_timeout = request.timeout || @timeout
|
|
37
41
|
f.options.timeout = request.timeout || @timeout
|
|
@@ -44,8 +48,8 @@ module Twilio
|
|
|
44
48
|
@last_response = nil
|
|
45
49
|
|
|
46
50
|
response = send(request)
|
|
47
|
-
if response.status
|
|
48
|
-
object = { message:
|
|
51
|
+
if (500..599).include?(response.status)
|
|
52
|
+
object = { message: "Server error (#{response.status})", code: response.status }.to_json
|
|
49
53
|
elsif response.body && !response.body.empty?
|
|
50
54
|
object = response.body
|
|
51
55
|
elsif response.status == 400
|
|
@@ -684,7 +684,6 @@ module Twilio
|
|
|
684
684
|
'price_unit' => payload['price_unit'],
|
|
685
685
|
'direction' => payload['direction'],
|
|
686
686
|
'answered_by' => payload['answered_by'],
|
|
687
|
-
'annotation' => payload['annotation'],
|
|
688
687
|
'api_version' => payload['api_version'],
|
|
689
688
|
'forwarded_from' => payload['forwarded_from'],
|
|
690
689
|
'group_sid' => payload['group_sid'],
|
|
@@ -819,12 +818,6 @@ module Twilio
|
|
|
819
818
|
@properties['answered_by']
|
|
820
819
|
end
|
|
821
820
|
|
|
822
|
-
##
|
|
823
|
-
# @return [String] The annotation provided for the call
|
|
824
|
-
def annotation
|
|
825
|
-
@properties['annotation']
|
|
826
|
-
end
|
|
827
|
-
|
|
828
821
|
##
|
|
829
822
|
# @return [String] The API Version used to create the call
|
|
830
823
|
def api_version
|
|
@@ -83,8 +83,7 @@ module Twilio
|
|
|
83
83
|
# @param [Time] send_at The time that Twilio will send the message. Must be in ISO
|
|
84
84
|
# 8601 format.
|
|
85
85
|
# @param [Boolean] send_as_mms If set to True, Twilio will deliver the message as
|
|
86
|
-
# a single MMS message, regardless of the presence of media.
|
|
87
|
-
# Feature.
|
|
86
|
+
# a single MMS message, regardless of the presence of media.
|
|
88
87
|
# @param [String] from A Twilio phone number in
|
|
89
88
|
# {E.164}[https://www.twilio.com/docs/glossary/what-e164] format, an {alphanumeric
|
|
90
89
|
# sender
|
|
@@ -13,11 +13,11 @@ module Twilio
|
|
|
13
13
|
class Client
|
|
14
14
|
@@default_region = 'us1'
|
|
15
15
|
|
|
16
|
-
attr_accessor :http_client, :username, :password, :account_sid, :auth_token, :region, :edge, :logger
|
|
16
|
+
attr_accessor :http_client, :username, :password, :account_sid, :auth_token, :region, :edge, :logger, :user_agent_extensions
|
|
17
17
|
|
|
18
18
|
##
|
|
19
19
|
# Initializes the Twilio Client
|
|
20
|
-
def initialize(username=nil, password=nil, account_sid=nil, region=nil, http_client=nil, logger=nil)
|
|
20
|
+
def initialize(username=nil, password=nil, account_sid=nil, region=nil, http_client=nil, logger=nil, user_agent_extensions=nil)
|
|
21
21
|
@username = username || Twilio.account_sid
|
|
22
22
|
@password = password || Twilio.auth_token
|
|
23
23
|
@region = region || Twilio.region
|
|
@@ -27,6 +27,7 @@ module Twilio
|
|
|
27
27
|
@auth = [@username, @password]
|
|
28
28
|
@http_client = http_client || Twilio.http_client || Twilio::HTTP::Client.new
|
|
29
29
|
@logger = logger || Twilio.logger
|
|
30
|
+
@user_agent_extensions = user_agent_extensions || []
|
|
30
31
|
|
|
31
32
|
# Domains
|
|
32
33
|
@accounts = nil
|
|
@@ -69,11 +70,12 @@ module Twilio
|
|
|
69
70
|
def request(host, port, method, uri, params={}, data={}, headers={}, auth=nil, timeout=nil)
|
|
70
71
|
auth ||= @auth
|
|
71
72
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
" #{RUBY_VERSION}-p#{RUBY_PATCHLEVEL})"
|
|
73
|
+
ruby_config = RbConfig::CONFIG
|
|
74
|
+
headers['User-Agent'] = "twilio-ruby/#{Twilio::VERSION} (#{ruby_config["host_os"]} #{ruby_config["host_cpu"]}) Ruby/#{RUBY_VERSION}"
|
|
75
75
|
headers['Accept-Charset'] = 'utf-8'
|
|
76
76
|
|
|
77
|
+
user_agent_extensions.each { |extension| headers['User-Agent'] += " #{extension}" }
|
|
78
|
+
|
|
77
79
|
if method == 'POST' && !headers['Content-Type']
|
|
78
80
|
headers['Content-Type'] = 'application/x-www-form-urlencoded'
|
|
79
81
|
end
|
|
@@ -27,6 +27,8 @@ module Twilio
|
|
|
27
27
|
# Lists AddressConfigurationInstance records from the API as a list.
|
|
28
28
|
# Unlike stream(), this operation is eager and will load `limit` records into
|
|
29
29
|
# memory before returning.
|
|
30
|
+
# @param [String] type Filter the address configurations by its type. This value
|
|
31
|
+
# can be one of: `whatsapp`, `sms`.
|
|
30
32
|
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
|
31
33
|
# guarantees to never return more than limit. Default is no limit
|
|
32
34
|
# @param [Integer] page_size Number of records to fetch per request, when
|
|
@@ -34,14 +36,16 @@ module Twilio
|
|
|
34
36
|
# but a limit is defined, stream() will attempt to read the limit with the most
|
|
35
37
|
# efficient page size, i.e. min(limit, 1000)
|
|
36
38
|
# @return [Array] Array of up to limit results
|
|
37
|
-
def list(limit: nil, page_size: nil)
|
|
38
|
-
self.stream(limit: limit, page_size: page_size).entries
|
|
39
|
+
def list(type: :unset, limit: nil, page_size: nil)
|
|
40
|
+
self.stream(type: type, limit: limit, page_size: page_size).entries
|
|
39
41
|
end
|
|
40
42
|
|
|
41
43
|
##
|
|
42
44
|
# Streams AddressConfigurationInstance records from the API as an Enumerable.
|
|
43
45
|
# This operation lazily loads records as efficiently as possible until the limit
|
|
44
46
|
# is reached.
|
|
47
|
+
# @param [String] type Filter the address configurations by its type. This value
|
|
48
|
+
# can be one of: `whatsapp`, `sms`.
|
|
45
49
|
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
|
46
50
|
# guarantees to never return more than limit. Default is no limit.
|
|
47
51
|
# @param [Integer] page_size Number of records to fetch per request, when
|
|
@@ -49,10 +53,10 @@ module Twilio
|
|
|
49
53
|
# but a limit is defined, stream() will attempt to read the limit with the most
|
|
50
54
|
# efficient page size, i.e. min(limit, 1000)
|
|
51
55
|
# @return [Enumerable] Enumerable that will yield up to limit results
|
|
52
|
-
def stream(limit: nil, page_size: nil)
|
|
56
|
+
def stream(type: :unset, limit: nil, page_size: nil)
|
|
53
57
|
limits = @version.read_limits(limit, page_size)
|
|
54
58
|
|
|
55
|
-
page = self.page(page_size: limits[:page_size], )
|
|
59
|
+
page = self.page(type: type, page_size: limits[:page_size], )
|
|
56
60
|
|
|
57
61
|
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
|
58
62
|
end
|
|
@@ -74,12 +78,15 @@ module Twilio
|
|
|
74
78
|
##
|
|
75
79
|
# Retrieve a single page of AddressConfigurationInstance records from the API.
|
|
76
80
|
# Request is executed immediately.
|
|
81
|
+
# @param [String] type Filter the address configurations by its type. This value
|
|
82
|
+
# can be one of: `whatsapp`, `sms`.
|
|
77
83
|
# @param [String] page_token PageToken provided by the API
|
|
78
84
|
# @param [Integer] page_number Page Number, this value is simply for client state
|
|
79
85
|
# @param [Integer] page_size Number of records to return, defaults to 50
|
|
80
86
|
# @return [Page] Page of AddressConfigurationInstance
|
|
81
|
-
def page(page_token: :unset, page_number: :unset, page_size: :unset)
|
|
87
|
+
def page(type: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
|
|
82
88
|
params = Twilio::Values.of({
|
|
89
|
+
'Type' => type,
|
|
83
90
|
'PageToken' => page_token,
|
|
84
91
|
'Page' => page_number,
|
|
85
92
|
'PageSize' => page_size,
|
|
@@ -27,19 +27,19 @@ module Twilio
|
|
|
27
27
|
|
|
28
28
|
##
|
|
29
29
|
# Create the EsimProfileInstance
|
|
30
|
-
# @param [String] eid Identifier of the eUICC that will claim the eSIM Profile.
|
|
31
30
|
# @param [String] callback_url The URL we should call using the `callback_method`
|
|
32
31
|
# when the status of the eSIM Profile changes. At this stage of the eSIM Profile
|
|
33
32
|
# pilot, the a request to the URL will only be called when the ESimProfile
|
|
34
33
|
# resource changes from `reserving` to `available`.
|
|
35
34
|
# @param [String] callback_method The HTTP method we should use to call
|
|
36
35
|
# `callback_url`. Can be: `GET` or `POST` and the default is POST.
|
|
36
|
+
# @param [String] eid Identifier of the eUICC that will claim the eSIM Profile.
|
|
37
37
|
# @return [EsimProfileInstance] Created EsimProfileInstance
|
|
38
|
-
def create(
|
|
38
|
+
def create(callback_url: :unset, callback_method: :unset, eid: :unset)
|
|
39
39
|
data = Twilio::Values.of({
|
|
40
|
-
'Eid' => eid,
|
|
41
40
|
'CallbackUrl' => callback_url,
|
|
42
41
|
'CallbackMethod' => callback_method,
|
|
42
|
+
'Eid' => eid,
|
|
43
43
|
})
|
|
44
44
|
|
|
45
45
|
payload = @version.create('POST', @uri, data: data)
|
|
@@ -263,6 +263,8 @@ module Twilio
|
|
|
263
263
|
'data_upload' => payload['data_upload'].to_i,
|
|
264
264
|
'data_download' => payload['data_download'].to_i,
|
|
265
265
|
'data_total' => payload['data_total'].to_i,
|
|
266
|
+
'data_total_billed' => payload['data_total_billed'].to_f,
|
|
267
|
+
'billed_unit' => payload['billed_unit'],
|
|
266
268
|
}
|
|
267
269
|
end
|
|
268
270
|
|
|
@@ -320,6 +322,18 @@ module Twilio
|
|
|
320
322
|
@properties['data_total']
|
|
321
323
|
end
|
|
322
324
|
|
|
325
|
+
##
|
|
326
|
+
# @return [String] Total amount in the `billed_unit` that was charged for the data uploaded or downloaded.
|
|
327
|
+
def data_total_billed
|
|
328
|
+
@properties['data_total_billed']
|
|
329
|
+
end
|
|
330
|
+
|
|
331
|
+
##
|
|
332
|
+
# @return [String] The currency in which the billed amounts are measured, specified in the 3 letter ISO 4127 format (e.g. `USD`, `EUR`, `JPY`).
|
|
333
|
+
def billed_unit
|
|
334
|
+
@properties['billed_unit']
|
|
335
|
+
end
|
|
336
|
+
|
|
323
337
|
##
|
|
324
338
|
# Provide a user friendly representation
|
|
325
339
|
def to_s
|
|
@@ -61,7 +61,8 @@ module Twilio
|
|
|
61
61
|
# may include multiple Rate Limit values in each request.
|
|
62
62
|
# @param [Hash] channel_configuration
|
|
63
63
|
# {`email`}[https://www.twilio.com/docs/verify/email] channel configuration in
|
|
64
|
-
# json format.
|
|
64
|
+
# json format. The fields 'from' and 'from_name' are optional but if included the
|
|
65
|
+
# 'from' field must have a valid email address.
|
|
65
66
|
# @param [String] app_hash Your {App
|
|
66
67
|
# Hash}[https://developers.google.com/identity/sms-retriever/verify#computing_your_apps_hash_string]
|
|
67
68
|
# to be appended at the end of your verification SMS body. Applies only to SMS.
|
|
@@ -48,10 +48,12 @@ module Twilio
|
|
|
48
48
|
# a custom code instead of a randomly generated one. Not available for all
|
|
49
49
|
# customers.
|
|
50
50
|
# @param [Boolean] push_include_date Optional configuration for the Push factors.
|
|
51
|
-
# If true, include the date in the Challenge's
|
|
51
|
+
# If true, include the date in the Challenge's response. Otherwise, the date is
|
|
52
52
|
# omitted from the response. See
|
|
53
53
|
# {Challenge}[https://www.twilio.com/docs/verify/api/challenge] resource’s details
|
|
54
|
-
# parameter for more info. Default:
|
|
54
|
+
# parameter for more info. Default: false. **Deprecated** do not use this
|
|
55
|
+
# parameter. This timestamp value is the same one as the one found in
|
|
56
|
+
# `date_created`, please use that one instead.
|
|
55
57
|
# @param [String] push_apn_credential_sid Optional configuration for the Push
|
|
56
58
|
# factors. Set the APN Credential for this service. This will allow to send push
|
|
57
59
|
# notifications to iOS devices. See {Credential
|
|
@@ -282,10 +284,11 @@ module Twilio
|
|
|
282
284
|
# a custom code instead of a randomly generated one. Not available for all
|
|
283
285
|
# customers.
|
|
284
286
|
# @param [Boolean] push_include_date Optional configuration for the Push factors.
|
|
285
|
-
# If true, include the date in the Challenge's
|
|
287
|
+
# If true, include the date in the Challenge's response. Otherwise, the date is
|
|
286
288
|
# omitted from the response. See
|
|
287
289
|
# {Challenge}[https://www.twilio.com/docs/verify/api/challenge] resource’s details
|
|
288
|
-
# parameter for more info. Default:
|
|
290
|
+
# parameter for more info. Default: false. **Deprecated** do not use this
|
|
291
|
+
# parameter.
|
|
289
292
|
# @param [String] push_apn_credential_sid Optional configuration for the Push
|
|
290
293
|
# factors. Set the APN Credential for this service. This will allow to send push
|
|
291
294
|
# notifications to iOS devices. See {Credential
|
|
@@ -666,10 +669,11 @@ module Twilio
|
|
|
666
669
|
# a custom code instead of a randomly generated one. Not available for all
|
|
667
670
|
# customers.
|
|
668
671
|
# @param [Boolean] push_include_date Optional configuration for the Push factors.
|
|
669
|
-
# If true, include the date in the Challenge's
|
|
672
|
+
# If true, include the date in the Challenge's response. Otherwise, the date is
|
|
670
673
|
# omitted from the response. See
|
|
671
674
|
# {Challenge}[https://www.twilio.com/docs/verify/api/challenge] resource’s details
|
|
672
|
-
# parameter for more info. Default:
|
|
675
|
+
# parameter for more info. Default: false. **Deprecated** do not use this
|
|
676
|
+
# parameter.
|
|
673
677
|
# @param [String] push_apn_credential_sid Optional configuration for the Push
|
|
674
678
|
# factors. Set the APN Credential for this service. This will allow to send push
|
|
675
679
|
# notifications to iOS devices. See {Credential
|
|
@@ -0,0 +1,234 @@
|
|
|
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 VerificationAttemptsSummaryList < ListResource
|
|
14
|
+
##
|
|
15
|
+
# Initialize the VerificationAttemptsSummaryList
|
|
16
|
+
# @param [Version] version Version that contains the resource
|
|
17
|
+
# @return [VerificationAttemptsSummaryList] VerificationAttemptsSummaryList
|
|
18
|
+
def initialize(version)
|
|
19
|
+
super(version)
|
|
20
|
+
|
|
21
|
+
# Path Solution
|
|
22
|
+
@solution = {}
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
##
|
|
26
|
+
# Provide a user friendly representation
|
|
27
|
+
def to_s
|
|
28
|
+
'#<Twilio.Verify.V2.VerificationAttemptsSummaryList>'
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
class VerificationAttemptsSummaryPage < Page
|
|
33
|
+
##
|
|
34
|
+
# Initialize the VerificationAttemptsSummaryPage
|
|
35
|
+
# @param [Version] version Version that contains the resource
|
|
36
|
+
# @param [Response] response Response from the API
|
|
37
|
+
# @param [Hash] solution Path solution for the resource
|
|
38
|
+
# @return [VerificationAttemptsSummaryPage] VerificationAttemptsSummaryPage
|
|
39
|
+
def initialize(version, response, solution)
|
|
40
|
+
super(version, response)
|
|
41
|
+
|
|
42
|
+
# Path Solution
|
|
43
|
+
@solution = solution
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
##
|
|
47
|
+
# Build an instance of VerificationAttemptsSummaryInstance
|
|
48
|
+
# @param [Hash] payload Payload response from the API
|
|
49
|
+
# @return [VerificationAttemptsSummaryInstance] VerificationAttemptsSummaryInstance
|
|
50
|
+
def get_instance(payload)
|
|
51
|
+
VerificationAttemptsSummaryInstance.new(@version, payload, )
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
##
|
|
55
|
+
# Provide a user friendly representation
|
|
56
|
+
def to_s
|
|
57
|
+
'<Twilio.Verify.V2.VerificationAttemptsSummaryPage>'
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
class VerificationAttemptsSummaryContext < InstanceContext
|
|
62
|
+
##
|
|
63
|
+
# Initialize the VerificationAttemptsSummaryContext
|
|
64
|
+
# @param [Version] version Version that contains the resource
|
|
65
|
+
# @return [VerificationAttemptsSummaryContext] VerificationAttemptsSummaryContext
|
|
66
|
+
def initialize(version)
|
|
67
|
+
super(version)
|
|
68
|
+
|
|
69
|
+
# Path Solution
|
|
70
|
+
@solution = {}
|
|
71
|
+
@uri = "/Attempts/Summary"
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
##
|
|
75
|
+
# Fetch the VerificationAttemptsSummaryInstance
|
|
76
|
+
# @param [String] verify_service_sid Filter used to consider only Verification
|
|
77
|
+
# Attempts of the given verify service on the summary aggregation.
|
|
78
|
+
# @param [Time] date_created_after Datetime filter used to consider only
|
|
79
|
+
# Verification Attempts created after this datetime on the summary aggregation.
|
|
80
|
+
# Given as GMT in RFC 2822 format.
|
|
81
|
+
# @param [Time] date_created_before Datetime filter used to consider only
|
|
82
|
+
# Verification Attempts created before this datetime on the summary aggregation.
|
|
83
|
+
# Given as GMT in RFC 2822 format.
|
|
84
|
+
# @param [String] country Filter used to consider only Verification Attempts sent
|
|
85
|
+
# to the specified destination country on the summary aggregation.
|
|
86
|
+
# @param [verification_attempts_summary.Channels] channel Filter Verification
|
|
87
|
+
# Attempts considered on the summary aggregation by communication channel. Valid
|
|
88
|
+
# values are `SMS` and `CALL`
|
|
89
|
+
# @param [String] destination_prefix Filter the Verification Attempts considered
|
|
90
|
+
# on the summary aggregation by Destination prefix. It is the prefix of a phone
|
|
91
|
+
# number in E.164 format.
|
|
92
|
+
# @return [VerificationAttemptsSummaryInstance] Fetched VerificationAttemptsSummaryInstance
|
|
93
|
+
def fetch(verify_service_sid: :unset, date_created_after: :unset, date_created_before: :unset, country: :unset, channel: :unset, destination_prefix: :unset)
|
|
94
|
+
params = Twilio::Values.of({
|
|
95
|
+
'VerifyServiceSid' => verify_service_sid,
|
|
96
|
+
'DateCreatedAfter' => Twilio.serialize_iso8601_datetime(date_created_after),
|
|
97
|
+
'DateCreatedBefore' => Twilio.serialize_iso8601_datetime(date_created_before),
|
|
98
|
+
'Country' => country,
|
|
99
|
+
'Channel' => channel,
|
|
100
|
+
'DestinationPrefix' => destination_prefix,
|
|
101
|
+
})
|
|
102
|
+
|
|
103
|
+
payload = @version.fetch('GET', @uri, params: params)
|
|
104
|
+
|
|
105
|
+
VerificationAttemptsSummaryInstance.new(@version, payload, )
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
##
|
|
109
|
+
# Provide a user friendly representation
|
|
110
|
+
def to_s
|
|
111
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
|
112
|
+
"#<Twilio.Verify.V2.VerificationAttemptsSummaryContext #{context}>"
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
##
|
|
116
|
+
# Provide a detailed, user friendly representation
|
|
117
|
+
def inspect
|
|
118
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
|
119
|
+
"#<Twilio.Verify.V2.VerificationAttemptsSummaryContext #{context}>"
|
|
120
|
+
end
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
class VerificationAttemptsSummaryInstance < InstanceResource
|
|
124
|
+
##
|
|
125
|
+
# Initialize the VerificationAttemptsSummaryInstance
|
|
126
|
+
# @param [Version] version Version that contains the resource
|
|
127
|
+
# @param [Hash] payload payload that contains response from Twilio
|
|
128
|
+
# @return [VerificationAttemptsSummaryInstance] VerificationAttemptsSummaryInstance
|
|
129
|
+
def initialize(version, payload)
|
|
130
|
+
super(version)
|
|
131
|
+
|
|
132
|
+
# Marshaled Properties
|
|
133
|
+
@properties = {
|
|
134
|
+
'total_attempts' => payload['total_attempts'].to_i,
|
|
135
|
+
'total_converted' => payload['total_converted'].to_i,
|
|
136
|
+
'total_unconverted' => payload['total_unconverted'].to_i,
|
|
137
|
+
'conversion_rate_percentage' => payload['conversion_rate_percentage'].to_f,
|
|
138
|
+
'url' => payload['url'],
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
# Context
|
|
142
|
+
@instance_context = nil
|
|
143
|
+
@params = {}
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
##
|
|
147
|
+
# Generate an instance context for the instance, the context is capable of
|
|
148
|
+
# performing various actions. All instance actions are proxied to the context
|
|
149
|
+
# @return [VerificationAttemptsSummaryContext] VerificationAttemptsSummaryContext for this VerificationAttemptsSummaryInstance
|
|
150
|
+
def context
|
|
151
|
+
unless @instance_context
|
|
152
|
+
@instance_context = VerificationAttemptsSummaryContext.new(@version, )
|
|
153
|
+
end
|
|
154
|
+
@instance_context
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
##
|
|
158
|
+
# @return [String] Total of attempts made.
|
|
159
|
+
def total_attempts
|
|
160
|
+
@properties['total_attempts']
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
##
|
|
164
|
+
# @return [String] Total of attempts confirmed by the end user.
|
|
165
|
+
def total_converted
|
|
166
|
+
@properties['total_converted']
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
##
|
|
170
|
+
# @return [String] Total of attempts made that were not confirmed by the end user.
|
|
171
|
+
def total_unconverted
|
|
172
|
+
@properties['total_unconverted']
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
##
|
|
176
|
+
# @return [String] Percentage of the confirmed messages over the total.
|
|
177
|
+
def conversion_rate_percentage
|
|
178
|
+
@properties['conversion_rate_percentage']
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
##
|
|
182
|
+
# @return [String] The url
|
|
183
|
+
def url
|
|
184
|
+
@properties['url']
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
##
|
|
188
|
+
# Fetch the VerificationAttemptsSummaryInstance
|
|
189
|
+
# @param [String] verify_service_sid Filter used to consider only Verification
|
|
190
|
+
# Attempts of the given verify service on the summary aggregation.
|
|
191
|
+
# @param [Time] date_created_after Datetime filter used to consider only
|
|
192
|
+
# Verification Attempts created after this datetime on the summary aggregation.
|
|
193
|
+
# Given as GMT in RFC 2822 format.
|
|
194
|
+
# @param [Time] date_created_before Datetime filter used to consider only
|
|
195
|
+
# Verification Attempts created before this datetime on the summary aggregation.
|
|
196
|
+
# Given as GMT in RFC 2822 format.
|
|
197
|
+
# @param [String] country Filter used to consider only Verification Attempts sent
|
|
198
|
+
# to the specified destination country on the summary aggregation.
|
|
199
|
+
# @param [verification_attempts_summary.Channels] channel Filter Verification
|
|
200
|
+
# Attempts considered on the summary aggregation by communication channel. Valid
|
|
201
|
+
# values are `SMS` and `CALL`
|
|
202
|
+
# @param [String] destination_prefix Filter the Verification Attempts considered
|
|
203
|
+
# on the summary aggregation by Destination prefix. It is the prefix of a phone
|
|
204
|
+
# number in E.164 format.
|
|
205
|
+
# @return [VerificationAttemptsSummaryInstance] Fetched VerificationAttemptsSummaryInstance
|
|
206
|
+
def fetch(verify_service_sid: :unset, date_created_after: :unset, date_created_before: :unset, country: :unset, channel: :unset, destination_prefix: :unset)
|
|
207
|
+
context.fetch(
|
|
208
|
+
verify_service_sid: verify_service_sid,
|
|
209
|
+
date_created_after: date_created_after,
|
|
210
|
+
date_created_before: date_created_before,
|
|
211
|
+
country: country,
|
|
212
|
+
channel: channel,
|
|
213
|
+
destination_prefix: destination_prefix,
|
|
214
|
+
)
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
##
|
|
218
|
+
# Provide a user friendly representation
|
|
219
|
+
def to_s
|
|
220
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
|
221
|
+
"<Twilio.Verify.V2.VerificationAttemptsSummaryInstance #{values}>"
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
##
|
|
225
|
+
# Provide a detailed, user friendly representation
|
|
226
|
+
def inspect
|
|
227
|
+
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
|
228
|
+
"<Twilio.Verify.V2.VerificationAttemptsSummaryInstance #{values}>"
|
|
229
|
+
end
|
|
230
|
+
end
|
|
231
|
+
end
|
|
232
|
+
end
|
|
233
|
+
end
|
|
234
|
+
end
|
|
@@ -18,6 +18,7 @@ module Twilio
|
|
|
18
18
|
@forms = nil
|
|
19
19
|
@services = nil
|
|
20
20
|
@verification_attempts = nil
|
|
21
|
+
@verification_attempts_summary = nil
|
|
21
22
|
@templates = nil
|
|
22
23
|
end
|
|
23
24
|
|
|
@@ -68,6 +69,12 @@ module Twilio
|
|
|
68
69
|
end
|
|
69
70
|
end
|
|
70
71
|
|
|
72
|
+
##
|
|
73
|
+
# @return [Twilio::REST::Verify::V2::VerificationAttemptsSummaryContext]
|
|
74
|
+
def verification_attempts_summary
|
|
75
|
+
@verification_attempts_summary ||= VerificationAttemptsSummaryContext.new self
|
|
76
|
+
end
|
|
77
|
+
|
|
71
78
|
##
|
|
72
79
|
# @return [Twilio::REST::Verify::V2::TemplateContext]
|
|
73
80
|
def templates
|
|
@@ -55,6 +55,12 @@ module Twilio
|
|
|
55
55
|
self.v2.verification_attempts(sid)
|
|
56
56
|
end
|
|
57
57
|
|
|
58
|
+
##
|
|
59
|
+
# @return [Twilio::REST::Verify::V2::VerificationAttemptsSummaryInstance]
|
|
60
|
+
def verification_attempts_summary
|
|
61
|
+
self.v2.verification_attempts_summary()
|
|
62
|
+
end
|
|
63
|
+
|
|
58
64
|
##
|
|
59
65
|
# @return [Twilio::REST::Verify::V2::TemplateInstance]
|
|
60
66
|
def templates
|
|
@@ -72,8 +72,10 @@ module Twilio
|
|
|
72
72
|
# @param [String] unused_room_timeout Configures how long (in minutes) a room will
|
|
73
73
|
# remain active if no one joins. Valid values range from 1 to 60 minutes (no
|
|
74
74
|
# fractions).
|
|
75
|
+
# @param [Boolean] large_room When set to true, indicated that this is the large
|
|
76
|
+
# room.
|
|
75
77
|
# @return [RoomInstance] Created RoomInstance
|
|
76
|
-
def create(enable_turn: :unset, type: :unset, unique_name: :unset, status_callback: :unset, status_callback_method: :unset, max_participants: :unset, record_participants_on_connect: :unset, video_codecs: :unset, media_region: :unset, recording_rules: :unset, audio_only: :unset, max_participant_duration: :unset, empty_room_timeout: :unset, unused_room_timeout: :unset)
|
|
78
|
+
def create(enable_turn: :unset, type: :unset, unique_name: :unset, status_callback: :unset, status_callback_method: :unset, max_participants: :unset, record_participants_on_connect: :unset, video_codecs: :unset, media_region: :unset, recording_rules: :unset, audio_only: :unset, max_participant_duration: :unset, empty_room_timeout: :unset, unused_room_timeout: :unset, large_room: :unset)
|
|
77
79
|
data = Twilio::Values.of({
|
|
78
80
|
'EnableTurn' => enable_turn,
|
|
79
81
|
'Type' => type,
|
|
@@ -89,6 +91,7 @@ module Twilio
|
|
|
89
91
|
'MaxParticipantDuration' => max_participant_duration,
|
|
90
92
|
'EmptyRoomTimeout' => empty_room_timeout,
|
|
91
93
|
'UnusedRoomTimeout' => unused_room_timeout,
|
|
94
|
+
'LargeRoom' => large_room,
|
|
92
95
|
})
|
|
93
96
|
|
|
94
97
|
payload = @version.create('POST', @uri, data: data)
|
|
@@ -387,6 +390,7 @@ module Twilio
|
|
|
387
390
|
'audio_only' => payload['audio_only'],
|
|
388
391
|
'empty_room_timeout' => payload['empty_room_timeout'].to_i,
|
|
389
392
|
'unused_room_timeout' => payload['unused_room_timeout'].to_i,
|
|
393
|
+
'large_room' => payload['large_room'],
|
|
390
394
|
'url' => payload['url'],
|
|
391
395
|
'links' => payload['links'],
|
|
392
396
|
}
|
|
@@ -533,6 +537,12 @@ module Twilio
|
|
|
533
537
|
@properties['unused_room_timeout']
|
|
534
538
|
end
|
|
535
539
|
|
|
540
|
+
##
|
|
541
|
+
# @return [Boolean] Indicates if this is a large room.
|
|
542
|
+
def large_room
|
|
543
|
+
@properties['large_room']
|
|
544
|
+
end
|
|
545
|
+
|
|
536
546
|
##
|
|
537
547
|
# @return [String] The absolute URL of the resource
|
|
538
548
|
def url
|
data/lib/twilio-ruby/version.rb
CHANGED
data/lib/twilio-ruby.rb
CHANGED
|
@@ -10,7 +10,7 @@ require 'time'
|
|
|
10
10
|
require 'json'
|
|
11
11
|
|
|
12
12
|
require 'twilio-ruby/version' unless defined?(Twilio::VERSION)
|
|
13
|
-
require 'rack/twilio_webhook_authentication' if defined?(Rack)
|
|
13
|
+
require 'rack/twilio_webhook_authentication' if defined?(Rack) && defined?(Rack::MediaType)
|
|
14
14
|
|
|
15
15
|
require 'twilio-ruby/util'
|
|
16
16
|
require 'twilio-ruby/security/request_validator'
|
data/twilio-ruby.gemspec
CHANGED
|
@@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
|
|
|
26
26
|
|
|
27
27
|
spec.add_dependency('jwt', '>= 1.5', '<= 2.5')
|
|
28
28
|
spec.add_dependency('nokogiri', '>= 1.6', '< 2.0')
|
|
29
|
-
spec.add_dependency('faraday', '>= 0.9', '<
|
|
29
|
+
spec.add_dependency('faraday', '>= 0.9', '< 3.0')
|
|
30
30
|
# Workaround for RBX <= 2.2.1, should be fixed in next version
|
|
31
31
|
spec.add_dependency('rubysl') if defined?(RUBY_ENGINE) && RUBY_ENGINE == 'rbx'
|
|
32
32
|
|
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.67.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: 2022-
|
|
11
|
+
date: 2022-05-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: jwt
|
|
@@ -59,7 +59,7 @@ dependencies:
|
|
|
59
59
|
version: '0.9'
|
|
60
60
|
- - "<"
|
|
61
61
|
- !ruby/object:Gem::Version
|
|
62
|
-
version: '
|
|
62
|
+
version: '3.0'
|
|
63
63
|
type: :runtime
|
|
64
64
|
prerelease: false
|
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -69,7 +69,7 @@ dependencies:
|
|
|
69
69
|
version: '0.9'
|
|
70
70
|
- - "<"
|
|
71
71
|
- !ruby/object:Gem::Version
|
|
72
|
-
version: '
|
|
72
|
+
version: '3.0'
|
|
73
73
|
- !ruby/object:Gem::Dependency
|
|
74
74
|
name: bundler
|
|
75
75
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -198,6 +198,7 @@ extra_rdoc_files:
|
|
|
198
198
|
- LICENSE
|
|
199
199
|
files:
|
|
200
200
|
- ".dockerignore"
|
|
201
|
+
- ".github/workflows/pr-lint.yml"
|
|
201
202
|
- ".github/workflows/test-and-deploy.yml"
|
|
202
203
|
- ".gitignore"
|
|
203
204
|
- ".rubocop.yml"
|
|
@@ -725,6 +726,7 @@ files:
|
|
|
725
726
|
- lib/twilio-ruby/rest/verify/v2/service/webhook.rb
|
|
726
727
|
- lib/twilio-ruby/rest/verify/v2/template.rb
|
|
727
728
|
- lib/twilio-ruby/rest/verify/v2/verification_attempt.rb
|
|
729
|
+
- lib/twilio-ruby/rest/verify/v2/verification_attempts_summary.rb
|
|
728
730
|
- lib/twilio-ruby/rest/video.rb
|
|
729
731
|
- lib/twilio-ruby/rest/video/v1.rb
|
|
730
732
|
- lib/twilio-ruby/rest/video/v1/composition.rb
|