twilio-ruby 7.0.2 → 7.1.1
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/CHANGES.md +58 -0
- data/Gemfile +1 -0
- data/README.md +2 -2
- data/lib/twilio-ruby/rest/api/v2010/account/message.rb +3 -3
- data/lib/twilio-ruby/rest/client.rb +3 -3
- data/lib/twilio-ruby/rest/content/v2/content.rb +316 -0
- data/lib/twilio-ruby/rest/content/v2/content_and_approvals.rb +309 -0
- data/lib/twilio-ruby/rest/content/v2.rb +46 -0
- data/lib/twilio-ruby/rest/content_base.rb +6 -1
- data/lib/twilio-ruby/rest/flex_api/v1/interaction.rb +1 -1
- data/lib/twilio-ruby/rest/flex_api/v1/plugin/plugin_versions.rb +8 -1
- data/lib/twilio-ruby/rest/intelligence/v2/custom_operator.rb +444 -0
- data/lib/twilio-ruby/rest/intelligence/v2/operator.rb +355 -0
- data/lib/twilio-ruby/rest/intelligence/v2/operator_attachment.rb +215 -0
- data/lib/twilio-ruby/rest/intelligence/v2/operator_attachments.rb +196 -0
- data/lib/twilio-ruby/rest/intelligence/v2/operator_type.rb +357 -0
- data/lib/twilio-ruby/rest/intelligence/v2/prebuilt_operator.rb +355 -0
- data/lib/twilio-ruby/rest/intelligence/v2/service.rb +9 -8
- data/lib/twilio-ruby/rest/intelligence/v2/transcript.rb +18 -18
- data/lib/twilio-ruby/rest/intelligence/v2.rb +112 -0
- data/lib/twilio-ruby/rest/marketplace/v1/available_add_on/available_add_on_extension.rb +308 -0
- data/lib/twilio-ruby/rest/marketplace/v1/available_add_on.rb +335 -0
- data/lib/twilio-ruby/rest/marketplace/v1/installed_add_on/installed_add_on_extension.rb +350 -0
- data/lib/twilio-ruby/rest/marketplace/v1/installed_add_on/installed_add_on_usage.rb +169 -0
- data/lib/twilio-ruby/rest/marketplace/v1/installed_add_on.rb +461 -0
- data/lib/twilio-ruby/rest/marketplace/v1/module_data_management.rb +282 -0
- data/lib/twilio-ruby/rest/marketplace/v1.rb +79 -0
- data/lib/twilio-ruby/rest/marketplace.rb +6 -0
- data/lib/twilio-ruby/rest/{preview_messaging_base.rb → marketplace_base.rb} +6 -6
- data/lib/twilio-ruby/rest/messaging/v1/service.rb +0 -7
- data/lib/twilio-ruby/rest/messaging/v1/tollfree_verification.rb +15 -3
- data/lib/twilio-ruby/rest/messaging/v1.rb +1 -1
- data/lib/twilio-ruby/rest/numbers/v1/porting_port_in.rb +86 -1
- data/lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb +126 -2
- data/lib/twilio-ruby/rest/numbers/v1/porting_webhook_configuration.rb +148 -0
- data/lib/twilio-ruby/rest/numbers/v1/porting_webhook_configuration_delete.rb +167 -0
- data/lib/twilio-ruby/rest/numbers/v1/porting_webhook_configuration_fetch.rb +160 -0
- data/lib/twilio-ruby/rest/numbers/v1/signing_request_configuration.rb +176 -0
- data/lib/twilio-ruby/rest/numbers/v1.rb +35 -32
- data/lib/twilio-ruby/rest/preview/sync/service/document.rb +1 -1
- data/lib/twilio-ruby/rest/preview/sync/service/sync_list.rb +2 -2
- data/lib/twilio-ruby/rest/preview/sync/service/sync_map.rb +2 -2
- data/lib/twilio-ruby/rest/preview/sync/service.rb +2 -2
- data/lib/twilio-ruby/rest/sync/v1/service/document.rb +1 -1
- data/lib/twilio-ruby/rest/sync/v1/service/sync_list.rb +2 -2
- data/lib/twilio-ruby/rest/sync/v1/service/sync_map.rb +2 -2
- data/lib/twilio-ruby/rest/sync/v1/service/sync_stream.rb +1 -1
- data/lib/twilio-ruby/rest/sync/v1/service.rb +3 -3
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +33 -4
- data/lib/twilio-ruby/rest/trusthub/v1/compliance_tollfree_inquiries.rb +4 -1
- data/lib/twilio-ruby/rest/trusthub/v1/customer_profiles.rb +7 -0
- data/lib/twilio-ruby/rest/trusthub/v1/trust_products.rb +7 -0
- data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +1 -1
- data/lib/twilio-ruby/rest/verify/v2/service/verification_check.rb +1 -1
- data/lib/twilio-ruby/rest/verify/v2/service.rb +1 -1
- data/lib/twilio-ruby/version.rb +1 -1
- metadata +24 -9
- data/lib/twilio-ruby/rest/numbers/v1/porting_bulk_portability.rb +0 -230
- data/lib/twilio-ruby/rest/numbers/v1/porting_port_in_fetch.rb +0 -252
- data/lib/twilio-ruby/rest/preview_messaging/v1/broadcast.rb +0 -164
- data/lib/twilio-ruby/rest/preview_messaging/v1/message.rb +0 -235
- data/lib/twilio-ruby/rest/preview_messaging/v1.rb +0 -46
- data/lib/twilio-ruby/rest/preview_messaging.rb +0 -12
@@ -0,0 +1,350 @@
|
|
1
|
+
##
|
2
|
+
# This code was generated by
|
3
|
+
# ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
4
|
+
# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
5
|
+
# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
6
|
+
#
|
7
|
+
# Twilio - Marketplace
|
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 Marketplace < MarketplaceBase
|
19
|
+
class V1 < Version
|
20
|
+
class InstalledAddOnContext < InstanceContext
|
21
|
+
|
22
|
+
class InstalledAddOnExtensionList < ListResource
|
23
|
+
|
24
|
+
##
|
25
|
+
# Initialize the InstalledAddOnExtensionList
|
26
|
+
# @param [Version] version Version that contains the resource
|
27
|
+
# @return [InstalledAddOnExtensionList] InstalledAddOnExtensionList
|
28
|
+
def initialize(version, installed_add_on_sid: nil)
|
29
|
+
super(version)
|
30
|
+
# Path Solution
|
31
|
+
@solution = { installed_add_on_sid: installed_add_on_sid }
|
32
|
+
@uri = "/InstalledAddOns/#{@solution[:installed_add_on_sid]}/Extensions"
|
33
|
+
|
34
|
+
end
|
35
|
+
|
36
|
+
##
|
37
|
+
# Lists InstalledAddOnExtensionInstance records from the API as a list.
|
38
|
+
# Unlike stream(), this operation is eager and will load `limit` records into
|
39
|
+
# memory before returning.
|
40
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
41
|
+
# guarantees to never return more than limit. Default is no limit
|
42
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
43
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
44
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
45
|
+
# efficient page size, i.e. min(limit, 1000)
|
46
|
+
# @return [Array] Array of up to limit results
|
47
|
+
def list(limit: nil, page_size: nil)
|
48
|
+
self.stream(
|
49
|
+
limit: limit,
|
50
|
+
page_size: page_size
|
51
|
+
).entries
|
52
|
+
end
|
53
|
+
|
54
|
+
##
|
55
|
+
# Streams Instance records from the API as an Enumerable.
|
56
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
57
|
+
# is reached.
|
58
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
59
|
+
# guarantees to never return more than limit. Default is no limit
|
60
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
61
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
62
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
63
|
+
# efficient page size, i.e. min(limit, 1000)
|
64
|
+
# @return [Enumerable] Enumerable that will yield up to limit results
|
65
|
+
def stream(limit: nil, page_size: nil)
|
66
|
+
limits = @version.read_limits(limit, page_size)
|
67
|
+
|
68
|
+
page = self.page(
|
69
|
+
page_size: limits[:page_size], )
|
70
|
+
|
71
|
+
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
72
|
+
end
|
73
|
+
|
74
|
+
##
|
75
|
+
# When passed a block, yields InstalledAddOnExtensionInstance records from the API.
|
76
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
77
|
+
# is reached.
|
78
|
+
def each
|
79
|
+
limits = @version.read_limits
|
80
|
+
|
81
|
+
page = self.page(page_size: limits[:page_size], )
|
82
|
+
|
83
|
+
@version.stream(page,
|
84
|
+
limit: limits[:limit],
|
85
|
+
page_limit: limits[:page_limit]).each {|x| yield x}
|
86
|
+
end
|
87
|
+
|
88
|
+
##
|
89
|
+
# Retrieve a single page of InstalledAddOnExtensionInstance records from the API.
|
90
|
+
# Request is executed immediately.
|
91
|
+
# @param [String] page_token PageToken provided by the API
|
92
|
+
# @param [Integer] page_number Page Number, this value is simply for client state
|
93
|
+
# @param [Integer] page_size Number of records to return, defaults to 50
|
94
|
+
# @return [Page] Page of InstalledAddOnExtensionInstance
|
95
|
+
def page(page_token: :unset, page_number: :unset, page_size: :unset)
|
96
|
+
params = Twilio::Values.of({
|
97
|
+
'PageToken' => page_token,
|
98
|
+
'Page' => page_number,
|
99
|
+
'PageSize' => page_size,
|
100
|
+
})
|
101
|
+
|
102
|
+
response = @version.page('GET', @uri, params: params)
|
103
|
+
|
104
|
+
InstalledAddOnExtensionPage.new(@version, response, @solution)
|
105
|
+
end
|
106
|
+
|
107
|
+
##
|
108
|
+
# Retrieve a single page of InstalledAddOnExtensionInstance records from the API.
|
109
|
+
# Request is executed immediately.
|
110
|
+
# @param [String] target_url API-generated URL for the requested results page
|
111
|
+
# @return [Page] Page of InstalledAddOnExtensionInstance
|
112
|
+
def get_page(target_url)
|
113
|
+
response = @version.domain.request(
|
114
|
+
'GET',
|
115
|
+
target_url
|
116
|
+
)
|
117
|
+
InstalledAddOnExtensionPage.new(@version, response, @solution)
|
118
|
+
end
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
# Provide a user friendly representation
|
123
|
+
def to_s
|
124
|
+
'#<Twilio.Marketplace.V1.InstalledAddOnExtensionList>'
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
|
129
|
+
class InstalledAddOnExtensionContext < InstanceContext
|
130
|
+
##
|
131
|
+
# Initialize the InstalledAddOnExtensionContext
|
132
|
+
# @param [Version] version Version that contains the resource
|
133
|
+
# @param [String] installed_add_on_sid The SID of the InstalledAddOn resource with the extension to update.
|
134
|
+
# @param [String] sid The SID of the InstalledAddOn Extension resource to update.
|
135
|
+
# @return [InstalledAddOnExtensionContext] InstalledAddOnExtensionContext
|
136
|
+
def initialize(version, installed_add_on_sid, sid)
|
137
|
+
super(version)
|
138
|
+
|
139
|
+
# Path Solution
|
140
|
+
@solution = { installed_add_on_sid: installed_add_on_sid, sid: sid, }
|
141
|
+
@uri = "/InstalledAddOns/#{@solution[:installed_add_on_sid]}/Extensions/#{@solution[:sid]}"
|
142
|
+
|
143
|
+
|
144
|
+
end
|
145
|
+
##
|
146
|
+
# Fetch the InstalledAddOnExtensionInstance
|
147
|
+
# @return [InstalledAddOnExtensionInstance] Fetched InstalledAddOnExtensionInstance
|
148
|
+
def fetch
|
149
|
+
|
150
|
+
|
151
|
+
payload = @version.fetch('GET', @uri)
|
152
|
+
InstalledAddOnExtensionInstance.new(
|
153
|
+
@version,
|
154
|
+
payload,
|
155
|
+
installed_add_on_sid: @solution[:installed_add_on_sid],
|
156
|
+
sid: @solution[:sid],
|
157
|
+
)
|
158
|
+
end
|
159
|
+
|
160
|
+
##
|
161
|
+
# Update the InstalledAddOnExtensionInstance
|
162
|
+
# @param [Boolean] enabled Whether the Extension should be invoked.
|
163
|
+
# @return [InstalledAddOnExtensionInstance] Updated InstalledAddOnExtensionInstance
|
164
|
+
def update(
|
165
|
+
enabled: nil
|
166
|
+
)
|
167
|
+
|
168
|
+
data = Twilio::Values.of({
|
169
|
+
'Enabled' => enabled,
|
170
|
+
})
|
171
|
+
|
172
|
+
|
173
|
+
payload = @version.update('POST', @uri, data: data)
|
174
|
+
InstalledAddOnExtensionInstance.new(
|
175
|
+
@version,
|
176
|
+
payload,
|
177
|
+
installed_add_on_sid: @solution[:installed_add_on_sid],
|
178
|
+
sid: @solution[:sid],
|
179
|
+
)
|
180
|
+
end
|
181
|
+
|
182
|
+
|
183
|
+
##
|
184
|
+
# Provide a user friendly representation
|
185
|
+
def to_s
|
186
|
+
context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
|
187
|
+
"#<Twilio.Marketplace.V1.InstalledAddOnExtensionContext #{context}>"
|
188
|
+
end
|
189
|
+
|
190
|
+
##
|
191
|
+
# Provide a detailed, user friendly representation
|
192
|
+
def inspect
|
193
|
+
context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
|
194
|
+
"#<Twilio.Marketplace.V1.InstalledAddOnExtensionContext #{context}>"
|
195
|
+
end
|
196
|
+
end
|
197
|
+
|
198
|
+
class InstalledAddOnExtensionPage < Page
|
199
|
+
##
|
200
|
+
# Initialize the InstalledAddOnExtensionPage
|
201
|
+
# @param [Version] version Version that contains the resource
|
202
|
+
# @param [Response] response Response from the API
|
203
|
+
# @param [Hash] solution Path solution for the resource
|
204
|
+
# @return [InstalledAddOnExtensionPage] InstalledAddOnExtensionPage
|
205
|
+
def initialize(version, response, solution)
|
206
|
+
super(version, response)
|
207
|
+
|
208
|
+
# Path Solution
|
209
|
+
@solution = solution
|
210
|
+
end
|
211
|
+
|
212
|
+
##
|
213
|
+
# Build an instance of InstalledAddOnExtensionInstance
|
214
|
+
# @param [Hash] payload Payload response from the API
|
215
|
+
# @return [InstalledAddOnExtensionInstance] InstalledAddOnExtensionInstance
|
216
|
+
def get_instance(payload)
|
217
|
+
InstalledAddOnExtensionInstance.new(@version, payload, installed_add_on_sid: @solution[:installed_add_on_sid])
|
218
|
+
end
|
219
|
+
|
220
|
+
##
|
221
|
+
# Provide a user friendly representation
|
222
|
+
def to_s
|
223
|
+
'<Twilio.Marketplace.V1.InstalledAddOnExtensionPage>'
|
224
|
+
end
|
225
|
+
end
|
226
|
+
class InstalledAddOnExtensionInstance < InstanceResource
|
227
|
+
##
|
228
|
+
# Initialize the InstalledAddOnExtensionInstance
|
229
|
+
# @param [Version] version Version that contains the resource
|
230
|
+
# @param [Hash] payload payload that contains response from Twilio
|
231
|
+
# @param [String] account_sid The SID of the
|
232
|
+
# {Account}[https://www.twilio.com/docs/iam/api/account] that created this InstalledAddOnExtension
|
233
|
+
# resource.
|
234
|
+
# @param [String] sid The SID of the Call resource to fetch.
|
235
|
+
# @return [InstalledAddOnExtensionInstance] InstalledAddOnExtensionInstance
|
236
|
+
def initialize(version, payload , installed_add_on_sid: nil, sid: nil)
|
237
|
+
super(version)
|
238
|
+
|
239
|
+
# Marshaled Properties
|
240
|
+
@properties = {
|
241
|
+
'sid' => payload['sid'],
|
242
|
+
'installed_add_on_sid' => payload['installed_add_on_sid'],
|
243
|
+
'friendly_name' => payload['friendly_name'],
|
244
|
+
'product_name' => payload['product_name'],
|
245
|
+
'unique_name' => payload['unique_name'],
|
246
|
+
'enabled' => payload['enabled'],
|
247
|
+
'url' => payload['url'],
|
248
|
+
}
|
249
|
+
|
250
|
+
# Context
|
251
|
+
@instance_context = nil
|
252
|
+
@params = { 'installed_add_on_sid' => installed_add_on_sid || @properties['installed_add_on_sid'] ,'sid' => sid || @properties['sid'] , }
|
253
|
+
end
|
254
|
+
|
255
|
+
##
|
256
|
+
# Generate an instance context for the instance, the context is capable of
|
257
|
+
# performing various actions. All instance actions are proxied to the context
|
258
|
+
# @return [InstalledAddOnExtensionContext] CallContext for this CallInstance
|
259
|
+
def context
|
260
|
+
unless @instance_context
|
261
|
+
@instance_context = InstalledAddOnExtensionContext.new(@version , @params['installed_add_on_sid'], @params['sid'])
|
262
|
+
end
|
263
|
+
@instance_context
|
264
|
+
end
|
265
|
+
|
266
|
+
##
|
267
|
+
# @return [String] The unique string that we created to identify the InstalledAddOn Extension resource.
|
268
|
+
def sid
|
269
|
+
@properties['sid']
|
270
|
+
end
|
271
|
+
|
272
|
+
##
|
273
|
+
# @return [String] The SID of the InstalledAddOn resource to which this extension applies.
|
274
|
+
def installed_add_on_sid
|
275
|
+
@properties['installed_add_on_sid']
|
276
|
+
end
|
277
|
+
|
278
|
+
##
|
279
|
+
# @return [String] The string that you assigned to describe the resource.
|
280
|
+
def friendly_name
|
281
|
+
@properties['friendly_name']
|
282
|
+
end
|
283
|
+
|
284
|
+
##
|
285
|
+
# @return [String] The name of the Product this Extension is used within.
|
286
|
+
def product_name
|
287
|
+
@properties['product_name']
|
288
|
+
end
|
289
|
+
|
290
|
+
##
|
291
|
+
# @return [String] An application-defined string that uniquely identifies the resource.
|
292
|
+
def unique_name
|
293
|
+
@properties['unique_name']
|
294
|
+
end
|
295
|
+
|
296
|
+
##
|
297
|
+
# @return [Boolean] Whether the Extension will be invoked.
|
298
|
+
def enabled
|
299
|
+
@properties['enabled']
|
300
|
+
end
|
301
|
+
|
302
|
+
##
|
303
|
+
# @return [String] The absolute URL of the resource.
|
304
|
+
def url
|
305
|
+
@properties['url']
|
306
|
+
end
|
307
|
+
|
308
|
+
##
|
309
|
+
# Fetch the InstalledAddOnExtensionInstance
|
310
|
+
# @return [InstalledAddOnExtensionInstance] Fetched InstalledAddOnExtensionInstance
|
311
|
+
def fetch
|
312
|
+
|
313
|
+
context.fetch
|
314
|
+
end
|
315
|
+
|
316
|
+
##
|
317
|
+
# Update the InstalledAddOnExtensionInstance
|
318
|
+
# @param [Boolean] enabled Whether the Extension should be invoked.
|
319
|
+
# @return [InstalledAddOnExtensionInstance] Updated InstalledAddOnExtensionInstance
|
320
|
+
def update(
|
321
|
+
enabled: nil
|
322
|
+
)
|
323
|
+
|
324
|
+
context.update(
|
325
|
+
enabled: enabled,
|
326
|
+
)
|
327
|
+
end
|
328
|
+
|
329
|
+
##
|
330
|
+
# Provide a user friendly representation
|
331
|
+
def to_s
|
332
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
333
|
+
"<Twilio.Marketplace.V1.InstalledAddOnExtensionInstance #{values}>"
|
334
|
+
end
|
335
|
+
|
336
|
+
##
|
337
|
+
# Provide a detailed, user friendly representation
|
338
|
+
def inspect
|
339
|
+
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
340
|
+
"<Twilio.Marketplace.V1.InstalledAddOnExtensionInstance #{values}>"
|
341
|
+
end
|
342
|
+
end
|
343
|
+
|
344
|
+
end
|
345
|
+
end
|
346
|
+
end
|
347
|
+
end
|
348
|
+
end
|
349
|
+
|
350
|
+
|
@@ -0,0 +1,169 @@
|
|
1
|
+
##
|
2
|
+
# This code was generated by
|
3
|
+
# ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
4
|
+
# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
5
|
+
# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
6
|
+
#
|
7
|
+
# Twilio - Marketplace
|
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 Marketplace < MarketplaceBase
|
19
|
+
class V1 < Version
|
20
|
+
class InstalledAddOnContext < InstanceContext
|
21
|
+
|
22
|
+
class InstalledAddOnUsageList < ListResource
|
23
|
+
|
24
|
+
class CreateMarketplaceBillingUsageRequest
|
25
|
+
# @param [billable_items]: [Array<InstalledAddOnUsageList.CreateMarketplaceBillingUsageRequestBillableItems>]
|
26
|
+
attr_accessor :billable_items
|
27
|
+
def initialize(payload)
|
28
|
+
@billable_items = payload["billable_items"]
|
29
|
+
end
|
30
|
+
def to_json(options = {})
|
31
|
+
{
|
32
|
+
billable_items: @billable_items,
|
33
|
+
}.to_json(options)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
class CreateMarketplaceBillingUsageRequestBillableItems
|
38
|
+
# @param [quantity]: [Float]
|
39
|
+
# @param [sid]: [String]
|
40
|
+
attr_accessor :quantity, :sid
|
41
|
+
def initialize(payload)
|
42
|
+
@quantity = payload["quantity"]
|
43
|
+
@sid = payload["sid"]
|
44
|
+
end
|
45
|
+
def to_json(options = {})
|
46
|
+
{
|
47
|
+
quantity: @quantity,
|
48
|
+
sid: @sid,
|
49
|
+
}.to_json(options)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
##
|
54
|
+
# Initialize the InstalledAddOnUsageList
|
55
|
+
# @param [Version] version Version that contains the resource
|
56
|
+
# @return [InstalledAddOnUsageList] InstalledAddOnUsageList
|
57
|
+
def initialize(version, installed_add_on_sid: nil)
|
58
|
+
super(version)
|
59
|
+
# Path Solution
|
60
|
+
@solution = { installed_add_on_sid: installed_add_on_sid }
|
61
|
+
@uri = "/InstalledAddOns/#{@solution[:installed_add_on_sid]}/Usage"
|
62
|
+
|
63
|
+
end
|
64
|
+
##
|
65
|
+
# Create the InstalledAddOnUsageInstance
|
66
|
+
# @param [CreateMarketplaceBillingUsageRequest] create_marketplace_billing_usage_request
|
67
|
+
# @return [InstalledAddOnUsageInstance] Created InstalledAddOnUsageInstance
|
68
|
+
def create(create_marketplace_billing_usage_request: nil
|
69
|
+
)
|
70
|
+
|
71
|
+
headers = Twilio::Values.of({"Content-Type"=> "application/json"})
|
72
|
+
payload = @version.create('POST', @uri, data: create_marketplace_billing_usage_request.to_json, headers: headers)
|
73
|
+
InstalledAddOnUsageInstance.new(
|
74
|
+
@version,
|
75
|
+
payload,
|
76
|
+
installed_add_on_sid: @solution[:installed_add_on_sid],
|
77
|
+
)
|
78
|
+
end
|
79
|
+
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
# Provide a user friendly representation
|
84
|
+
def to_s
|
85
|
+
'#<Twilio.Marketplace.V1.InstalledAddOnUsageList>'
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
class InstalledAddOnUsagePage < Page
|
90
|
+
##
|
91
|
+
# Initialize the InstalledAddOnUsagePage
|
92
|
+
# @param [Version] version Version that contains the resource
|
93
|
+
# @param [Response] response Response from the API
|
94
|
+
# @param [Hash] solution Path solution for the resource
|
95
|
+
# @return [InstalledAddOnUsagePage] InstalledAddOnUsagePage
|
96
|
+
def initialize(version, response, solution)
|
97
|
+
super(version, response)
|
98
|
+
|
99
|
+
# Path Solution
|
100
|
+
@solution = solution
|
101
|
+
end
|
102
|
+
|
103
|
+
##
|
104
|
+
# Build an instance of InstalledAddOnUsageInstance
|
105
|
+
# @param [Hash] payload Payload response from the API
|
106
|
+
# @return [InstalledAddOnUsageInstance] InstalledAddOnUsageInstance
|
107
|
+
def get_instance(payload)
|
108
|
+
InstalledAddOnUsageInstance.new(@version, payload, installed_add_on_sid: @solution[:installed_add_on_sid])
|
109
|
+
end
|
110
|
+
|
111
|
+
##
|
112
|
+
# Provide a user friendly representation
|
113
|
+
def to_s
|
114
|
+
'<Twilio.Marketplace.V1.InstalledAddOnUsagePage>'
|
115
|
+
end
|
116
|
+
end
|
117
|
+
class InstalledAddOnUsageInstance < InstanceResource
|
118
|
+
##
|
119
|
+
# Initialize the InstalledAddOnUsageInstance
|
120
|
+
# @param [Version] version Version that contains the resource
|
121
|
+
# @param [Hash] payload payload that contains response from Twilio
|
122
|
+
# @param [String] account_sid The SID of the
|
123
|
+
# {Account}[https://www.twilio.com/docs/iam/api/account] that created this InstalledAddOnUsage
|
124
|
+
# resource.
|
125
|
+
# @param [String] sid The SID of the Call resource to fetch.
|
126
|
+
# @return [InstalledAddOnUsageInstance] InstalledAddOnUsageInstance
|
127
|
+
def initialize(version, payload , installed_add_on_sid: nil)
|
128
|
+
super(version)
|
129
|
+
|
130
|
+
# Marshaled Properties
|
131
|
+
@properties = {
|
132
|
+
'billable_items' => payload['billable_items'],
|
133
|
+
'total_submitted' => payload['total_submitted'],
|
134
|
+
}
|
135
|
+
end
|
136
|
+
|
137
|
+
|
138
|
+
##
|
139
|
+
# @return [Array<MarketplaceInstalledAddOnBillingUsageResponseBillableItems>]
|
140
|
+
def billable_items
|
141
|
+
@properties['billable_items']
|
142
|
+
end
|
143
|
+
|
144
|
+
##
|
145
|
+
# @return [Float] Represents the total quantity submitted.
|
146
|
+
def total_submitted
|
147
|
+
@properties['total_submitted']
|
148
|
+
end
|
149
|
+
|
150
|
+
##
|
151
|
+
# Provide a user friendly representation
|
152
|
+
def to_s
|
153
|
+
"<Twilio.Marketplace.V1.InstalledAddOnUsageInstance>"
|
154
|
+
end
|
155
|
+
|
156
|
+
##
|
157
|
+
# Provide a detailed, user friendly representation
|
158
|
+
def inspect
|
159
|
+
"<Twilio.Marketplace.V1.InstalledAddOnUsageInstance>"
|
160
|
+
end
|
161
|
+
end
|
162
|
+
|
163
|
+
end
|
164
|
+
end
|
165
|
+
end
|
166
|
+
end
|
167
|
+
end
|
168
|
+
|
169
|
+
|