twilio-ruby 7.0.0.pre.rc.1 → 7.0.0.pre.rc.3
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/test-and-deploy.yml +9 -9
- data/CHANGES.md +46 -0
- data/README.md +2 -2
- data/lib/twilio-ruby/rest/api/v2010/account/call.rb +28 -37
- data/lib/twilio-ruby/rest/api/v2010/account/conference.rb +27 -3
- data/lib/twilio-ruby/rest/api/v2010/account/message.rb +17 -5
- data/lib/twilio-ruby/rest/client.rb +5 -0
- data/lib/twilio-ruby/rest/content/v1/content.rb +60 -1
- data/lib/twilio-ruby/rest/flex_api/v1/configuration.rb +10 -5
- data/lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_participant.rb +11 -1
- data/lib/twilio-ruby/rest/flex_api/v1/plugin/plugin_versions.rb +384 -0
- data/lib/twilio-ruby/rest/flex_api/v1/plugin.rb +446 -0
- data/lib/twilio-ruby/rest/flex_api/v1/plugin_archive.rb +247 -0
- data/lib/twilio-ruby/rest/flex_api/v1/plugin_configuration/configured_plugin.rb +393 -0
- data/lib/twilio-ruby/rest/flex_api/v1/plugin_configuration.rb +386 -0
- data/lib/twilio-ruby/rest/flex_api/v1/plugin_configuration_archive.rb +233 -0
- data/lib/twilio-ruby/rest/flex_api/v1/plugin_release.rb +332 -0
- data/lib/twilio-ruby/rest/flex_api/v1/plugin_version_archive.rb +256 -0
- data/lib/twilio-ruby/rest/flex_api/v1.rb +112 -30
- data/lib/twilio-ruby/rest/lookups/v1/phone_number.rb +1 -1
- data/lib/twilio-ruby/rest/lookups/v2/phone_number.rb +6 -6
- data/lib/twilio-ruby/rest/messaging/v1/brand_registration.rb +9 -2
- data/lib/twilio-ruby/rest/messaging/v1/tollfree_verification.rb +11 -4
- data/lib/twilio-ruby/rest/numbers/v1/bulk_eligibility.rb +5 -3
- data/lib/twilio-ruby/rest/numbers/v1/eligibility.rb +5 -3
- data/lib/twilio-ruby/rest/numbers/v1/porting_port_in.rb +5 -3
- data/lib/twilio-ruby/rest/numbers/v1.rb +3 -3
- data/lib/twilio-ruby/rest/numbers/v2/bulk_hosted_number_order.rb +5 -3
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle.rb +15 -3
- data/lib/twilio-ruby/rest/oauth/v1/authorize.rb +143 -0
- data/lib/twilio-ruby/rest/oauth/v1/token.rb +175 -0
- data/lib/twilio-ruby/rest/oauth/v1.rb +46 -0
- data/lib/twilio-ruby/rest/oauth.rb +6 -0
- data/lib/twilio-ruby/rest/oauth_base.rb +38 -0
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_bulk_real_time_statistics.rb +5 -3
- data/lib/twilio-ruby/rest/trusthub/v1/compliance_registration_inquiries.rb +26 -2
- data/lib/twilio-ruby/rest/trusthub/v1/customer_profiles/customer_profiles_entity_assignments.rb +9 -3
- data/lib/twilio-ruby/rest/trusthub/v1/trust_products/trust_products_entity_assignments.rb +9 -3
- data/lib/twilio-ruby/twiml/messaging_response.rb +1 -1
- data/lib/twilio-ruby/version.rb +1 -1
- metadata +15 -6
- data/lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb +0 -267
- data/lib/twilio-ruby/rest/api/v2010/account/call/feedback_summary.rb +0 -332
- data/lib/twilio-ruby/rest/flex_api/v1/insights_conversational_ai.rb +0 -274
- data/lib/twilio-ruby/rest/flex_api/v1/insights_conversational_ai_report_insights.rb +0 -253
@@ -0,0 +1,446 @@
|
|
1
|
+
##
|
2
|
+
# This code was generated by
|
3
|
+
# ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
4
|
+
# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
5
|
+
# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
6
|
+
#
|
7
|
+
# Twilio - Flex
|
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 FlexApi < FlexApiBase
|
19
|
+
class V1 < Version
|
20
|
+
class PluginList < ListResource
|
21
|
+
|
22
|
+
##
|
23
|
+
# Initialize the PluginList
|
24
|
+
# @param [Version] version Version that contains the resource
|
25
|
+
# @return [PluginList] PluginList
|
26
|
+
def initialize(version)
|
27
|
+
super(version)
|
28
|
+
# Path Solution
|
29
|
+
@solution = { }
|
30
|
+
@uri = "/PluginService/Plugins"
|
31
|
+
|
32
|
+
end
|
33
|
+
##
|
34
|
+
# Create the PluginInstance
|
35
|
+
# @param [String] unique_name The Flex Plugin's unique name.
|
36
|
+
# @param [String] friendly_name The Flex Plugin's friendly name.
|
37
|
+
# @param [String] description A descriptive string that you create to describe the plugin resource. It can be up to 500 characters long
|
38
|
+
# @param [String] flex_metadata The Flex-Metadata HTTP request header
|
39
|
+
# @return [PluginInstance] Created PluginInstance
|
40
|
+
def create(
|
41
|
+
unique_name: nil,
|
42
|
+
friendly_name: :unset,
|
43
|
+
description: :unset,
|
44
|
+
flex_metadata: :unset
|
45
|
+
)
|
46
|
+
|
47
|
+
data = Twilio::Values.of({
|
48
|
+
'UniqueName' => unique_name,
|
49
|
+
'FriendlyName' => friendly_name,
|
50
|
+
'Description' => description,
|
51
|
+
})
|
52
|
+
|
53
|
+
|
54
|
+
headers = Twilio::Values.of({ 'Flex-Metadata' => flex_metadata, })
|
55
|
+
payload = @version.create('POST', @uri, data: data, headers: headers)
|
56
|
+
PluginInstance.new(
|
57
|
+
@version,
|
58
|
+
payload,
|
59
|
+
)
|
60
|
+
end
|
61
|
+
|
62
|
+
|
63
|
+
##
|
64
|
+
# Lists PluginInstance records from the API as a list.
|
65
|
+
# Unlike stream(), this operation is eager and will load `limit` records into
|
66
|
+
# memory before returning.
|
67
|
+
# @param [String] flex_metadata The Flex-Metadata HTTP request header
|
68
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
69
|
+
# guarantees to never return more than limit. Default is no limit
|
70
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
71
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
72
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
73
|
+
# efficient page size, i.e. min(limit, 1000)
|
74
|
+
# @return [Array] Array of up to limit results
|
75
|
+
def list(flex_metadata: :unset, limit: nil, page_size: nil)
|
76
|
+
self.stream(
|
77
|
+
flex_metadata: flex_metadata,
|
78
|
+
limit: limit,
|
79
|
+
page_size: page_size
|
80
|
+
).entries
|
81
|
+
end
|
82
|
+
|
83
|
+
##
|
84
|
+
# Streams Instance records from the API as an Enumerable.
|
85
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
86
|
+
# is reached.
|
87
|
+
# @param [String] flex_metadata The Flex-Metadata HTTP request header
|
88
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
89
|
+
# guarantees to never return more than limit. Default is no limit
|
90
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
91
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
92
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
93
|
+
# efficient page size, i.e. min(limit, 1000)
|
94
|
+
# @return [Enumerable] Enumerable that will yield up to limit results
|
95
|
+
def stream(flex_metadata: :unset, limit: nil, page_size: nil)
|
96
|
+
limits = @version.read_limits(limit, page_size)
|
97
|
+
|
98
|
+
page = self.page(
|
99
|
+
flex_metadata: flex_metadata,
|
100
|
+
page_size: limits[:page_size], )
|
101
|
+
|
102
|
+
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
103
|
+
end
|
104
|
+
|
105
|
+
##
|
106
|
+
# When passed a block, yields PluginInstance records from the API.
|
107
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
108
|
+
# is reached.
|
109
|
+
def each
|
110
|
+
limits = @version.read_limits
|
111
|
+
|
112
|
+
page = self.page(page_size: limits[:page_size], )
|
113
|
+
|
114
|
+
@version.stream(page,
|
115
|
+
limit: limits[:limit],
|
116
|
+
page_limit: limits[:page_limit]).each {|x| yield x}
|
117
|
+
end
|
118
|
+
|
119
|
+
##
|
120
|
+
# Retrieve a single page of PluginInstance records from the API.
|
121
|
+
# Request is executed immediately.
|
122
|
+
# @param [String] flex_metadata The Flex-Metadata HTTP request header
|
123
|
+
# @param [String] page_token PageToken provided by the API
|
124
|
+
# @param [Integer] page_number Page Number, this value is simply for client state
|
125
|
+
# @param [Integer] page_size Number of records to return, defaults to 50
|
126
|
+
# @return [Page] Page of PluginInstance
|
127
|
+
def page(flex_metadata: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
|
128
|
+
params = Twilio::Values.of({
|
129
|
+
'Flex-Metadata' => flex_metadata,
|
130
|
+
'PageToken' => page_token,
|
131
|
+
'Page' => page_number,
|
132
|
+
'PageSize' => page_size,
|
133
|
+
})
|
134
|
+
|
135
|
+
response = @version.page('GET', @uri, params: params)
|
136
|
+
|
137
|
+
PluginPage.new(@version, response, @solution)
|
138
|
+
end
|
139
|
+
|
140
|
+
##
|
141
|
+
# Retrieve a single page of PluginInstance records from the API.
|
142
|
+
# Request is executed immediately.
|
143
|
+
# @param [String] target_url API-generated URL for the requested results page
|
144
|
+
# @return [Page] Page of PluginInstance
|
145
|
+
def get_page(target_url)
|
146
|
+
response = @version.domain.request(
|
147
|
+
'GET',
|
148
|
+
target_url
|
149
|
+
)
|
150
|
+
PluginPage.new(@version, response, @solution)
|
151
|
+
end
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
# Provide a user friendly representation
|
156
|
+
def to_s
|
157
|
+
'#<Twilio.FlexApi.V1.PluginList>'
|
158
|
+
end
|
159
|
+
end
|
160
|
+
|
161
|
+
|
162
|
+
class PluginContext < InstanceContext
|
163
|
+
##
|
164
|
+
# Initialize the PluginContext
|
165
|
+
# @param [Version] version Version that contains the resource
|
166
|
+
# @param [String] sid The SID of the Flex Plugin resource to update.
|
167
|
+
# @return [PluginContext] PluginContext
|
168
|
+
def initialize(version, sid)
|
169
|
+
super(version)
|
170
|
+
|
171
|
+
# Path Solution
|
172
|
+
@solution = { sid: sid, }
|
173
|
+
@uri = "/PluginService/Plugins/#{@solution[:sid]}"
|
174
|
+
|
175
|
+
# Dependents
|
176
|
+
@plugin_versions = nil
|
177
|
+
end
|
178
|
+
##
|
179
|
+
# Fetch the PluginInstance
|
180
|
+
# @param [String] flex_metadata The Flex-Metadata HTTP request header
|
181
|
+
# @return [PluginInstance] Fetched PluginInstance
|
182
|
+
def fetch(
|
183
|
+
flex_metadata: :unset
|
184
|
+
)
|
185
|
+
|
186
|
+
|
187
|
+
headers = Twilio::Values.of({ 'Flex-Metadata' => flex_metadata, })
|
188
|
+
payload = @version.fetch('GET', @uri, headers: headers)
|
189
|
+
PluginInstance.new(
|
190
|
+
@version,
|
191
|
+
payload,
|
192
|
+
sid: @solution[:sid],
|
193
|
+
)
|
194
|
+
end
|
195
|
+
|
196
|
+
##
|
197
|
+
# Update the PluginInstance
|
198
|
+
# @param [String] friendly_name The Flex Plugin's friendly name.
|
199
|
+
# @param [String] description A descriptive string that you update to describe the plugin resource. It can be up to 500 characters long
|
200
|
+
# @param [String] flex_metadata The Flex-Metadata HTTP request header
|
201
|
+
# @return [PluginInstance] Updated PluginInstance
|
202
|
+
def update(
|
203
|
+
friendly_name: :unset,
|
204
|
+
description: :unset,
|
205
|
+
flex_metadata: :unset
|
206
|
+
)
|
207
|
+
|
208
|
+
data = Twilio::Values.of({
|
209
|
+
'FriendlyName' => friendly_name,
|
210
|
+
'Description' => description,
|
211
|
+
})
|
212
|
+
|
213
|
+
|
214
|
+
headers = Twilio::Values.of({ 'Flex-Metadata' => flex_metadata, })
|
215
|
+
payload = @version.update('POST', @uri, data: data, headers: headers)
|
216
|
+
PluginInstance.new(
|
217
|
+
@version,
|
218
|
+
payload,
|
219
|
+
sid: @solution[:sid],
|
220
|
+
)
|
221
|
+
end
|
222
|
+
|
223
|
+
##
|
224
|
+
# Access the plugin_versions
|
225
|
+
# @return [PluginVersionsList]
|
226
|
+
# @return [PluginVersionsContext] if sid was passed.
|
227
|
+
def plugin_versions(sid=:unset)
|
228
|
+
|
229
|
+
raise ArgumentError, 'sid cannot be nil' if sid.nil?
|
230
|
+
|
231
|
+
if sid != :unset
|
232
|
+
return PluginVersionsContext.new(@version, @solution[:sid],sid )
|
233
|
+
end
|
234
|
+
|
235
|
+
unless @plugin_versions
|
236
|
+
@plugin_versions = PluginVersionsList.new(
|
237
|
+
@version, plugin_sid: @solution[:sid], )
|
238
|
+
end
|
239
|
+
|
240
|
+
@plugin_versions
|
241
|
+
end
|
242
|
+
|
243
|
+
##
|
244
|
+
# Provide a user friendly representation
|
245
|
+
def to_s
|
246
|
+
context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
|
247
|
+
"#<Twilio.FlexApi.V1.PluginContext #{context}>"
|
248
|
+
end
|
249
|
+
|
250
|
+
##
|
251
|
+
# Provide a detailed, user friendly representation
|
252
|
+
def inspect
|
253
|
+
context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
|
254
|
+
"#<Twilio.FlexApi.V1.PluginContext #{context}>"
|
255
|
+
end
|
256
|
+
end
|
257
|
+
|
258
|
+
class PluginPage < Page
|
259
|
+
##
|
260
|
+
# Initialize the PluginPage
|
261
|
+
# @param [Version] version Version that contains the resource
|
262
|
+
# @param [Response] response Response from the API
|
263
|
+
# @param [Hash] solution Path solution for the resource
|
264
|
+
# @return [PluginPage] PluginPage
|
265
|
+
def initialize(version, response, solution)
|
266
|
+
super(version, response)
|
267
|
+
|
268
|
+
# Path Solution
|
269
|
+
@solution = solution
|
270
|
+
end
|
271
|
+
|
272
|
+
##
|
273
|
+
# Build an instance of PluginInstance
|
274
|
+
# @param [Hash] payload Payload response from the API
|
275
|
+
# @return [PluginInstance] PluginInstance
|
276
|
+
def get_instance(payload)
|
277
|
+
PluginInstance.new(@version, payload)
|
278
|
+
end
|
279
|
+
|
280
|
+
##
|
281
|
+
# Provide a user friendly representation
|
282
|
+
def to_s
|
283
|
+
'<Twilio.FlexApi.V1.PluginPage>'
|
284
|
+
end
|
285
|
+
end
|
286
|
+
class PluginInstance < InstanceResource
|
287
|
+
##
|
288
|
+
# Initialize the PluginInstance
|
289
|
+
# @param [Version] version Version that contains the resource
|
290
|
+
# @param [Hash] payload payload that contains response from Twilio
|
291
|
+
# @param [String] account_sid The SID of the
|
292
|
+
# {Account}[https://www.twilio.com/docs/iam/api/account] that created this Plugin
|
293
|
+
# resource.
|
294
|
+
# @param [String] sid The SID of the Call resource to fetch.
|
295
|
+
# @return [PluginInstance] PluginInstance
|
296
|
+
def initialize(version, payload , sid: nil)
|
297
|
+
super(version)
|
298
|
+
|
299
|
+
# Marshaled Properties
|
300
|
+
@properties = {
|
301
|
+
'sid' => payload['sid'],
|
302
|
+
'account_sid' => payload['account_sid'],
|
303
|
+
'unique_name' => payload['unique_name'],
|
304
|
+
'friendly_name' => payload['friendly_name'],
|
305
|
+
'description' => payload['description'],
|
306
|
+
'archived' => payload['archived'],
|
307
|
+
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
|
308
|
+
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
|
309
|
+
'url' => payload['url'],
|
310
|
+
'links' => payload['links'],
|
311
|
+
}
|
312
|
+
|
313
|
+
# Context
|
314
|
+
@instance_context = nil
|
315
|
+
@params = { 'sid' => sid || @properties['sid'] , }
|
316
|
+
end
|
317
|
+
|
318
|
+
##
|
319
|
+
# Generate an instance context for the instance, the context is capable of
|
320
|
+
# performing various actions. All instance actions are proxied to the context
|
321
|
+
# @return [PluginContext] CallContext for this CallInstance
|
322
|
+
def context
|
323
|
+
unless @instance_context
|
324
|
+
@instance_context = PluginContext.new(@version , @params['sid'])
|
325
|
+
end
|
326
|
+
@instance_context
|
327
|
+
end
|
328
|
+
|
329
|
+
##
|
330
|
+
# @return [String] The unique string that we created to identify the Flex Plugin resource.
|
331
|
+
def sid
|
332
|
+
@properties['sid']
|
333
|
+
end
|
334
|
+
|
335
|
+
##
|
336
|
+
# @return [String] The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Flex Plugin resource and owns this resource.
|
337
|
+
def account_sid
|
338
|
+
@properties['account_sid']
|
339
|
+
end
|
340
|
+
|
341
|
+
##
|
342
|
+
# @return [String] The name that uniquely identifies this Flex Plugin resource.
|
343
|
+
def unique_name
|
344
|
+
@properties['unique_name']
|
345
|
+
end
|
346
|
+
|
347
|
+
##
|
348
|
+
# @return [String] The friendly name this Flex Plugin resource.
|
349
|
+
def friendly_name
|
350
|
+
@properties['friendly_name']
|
351
|
+
end
|
352
|
+
|
353
|
+
##
|
354
|
+
# @return [String] A descriptive string that you create to describe the plugin resource. It can be up to 500 characters long
|
355
|
+
def description
|
356
|
+
@properties['description']
|
357
|
+
end
|
358
|
+
|
359
|
+
##
|
360
|
+
# @return [Boolean] Whether the Flex Plugin is archived. The default value is false.
|
361
|
+
def archived
|
362
|
+
@properties['archived']
|
363
|
+
end
|
364
|
+
|
365
|
+
##
|
366
|
+
# @return [Time] The date and time in GMT-7 when the Flex Plugin was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
367
|
+
def date_created
|
368
|
+
@properties['date_created']
|
369
|
+
end
|
370
|
+
|
371
|
+
##
|
372
|
+
# @return [Time] The date and time in GMT-7 when the Flex Plugin was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
373
|
+
def date_updated
|
374
|
+
@properties['date_updated']
|
375
|
+
end
|
376
|
+
|
377
|
+
##
|
378
|
+
# @return [String] The absolute URL of the Flex Plugin resource.
|
379
|
+
def url
|
380
|
+
@properties['url']
|
381
|
+
end
|
382
|
+
|
383
|
+
##
|
384
|
+
# @return [Hash]
|
385
|
+
def links
|
386
|
+
@properties['links']
|
387
|
+
end
|
388
|
+
|
389
|
+
##
|
390
|
+
# Fetch the PluginInstance
|
391
|
+
# @param [String] flex_metadata The Flex-Metadata HTTP request header
|
392
|
+
# @return [PluginInstance] Fetched PluginInstance
|
393
|
+
def fetch(
|
394
|
+
flex_metadata: :unset
|
395
|
+
)
|
396
|
+
|
397
|
+
context.fetch(
|
398
|
+
flex_metadata: flex_metadata,
|
399
|
+
)
|
400
|
+
end
|
401
|
+
|
402
|
+
##
|
403
|
+
# Update the PluginInstance
|
404
|
+
# @param [String] friendly_name The Flex Plugin's friendly name.
|
405
|
+
# @param [String] description A descriptive string that you update to describe the plugin resource. It can be up to 500 characters long
|
406
|
+
# @param [String] flex_metadata The Flex-Metadata HTTP request header
|
407
|
+
# @return [PluginInstance] Updated PluginInstance
|
408
|
+
def update(
|
409
|
+
friendly_name: :unset,
|
410
|
+
description: :unset,
|
411
|
+
flex_metadata: :unset
|
412
|
+
)
|
413
|
+
|
414
|
+
context.update(
|
415
|
+
friendly_name: friendly_name,
|
416
|
+
description: description,
|
417
|
+
flex_metadata: flex_metadata,
|
418
|
+
)
|
419
|
+
end
|
420
|
+
|
421
|
+
##
|
422
|
+
# Access the plugin_versions
|
423
|
+
# @return [plugin_versions] plugin_versions
|
424
|
+
def plugin_versions
|
425
|
+
context.plugin_versions
|
426
|
+
end
|
427
|
+
|
428
|
+
##
|
429
|
+
# Provide a user friendly representation
|
430
|
+
def to_s
|
431
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
432
|
+
"<Twilio.FlexApi.V1.PluginInstance #{values}>"
|
433
|
+
end
|
434
|
+
|
435
|
+
##
|
436
|
+
# Provide a detailed, user friendly representation
|
437
|
+
def inspect
|
438
|
+
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
439
|
+
"<Twilio.FlexApi.V1.PluginInstance #{values}>"
|
440
|
+
end
|
441
|
+
end
|
442
|
+
|
443
|
+
end
|
444
|
+
end
|
445
|
+
end
|
446
|
+
end
|
@@ -0,0 +1,247 @@
|
|
1
|
+
##
|
2
|
+
# This code was generated by
|
3
|
+
# ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
4
|
+
# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
5
|
+
# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
6
|
+
#
|
7
|
+
# Twilio - Flex
|
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 FlexApi < FlexApiBase
|
19
|
+
class V1 < Version
|
20
|
+
class PluginArchiveList < ListResource
|
21
|
+
|
22
|
+
##
|
23
|
+
# Initialize the PluginArchiveList
|
24
|
+
# @param [Version] version Version that contains the resource
|
25
|
+
# @return [PluginArchiveList] PluginArchiveList
|
26
|
+
def initialize(version)
|
27
|
+
super(version)
|
28
|
+
# Path Solution
|
29
|
+
@solution = { }
|
30
|
+
|
31
|
+
|
32
|
+
end
|
33
|
+
|
34
|
+
|
35
|
+
|
36
|
+
# Provide a user friendly representation
|
37
|
+
def to_s
|
38
|
+
'#<Twilio.FlexApi.V1.PluginArchiveList>'
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
|
43
|
+
class PluginArchiveContext < InstanceContext
|
44
|
+
##
|
45
|
+
# Initialize the PluginArchiveContext
|
46
|
+
# @param [Version] version Version that contains the resource
|
47
|
+
# @param [String] sid The SID of the Flex Plugin resource to archive.
|
48
|
+
# @return [PluginArchiveContext] PluginArchiveContext
|
49
|
+
def initialize(version, sid)
|
50
|
+
super(version)
|
51
|
+
|
52
|
+
# Path Solution
|
53
|
+
@solution = { sid: sid, }
|
54
|
+
@uri = "/PluginService/Plugins/#{@solution[:sid]}/Archive"
|
55
|
+
|
56
|
+
|
57
|
+
end
|
58
|
+
##
|
59
|
+
# Update the PluginArchiveInstance
|
60
|
+
# @param [String] flex_metadata The Flex-Metadata HTTP request header
|
61
|
+
# @return [PluginArchiveInstance] Updated PluginArchiveInstance
|
62
|
+
def update(
|
63
|
+
flex_metadata: :unset
|
64
|
+
)
|
65
|
+
|
66
|
+
|
67
|
+
headers = Twilio::Values.of({ 'Flex-Metadata' => flex_metadata, })
|
68
|
+
payload = @version.update('POST', @uri, headers: headers)
|
69
|
+
PluginArchiveInstance.new(
|
70
|
+
@version,
|
71
|
+
payload,
|
72
|
+
sid: @solution[:sid],
|
73
|
+
)
|
74
|
+
end
|
75
|
+
|
76
|
+
|
77
|
+
##
|
78
|
+
# Provide a user friendly representation
|
79
|
+
def to_s
|
80
|
+
context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
|
81
|
+
"#<Twilio.FlexApi.V1.PluginArchiveContext #{context}>"
|
82
|
+
end
|
83
|
+
|
84
|
+
##
|
85
|
+
# Provide a detailed, user friendly representation
|
86
|
+
def inspect
|
87
|
+
context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
|
88
|
+
"#<Twilio.FlexApi.V1.PluginArchiveContext #{context}>"
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
class PluginArchivePage < Page
|
93
|
+
##
|
94
|
+
# Initialize the PluginArchivePage
|
95
|
+
# @param [Version] version Version that contains the resource
|
96
|
+
# @param [Response] response Response from the API
|
97
|
+
# @param [Hash] solution Path solution for the resource
|
98
|
+
# @return [PluginArchivePage] PluginArchivePage
|
99
|
+
def initialize(version, response, solution)
|
100
|
+
super(version, response)
|
101
|
+
|
102
|
+
# Path Solution
|
103
|
+
@solution = solution
|
104
|
+
end
|
105
|
+
|
106
|
+
##
|
107
|
+
# Build an instance of PluginArchiveInstance
|
108
|
+
# @param [Hash] payload Payload response from the API
|
109
|
+
# @return [PluginArchiveInstance] PluginArchiveInstance
|
110
|
+
def get_instance(payload)
|
111
|
+
PluginArchiveInstance.new(@version, payload)
|
112
|
+
end
|
113
|
+
|
114
|
+
##
|
115
|
+
# Provide a user friendly representation
|
116
|
+
def to_s
|
117
|
+
'<Twilio.FlexApi.V1.PluginArchivePage>'
|
118
|
+
end
|
119
|
+
end
|
120
|
+
class PluginArchiveInstance < InstanceResource
|
121
|
+
##
|
122
|
+
# Initialize the PluginArchiveInstance
|
123
|
+
# @param [Version] version Version that contains the resource
|
124
|
+
# @param [Hash] payload payload that contains response from Twilio
|
125
|
+
# @param [String] account_sid The SID of the
|
126
|
+
# {Account}[https://www.twilio.com/docs/iam/api/account] that created this PluginArchive
|
127
|
+
# resource.
|
128
|
+
# @param [String] sid The SID of the Call resource to fetch.
|
129
|
+
# @return [PluginArchiveInstance] PluginArchiveInstance
|
130
|
+
def initialize(version, payload , sid: nil)
|
131
|
+
super(version)
|
132
|
+
|
133
|
+
# Marshaled Properties
|
134
|
+
@properties = {
|
135
|
+
'sid' => payload['sid'],
|
136
|
+
'account_sid' => payload['account_sid'],
|
137
|
+
'unique_name' => payload['unique_name'],
|
138
|
+
'friendly_name' => payload['friendly_name'],
|
139
|
+
'description' => payload['description'],
|
140
|
+
'archived' => payload['archived'],
|
141
|
+
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
|
142
|
+
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
|
143
|
+
'url' => payload['url'],
|
144
|
+
}
|
145
|
+
|
146
|
+
# Context
|
147
|
+
@instance_context = nil
|
148
|
+
@params = { 'sid' => sid || @properties['sid'] , }
|
149
|
+
end
|
150
|
+
|
151
|
+
##
|
152
|
+
# Generate an instance context for the instance, the context is capable of
|
153
|
+
# performing various actions. All instance actions are proxied to the context
|
154
|
+
# @return [PluginArchiveContext] CallContext for this CallInstance
|
155
|
+
def context
|
156
|
+
unless @instance_context
|
157
|
+
@instance_context = PluginArchiveContext.new(@version , @params['sid'])
|
158
|
+
end
|
159
|
+
@instance_context
|
160
|
+
end
|
161
|
+
|
162
|
+
##
|
163
|
+
# @return [String] The unique string that we created to identify the Flex Plugin resource.
|
164
|
+
def sid
|
165
|
+
@properties['sid']
|
166
|
+
end
|
167
|
+
|
168
|
+
##
|
169
|
+
# @return [String] The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Flex Plugin resource and owns this resource.
|
170
|
+
def account_sid
|
171
|
+
@properties['account_sid']
|
172
|
+
end
|
173
|
+
|
174
|
+
##
|
175
|
+
# @return [String] The name that uniquely identifies this Flex Plugin resource.
|
176
|
+
def unique_name
|
177
|
+
@properties['unique_name']
|
178
|
+
end
|
179
|
+
|
180
|
+
##
|
181
|
+
# @return [String] The friendly name this Flex Plugin resource.
|
182
|
+
def friendly_name
|
183
|
+
@properties['friendly_name']
|
184
|
+
end
|
185
|
+
|
186
|
+
##
|
187
|
+
# @return [String] A descriptive string that you create to describe the plugin resource. It can be up to 500 characters long
|
188
|
+
def description
|
189
|
+
@properties['description']
|
190
|
+
end
|
191
|
+
|
192
|
+
##
|
193
|
+
# @return [Boolean] Whether the Flex Plugin is archived. The default value is false.
|
194
|
+
def archived
|
195
|
+
@properties['archived']
|
196
|
+
end
|
197
|
+
|
198
|
+
##
|
199
|
+
# @return [Time] The date and time in GMT when the Flex Plugin was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
200
|
+
def date_created
|
201
|
+
@properties['date_created']
|
202
|
+
end
|
203
|
+
|
204
|
+
##
|
205
|
+
# @return [Time] The date and time in GMT when the Flex Plugin was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
206
|
+
def date_updated
|
207
|
+
@properties['date_updated']
|
208
|
+
end
|
209
|
+
|
210
|
+
##
|
211
|
+
# @return [String] The absolute URL of the Flex Plugin resource.
|
212
|
+
def url
|
213
|
+
@properties['url']
|
214
|
+
end
|
215
|
+
|
216
|
+
##
|
217
|
+
# Update the PluginArchiveInstance
|
218
|
+
# @param [String] flex_metadata The Flex-Metadata HTTP request header
|
219
|
+
# @return [PluginArchiveInstance] Updated PluginArchiveInstance
|
220
|
+
def update(
|
221
|
+
flex_metadata: :unset
|
222
|
+
)
|
223
|
+
|
224
|
+
context.update(
|
225
|
+
flex_metadata: flex_metadata,
|
226
|
+
)
|
227
|
+
end
|
228
|
+
|
229
|
+
##
|
230
|
+
# Provide a user friendly representation
|
231
|
+
def to_s
|
232
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
233
|
+
"<Twilio.FlexApi.V1.PluginArchiveInstance #{values}>"
|
234
|
+
end
|
235
|
+
|
236
|
+
##
|
237
|
+
# Provide a detailed, user friendly representation
|
238
|
+
def inspect
|
239
|
+
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
240
|
+
"<Twilio.FlexApi.V1.PluginArchiveInstance #{values}>"
|
241
|
+
end
|
242
|
+
end
|
243
|
+
|
244
|
+
end
|
245
|
+
end
|
246
|
+
end
|
247
|
+
end
|