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,297 @@
|
|
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
|
+
##
|
14
|
+
# 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.
|
15
|
+
class AccountConfigList < ListResource
|
16
|
+
##
|
17
|
+
# Initialize the AccountConfigList
|
18
|
+
# @param [Version] version Version that contains the resource
|
19
|
+
# @return [AccountConfigList] AccountConfigList
|
20
|
+
def initialize(version)
|
21
|
+
super(version)
|
22
|
+
|
23
|
+
# Path Solution
|
24
|
+
@solution = {}
|
25
|
+
@uri = "/Configs"
|
26
|
+
end
|
27
|
+
|
28
|
+
##
|
29
|
+
# Lists AccountConfigInstance records from the API as a list.
|
30
|
+
# Unlike stream(), this operation is eager and will load `limit` records into
|
31
|
+
# memory before returning.
|
32
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
33
|
+
# guarantees to never return more than limit. Default is no limit
|
34
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
35
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
36
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
37
|
+
# efficient page size, i.e. min(limit, 1000)
|
38
|
+
# @return [Array] Array of up to limit results
|
39
|
+
def list(limit: nil, page_size: nil)
|
40
|
+
self.stream(limit: limit, page_size: page_size).entries
|
41
|
+
end
|
42
|
+
|
43
|
+
##
|
44
|
+
# Streams AccountConfigInstance records from the API as an Enumerable.
|
45
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
46
|
+
# is reached.
|
47
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
48
|
+
# guarantees to never return more than limit. Default is no limit.
|
49
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
50
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
51
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
52
|
+
# efficient page size, i.e. min(limit, 1000)
|
53
|
+
# @return [Enumerable] Enumerable that will yield up to limit results
|
54
|
+
def stream(limit: nil, page_size: nil)
|
55
|
+
limits = @version.read_limits(limit, page_size)
|
56
|
+
|
57
|
+
page = self.page(page_size: limits[:page_size], )
|
58
|
+
|
59
|
+
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
60
|
+
end
|
61
|
+
|
62
|
+
##
|
63
|
+
# When passed a block, yields AccountConfigInstance records from the API.
|
64
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
65
|
+
# is reached.
|
66
|
+
def each
|
67
|
+
limits = @version.read_limits
|
68
|
+
|
69
|
+
page = self.page(page_size: limits[:page_size], )
|
70
|
+
|
71
|
+
@version.stream(page,
|
72
|
+
limit: limits[:limit],
|
73
|
+
page_limit: limits[:page_limit]).each {|x| yield x}
|
74
|
+
end
|
75
|
+
|
76
|
+
##
|
77
|
+
# Retrieve a single page of AccountConfigInstance records from the API.
|
78
|
+
# Request is executed immediately.
|
79
|
+
# @param [String] page_token PageToken provided by the API
|
80
|
+
# @param [Integer] page_number Page Number, this value is simply for client state
|
81
|
+
# @param [Integer] page_size Number of records to return, defaults to 50
|
82
|
+
# @return [Page] Page of AccountConfigInstance
|
83
|
+
def page(page_token: :unset, page_number: :unset, page_size: :unset)
|
84
|
+
params = Twilio::Values.of({
|
85
|
+
'PageToken' => page_token,
|
86
|
+
'Page' => page_number,
|
87
|
+
'PageSize' => page_size,
|
88
|
+
})
|
89
|
+
|
90
|
+
response = @version.page('GET', @uri, params: params)
|
91
|
+
|
92
|
+
AccountConfigPage.new(@version, response, @solution)
|
93
|
+
end
|
94
|
+
|
95
|
+
##
|
96
|
+
# Retrieve a single page of AccountConfigInstance records from the API.
|
97
|
+
# Request is executed immediately.
|
98
|
+
# @param [String] target_url API-generated URL for the requested results page
|
99
|
+
# @return [Page] Page of AccountConfigInstance
|
100
|
+
def get_page(target_url)
|
101
|
+
response = @version.domain.request(
|
102
|
+
'GET',
|
103
|
+
target_url
|
104
|
+
)
|
105
|
+
AccountConfigPage.new(@version, response, @solution)
|
106
|
+
end
|
107
|
+
|
108
|
+
##
|
109
|
+
# Create the AccountConfigInstance
|
110
|
+
# @param [String] key The config key; up to 100 characters.
|
111
|
+
# @param [String] value The config value; up to 4096 characters.
|
112
|
+
# @return [AccountConfigInstance] Created AccountConfigInstance
|
113
|
+
def create(key: nil, value: nil)
|
114
|
+
data = Twilio::Values.of({'Key' => key, 'Value' => value, })
|
115
|
+
|
116
|
+
payload = @version.create('POST', @uri, data: data)
|
117
|
+
|
118
|
+
AccountConfigInstance.new(@version, payload, )
|
119
|
+
end
|
120
|
+
|
121
|
+
##
|
122
|
+
# Provide a user friendly representation
|
123
|
+
def to_s
|
124
|
+
'#<Twilio.Microvisor.V1.AccountConfigList>'
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
##
|
129
|
+
# 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.
|
130
|
+
class AccountConfigPage < Page
|
131
|
+
##
|
132
|
+
# Initialize the AccountConfigPage
|
133
|
+
# @param [Version] version Version that contains the resource
|
134
|
+
# @param [Response] response Response from the API
|
135
|
+
# @param [Hash] solution Path solution for the resource
|
136
|
+
# @return [AccountConfigPage] AccountConfigPage
|
137
|
+
def initialize(version, response, solution)
|
138
|
+
super(version, response)
|
139
|
+
|
140
|
+
# Path Solution
|
141
|
+
@solution = solution
|
142
|
+
end
|
143
|
+
|
144
|
+
##
|
145
|
+
# Build an instance of AccountConfigInstance
|
146
|
+
# @param [Hash] payload Payload response from the API
|
147
|
+
# @return [AccountConfigInstance] AccountConfigInstance
|
148
|
+
def get_instance(payload)
|
149
|
+
AccountConfigInstance.new(@version, payload, )
|
150
|
+
end
|
151
|
+
|
152
|
+
##
|
153
|
+
# Provide a user friendly representation
|
154
|
+
def to_s
|
155
|
+
'<Twilio.Microvisor.V1.AccountConfigPage>'
|
156
|
+
end
|
157
|
+
end
|
158
|
+
|
159
|
+
##
|
160
|
+
# 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.
|
161
|
+
class AccountConfigContext < InstanceContext
|
162
|
+
##
|
163
|
+
# Initialize the AccountConfigContext
|
164
|
+
# @param [Version] version Version that contains the resource
|
165
|
+
# @param [String] key The config key; up to 100 characters.
|
166
|
+
# @return [AccountConfigContext] AccountConfigContext
|
167
|
+
def initialize(version, key)
|
168
|
+
super(version)
|
169
|
+
|
170
|
+
# Path Solution
|
171
|
+
@solution = {key: key, }
|
172
|
+
@uri = "/Configs/#{@solution[:key]}"
|
173
|
+
end
|
174
|
+
|
175
|
+
##
|
176
|
+
# Fetch the AccountConfigInstance
|
177
|
+
# @return [AccountConfigInstance] Fetched AccountConfigInstance
|
178
|
+
def fetch
|
179
|
+
payload = @version.fetch('GET', @uri)
|
180
|
+
|
181
|
+
AccountConfigInstance.new(@version, payload, key: @solution[:key], )
|
182
|
+
end
|
183
|
+
|
184
|
+
##
|
185
|
+
# Delete the AccountConfigInstance
|
186
|
+
# @return [Boolean] true if delete succeeds, false otherwise
|
187
|
+
def delete
|
188
|
+
@version.delete('DELETE', @uri)
|
189
|
+
end
|
190
|
+
|
191
|
+
##
|
192
|
+
# Provide a user friendly representation
|
193
|
+
def to_s
|
194
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
195
|
+
"#<Twilio.Microvisor.V1.AccountConfigContext #{context}>"
|
196
|
+
end
|
197
|
+
|
198
|
+
##
|
199
|
+
# Provide a detailed, user friendly representation
|
200
|
+
def inspect
|
201
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
202
|
+
"#<Twilio.Microvisor.V1.AccountConfigContext #{context}>"
|
203
|
+
end
|
204
|
+
end
|
205
|
+
|
206
|
+
##
|
207
|
+
# 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.
|
208
|
+
class AccountConfigInstance < InstanceResource
|
209
|
+
##
|
210
|
+
# Initialize the AccountConfigInstance
|
211
|
+
# @param [Version] version Version that contains the resource
|
212
|
+
# @param [Hash] payload payload that contains response from Twilio
|
213
|
+
# @param [String] key The config key; up to 100 characters.
|
214
|
+
# @return [AccountConfigInstance] AccountConfigInstance
|
215
|
+
def initialize(version, payload, key: nil)
|
216
|
+
super(version)
|
217
|
+
|
218
|
+
# Marshaled Properties
|
219
|
+
@properties = {
|
220
|
+
'key' => payload['key'],
|
221
|
+
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
|
222
|
+
'value' => payload['value'],
|
223
|
+
'url' => payload['url'],
|
224
|
+
}
|
225
|
+
|
226
|
+
# Context
|
227
|
+
@instance_context = nil
|
228
|
+
@params = {'key' => key || @properties['key'], }
|
229
|
+
end
|
230
|
+
|
231
|
+
##
|
232
|
+
# Generate an instance context for the instance, the context is capable of
|
233
|
+
# performing various actions. All instance actions are proxied to the context
|
234
|
+
# @return [AccountConfigContext] AccountConfigContext for this AccountConfigInstance
|
235
|
+
def context
|
236
|
+
unless @instance_context
|
237
|
+
@instance_context = AccountConfigContext.new(@version, @params['key'], )
|
238
|
+
end
|
239
|
+
@instance_context
|
240
|
+
end
|
241
|
+
|
242
|
+
##
|
243
|
+
# @return [String] The config key.
|
244
|
+
def key
|
245
|
+
@properties['key']
|
246
|
+
end
|
247
|
+
|
248
|
+
##
|
249
|
+
# @return [Time] The date_updated
|
250
|
+
def date_updated
|
251
|
+
@properties['date_updated']
|
252
|
+
end
|
253
|
+
|
254
|
+
##
|
255
|
+
# @return [String] The config value.
|
256
|
+
def value
|
257
|
+
@properties['value']
|
258
|
+
end
|
259
|
+
|
260
|
+
##
|
261
|
+
# @return [String] The absolute URL of the Config.
|
262
|
+
def url
|
263
|
+
@properties['url']
|
264
|
+
end
|
265
|
+
|
266
|
+
##
|
267
|
+
# Fetch the AccountConfigInstance
|
268
|
+
# @return [AccountConfigInstance] Fetched AccountConfigInstance
|
269
|
+
def fetch
|
270
|
+
context.fetch
|
271
|
+
end
|
272
|
+
|
273
|
+
##
|
274
|
+
# Delete the AccountConfigInstance
|
275
|
+
# @return [Boolean] true if delete succeeds, false otherwise
|
276
|
+
def delete
|
277
|
+
context.delete
|
278
|
+
end
|
279
|
+
|
280
|
+
##
|
281
|
+
# Provide a user friendly representation
|
282
|
+
def to_s
|
283
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
284
|
+
"<Twilio.Microvisor.V1.AccountConfigInstance #{values}>"
|
285
|
+
end
|
286
|
+
|
287
|
+
##
|
288
|
+
# Provide a detailed, user friendly representation
|
289
|
+
def inspect
|
290
|
+
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
291
|
+
"<Twilio.Microvisor.V1.AccountConfigInstance #{values}>"
|
292
|
+
end
|
293
|
+
end
|
294
|
+
end
|
295
|
+
end
|
296
|
+
end
|
297
|
+
end
|
@@ -0,0 +1,290 @@
|
|
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
|
+
##
|
14
|
+
# 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.
|
15
|
+
class AccountSecretList < ListResource
|
16
|
+
##
|
17
|
+
# Initialize the AccountSecretList
|
18
|
+
# @param [Version] version Version that contains the resource
|
19
|
+
# @return [AccountSecretList] AccountSecretList
|
20
|
+
def initialize(version)
|
21
|
+
super(version)
|
22
|
+
|
23
|
+
# Path Solution
|
24
|
+
@solution = {}
|
25
|
+
@uri = "/Secrets"
|
26
|
+
end
|
27
|
+
|
28
|
+
##
|
29
|
+
# Lists AccountSecretInstance records from the API as a list.
|
30
|
+
# Unlike stream(), this operation is eager and will load `limit` records into
|
31
|
+
# memory before returning.
|
32
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
33
|
+
# guarantees to never return more than limit. Default is no limit
|
34
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
35
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
36
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
37
|
+
# efficient page size, i.e. min(limit, 1000)
|
38
|
+
# @return [Array] Array of up to limit results
|
39
|
+
def list(limit: nil, page_size: nil)
|
40
|
+
self.stream(limit: limit, page_size: page_size).entries
|
41
|
+
end
|
42
|
+
|
43
|
+
##
|
44
|
+
# Streams AccountSecretInstance records from the API as an Enumerable.
|
45
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
46
|
+
# is reached.
|
47
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
48
|
+
# guarantees to never return more than limit. Default is no limit.
|
49
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
50
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
51
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
52
|
+
# efficient page size, i.e. min(limit, 1000)
|
53
|
+
# @return [Enumerable] Enumerable that will yield up to limit results
|
54
|
+
def stream(limit: nil, page_size: nil)
|
55
|
+
limits = @version.read_limits(limit, page_size)
|
56
|
+
|
57
|
+
page = self.page(page_size: limits[:page_size], )
|
58
|
+
|
59
|
+
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
60
|
+
end
|
61
|
+
|
62
|
+
##
|
63
|
+
# When passed a block, yields AccountSecretInstance records from the API.
|
64
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
65
|
+
# is reached.
|
66
|
+
def each
|
67
|
+
limits = @version.read_limits
|
68
|
+
|
69
|
+
page = self.page(page_size: limits[:page_size], )
|
70
|
+
|
71
|
+
@version.stream(page,
|
72
|
+
limit: limits[:limit],
|
73
|
+
page_limit: limits[:page_limit]).each {|x| yield x}
|
74
|
+
end
|
75
|
+
|
76
|
+
##
|
77
|
+
# Retrieve a single page of AccountSecretInstance records from the API.
|
78
|
+
# Request is executed immediately.
|
79
|
+
# @param [String] page_token PageToken provided by the API
|
80
|
+
# @param [Integer] page_number Page Number, this value is simply for client state
|
81
|
+
# @param [Integer] page_size Number of records to return, defaults to 50
|
82
|
+
# @return [Page] Page of AccountSecretInstance
|
83
|
+
def page(page_token: :unset, page_number: :unset, page_size: :unset)
|
84
|
+
params = Twilio::Values.of({
|
85
|
+
'PageToken' => page_token,
|
86
|
+
'Page' => page_number,
|
87
|
+
'PageSize' => page_size,
|
88
|
+
})
|
89
|
+
|
90
|
+
response = @version.page('GET', @uri, params: params)
|
91
|
+
|
92
|
+
AccountSecretPage.new(@version, response, @solution)
|
93
|
+
end
|
94
|
+
|
95
|
+
##
|
96
|
+
# Retrieve a single page of AccountSecretInstance records from the API.
|
97
|
+
# Request is executed immediately.
|
98
|
+
# @param [String] target_url API-generated URL for the requested results page
|
99
|
+
# @return [Page] Page of AccountSecretInstance
|
100
|
+
def get_page(target_url)
|
101
|
+
response = @version.domain.request(
|
102
|
+
'GET',
|
103
|
+
target_url
|
104
|
+
)
|
105
|
+
AccountSecretPage.new(@version, response, @solution)
|
106
|
+
end
|
107
|
+
|
108
|
+
##
|
109
|
+
# Create the AccountSecretInstance
|
110
|
+
# @param [String] key The secret key; up to 100 characters.
|
111
|
+
# @param [String] value The secret value; up to 4096 characters.
|
112
|
+
# @return [AccountSecretInstance] Created AccountSecretInstance
|
113
|
+
def create(key: nil, value: nil)
|
114
|
+
data = Twilio::Values.of({'Key' => key, 'Value' => value, })
|
115
|
+
|
116
|
+
payload = @version.create('POST', @uri, data: data)
|
117
|
+
|
118
|
+
AccountSecretInstance.new(@version, payload, )
|
119
|
+
end
|
120
|
+
|
121
|
+
##
|
122
|
+
# Provide a user friendly representation
|
123
|
+
def to_s
|
124
|
+
'#<Twilio.Microvisor.V1.AccountSecretList>'
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
##
|
129
|
+
# 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.
|
130
|
+
class AccountSecretPage < Page
|
131
|
+
##
|
132
|
+
# Initialize the AccountSecretPage
|
133
|
+
# @param [Version] version Version that contains the resource
|
134
|
+
# @param [Response] response Response from the API
|
135
|
+
# @param [Hash] solution Path solution for the resource
|
136
|
+
# @return [AccountSecretPage] AccountSecretPage
|
137
|
+
def initialize(version, response, solution)
|
138
|
+
super(version, response)
|
139
|
+
|
140
|
+
# Path Solution
|
141
|
+
@solution = solution
|
142
|
+
end
|
143
|
+
|
144
|
+
##
|
145
|
+
# Build an instance of AccountSecretInstance
|
146
|
+
# @param [Hash] payload Payload response from the API
|
147
|
+
# @return [AccountSecretInstance] AccountSecretInstance
|
148
|
+
def get_instance(payload)
|
149
|
+
AccountSecretInstance.new(@version, payload, )
|
150
|
+
end
|
151
|
+
|
152
|
+
##
|
153
|
+
# Provide a user friendly representation
|
154
|
+
def to_s
|
155
|
+
'<Twilio.Microvisor.V1.AccountSecretPage>'
|
156
|
+
end
|
157
|
+
end
|
158
|
+
|
159
|
+
##
|
160
|
+
# 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.
|
161
|
+
class AccountSecretContext < InstanceContext
|
162
|
+
##
|
163
|
+
# Initialize the AccountSecretContext
|
164
|
+
# @param [Version] version Version that contains the resource
|
165
|
+
# @param [String] key The secret key; up to 100 characters.
|
166
|
+
# @return [AccountSecretContext] AccountSecretContext
|
167
|
+
def initialize(version, key)
|
168
|
+
super(version)
|
169
|
+
|
170
|
+
# Path Solution
|
171
|
+
@solution = {key: key, }
|
172
|
+
@uri = "/Secrets/#{@solution[:key]}"
|
173
|
+
end
|
174
|
+
|
175
|
+
##
|
176
|
+
# Fetch the AccountSecretInstance
|
177
|
+
# @return [AccountSecretInstance] Fetched AccountSecretInstance
|
178
|
+
def fetch
|
179
|
+
payload = @version.fetch('GET', @uri)
|
180
|
+
|
181
|
+
AccountSecretInstance.new(@version, payload, key: @solution[:key], )
|
182
|
+
end
|
183
|
+
|
184
|
+
##
|
185
|
+
# Delete the AccountSecretInstance
|
186
|
+
# @return [Boolean] true if delete succeeds, false otherwise
|
187
|
+
def delete
|
188
|
+
@version.delete('DELETE', @uri)
|
189
|
+
end
|
190
|
+
|
191
|
+
##
|
192
|
+
# Provide a user friendly representation
|
193
|
+
def to_s
|
194
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
195
|
+
"#<Twilio.Microvisor.V1.AccountSecretContext #{context}>"
|
196
|
+
end
|
197
|
+
|
198
|
+
##
|
199
|
+
# Provide a detailed, user friendly representation
|
200
|
+
def inspect
|
201
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
202
|
+
"#<Twilio.Microvisor.V1.AccountSecretContext #{context}>"
|
203
|
+
end
|
204
|
+
end
|
205
|
+
|
206
|
+
##
|
207
|
+
# 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.
|
208
|
+
class AccountSecretInstance < InstanceResource
|
209
|
+
##
|
210
|
+
# Initialize the AccountSecretInstance
|
211
|
+
# @param [Version] version Version that contains the resource
|
212
|
+
# @param [Hash] payload payload that contains response from Twilio
|
213
|
+
# @param [String] key The secret key; up to 100 characters.
|
214
|
+
# @return [AccountSecretInstance] AccountSecretInstance
|
215
|
+
def initialize(version, payload, key: nil)
|
216
|
+
super(version)
|
217
|
+
|
218
|
+
# Marshaled Properties
|
219
|
+
@properties = {
|
220
|
+
'key' => payload['key'],
|
221
|
+
'date_rotated' => Twilio.deserialize_iso8601_datetime(payload['date_rotated']),
|
222
|
+
'url' => payload['url'],
|
223
|
+
}
|
224
|
+
|
225
|
+
# Context
|
226
|
+
@instance_context = nil
|
227
|
+
@params = {'key' => key || @properties['key'], }
|
228
|
+
end
|
229
|
+
|
230
|
+
##
|
231
|
+
# Generate an instance context for the instance, the context is capable of
|
232
|
+
# performing various actions. All instance actions are proxied to the context
|
233
|
+
# @return [AccountSecretContext] AccountSecretContext for this AccountSecretInstance
|
234
|
+
def context
|
235
|
+
unless @instance_context
|
236
|
+
@instance_context = AccountSecretContext.new(@version, @params['key'], )
|
237
|
+
end
|
238
|
+
@instance_context
|
239
|
+
end
|
240
|
+
|
241
|
+
##
|
242
|
+
# @return [String] The secret key.
|
243
|
+
def key
|
244
|
+
@properties['key']
|
245
|
+
end
|
246
|
+
|
247
|
+
##
|
248
|
+
# @return [Time] The date_rotated
|
249
|
+
def date_rotated
|
250
|
+
@properties['date_rotated']
|
251
|
+
end
|
252
|
+
|
253
|
+
##
|
254
|
+
# @return [String] The absolute URL of the Secret.
|
255
|
+
def url
|
256
|
+
@properties['url']
|
257
|
+
end
|
258
|
+
|
259
|
+
##
|
260
|
+
# Fetch the AccountSecretInstance
|
261
|
+
# @return [AccountSecretInstance] Fetched AccountSecretInstance
|
262
|
+
def fetch
|
263
|
+
context.fetch
|
264
|
+
end
|
265
|
+
|
266
|
+
##
|
267
|
+
# Delete the AccountSecretInstance
|
268
|
+
# @return [Boolean] true if delete succeeds, false otherwise
|
269
|
+
def delete
|
270
|
+
context.delete
|
271
|
+
end
|
272
|
+
|
273
|
+
##
|
274
|
+
# Provide a user friendly representation
|
275
|
+
def to_s
|
276
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
277
|
+
"<Twilio.Microvisor.V1.AccountSecretInstance #{values}>"
|
278
|
+
end
|
279
|
+
|
280
|
+
##
|
281
|
+
# Provide a detailed, user friendly representation
|
282
|
+
def inspect
|
283
|
+
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
284
|
+
"<Twilio.Microvisor.V1.AccountSecretInstance #{values}>"
|
285
|
+
end
|
286
|
+
end
|
287
|
+
end
|
288
|
+
end
|
289
|
+
end
|
290
|
+
end
|