twilio-ruby 5.74.2 → 5.74.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/CHANGES.md +7 -0
- data/README.md +2 -2
- data/lib/twilio-ruby/rest/content/v1/legacy_content.rb +254 -0
- data/lib/twilio-ruby/rest/content/v1.rb +7 -0
- data/lib/twilio-ruby/rest/content.rb +6 -0
- data/lib/twilio-ruby/rest/flex_api/v1/insights_assessments_comment.rb +314 -0
- data/lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires.rb +394 -0
- data/lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_category.rb +84 -0
- data/lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb +105 -10
- data/lib/twilio-ruby/rest/flex_api/v1/insights_segments.rb +319 -0
- data/lib/twilio-ruby/rest/flex_api/v1/insights_session.rb +14 -6
- data/lib/twilio-ruby/rest/flex_api/v1/insights_user_roles.rb +14 -6
- data/lib/twilio-ruby/rest/flex_api/v1.rb +39 -0
- data/lib/twilio-ruby/rest/flex_api.rb +22 -0
- data/lib/twilio-ruby/rest/lookups/v2/phone_number.rb +14 -0
- data/lib/twilio-ruby/rest/microvisor/v1/account_config.rb +297 -0
- data/lib/twilio-ruby/rest/microvisor/v1/account_secret.rb +290 -0
- data/lib/twilio-ruby/rest/microvisor/v1/device/device_config.rb +317 -0
- data/lib/twilio-ruby/rest/microvisor/v1/device/device_secret.rb +310 -0
- data/lib/twilio-ruby/rest/microvisor/v1/device.rb +54 -0
- data/lib/twilio-ruby/rest/microvisor/v1.rb +32 -0
- data/lib/twilio-ruby/rest/microvisor.rb +16 -0
- data/lib/twilio-ruby/rest/supersim/v1/sms_command.rb +3 -3
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue_bulk_real_time_statistics.rb +149 -0
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace.rb +23 -0
- data/lib/twilio-ruby/version.rb +1 -1
- metadata +11 -2
@@ -0,0 +1,317 @@
|
|
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 Microvisor < Domain
|
12
|
+
class V1 < Version
|
13
|
+
class DeviceContext < 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 DeviceConfigList < ListResource
|
17
|
+
##
|
18
|
+
# Initialize the DeviceConfigList
|
19
|
+
# @param [Version] version Version that contains the resource
|
20
|
+
# @param [String] device_sid A 34-character string that uniquely identifies the
|
21
|
+
# parent Device.
|
22
|
+
# @return [DeviceConfigList] DeviceConfigList
|
23
|
+
def initialize(version, device_sid: nil)
|
24
|
+
super(version)
|
25
|
+
|
26
|
+
# Path Solution
|
27
|
+
@solution = {device_sid: device_sid}
|
28
|
+
@uri = "/Devices/#{@solution[:device_sid]}/Configs"
|
29
|
+
end
|
30
|
+
|
31
|
+
##
|
32
|
+
# Lists DeviceConfigInstance records from the API as a list.
|
33
|
+
# Unlike stream(), this operation is eager and will load `limit` records into
|
34
|
+
# memory before returning.
|
35
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
36
|
+
# guarantees to never return more than limit. Default is no limit
|
37
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
38
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
39
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
40
|
+
# efficient page size, i.e. min(limit, 1000)
|
41
|
+
# @return [Array] Array of up to limit results
|
42
|
+
def list(limit: nil, page_size: nil)
|
43
|
+
self.stream(limit: limit, page_size: page_size).entries
|
44
|
+
end
|
45
|
+
|
46
|
+
##
|
47
|
+
# Streams DeviceConfigInstance records from the API as an Enumerable.
|
48
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
49
|
+
# is reached.
|
50
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
51
|
+
# guarantees to never return more than limit. Default is no limit.
|
52
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
53
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
54
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
55
|
+
# efficient page size, i.e. min(limit, 1000)
|
56
|
+
# @return [Enumerable] Enumerable that will yield up to limit results
|
57
|
+
def stream(limit: nil, page_size: nil)
|
58
|
+
limits = @version.read_limits(limit, page_size)
|
59
|
+
|
60
|
+
page = self.page(page_size: limits[:page_size], )
|
61
|
+
|
62
|
+
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
63
|
+
end
|
64
|
+
|
65
|
+
##
|
66
|
+
# When passed a block, yields DeviceConfigInstance records from the API.
|
67
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
68
|
+
# is reached.
|
69
|
+
def each
|
70
|
+
limits = @version.read_limits
|
71
|
+
|
72
|
+
page = self.page(page_size: limits[:page_size], )
|
73
|
+
|
74
|
+
@version.stream(page,
|
75
|
+
limit: limits[:limit],
|
76
|
+
page_limit: limits[:page_limit]).each {|x| yield x}
|
77
|
+
end
|
78
|
+
|
79
|
+
##
|
80
|
+
# Retrieve a single page of DeviceConfigInstance records from the API.
|
81
|
+
# Request is executed immediately.
|
82
|
+
# @param [String] page_token PageToken provided by the API
|
83
|
+
# @param [Integer] page_number Page Number, this value is simply for client state
|
84
|
+
# @param [Integer] page_size Number of records to return, defaults to 50
|
85
|
+
# @return [Page] Page of DeviceConfigInstance
|
86
|
+
def page(page_token: :unset, page_number: :unset, page_size: :unset)
|
87
|
+
params = Twilio::Values.of({
|
88
|
+
'PageToken' => page_token,
|
89
|
+
'Page' => page_number,
|
90
|
+
'PageSize' => page_size,
|
91
|
+
})
|
92
|
+
|
93
|
+
response = @version.page('GET', @uri, params: params)
|
94
|
+
|
95
|
+
DeviceConfigPage.new(@version, response, @solution)
|
96
|
+
end
|
97
|
+
|
98
|
+
##
|
99
|
+
# Retrieve a single page of DeviceConfigInstance records from the API.
|
100
|
+
# Request is executed immediately.
|
101
|
+
# @param [String] target_url API-generated URL for the requested results page
|
102
|
+
# @return [Page] Page of DeviceConfigInstance
|
103
|
+
def get_page(target_url)
|
104
|
+
response = @version.domain.request(
|
105
|
+
'GET',
|
106
|
+
target_url
|
107
|
+
)
|
108
|
+
DeviceConfigPage.new(@version, response, @solution)
|
109
|
+
end
|
110
|
+
|
111
|
+
##
|
112
|
+
# Create the DeviceConfigInstance
|
113
|
+
# @param [String] key The config key; up to 100 characters.
|
114
|
+
# @param [String] value The config value; up to 4096 characters.
|
115
|
+
# @return [DeviceConfigInstance] Created DeviceConfigInstance
|
116
|
+
def create(key: nil, value: nil)
|
117
|
+
data = Twilio::Values.of({'Key' => key, 'Value' => value, })
|
118
|
+
|
119
|
+
payload = @version.create('POST', @uri, data: data)
|
120
|
+
|
121
|
+
DeviceConfigInstance.new(@version, payload, device_sid: @solution[:device_sid], )
|
122
|
+
end
|
123
|
+
|
124
|
+
##
|
125
|
+
# Provide a user friendly representation
|
126
|
+
def to_s
|
127
|
+
'#<Twilio.Microvisor.V1.DeviceConfigList>'
|
128
|
+
end
|
129
|
+
end
|
130
|
+
|
131
|
+
##
|
132
|
+
# 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.
|
133
|
+
class DeviceConfigPage < Page
|
134
|
+
##
|
135
|
+
# Initialize the DeviceConfigPage
|
136
|
+
# @param [Version] version Version that contains the resource
|
137
|
+
# @param [Response] response Response from the API
|
138
|
+
# @param [Hash] solution Path solution for the resource
|
139
|
+
# @return [DeviceConfigPage] DeviceConfigPage
|
140
|
+
def initialize(version, response, solution)
|
141
|
+
super(version, response)
|
142
|
+
|
143
|
+
# Path Solution
|
144
|
+
@solution = solution
|
145
|
+
end
|
146
|
+
|
147
|
+
##
|
148
|
+
# Build an instance of DeviceConfigInstance
|
149
|
+
# @param [Hash] payload Payload response from the API
|
150
|
+
# @return [DeviceConfigInstance] DeviceConfigInstance
|
151
|
+
def get_instance(payload)
|
152
|
+
DeviceConfigInstance.new(@version, payload, device_sid: @solution[:device_sid], )
|
153
|
+
end
|
154
|
+
|
155
|
+
##
|
156
|
+
# Provide a user friendly representation
|
157
|
+
def to_s
|
158
|
+
'<Twilio.Microvisor.V1.DeviceConfigPage>'
|
159
|
+
end
|
160
|
+
end
|
161
|
+
|
162
|
+
##
|
163
|
+
# 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.
|
164
|
+
class DeviceConfigContext < InstanceContext
|
165
|
+
##
|
166
|
+
# Initialize the DeviceConfigContext
|
167
|
+
# @param [Version] version Version that contains the resource
|
168
|
+
# @param [String] device_sid A 34-character string that uniquely identifies the
|
169
|
+
# Device.
|
170
|
+
# @param [String] key The config key; up to 100 characters.
|
171
|
+
# @return [DeviceConfigContext] DeviceConfigContext
|
172
|
+
def initialize(version, device_sid, key)
|
173
|
+
super(version)
|
174
|
+
|
175
|
+
# Path Solution
|
176
|
+
@solution = {device_sid: device_sid, key: key, }
|
177
|
+
@uri = "/Devices/#{@solution[:device_sid]}/Configs/#{@solution[:key]}"
|
178
|
+
end
|
179
|
+
|
180
|
+
##
|
181
|
+
# Fetch the DeviceConfigInstance
|
182
|
+
# @return [DeviceConfigInstance] Fetched DeviceConfigInstance
|
183
|
+
def fetch
|
184
|
+
payload = @version.fetch('GET', @uri)
|
185
|
+
|
186
|
+
DeviceConfigInstance.new(
|
187
|
+
@version,
|
188
|
+
payload,
|
189
|
+
device_sid: @solution[:device_sid],
|
190
|
+
key: @solution[:key],
|
191
|
+
)
|
192
|
+
end
|
193
|
+
|
194
|
+
##
|
195
|
+
# Delete the DeviceConfigInstance
|
196
|
+
# @return [Boolean] true if delete succeeds, false otherwise
|
197
|
+
def delete
|
198
|
+
@version.delete('DELETE', @uri)
|
199
|
+
end
|
200
|
+
|
201
|
+
##
|
202
|
+
# Provide a user friendly representation
|
203
|
+
def to_s
|
204
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
205
|
+
"#<Twilio.Microvisor.V1.DeviceConfigContext #{context}>"
|
206
|
+
end
|
207
|
+
|
208
|
+
##
|
209
|
+
# Provide a detailed, user friendly representation
|
210
|
+
def inspect
|
211
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
212
|
+
"#<Twilio.Microvisor.V1.DeviceConfigContext #{context}>"
|
213
|
+
end
|
214
|
+
end
|
215
|
+
|
216
|
+
##
|
217
|
+
# 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.
|
218
|
+
class DeviceConfigInstance < InstanceResource
|
219
|
+
##
|
220
|
+
# Initialize the DeviceConfigInstance
|
221
|
+
# @param [Version] version Version that contains the resource
|
222
|
+
# @param [Hash] payload payload that contains response from Twilio
|
223
|
+
# @param [String] device_sid A 34-character string that uniquely identifies the
|
224
|
+
# parent Device.
|
225
|
+
# @param [String] key The config key; up to 100 characters.
|
226
|
+
# @return [DeviceConfigInstance] DeviceConfigInstance
|
227
|
+
def initialize(version, payload, device_sid: nil, key: nil)
|
228
|
+
super(version)
|
229
|
+
|
230
|
+
# Marshaled Properties
|
231
|
+
@properties = {
|
232
|
+
'device_sid' => payload['device_sid'],
|
233
|
+
'key' => payload['key'],
|
234
|
+
'value' => payload['value'],
|
235
|
+
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
|
236
|
+
'url' => payload['url'],
|
237
|
+
}
|
238
|
+
|
239
|
+
# Context
|
240
|
+
@instance_context = nil
|
241
|
+
@params = {'device_sid' => device_sid, 'key' => key || @properties['key'], }
|
242
|
+
end
|
243
|
+
|
244
|
+
##
|
245
|
+
# Generate an instance context for the instance, the context is capable of
|
246
|
+
# performing various actions. All instance actions are proxied to the context
|
247
|
+
# @return [DeviceConfigContext] DeviceConfigContext for this DeviceConfigInstance
|
248
|
+
def context
|
249
|
+
unless @instance_context
|
250
|
+
@instance_context = DeviceConfigContext.new(@version, @params['device_sid'], @params['key'], )
|
251
|
+
end
|
252
|
+
@instance_context
|
253
|
+
end
|
254
|
+
|
255
|
+
##
|
256
|
+
# @return [String] A string that uniquely identifies the parent Device.
|
257
|
+
def device_sid
|
258
|
+
@properties['device_sid']
|
259
|
+
end
|
260
|
+
|
261
|
+
##
|
262
|
+
# @return [String] The config key.
|
263
|
+
def key
|
264
|
+
@properties['key']
|
265
|
+
end
|
266
|
+
|
267
|
+
##
|
268
|
+
# @return [String] The config value.
|
269
|
+
def value
|
270
|
+
@properties['value']
|
271
|
+
end
|
272
|
+
|
273
|
+
##
|
274
|
+
# @return [Time] The date_updated
|
275
|
+
def date_updated
|
276
|
+
@properties['date_updated']
|
277
|
+
end
|
278
|
+
|
279
|
+
##
|
280
|
+
# @return [String] The absolute URL of the Config.
|
281
|
+
def url
|
282
|
+
@properties['url']
|
283
|
+
end
|
284
|
+
|
285
|
+
##
|
286
|
+
# Fetch the DeviceConfigInstance
|
287
|
+
# @return [DeviceConfigInstance] Fetched DeviceConfigInstance
|
288
|
+
def fetch
|
289
|
+
context.fetch
|
290
|
+
end
|
291
|
+
|
292
|
+
##
|
293
|
+
# Delete the DeviceConfigInstance
|
294
|
+
# @return [Boolean] true if delete succeeds, false otherwise
|
295
|
+
def delete
|
296
|
+
context.delete
|
297
|
+
end
|
298
|
+
|
299
|
+
##
|
300
|
+
# Provide a user friendly representation
|
301
|
+
def to_s
|
302
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
303
|
+
"<Twilio.Microvisor.V1.DeviceConfigInstance #{values}>"
|
304
|
+
end
|
305
|
+
|
306
|
+
##
|
307
|
+
# Provide a detailed, user friendly representation
|
308
|
+
def inspect
|
309
|
+
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
310
|
+
"<Twilio.Microvisor.V1.DeviceConfigInstance #{values}>"
|
311
|
+
end
|
312
|
+
end
|
313
|
+
end
|
314
|
+
end
|
315
|
+
end
|
316
|
+
end
|
317
|
+
end
|
@@ -0,0 +1,310 @@
|
|
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 Microvisor < Domain
|
12
|
+
class V1 < Version
|
13
|
+
class DeviceContext < 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 DeviceSecretList < ListResource
|
17
|
+
##
|
18
|
+
# Initialize the DeviceSecretList
|
19
|
+
# @param [Version] version Version that contains the resource
|
20
|
+
# @param [String] device_sid A 34-character string that uniquely identifies the
|
21
|
+
# parent Device.
|
22
|
+
# @return [DeviceSecretList] DeviceSecretList
|
23
|
+
def initialize(version, device_sid: nil)
|
24
|
+
super(version)
|
25
|
+
|
26
|
+
# Path Solution
|
27
|
+
@solution = {device_sid: device_sid}
|
28
|
+
@uri = "/Devices/#{@solution[:device_sid]}/Secrets"
|
29
|
+
end
|
30
|
+
|
31
|
+
##
|
32
|
+
# Lists DeviceSecretInstance records from the API as a list.
|
33
|
+
# Unlike stream(), this operation is eager and will load `limit` records into
|
34
|
+
# memory before returning.
|
35
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
36
|
+
# guarantees to never return more than limit. Default is no limit
|
37
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
38
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
39
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
40
|
+
# efficient page size, i.e. min(limit, 1000)
|
41
|
+
# @return [Array] Array of up to limit results
|
42
|
+
def list(limit: nil, page_size: nil)
|
43
|
+
self.stream(limit: limit, page_size: page_size).entries
|
44
|
+
end
|
45
|
+
|
46
|
+
##
|
47
|
+
# Streams DeviceSecretInstance records from the API as an Enumerable.
|
48
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
49
|
+
# is reached.
|
50
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
51
|
+
# guarantees to never return more than limit. Default is no limit.
|
52
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
53
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
54
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
55
|
+
# efficient page size, i.e. min(limit, 1000)
|
56
|
+
# @return [Enumerable] Enumerable that will yield up to limit results
|
57
|
+
def stream(limit: nil, page_size: nil)
|
58
|
+
limits = @version.read_limits(limit, page_size)
|
59
|
+
|
60
|
+
page = self.page(page_size: limits[:page_size], )
|
61
|
+
|
62
|
+
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
63
|
+
end
|
64
|
+
|
65
|
+
##
|
66
|
+
# When passed a block, yields DeviceSecretInstance records from the API.
|
67
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
68
|
+
# is reached.
|
69
|
+
def each
|
70
|
+
limits = @version.read_limits
|
71
|
+
|
72
|
+
page = self.page(page_size: limits[:page_size], )
|
73
|
+
|
74
|
+
@version.stream(page,
|
75
|
+
limit: limits[:limit],
|
76
|
+
page_limit: limits[:page_limit]).each {|x| yield x}
|
77
|
+
end
|
78
|
+
|
79
|
+
##
|
80
|
+
# Retrieve a single page of DeviceSecretInstance records from the API.
|
81
|
+
# Request is executed immediately.
|
82
|
+
# @param [String] page_token PageToken provided by the API
|
83
|
+
# @param [Integer] page_number Page Number, this value is simply for client state
|
84
|
+
# @param [Integer] page_size Number of records to return, defaults to 50
|
85
|
+
# @return [Page] Page of DeviceSecretInstance
|
86
|
+
def page(page_token: :unset, page_number: :unset, page_size: :unset)
|
87
|
+
params = Twilio::Values.of({
|
88
|
+
'PageToken' => page_token,
|
89
|
+
'Page' => page_number,
|
90
|
+
'PageSize' => page_size,
|
91
|
+
})
|
92
|
+
|
93
|
+
response = @version.page('GET', @uri, params: params)
|
94
|
+
|
95
|
+
DeviceSecretPage.new(@version, response, @solution)
|
96
|
+
end
|
97
|
+
|
98
|
+
##
|
99
|
+
# Retrieve a single page of DeviceSecretInstance records from the API.
|
100
|
+
# Request is executed immediately.
|
101
|
+
# @param [String] target_url API-generated URL for the requested results page
|
102
|
+
# @return [Page] Page of DeviceSecretInstance
|
103
|
+
def get_page(target_url)
|
104
|
+
response = @version.domain.request(
|
105
|
+
'GET',
|
106
|
+
target_url
|
107
|
+
)
|
108
|
+
DeviceSecretPage.new(@version, response, @solution)
|
109
|
+
end
|
110
|
+
|
111
|
+
##
|
112
|
+
# Create the DeviceSecretInstance
|
113
|
+
# @param [String] key The secret key; up to 100 characters.
|
114
|
+
# @param [String] value The secret value; up to 4096 characters.
|
115
|
+
# @return [DeviceSecretInstance] Created DeviceSecretInstance
|
116
|
+
def create(key: nil, value: nil)
|
117
|
+
data = Twilio::Values.of({'Key' => key, 'Value' => value, })
|
118
|
+
|
119
|
+
payload = @version.create('POST', @uri, data: data)
|
120
|
+
|
121
|
+
DeviceSecretInstance.new(@version, payload, device_sid: @solution[:device_sid], )
|
122
|
+
end
|
123
|
+
|
124
|
+
##
|
125
|
+
# Provide a user friendly representation
|
126
|
+
def to_s
|
127
|
+
'#<Twilio.Microvisor.V1.DeviceSecretList>'
|
128
|
+
end
|
129
|
+
end
|
130
|
+
|
131
|
+
##
|
132
|
+
# 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.
|
133
|
+
class DeviceSecretPage < Page
|
134
|
+
##
|
135
|
+
# Initialize the DeviceSecretPage
|
136
|
+
# @param [Version] version Version that contains the resource
|
137
|
+
# @param [Response] response Response from the API
|
138
|
+
# @param [Hash] solution Path solution for the resource
|
139
|
+
# @return [DeviceSecretPage] DeviceSecretPage
|
140
|
+
def initialize(version, response, solution)
|
141
|
+
super(version, response)
|
142
|
+
|
143
|
+
# Path Solution
|
144
|
+
@solution = solution
|
145
|
+
end
|
146
|
+
|
147
|
+
##
|
148
|
+
# Build an instance of DeviceSecretInstance
|
149
|
+
# @param [Hash] payload Payload response from the API
|
150
|
+
# @return [DeviceSecretInstance] DeviceSecretInstance
|
151
|
+
def get_instance(payload)
|
152
|
+
DeviceSecretInstance.new(@version, payload, device_sid: @solution[:device_sid], )
|
153
|
+
end
|
154
|
+
|
155
|
+
##
|
156
|
+
# Provide a user friendly representation
|
157
|
+
def to_s
|
158
|
+
'<Twilio.Microvisor.V1.DeviceSecretPage>'
|
159
|
+
end
|
160
|
+
end
|
161
|
+
|
162
|
+
##
|
163
|
+
# 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.
|
164
|
+
class DeviceSecretContext < InstanceContext
|
165
|
+
##
|
166
|
+
# Initialize the DeviceSecretContext
|
167
|
+
# @param [Version] version Version that contains the resource
|
168
|
+
# @param [String] device_sid A 34-character string that uniquely identifies the
|
169
|
+
# Device.
|
170
|
+
# @param [String] key The secret key; up to 100 characters.
|
171
|
+
# @return [DeviceSecretContext] DeviceSecretContext
|
172
|
+
def initialize(version, device_sid, key)
|
173
|
+
super(version)
|
174
|
+
|
175
|
+
# Path Solution
|
176
|
+
@solution = {device_sid: device_sid, key: key, }
|
177
|
+
@uri = "/Devices/#{@solution[:device_sid]}/Secrets/#{@solution[:key]}"
|
178
|
+
end
|
179
|
+
|
180
|
+
##
|
181
|
+
# Fetch the DeviceSecretInstance
|
182
|
+
# @return [DeviceSecretInstance] Fetched DeviceSecretInstance
|
183
|
+
def fetch
|
184
|
+
payload = @version.fetch('GET', @uri)
|
185
|
+
|
186
|
+
DeviceSecretInstance.new(
|
187
|
+
@version,
|
188
|
+
payload,
|
189
|
+
device_sid: @solution[:device_sid],
|
190
|
+
key: @solution[:key],
|
191
|
+
)
|
192
|
+
end
|
193
|
+
|
194
|
+
##
|
195
|
+
# Delete the DeviceSecretInstance
|
196
|
+
# @return [Boolean] true if delete succeeds, false otherwise
|
197
|
+
def delete
|
198
|
+
@version.delete('DELETE', @uri)
|
199
|
+
end
|
200
|
+
|
201
|
+
##
|
202
|
+
# Provide a user friendly representation
|
203
|
+
def to_s
|
204
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
205
|
+
"#<Twilio.Microvisor.V1.DeviceSecretContext #{context}>"
|
206
|
+
end
|
207
|
+
|
208
|
+
##
|
209
|
+
# Provide a detailed, user friendly representation
|
210
|
+
def inspect
|
211
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
212
|
+
"#<Twilio.Microvisor.V1.DeviceSecretContext #{context}>"
|
213
|
+
end
|
214
|
+
end
|
215
|
+
|
216
|
+
##
|
217
|
+
# 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.
|
218
|
+
class DeviceSecretInstance < InstanceResource
|
219
|
+
##
|
220
|
+
# Initialize the DeviceSecretInstance
|
221
|
+
# @param [Version] version Version that contains the resource
|
222
|
+
# @param [Hash] payload payload that contains response from Twilio
|
223
|
+
# @param [String] device_sid A 34-character string that uniquely identifies the
|
224
|
+
# parent Device.
|
225
|
+
# @param [String] key The secret key; up to 100 characters.
|
226
|
+
# @return [DeviceSecretInstance] DeviceSecretInstance
|
227
|
+
def initialize(version, payload, device_sid: nil, key: nil)
|
228
|
+
super(version)
|
229
|
+
|
230
|
+
# Marshaled Properties
|
231
|
+
@properties = {
|
232
|
+
'device_sid' => payload['device_sid'],
|
233
|
+
'key' => payload['key'],
|
234
|
+
'date_rotated' => Twilio.deserialize_iso8601_datetime(payload['date_rotated']),
|
235
|
+
'url' => payload['url'],
|
236
|
+
}
|
237
|
+
|
238
|
+
# Context
|
239
|
+
@instance_context = nil
|
240
|
+
@params = {'device_sid' => device_sid, 'key' => key || @properties['key'], }
|
241
|
+
end
|
242
|
+
|
243
|
+
##
|
244
|
+
# Generate an instance context for the instance, the context is capable of
|
245
|
+
# performing various actions. All instance actions are proxied to the context
|
246
|
+
# @return [DeviceSecretContext] DeviceSecretContext for this DeviceSecretInstance
|
247
|
+
def context
|
248
|
+
unless @instance_context
|
249
|
+
@instance_context = DeviceSecretContext.new(@version, @params['device_sid'], @params['key'], )
|
250
|
+
end
|
251
|
+
@instance_context
|
252
|
+
end
|
253
|
+
|
254
|
+
##
|
255
|
+
# @return [String] A string that uniquely identifies the parent Device.
|
256
|
+
def device_sid
|
257
|
+
@properties['device_sid']
|
258
|
+
end
|
259
|
+
|
260
|
+
##
|
261
|
+
# @return [String] The secret key.
|
262
|
+
def key
|
263
|
+
@properties['key']
|
264
|
+
end
|
265
|
+
|
266
|
+
##
|
267
|
+
# @return [Time] The date_rotated
|
268
|
+
def date_rotated
|
269
|
+
@properties['date_rotated']
|
270
|
+
end
|
271
|
+
|
272
|
+
##
|
273
|
+
# @return [String] The absolute URL of the Secret.
|
274
|
+
def url
|
275
|
+
@properties['url']
|
276
|
+
end
|
277
|
+
|
278
|
+
##
|
279
|
+
# Fetch the DeviceSecretInstance
|
280
|
+
# @return [DeviceSecretInstance] Fetched DeviceSecretInstance
|
281
|
+
def fetch
|
282
|
+
context.fetch
|
283
|
+
end
|
284
|
+
|
285
|
+
##
|
286
|
+
# Delete the DeviceSecretInstance
|
287
|
+
# @return [Boolean] true if delete succeeds, false otherwise
|
288
|
+
def delete
|
289
|
+
context.delete
|
290
|
+
end
|
291
|
+
|
292
|
+
##
|
293
|
+
# Provide a user friendly representation
|
294
|
+
def to_s
|
295
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
296
|
+
"<Twilio.Microvisor.V1.DeviceSecretInstance #{values}>"
|
297
|
+
end
|
298
|
+
|
299
|
+
##
|
300
|
+
# Provide a detailed, user friendly representation
|
301
|
+
def inspect
|
302
|
+
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
303
|
+
"<Twilio.Microvisor.V1.DeviceSecretInstance #{values}>"
|
304
|
+
end
|
305
|
+
end
|
306
|
+
end
|
307
|
+
end
|
308
|
+
end
|
309
|
+
end
|
310
|
+
end
|
@@ -157,6 +157,10 @@ module Twilio
|
|
157
157
|
# Path Solution
|
158
158
|
@solution = {sid: sid, }
|
159
159
|
@uri = "/Devices/#{@solution[:sid]}"
|
160
|
+
|
161
|
+
# Dependents
|
162
|
+
@device_configs = nil
|
163
|
+
@device_secrets = nil
|
160
164
|
end
|
161
165
|
|
162
166
|
##
|
@@ -189,6 +193,42 @@ module Twilio
|
|
189
193
|
DeviceInstance.new(@version, payload, sid: @solution[:sid], )
|
190
194
|
end
|
191
195
|
|
196
|
+
##
|
197
|
+
# Access the device_configs
|
198
|
+
# @return [DeviceConfigList]
|
199
|
+
# @return [DeviceConfigContext] if key was passed.
|
200
|
+
def device_configs(key=:unset)
|
201
|
+
raise ArgumentError, 'key cannot be nil' if key.nil?
|
202
|
+
|
203
|
+
if key != :unset
|
204
|
+
return DeviceConfigContext.new(@version, @solution[:sid], key, )
|
205
|
+
end
|
206
|
+
|
207
|
+
unless @device_configs
|
208
|
+
@device_configs = DeviceConfigList.new(@version, device_sid: @solution[:sid], )
|
209
|
+
end
|
210
|
+
|
211
|
+
@device_configs
|
212
|
+
end
|
213
|
+
|
214
|
+
##
|
215
|
+
# Access the device_secrets
|
216
|
+
# @return [DeviceSecretList]
|
217
|
+
# @return [DeviceSecretContext] if key was passed.
|
218
|
+
def device_secrets(key=:unset)
|
219
|
+
raise ArgumentError, 'key cannot be nil' if key.nil?
|
220
|
+
|
221
|
+
if key != :unset
|
222
|
+
return DeviceSecretContext.new(@version, @solution[:sid], key, )
|
223
|
+
end
|
224
|
+
|
225
|
+
unless @device_secrets
|
226
|
+
@device_secrets = DeviceSecretList.new(@version, device_sid: @solution[:sid], )
|
227
|
+
end
|
228
|
+
|
229
|
+
@device_secrets
|
230
|
+
end
|
231
|
+
|
192
232
|
##
|
193
233
|
# Provide a user friendly representation
|
194
234
|
def to_s
|
@@ -319,6 +359,20 @@ module Twilio
|
|
319
359
|
context.update(unique_name: unique_name, target_app: target_app, logging_enabled: logging_enabled, )
|
320
360
|
end
|
321
361
|
|
362
|
+
##
|
363
|
+
# Access the device_configs
|
364
|
+
# @return [device_configs] device_configs
|
365
|
+
def device_configs
|
366
|
+
context.device_configs
|
367
|
+
end
|
368
|
+
|
369
|
+
##
|
370
|
+
# Access the device_secrets
|
371
|
+
# @return [device_secrets] device_secrets
|
372
|
+
def device_secrets
|
373
|
+
context.device_secrets
|
374
|
+
end
|
375
|
+
|
322
376
|
##
|
323
377
|
# Provide a user friendly representation
|
324
378
|
def to_s
|