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.
- checksums.yaml +4 -4
- data/.rubocop.yml +2 -2
- data/.rubocop_todo.yml +90 -48
- data/CHANGES.md +18 -0
- data/README.md +2 -2
- data/lib/twilio-ruby/rest/preview.rb +9 -0
- data/lib/twilio-ruby/rest/preview/trusted_comms.rb +16 -0
- data/lib/twilio-ruby/rest/preview/trusted_comms/business.rb +219 -0
- data/lib/twilio-ruby/rest/preview/trusted_comms/business/insights.rb +111 -0
- data/lib/twilio-ruby/rest/preview/trusted_comms/business/insights/success_rate.rb +264 -0
- data/lib/twilio-ruby/rest/verify/v2/service.rb +0 -8
- data/lib/twilio-ruby/rest/verify/v2/service/messaging_configuration.rb +0 -8
- data/lib/twilio-ruby/rest/verify/v2/service/rate_limit.rb +0 -8
- data/lib/twilio-ruby/rest/verify/v2/service/rate_limit/bucket.rb +0 -8
- data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +3 -11
- data/lib/twilio-ruby/rest/verify/v2/service/verification_check.rb +8 -11
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/integration/api/v2010/account_spec.rb +18 -7
- data/spec/integration/lookups/v1/phone_number_spec.rb +37 -32
- data/spec/integration/preview/trusted_comms/business/insights/success_rate_spec.rb +58 -0
- data/spec/integration/preview/trusted_comms/business/insights_spec.rb +12 -0
- data/spec/integration/preview/trusted_comms/business_spec.rb +46 -0
- data/spec/integration/verify/v2/service_spec.rb +4 -0
- data/spec/integration/wireless/v1/rate_plan_spec.rb +4 -0
- data/twilio-ruby.gemspec +1 -1
- metadata +13 -4
@@ -0,0 +1,111 @@
|
|
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 Preview < Domain
|
12
|
+
class TrustedComms < Version
|
13
|
+
class BusinessContext < InstanceContext
|
14
|
+
##
|
15
|
+
# PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
|
16
|
+
class InsightsList < ListResource
|
17
|
+
##
|
18
|
+
# Initialize the InsightsList
|
19
|
+
# @param [Version] version Version that contains the resource
|
20
|
+
# @param [String] business_sid A 34 character string that uniquely identifies this
|
21
|
+
# Business.
|
22
|
+
# @return [InsightsList] InsightsList
|
23
|
+
def initialize(version, business_sid: nil)
|
24
|
+
super(version)
|
25
|
+
|
26
|
+
# Path Solution
|
27
|
+
@solution = {business_sid: business_sid}
|
28
|
+
|
29
|
+
# Components
|
30
|
+
@success_rate = nil
|
31
|
+
end
|
32
|
+
|
33
|
+
##
|
34
|
+
# Access the success_rate
|
35
|
+
# @return [SuccessRateList]
|
36
|
+
# @return [SuccessRateContext]
|
37
|
+
def success_rate
|
38
|
+
return SuccessRateContext.new(@version, @solution[:business_sid], )
|
39
|
+
|
40
|
+
@success_rate ||= SuccessRateList.new(@version, business_sid: @solution[:business_sid], )
|
41
|
+
end
|
42
|
+
|
43
|
+
##
|
44
|
+
# Provide a user friendly representation
|
45
|
+
def to_s
|
46
|
+
'#<Twilio.Preview.TrustedComms.InsightsList>'
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
##
|
51
|
+
# PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
|
52
|
+
class InsightsPage < Page
|
53
|
+
##
|
54
|
+
# Initialize the InsightsPage
|
55
|
+
# @param [Version] version Version that contains the resource
|
56
|
+
# @param [Response] response Response from the API
|
57
|
+
# @param [Hash] solution Path solution for the resource
|
58
|
+
# @return [InsightsPage] InsightsPage
|
59
|
+
def initialize(version, response, solution)
|
60
|
+
super(version, response)
|
61
|
+
|
62
|
+
# Path Solution
|
63
|
+
@solution = solution
|
64
|
+
end
|
65
|
+
|
66
|
+
##
|
67
|
+
# Build an instance of InsightsInstance
|
68
|
+
# @param [Hash] payload Payload response from the API
|
69
|
+
# @return [InsightsInstance] InsightsInstance
|
70
|
+
def get_instance(payload)
|
71
|
+
InsightsInstance.new(@version, payload, business_sid: @solution[:business_sid], )
|
72
|
+
end
|
73
|
+
|
74
|
+
##
|
75
|
+
# Provide a user friendly representation
|
76
|
+
def to_s
|
77
|
+
'<Twilio.Preview.TrustedComms.InsightsPage>'
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
##
|
82
|
+
# PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
|
83
|
+
class InsightsInstance < InstanceResource
|
84
|
+
##
|
85
|
+
# Initialize the InsightsInstance
|
86
|
+
# @param [Version] version Version that contains the resource
|
87
|
+
# @param [Hash] payload payload that contains response from Twilio
|
88
|
+
# @param [String] business_sid A 34 character string that uniquely identifies this
|
89
|
+
# Business.
|
90
|
+
# @return [InsightsInstance] InsightsInstance
|
91
|
+
def initialize(version, payload, business_sid: nil)
|
92
|
+
super(version)
|
93
|
+
end
|
94
|
+
|
95
|
+
##
|
96
|
+
# Provide a user friendly representation
|
97
|
+
def to_s
|
98
|
+
"<Twilio.Preview.TrustedComms.InsightsInstance>"
|
99
|
+
end
|
100
|
+
|
101
|
+
##
|
102
|
+
# Provide a detailed, user friendly representation
|
103
|
+
def inspect
|
104
|
+
"<Twilio.Preview.TrustedComms.InsightsInstance>"
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
@@ -0,0 +1,264 @@
|
|
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 Preview < Domain
|
12
|
+
class TrustedComms < Version
|
13
|
+
class BusinessContext < InstanceContext
|
14
|
+
class InsightsList < ListResource
|
15
|
+
##
|
16
|
+
# PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
|
17
|
+
class SuccessRateList < ListResource
|
18
|
+
##
|
19
|
+
# Initialize the SuccessRateList
|
20
|
+
# @param [Version] version Version that contains the resource
|
21
|
+
# @param [String] business_sid A 34 character string that uniquely identifies this
|
22
|
+
# Business.
|
23
|
+
# @return [SuccessRateList] SuccessRateList
|
24
|
+
def initialize(version, business_sid: nil)
|
25
|
+
super(version)
|
26
|
+
|
27
|
+
# Path Solution
|
28
|
+
@solution = {business_sid: business_sid}
|
29
|
+
end
|
30
|
+
|
31
|
+
##
|
32
|
+
# Provide a user friendly representation
|
33
|
+
def to_s
|
34
|
+
'#<Twilio.Preview.TrustedComms.SuccessRateList>'
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
##
|
39
|
+
# PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
|
40
|
+
class SuccessRatePage < Page
|
41
|
+
##
|
42
|
+
# Initialize the SuccessRatePage
|
43
|
+
# @param [Version] version Version that contains the resource
|
44
|
+
# @param [Response] response Response from the API
|
45
|
+
# @param [Hash] solution Path solution for the resource
|
46
|
+
# @return [SuccessRatePage] SuccessRatePage
|
47
|
+
def initialize(version, response, solution)
|
48
|
+
super(version, response)
|
49
|
+
|
50
|
+
# Path Solution
|
51
|
+
@solution = solution
|
52
|
+
end
|
53
|
+
|
54
|
+
##
|
55
|
+
# Build an instance of SuccessRateInstance
|
56
|
+
# @param [Hash] payload Payload response from the API
|
57
|
+
# @return [SuccessRateInstance] SuccessRateInstance
|
58
|
+
def get_instance(payload)
|
59
|
+
SuccessRateInstance.new(@version, payload, business_sid: @solution[:business_sid], )
|
60
|
+
end
|
61
|
+
|
62
|
+
##
|
63
|
+
# Provide a user friendly representation
|
64
|
+
def to_s
|
65
|
+
'<Twilio.Preview.TrustedComms.SuccessRatePage>'
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
##
|
70
|
+
# PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
|
71
|
+
class SuccessRateContext < InstanceContext
|
72
|
+
##
|
73
|
+
# Initialize the SuccessRateContext
|
74
|
+
# @param [Version] version Version that contains the resource
|
75
|
+
# @param [String] business_sid The unique SID identifier of the Business to filter
|
76
|
+
# by.
|
77
|
+
# @return [SuccessRateContext] SuccessRateContext
|
78
|
+
def initialize(version, business_sid)
|
79
|
+
super(version)
|
80
|
+
|
81
|
+
# Path Solution
|
82
|
+
@solution = {business_sid: business_sid, }
|
83
|
+
@uri = "/Businesses/#{@solution[:business_sid]}/Insights/SuccessRate"
|
84
|
+
end
|
85
|
+
|
86
|
+
##
|
87
|
+
# Fetch a SuccessRateInstance
|
88
|
+
# @param [String] brand_sid The unique SID identifier of the Brand to filter by.
|
89
|
+
# @param [String] branded_channel_sid The unique SID identifier of the Branded
|
90
|
+
# Channel to filter by.
|
91
|
+
# @param [String] phone_number_sid The unique SID identifier of the Phone Number
|
92
|
+
# to filter by.
|
93
|
+
# @param [String] country The 2-letter ISO 3166 code of the Country to filter by.
|
94
|
+
# @param [Time] start The start date that for this Success Rate, given in ISO 8601
|
95
|
+
# format. Default value is 30 days ago.
|
96
|
+
# @param [Time] end_ The end date that for this Success Rate, given in ISO 8601
|
97
|
+
# format. Default value is current timestamp.
|
98
|
+
# @param [success_rate.Intervals] interval The Interval of this Success Rate. One
|
99
|
+
# of `minute`, `hour`, `day`, `week` or `month`.
|
100
|
+
# @return [SuccessRateInstance] Fetched SuccessRateInstance
|
101
|
+
def fetch(brand_sid: :unset, branded_channel_sid: :unset, phone_number_sid: :unset, country: :unset, start: :unset, end_: :unset, interval: :unset)
|
102
|
+
params = Twilio::Values.of({
|
103
|
+
'BrandSid' => brand_sid,
|
104
|
+
'BrandedChannelSid' => branded_channel_sid,
|
105
|
+
'PhoneNumberSid' => phone_number_sid,
|
106
|
+
'Country' => country,
|
107
|
+
'Start' => Twilio.serialize_iso8601_datetime(start),
|
108
|
+
'End' => Twilio.serialize_iso8601_datetime(end_),
|
109
|
+
'Interval' => interval,
|
110
|
+
})
|
111
|
+
|
112
|
+
payload = @version.fetch(
|
113
|
+
'GET',
|
114
|
+
@uri,
|
115
|
+
params,
|
116
|
+
)
|
117
|
+
|
118
|
+
SuccessRateInstance.new(@version, payload, business_sid: @solution[:business_sid], )
|
119
|
+
end
|
120
|
+
|
121
|
+
##
|
122
|
+
# Provide a user friendly representation
|
123
|
+
def to_s
|
124
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
125
|
+
"#<Twilio.Preview.TrustedComms.SuccessRateContext #{context}>"
|
126
|
+
end
|
127
|
+
|
128
|
+
##
|
129
|
+
# Provide a detailed, user friendly representation
|
130
|
+
def inspect
|
131
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
132
|
+
"#<Twilio.Preview.TrustedComms.SuccessRateContext #{context}>"
|
133
|
+
end
|
134
|
+
end
|
135
|
+
|
136
|
+
##
|
137
|
+
# PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
|
138
|
+
class SuccessRateInstance < InstanceResource
|
139
|
+
##
|
140
|
+
# Initialize the SuccessRateInstance
|
141
|
+
# @param [Version] version Version that contains the resource
|
142
|
+
# @param [Hash] payload payload that contains response from Twilio
|
143
|
+
# @param [String] business_sid A 34 character string that uniquely identifies this
|
144
|
+
# Business.
|
145
|
+
# @return [SuccessRateInstance] SuccessRateInstance
|
146
|
+
def initialize(version, payload, business_sid: nil)
|
147
|
+
super(version)
|
148
|
+
|
149
|
+
# Marshaled Properties
|
150
|
+
@properties = {
|
151
|
+
'account_sid' => payload['account_sid'],
|
152
|
+
'business_sid' => payload['business_sid'],
|
153
|
+
'end_' => Twilio.deserialize_iso8601_datetime(payload['end']),
|
154
|
+
'interval' => payload['interval'],
|
155
|
+
'reports' => payload['reports'],
|
156
|
+
'start' => Twilio.deserialize_iso8601_datetime(payload['start']),
|
157
|
+
'url' => payload['url'],
|
158
|
+
}
|
159
|
+
|
160
|
+
# Context
|
161
|
+
@instance_context = nil
|
162
|
+
@params = {'business_sid' => business_sid, }
|
163
|
+
end
|
164
|
+
|
165
|
+
##
|
166
|
+
# Generate an instance context for the instance, the context is capable of
|
167
|
+
# performing various actions. All instance actions are proxied to the context
|
168
|
+
# @return [SuccessRateContext] SuccessRateContext for this SuccessRateInstance
|
169
|
+
def context
|
170
|
+
unless @instance_context
|
171
|
+
@instance_context = SuccessRateContext.new(@version, @params['business_sid'], )
|
172
|
+
end
|
173
|
+
@instance_context
|
174
|
+
end
|
175
|
+
|
176
|
+
##
|
177
|
+
# @return [String] Account Sid.
|
178
|
+
def account_sid
|
179
|
+
@properties['account_sid']
|
180
|
+
end
|
181
|
+
|
182
|
+
##
|
183
|
+
# @return [String] Business Sid.
|
184
|
+
def business_sid
|
185
|
+
@properties['business_sid']
|
186
|
+
end
|
187
|
+
|
188
|
+
##
|
189
|
+
# @return [Time] The end date that for this Success Rate.
|
190
|
+
def end_
|
191
|
+
@properties['end_']
|
192
|
+
end
|
193
|
+
|
194
|
+
##
|
195
|
+
# @return [success_rate.Intervals] The Interval of this Success Rate.
|
196
|
+
def interval
|
197
|
+
@properties['interval']
|
198
|
+
end
|
199
|
+
|
200
|
+
##
|
201
|
+
# @return [Hash] Values of Success Rate per interval.
|
202
|
+
def reports
|
203
|
+
@properties['reports']
|
204
|
+
end
|
205
|
+
|
206
|
+
##
|
207
|
+
# @return [Time] The start date that for this Success Rate.
|
208
|
+
def start
|
209
|
+
@properties['start']
|
210
|
+
end
|
211
|
+
|
212
|
+
##
|
213
|
+
# @return [String] The URL of this resource.
|
214
|
+
def url
|
215
|
+
@properties['url']
|
216
|
+
end
|
217
|
+
|
218
|
+
##
|
219
|
+
# Fetch a SuccessRateInstance
|
220
|
+
# @param [String] brand_sid The unique SID identifier of the Brand to filter by.
|
221
|
+
# @param [String] branded_channel_sid The unique SID identifier of the Branded
|
222
|
+
# Channel to filter by.
|
223
|
+
# @param [String] phone_number_sid The unique SID identifier of the Phone Number
|
224
|
+
# to filter by.
|
225
|
+
# @param [String] country The 2-letter ISO 3166 code of the Country to filter by.
|
226
|
+
# @param [Time] start The start date that for this Success Rate, given in ISO 8601
|
227
|
+
# format. Default value is 30 days ago.
|
228
|
+
# @param [Time] end_ The end date that for this Success Rate, given in ISO 8601
|
229
|
+
# format. Default value is current timestamp.
|
230
|
+
# @param [success_rate.Intervals] interval The Interval of this Success Rate. One
|
231
|
+
# of `minute`, `hour`, `day`, `week` or `month`.
|
232
|
+
# @return [SuccessRateInstance] Fetched SuccessRateInstance
|
233
|
+
def fetch(brand_sid: :unset, branded_channel_sid: :unset, phone_number_sid: :unset, country: :unset, start: :unset, end_: :unset, interval: :unset)
|
234
|
+
context.fetch(
|
235
|
+
brand_sid: brand_sid,
|
236
|
+
branded_channel_sid: branded_channel_sid,
|
237
|
+
phone_number_sid: phone_number_sid,
|
238
|
+
country: country,
|
239
|
+
start: start,
|
240
|
+
end_: end_,
|
241
|
+
interval: interval,
|
242
|
+
)
|
243
|
+
end
|
244
|
+
|
245
|
+
##
|
246
|
+
# Provide a user friendly representation
|
247
|
+
def to_s
|
248
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
249
|
+
"<Twilio.Preview.TrustedComms.SuccessRateInstance #{values}>"
|
250
|
+
end
|
251
|
+
|
252
|
+
##
|
253
|
+
# Provide a detailed, user friendly representation
|
254
|
+
def inspect
|
255
|
+
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
256
|
+
"<Twilio.Preview.TrustedComms.SuccessRateInstance #{values}>"
|
257
|
+
end
|
258
|
+
end
|
259
|
+
end
|
260
|
+
end
|
261
|
+
end
|
262
|
+
end
|
263
|
+
end
|
264
|
+
end
|
@@ -10,8 +10,6 @@ module Twilio
|
|
10
10
|
module REST
|
11
11
|
class Verify < Domain
|
12
12
|
class V2 < Version
|
13
|
-
##
|
14
|
-
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
15
13
|
class ServiceList < ListResource
|
16
14
|
##
|
17
15
|
# Initialize the ServiceList
|
@@ -153,8 +151,6 @@ module Twilio
|
|
153
151
|
end
|
154
152
|
end
|
155
153
|
|
156
|
-
##
|
157
|
-
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
158
154
|
class ServicePage < Page
|
159
155
|
##
|
160
156
|
# Initialize the ServicePage
|
@@ -184,8 +180,6 @@ module Twilio
|
|
184
180
|
end
|
185
181
|
end
|
186
182
|
|
187
|
-
##
|
188
|
-
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
189
183
|
class ServiceContext < InstanceContext
|
190
184
|
##
|
191
185
|
# Initialize the ServiceContext
|
@@ -348,8 +342,6 @@ module Twilio
|
|
348
342
|
end
|
349
343
|
end
|
350
344
|
|
351
|
-
##
|
352
|
-
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
353
345
|
class ServiceInstance < InstanceResource
|
354
346
|
##
|
355
347
|
# Initialize the ServiceInstance
|
@@ -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 MessagingConfigurationList < ListResource
|
17
15
|
##
|
18
16
|
# Initialize the MessagingConfigurationList
|
@@ -141,8 +139,6 @@ module Twilio
|
|
141
139
|
end
|
142
140
|
end
|
143
141
|
|
144
|
-
##
|
145
|
-
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
146
142
|
class MessagingConfigurationPage < Page
|
147
143
|
##
|
148
144
|
# Initialize the MessagingConfigurationPage
|
@@ -172,8 +168,6 @@ module Twilio
|
|
172
168
|
end
|
173
169
|
end
|
174
170
|
|
175
|
-
##
|
176
|
-
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
177
171
|
class MessagingConfigurationContext < InstanceContext
|
178
172
|
##
|
179
173
|
# Initialize the MessagingConfigurationContext
|
@@ -259,8 +253,6 @@ module Twilio
|
|
259
253
|
end
|
260
254
|
end
|
261
255
|
|
262
|
-
##
|
263
|
-
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
264
256
|
class MessagingConfigurationInstance < InstanceResource
|
265
257
|
##
|
266
258
|
# Initialize the MessagingConfigurationInstance
|
@@ -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 RateLimitList < ListResource
|
17
15
|
##
|
18
16
|
# Initialize the RateLimitList
|
@@ -138,8 +136,6 @@ module Twilio
|
|
138
136
|
end
|
139
137
|
end
|
140
138
|
|
141
|
-
##
|
142
|
-
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
143
139
|
class RateLimitPage < Page
|
144
140
|
##
|
145
141
|
# Initialize the RateLimitPage
|
@@ -169,8 +165,6 @@ module Twilio
|
|
169
165
|
end
|
170
166
|
end
|
171
167
|
|
172
|
-
##
|
173
|
-
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
174
168
|
class RateLimitContext < InstanceContext
|
175
169
|
##
|
176
170
|
# Initialize the RateLimitContext
|
@@ -267,8 +261,6 @@ module Twilio
|
|
267
261
|
end
|
268
262
|
end
|
269
263
|
|
270
|
-
##
|
271
|
-
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
272
264
|
class RateLimitInstance < InstanceResource
|
273
265
|
##
|
274
266
|
# Initialize the RateLimitInstance
|