twilio-ruby 5.31.0 → 5.31.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -12,8 +12,6 @@ module Twilio
12
12
  class V2 < Version
13
13
  class ServiceContext < InstanceContext
14
14
  class RateLimitContext < InstanceContext
15
- ##
16
- # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
17
15
  class BucketList < ListResource
18
16
  ##
19
17
  # Initialize the BucketList
@@ -145,8 +143,6 @@ module Twilio
145
143
  end
146
144
  end
147
145
 
148
- ##
149
- # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
150
146
  class BucketPage < Page
151
147
  ##
152
148
  # Initialize the BucketPage
@@ -181,8 +177,6 @@ module Twilio
181
177
  end
182
178
  end
183
179
 
184
- ##
185
- # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
186
180
  class BucketContext < InstanceContext
187
181
  ##
188
182
  # Initialize the BucketContext
@@ -269,8 +263,6 @@ module Twilio
269
263
  end
270
264
  end
271
265
 
272
- ##
273
- # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
274
266
  class BucketInstance < InstanceResource
275
267
  ##
276
268
  # Initialize the BucketInstance
@@ -11,8 +11,6 @@ module Twilio
11
11
  class Verify < Domain
12
12
  class V2 < Version
13
13
  class ServiceContext < InstanceContext
14
- ##
15
- # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
16
14
  class VerificationList < ListResource
17
15
  ##
18
16
  # Initialize the VerificationList
@@ -35,7 +33,7 @@ module Twilio
35
33
  # @param [String] to The phone number or email to verify. Phone numbers must be in
36
34
  # [E.164 format](https://www.twilio.com/docs/glossary/what-e164).
37
35
  # @param [String] channel The verification method to use. Can be:
38
- # `email`([*])[#email-channel-availability], `sms` or `call`.
36
+ # [`email`*](#email-channel-availability), `sms` or `call`.
39
37
  # @param [String] custom_message The text of a custom message to use for the
40
38
  # verification.
41
39
  # @param [String] send_digits The digits to send after a phone call is answered,
@@ -56,8 +54,8 @@ module Twilio
56
54
  # Limits. Keys should be the unique_name configured while creating you Rate Limit
57
55
  # along with the associated values for each particular request. You may include
58
56
  # multiple Rate Limit values in each request.
59
- # @param [Hash] channel_configuration Channel specific configuration in json
60
- # format: For email must include 'from' and 'from_name'.
57
+ # @param [Hash] channel_configuration `email` channel configuration in json
58
+ # format. Must include 'from' and 'from_name'.
61
59
  # @return [VerificationInstance] Newly created VerificationInstance
62
60
  def create(to: nil, channel: nil, custom_message: :unset, send_digits: :unset, locale: :unset, custom_code: :unset, amount: :unset, payee: :unset, rate_limits: :unset, channel_configuration: :unset)
63
61
  data = Twilio::Values.of({
@@ -89,8 +87,6 @@ module Twilio
89
87
  end
90
88
  end
91
89
 
92
- ##
93
- # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
94
90
  class VerificationPage < Page
95
91
  ##
96
92
  # Initialize the VerificationPage
@@ -120,8 +116,6 @@ module Twilio
120
116
  end
121
117
  end
122
118
 
123
- ##
124
- # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
125
119
  class VerificationContext < InstanceContext
126
120
  ##
127
121
  # Initialize the VerificationContext
@@ -197,8 +191,6 @@ module Twilio
197
191
  end
198
192
  end
199
193
 
200
- ##
201
- # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
202
194
  class VerificationInstance < InstanceResource
203
195
  ##
204
196
  # Initialize the VerificationInstance
@@ -11,8 +11,6 @@ module Twilio
11
11
  class Verify < Domain
12
12
  class V2 < Version
13
13
  class ServiceContext < InstanceContext
14
- ##
15
- # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
16
14
  class VerificationCheckList < ListResource
17
15
  ##
18
16
  # Initialize the VerificationCheckList
@@ -33,11 +31,14 @@ module Twilio
33
31
  # Retrieve a single page of VerificationCheckInstance records from the API.
34
32
  # Request is executed immediately.
35
33
  # @param [String] code The 4-10 character string being verified.
36
- # @param [String] to The phone number to verify. Either this parameter or the
37
- # `verification_sid` must be specified. Phone numbers must be in [E.164
38
- # format](https://www.twilio.com/docs/glossary/what-e164).
34
+ # @param [String] to The phone number or
35
+ # [email](https://www.twilio.com/docs/verify/tutorials/email) to verify. Either
36
+ # this parameter or the `verification_sid` must be specified. Phone numbers must
37
+ # be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164).
39
38
  # @param [String] verification_sid A SID that uniquely identifies the Verification
40
- # Check. Either this parameter or the `to` phone number must be specified.
39
+ # Check. Either this parameter or the `to` phone
40
+ # number/[email](https://www.twilio.com/docs/verify/tutorials/email) must be
41
+ # specified.
41
42
  # @param [String] amount The amount of the associated PSD2 compliant transaction.
42
43
  # Requires the PSD2 Service flag enabled.
43
44
  # @param [String] payee The payee of the associated PSD2 compliant transaction.
@@ -68,8 +69,6 @@ module Twilio
68
69
  end
69
70
  end
70
71
 
71
- ##
72
- # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
73
72
  class VerificationCheckPage < Page
74
73
  ##
75
74
  # Initialize the VerificationCheckPage
@@ -99,8 +98,6 @@ module Twilio
99
98
  end
100
99
  end
101
100
 
102
- ##
103
- # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
104
101
  class VerificationCheckInstance < InstanceResource
105
102
  ##
106
103
  # Initialize the VerificationCheckInstance
@@ -148,7 +145,7 @@ module Twilio
148
145
  end
149
146
 
150
147
  ##
151
- # @return [String] The phone number being verified
148
+ # @return [String] The phone number or email being verified
152
149
  def to
153
150
  @properties['to']
154
151
  end
@@ -1,3 +1,3 @@
1
1
  module Twilio
2
- VERSION = '5.31.0'
2
+ VERSION = '5.31.1'
3
3
  end
@@ -244,12 +244,12 @@ describe 'Account' do
244
244
  200,
245
245
  %q[
246
246
  {
247
- "auth_token": "AUTHTOKEN",
248
- "date_created": "Sun, 15 Mar 2009 02:08:47 +0000",
249
- "date_updated": "Wed, 25 Aug 2010 01:30:09 +0000",
250
- "friendly_name": "Test Account",
247
+ "auth_token": "auth_token",
248
+ "date_created": "Thu, 30 Jul 2015 20:00:00 +0000",
249
+ "date_updated": "Thu, 30 Jul 2015 20:00:00 +0000",
250
+ "friendly_name": "friendly_name",
251
+ "owner_account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
251
252
  "sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
252
- "owner_account_sid": "ACbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
253
253
  "status": "active",
254
254
  "subresource_uris": {
255
255
  "available_phone_numbers": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers.json",
@@ -259,8 +259,19 @@ describe 'Account' do
259
259
  "notifications": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json",
260
260
  "outgoing_caller_ids": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OutgoingCallerIds.json",
261
261
  "recordings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json",
262
- "sms_messages": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SMS/Messages.json",
263
- "transcriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json"
262
+ "transcriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json",
263
+ "addresses": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Addresses.json",
264
+ "signing_keys": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SigningKeys.json",
265
+ "connect_apps": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ConnectApps.json",
266
+ "sip": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP.json",
267
+ "authorized_connect_apps": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AuthorizedConnectApps.json",
268
+ "usage": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage.json",
269
+ "keys": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys.json",
270
+ "applications": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Applications.json",
271
+ "short_codes": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SMS/ShortCodes.json",
272
+ "queues": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues.json",
273
+ "messages": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages.json",
274
+ "balance": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Balance.json"
264
275
  },
265
276
  "type": "Full",
266
277
  "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json"
@@ -29,37 +29,14 @@ describe 'PhoneNumber' do
29
29
  200,
30
30
  %q[
31
31
  {
32
- "caller_name": {
33
- "caller_name": "Delicious Cheese Cake",
34
- "caller_type": "CONSUMER",
35
- "error_code": null
36
- },
37
- "carrier": {
38
- "error_code": null,
39
- "mobile_country_code": "310",
40
- "mobile_network_code": "456",
41
- "name": "verizon",
42
- "type": "mobile"
43
- },
44
- "fraud": {
45
- "error_code": null,
46
- "mobile_country_code": "310",
47
- "mobile_network_code": "456",
48
- "advanced_line_type": "voip",
49
- "caller_name": "Delicious Cheese Cake",
50
- "is_ported": false,
51
- "last_ported_date": "2018-05-01 04:05:11"
52
- },
32
+ "caller_name": null,
33
+ "carrier": null,
34
+ "fraud": null,
35
+ "add_ons": null,
53
36
  "country_code": "US",
54
37
  "national_format": "(510) 867-5310",
55
38
  "phone_number": "+15108675310",
56
- "add_ons": {
57
- "status": "successful",
58
- "message": null,
59
- "code": null,
60
- "results": {}
61
- },
62
- "url": "https://lookups.twilio.com/v1/PhoneNumbers/phone_number"
39
+ "url": "https://lookups.twilio.com/v1/PhoneNumbers/+15108675310"
63
40
  }
64
41
  ]
65
42
  ))
@@ -87,7 +64,35 @@ describe 'PhoneNumber' do
87
64
  "phone_number": "+15108675310",
88
65
  "fraud": null,
89
66
  "add_ons": null,
90
- "url": "https://lookups.twilio.com/v1/PhoneNumbers/phone_number"
67
+ "url": "https://lookups.twilio.com/v1/PhoneNumbers/+15108675310?Type=carrier"
68
+ }
69
+ ]
70
+ ))
71
+
72
+ actual = @client.lookups.v1.phone_numbers('+15017122661').fetch()
73
+
74
+ expect(actual).to_not eq(nil)
75
+ end
76
+
77
+ it "receives fetch_carrier_international responses" do
78
+ @holodeck.mock(Twilio::Response.new(
79
+ 200,
80
+ %q[
81
+ {
82
+ "caller_name": null,
83
+ "carrier": {
84
+ "error_code": null,
85
+ "mobile_country_code": null,
86
+ "mobile_network_code": null,
87
+ "name": "Vodafone Business Solutions",
88
+ "type": "landline"
89
+ },
90
+ "country_code": "GB",
91
+ "national_format": "020 7765 1182",
92
+ "phone_number": "+4402077651182",
93
+ "fraud": null,
94
+ "add_ons": null,
95
+ "url": "https://lookups.twilio.com/v1/PhoneNumbers/+4402077651182?Type=carrier"
91
96
  }
92
97
  ]
93
98
  ))
@@ -113,7 +118,7 @@ describe 'PhoneNumber' do
113
118
  "national_format": "(510) 867-5310",
114
119
  "phone_number": "+15108675310",
115
120
  "add_ons": null,
116
- "url": "https://lookups.twilio.com/v1/PhoneNumbers/phone_number"
121
+ "url": "https://lookups.twilio.com/v1/PhoneNumbers/+15108675310?Type=caller-name"
117
122
  }
118
123
  ]
119
124
  ))
@@ -150,7 +155,7 @@ describe 'PhoneNumber' do
150
155
  "code": null,
151
156
  "results": {}
152
157
  },
153
- "url": "https://lookups.twilio.com/v1/PhoneNumbers/+15108675310"
158
+ "url": "https://lookups.twilio.com/v1/PhoneNumbers/+15108675310?Type=carrier&Type=caller-name"
154
159
  }
155
160
  ]
156
161
  ))
@@ -225,7 +230,7 @@ describe 'PhoneNumber' do
225
230
  }
226
231
  }
227
232
  },
228
- "url": "https://lookups.twilio.com/v1/PhoneNumbers/+12127363100?Type=carrier"
233
+ "url": "https://lookups.twilio.com/v1/PhoneNumbers/+12127363100?Type=caller-name"
229
234
  }
230
235
  ]
231
236
  ))
@@ -0,0 +1,58 @@
1
+ ##
2
+ # This code was generated by
3
+ # \ / _ _ _| _ _
4
+ # | (_)\/(_)(_|\/| |(/_ v1.0.0
5
+ # / /
6
+ #
7
+ # frozen_string_literal: true
8
+
9
+ require 'spec_helper.rb'
10
+
11
+ describe 'SuccessRate' do
12
+ it "can fetch" do
13
+ @holodeck.mock(Twilio::Response.new(500, ''))
14
+
15
+ expect {
16
+ @client.preview.trusted_comms.businesses('BXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
17
+ .insights \
18
+ .success_rate().fetch()
19
+ }.to raise_exception(Twilio::REST::TwilioError)
20
+
21
+ values = {}
22
+ expect(
23
+ @holodeck.has_request?(Holodeck::Request.new(
24
+ method: 'get',
25
+ url: 'https://preview.twilio.com/TrustedComms/Businesses/BXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Insights/SuccessRate',
26
+ ))).to eq(true)
27
+ end
28
+
29
+ it "receives fetch responses" do
30
+ @holodeck.mock(Twilio::Response.new(
31
+ 200,
32
+ %q[
33
+ {
34
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
35
+ "business_sid": "BXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
36
+ "start": "2015-07-30T20:00:00Z",
37
+ "end": "2015-07-30T21:00:00Z",
38
+ "interval": "minute",
39
+ "reports": {
40
+ "success_rate": {
41
+ "timestamp": "2015-07-30T20:00:00",
42
+ "calls": 1200,
43
+ "branded": 800,
44
+ "value": 66.67
45
+ }
46
+ },
47
+ "url": "https://preview.twilio.com/TrustedComms/Businesses/BXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Insights/SuccessRate"
48
+ }
49
+ ]
50
+ ))
51
+
52
+ actual = @client.preview.trusted_comms.businesses('BXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
53
+ .insights \
54
+ .success_rate().fetch()
55
+
56
+ expect(actual).to_not eq(nil)
57
+ end
58
+ end
@@ -0,0 +1,12 @@
1
+ ##
2
+ # This code was generated by
3
+ # \ / _ _ _| _ _
4
+ # | (_)\/(_)(_|\/| |(/_ v1.0.0
5
+ # / /
6
+ #
7
+ # frozen_string_literal: true
8
+
9
+ require 'spec_helper.rb'
10
+
11
+ describe 'Insights' do
12
+ end
@@ -0,0 +1,46 @@
1
+ ##
2
+ # This code was generated by
3
+ # \ / _ _ _| _ _
4
+ # | (_)\/(_)(_|\/| |(/_ v1.0.0
5
+ # / /
6
+ #
7
+ # frozen_string_literal: true
8
+
9
+ require 'spec_helper.rb'
10
+
11
+ describe 'Business' do
12
+ it "can fetch" do
13
+ @holodeck.mock(Twilio::Response.new(500, ''))
14
+
15
+ expect {
16
+ @client.preview.trusted_comms.businesses('BXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
17
+ }.to raise_exception(Twilio::REST::TwilioError)
18
+
19
+ values = {}
20
+ expect(
21
+ @holodeck.has_request?(Holodeck::Request.new(
22
+ method: 'get',
23
+ url: 'https://preview.twilio.com/TrustedComms/Businesses/BXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
24
+ ))).to eq(true)
25
+ end
26
+
27
+ it "receives fetch responses" do
28
+ @holodeck.mock(Twilio::Response.new(
29
+ 200,
30
+ %q[
31
+ {
32
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
33
+ "sid": "BXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
34
+ "url": "https://preview.twilio.com/TrustedComms/Businesses/BXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
35
+ "links": {
36
+ "insights": "https://preview.twilio.com/TrustedComms/Businesses/BXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Insights"
37
+ }
38
+ }
39
+ ]
40
+ ))
41
+
42
+ actual = @client.preview.trusted_comms.businesses('BXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
43
+
44
+ expect(actual).to_not eq(nil)
45
+ end
46
+ end
@@ -39,6 +39,7 @@ describe 'Service' do
39
39
  "skip_sms_to_landlines": false,
40
40
  "dtmf_input_required": false,
41
41
  "tts_name": "name",
42
+ "mailer_sid": "MDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
42
43
  "date_created": "2015-07-30T20:00:00Z",
43
44
  "date_updated": "2015-07-30T20:00:00Z",
44
45
  "url": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
@@ -86,6 +87,7 @@ describe 'Service' do
86
87
  "skip_sms_to_landlines": false,
87
88
  "dtmf_input_required": false,
88
89
  "tts_name": "name",
90
+ "mailer_sid": "MDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
89
91
  "date_created": "2015-07-30T20:00:00Z",
90
92
  "date_updated": "2015-07-30T20:00:00Z",
91
93
  "url": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
@@ -170,6 +172,7 @@ describe 'Service' do
170
172
  "skip_sms_to_landlines": false,
171
173
  "dtmf_input_required": false,
172
174
  "tts_name": "name",
175
+ "mailer_sid": "MDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
173
176
  "date_created": "2015-07-30T20:00:00Z",
174
177
  "date_updated": "2015-07-30T20:00:00Z",
175
178
  "url": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
@@ -219,6 +222,7 @@ describe 'Service' do
219
222
  "skip_sms_to_landlines": false,
220
223
  "dtmf_input_required": false,
221
224
  "tts_name": "name",
225
+ "mailer_sid": "MDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
222
226
  "date_created": "2015-07-30T20:00:00Z",
223
227
  "date_updated": "2015-07-30T20:00:00Z",
224
228
  "url": "https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",