azure_mgmt_storage 0.21.1 → 0.21.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2015-05-01-preview/generated/azure_mgmt_storage/storage_management_client.rb +1 -1
  3. data/lib/2015-06-15/generated/azure_mgmt_storage/storage_management_client.rb +1 -1
  4. data/lib/2016-01-01/generated/azure_mgmt_storage/storage_management_client.rb +1 -1
  5. data/lib/2016-12-01/generated/azure_mgmt_storage.rb +2 -0
  6. data/lib/2016-12-01/generated/azure_mgmt_storage/models/permissions.rb +22 -0
  7. data/lib/2016-12-01/generated/azure_mgmt_storage/models/service_sas_parameters.rb +7 -7
  8. data/lib/2016-12-01/generated/azure_mgmt_storage/models/signed_resource.rb +18 -0
  9. data/lib/2016-12-01/generated/azure_mgmt_storage/storage_management_client.rb +1 -1
  10. data/lib/2017-06-01/generated/azure_mgmt_storage/storage_management_client.rb +1 -1
  11. data/lib/2017-10-01/generated/azure_mgmt_storage/storage_management_client.rb +1 -1
  12. data/lib/2018-02-01/generated/azure_mgmt_storage/storage_management_client.rb +1 -1
  13. data/lib/2018-03-01-preview/generated/azure_mgmt_storage/storage_management_client.rb +1 -1
  14. data/lib/2018-07-01/generated/azure_mgmt_storage/storage_management_client.rb +1 -1
  15. data/lib/2018-11-01/generated/azure_mgmt_storage/storage_management_client.rb +1 -1
  16. data/lib/2019-04-01/generated/azure_mgmt_storage.rb +1 -0
  17. data/lib/2019-04-01/generated/azure_mgmt_storage/models/minimum_tls_version.rb +17 -0
  18. data/lib/2019-04-01/generated/azure_mgmt_storage/models/storage_account.rb +26 -0
  19. data/lib/2019-04-01/generated/azure_mgmt_storage/models/storage_account_create_parameters.rb +26 -0
  20. data/lib/2019-04-01/generated/azure_mgmt_storage/models/storage_account_update_parameters.rb +26 -0
  21. data/lib/2019-04-01/generated/azure_mgmt_storage/storage_management_client.rb +1 -1
  22. data/lib/2019-06-01/generated/azure_mgmt_storage.rb +73 -57
  23. data/lib/2019-06-01/generated/azure_mgmt_storage/blob_containers.rb +20 -8
  24. data/lib/2019-06-01/generated/azure_mgmt_storage/models/blob_container.rb +49 -0
  25. data/lib/2019-06-01/generated/azure_mgmt_storage/models/encryption.rb +13 -0
  26. data/lib/2019-06-01/generated/azure_mgmt_storage/models/list_container_item.rb +49 -0
  27. data/lib/2019-06-01/generated/azure_mgmt_storage/models/list_containers_include.rb +15 -0
  28. data/lib/2019-06-01/generated/azure_mgmt_storage/models/list_queue.rb +83 -0
  29. data/lib/2019-06-01/generated/azure_mgmt_storage/models/list_queue_resource.rb +101 -0
  30. data/lib/2019-06-01/generated/azure_mgmt_storage/models/list_queue_services.rb +58 -0
  31. data/lib/2019-06-01/generated/azure_mgmt_storage/models/list_table_resource.rb +101 -0
  32. data/lib/2019-06-01/generated/azure_mgmt_storage/models/list_table_services.rb +58 -0
  33. data/lib/2019-06-01/generated/azure_mgmt_storage/models/minimum_tls_version.rb +17 -0
  34. data/lib/2019-06-01/generated/azure_mgmt_storage/models/private_endpoint_connection_list_result.rb +57 -0
  35. data/lib/2019-06-01/generated/azure_mgmt_storage/models/queue_service_properties.rb +77 -0
  36. data/lib/2019-06-01/generated/azure_mgmt_storage/models/storage_account.rb +26 -0
  37. data/lib/2019-06-01/generated/azure_mgmt_storage/models/storage_account_create_parameters.rb +26 -0
  38. data/lib/2019-06-01/generated/azure_mgmt_storage/models/storage_account_update_parameters.rb +26 -0
  39. data/lib/2019-06-01/generated/azure_mgmt_storage/models/storage_queue.rb +97 -0
  40. data/lib/2019-06-01/generated/azure_mgmt_storage/models/table.rb +74 -0
  41. data/lib/2019-06-01/generated/azure_mgmt_storage/models/table_service_properties.rb +77 -0
  42. data/lib/2019-06-01/generated/azure_mgmt_storage/private_endpoint_connections.rb +122 -9
  43. data/lib/2019-06-01/generated/azure_mgmt_storage/queue.rb +805 -0
  44. data/lib/2019-06-01/generated/azure_mgmt_storage/queue_services.rb +386 -0
  45. data/lib/2019-06-01/generated/azure_mgmt_storage/storage_management_client.rb +17 -1
  46. data/lib/2019-06-01/generated/azure_mgmt_storage/table_operations.rb +743 -0
  47. data/lib/2019-06-01/generated/azure_mgmt_storage/table_services.rb +386 -0
  48. data/lib/azure_mgmt_storage.rb +10 -10
  49. data/lib/profiles/latest/modules/storage_profile_module.rb +247 -191
  50. data/lib/version.rb +1 -1
  51. metadata +21 -2
@@ -0,0 +1,386 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::Storage::Mgmt::V2019_06_01
7
+ #
8
+ # The Azure Storage Management API.
9
+ #
10
+ class QueueServices
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the QueueServices class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [StorageManagementClient] reference to the StorageManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # List all queue services for the storage account
26
+ #
27
+ # @param resource_group_name [String] The name of the resource group within the
28
+ # user's subscription. The name is case insensitive.
29
+ # @param account_name [String] The name of the storage account within the
30
+ # specified resource group. Storage account names must be between 3 and 24
31
+ # characters in length and use numbers and lower-case letters only.
32
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
33
+ # will be added to the HTTP request.
34
+ #
35
+ # @return [ListQueueServices] operation results.
36
+ #
37
+ def list(resource_group_name, account_name, custom_headers:nil)
38
+ response = list_async(resource_group_name, account_name, custom_headers:custom_headers).value!
39
+ response.body unless response.nil?
40
+ end
41
+
42
+ #
43
+ # List all queue services for the storage account
44
+ #
45
+ # @param resource_group_name [String] The name of the resource group within the
46
+ # user's subscription. The name is case insensitive.
47
+ # @param account_name [String] The name of the storage account within the
48
+ # specified resource group. Storage account names must be between 3 and 24
49
+ # characters in length and use numbers and lower-case letters only.
50
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
51
+ # will be added to the HTTP request.
52
+ #
53
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
54
+ #
55
+ def list_with_http_info(resource_group_name, account_name, custom_headers:nil)
56
+ list_async(resource_group_name, account_name, custom_headers:custom_headers).value!
57
+ end
58
+
59
+ #
60
+ # List all queue services for the storage account
61
+ #
62
+ # @param resource_group_name [String] The name of the resource group within the
63
+ # user's subscription. The name is case insensitive.
64
+ # @param account_name [String] The name of the storage account within the
65
+ # specified resource group. Storage account names must be between 3 and 24
66
+ # characters in length and use numbers and lower-case letters only.
67
+ # @param [Hash{String => String}] A hash of custom headers that will be added
68
+ # to the HTTP request.
69
+ #
70
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
71
+ #
72
+ def list_async(resource_group_name, account_name, custom_headers:nil)
73
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
74
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
75
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
76
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
77
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
78
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
79
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
80
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
81
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
82
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
83
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
84
+
85
+
86
+ request_headers = {}
87
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
88
+
89
+ # Set Headers
90
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
91
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
92
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices'
93
+
94
+ request_url = @base_url || @client.base_url
95
+
96
+ options = {
97
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
98
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
99
+ query_params: {'api-version' => @client.api_version},
100
+ headers: request_headers.merge(custom_headers || {}),
101
+ base_url: request_url
102
+ }
103
+ promise = @client.make_request_async(:get, path_template, options)
104
+
105
+ promise = promise.then do |result|
106
+ http_response = result.response
107
+ status_code = http_response.status
108
+ response_content = http_response.body
109
+ unless status_code == 200
110
+ error_model = JSON.load(response_content)
111
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
112
+ end
113
+
114
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
115
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
116
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
117
+ # Deserialize Response
118
+ if status_code == 200
119
+ begin
120
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
121
+ result_mapper = Azure::Storage::Mgmt::V2019_06_01::Models::ListQueueServices.mapper()
122
+ result.body = @client.deserialize(result_mapper, parsed_response)
123
+ rescue Exception => e
124
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
125
+ end
126
+ end
127
+
128
+ result
129
+ end
130
+
131
+ promise.execute
132
+ end
133
+
134
+ #
135
+ # Sets the properties of a storage account’s Queue service, including
136
+ # properties for Storage Analytics and CORS (Cross-Origin Resource Sharing)
137
+ # rules.
138
+ #
139
+ # @param resource_group_name [String] The name of the resource group within the
140
+ # user's subscription. The name is case insensitive.
141
+ # @param account_name [String] The name of the storage account within the
142
+ # specified resource group. Storage account names must be between 3 and 24
143
+ # characters in length and use numbers and lower-case letters only.
144
+ # @param parameters [QueueServiceProperties] The properties of a storage
145
+ # account’s Queue service, only properties for Storage Analytics and CORS
146
+ # (Cross-Origin Resource Sharing) rules can be specified.
147
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
148
+ # will be added to the HTTP request.
149
+ #
150
+ # @return [QueueServiceProperties] operation results.
151
+ #
152
+ def set_service_properties(resource_group_name, account_name, parameters, custom_headers:nil)
153
+ response = set_service_properties_async(resource_group_name, account_name, parameters, custom_headers:custom_headers).value!
154
+ response.body unless response.nil?
155
+ end
156
+
157
+ #
158
+ # Sets the properties of a storage account’s Queue service, including
159
+ # properties for Storage Analytics and CORS (Cross-Origin Resource Sharing)
160
+ # rules.
161
+ #
162
+ # @param resource_group_name [String] The name of the resource group within the
163
+ # user's subscription. The name is case insensitive.
164
+ # @param account_name [String] The name of the storage account within the
165
+ # specified resource group. Storage account names must be between 3 and 24
166
+ # characters in length and use numbers and lower-case letters only.
167
+ # @param parameters [QueueServiceProperties] The properties of a storage
168
+ # account’s Queue service, only properties for Storage Analytics and CORS
169
+ # (Cross-Origin Resource Sharing) rules can be specified.
170
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
171
+ # will be added to the HTTP request.
172
+ #
173
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
174
+ #
175
+ def set_service_properties_with_http_info(resource_group_name, account_name, parameters, custom_headers:nil)
176
+ set_service_properties_async(resource_group_name, account_name, parameters, custom_headers:custom_headers).value!
177
+ end
178
+
179
+ #
180
+ # Sets the properties of a storage account’s Queue service, including
181
+ # properties for Storage Analytics and CORS (Cross-Origin Resource Sharing)
182
+ # rules.
183
+ #
184
+ # @param resource_group_name [String] The name of the resource group within the
185
+ # user's subscription. The name is case insensitive.
186
+ # @param account_name [String] The name of the storage account within the
187
+ # specified resource group. Storage account names must be between 3 and 24
188
+ # characters in length and use numbers and lower-case letters only.
189
+ # @param parameters [QueueServiceProperties] The properties of a storage
190
+ # account’s Queue service, only properties for Storage Analytics and CORS
191
+ # (Cross-Origin Resource Sharing) rules can be specified.
192
+ # @param [Hash{String => String}] A hash of custom headers that will be added
193
+ # to the HTTP request.
194
+ #
195
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
196
+ #
197
+ def set_service_properties_async(resource_group_name, account_name, parameters, custom_headers:nil)
198
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
199
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
200
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
201
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
202
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
203
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
204
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
205
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
206
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
207
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
208
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
209
+ queue_service_name = 'default'
210
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
211
+
212
+
213
+ request_headers = {}
214
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
215
+
216
+ # Set Headers
217
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
218
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
219
+
220
+ # Serialize Request
221
+ request_mapper = Azure::Storage::Mgmt::V2019_06_01::Models::QueueServiceProperties.mapper()
222
+ request_content = @client.serialize(request_mapper, parameters)
223
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
224
+
225
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/{queueServiceName}'
226
+
227
+ request_url = @base_url || @client.base_url
228
+
229
+ options = {
230
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
231
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id,'queueServiceName' => queue_service_name},
232
+ query_params: {'api-version' => @client.api_version},
233
+ body: request_content,
234
+ headers: request_headers.merge(custom_headers || {}),
235
+ base_url: request_url
236
+ }
237
+ promise = @client.make_request_async(:put, path_template, options)
238
+
239
+ promise = promise.then do |result|
240
+ http_response = result.response
241
+ status_code = http_response.status
242
+ response_content = http_response.body
243
+ unless status_code == 200
244
+ error_model = JSON.load(response_content)
245
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
246
+ end
247
+
248
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
249
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
250
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
251
+ # Deserialize Response
252
+ if status_code == 200
253
+ begin
254
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
255
+ result_mapper = Azure::Storage::Mgmt::V2019_06_01::Models::QueueServiceProperties.mapper()
256
+ result.body = @client.deserialize(result_mapper, parsed_response)
257
+ rescue Exception => e
258
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
259
+ end
260
+ end
261
+
262
+ result
263
+ end
264
+
265
+ promise.execute
266
+ end
267
+
268
+ #
269
+ # Gets the properties of a storage account’s Queue service, including
270
+ # properties for Storage Analytics and CORS (Cross-Origin Resource Sharing)
271
+ # rules.
272
+ #
273
+ # @param resource_group_name [String] The name of the resource group within the
274
+ # user's subscription. The name is case insensitive.
275
+ # @param account_name [String] The name of the storage account within the
276
+ # specified resource group. Storage account names must be between 3 and 24
277
+ # characters in length and use numbers and lower-case letters only.
278
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
279
+ # will be added to the HTTP request.
280
+ #
281
+ # @return [QueueServiceProperties] operation results.
282
+ #
283
+ def get_service_properties(resource_group_name, account_name, custom_headers:nil)
284
+ response = get_service_properties_async(resource_group_name, account_name, custom_headers:custom_headers).value!
285
+ response.body unless response.nil?
286
+ end
287
+
288
+ #
289
+ # Gets the properties of a storage account’s Queue service, including
290
+ # properties for Storage Analytics and CORS (Cross-Origin Resource Sharing)
291
+ # rules.
292
+ #
293
+ # @param resource_group_name [String] The name of the resource group within the
294
+ # user's subscription. The name is case insensitive.
295
+ # @param account_name [String] The name of the storage account within the
296
+ # specified resource group. Storage account names must be between 3 and 24
297
+ # characters in length and use numbers and lower-case letters only.
298
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
299
+ # will be added to the HTTP request.
300
+ #
301
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
302
+ #
303
+ def get_service_properties_with_http_info(resource_group_name, account_name, custom_headers:nil)
304
+ get_service_properties_async(resource_group_name, account_name, custom_headers:custom_headers).value!
305
+ end
306
+
307
+ #
308
+ # Gets the properties of a storage account’s Queue service, including
309
+ # properties for Storage Analytics and CORS (Cross-Origin Resource Sharing)
310
+ # rules.
311
+ #
312
+ # @param resource_group_name [String] The name of the resource group within the
313
+ # user's subscription. The name is case insensitive.
314
+ # @param account_name [String] The name of the storage account within the
315
+ # specified resource group. Storage account names must be between 3 and 24
316
+ # characters in length and use numbers and lower-case letters only.
317
+ # @param [Hash{String => String}] A hash of custom headers that will be added
318
+ # to the HTTP request.
319
+ #
320
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
321
+ #
322
+ def get_service_properties_async(resource_group_name, account_name, custom_headers:nil)
323
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
324
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
325
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
326
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
327
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
328
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
329
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
330
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
331
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
332
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
333
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
334
+ queue_service_name = 'default'
335
+
336
+
337
+ request_headers = {}
338
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
339
+
340
+ # Set Headers
341
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
342
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
343
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/{queueServiceName}'
344
+
345
+ request_url = @base_url || @client.base_url
346
+
347
+ options = {
348
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
349
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id,'queueServiceName' => queue_service_name},
350
+ query_params: {'api-version' => @client.api_version},
351
+ headers: request_headers.merge(custom_headers || {}),
352
+ base_url: request_url
353
+ }
354
+ promise = @client.make_request_async(:get, path_template, options)
355
+
356
+ promise = promise.then do |result|
357
+ http_response = result.response
358
+ status_code = http_response.status
359
+ response_content = http_response.body
360
+ unless status_code == 200
361
+ error_model = JSON.load(response_content)
362
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
363
+ end
364
+
365
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
366
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
367
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
368
+ # Deserialize Response
369
+ if status_code == 200
370
+ begin
371
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
372
+ result_mapper = Azure::Storage::Mgmt::V2019_06_01::Models::QueueServiceProperties.mapper()
373
+ result.body = @client.deserialize(result_mapper, parsed_response)
374
+ rescue Exception => e
375
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
376
+ end
377
+ end
378
+
379
+ result
380
+ end
381
+
382
+ promise.execute
383
+ end
384
+
385
+ end
386
+ end
@@ -75,6 +75,18 @@ module Azure::Storage::Mgmt::V2019_06_01
75
75
  # @return [FileShares] file_shares
76
76
  attr_reader :file_shares
77
77
 
78
+ # @return [QueueServices] queue_services
79
+ attr_reader :queue_services
80
+
81
+ # @return [Queue] queue
82
+ attr_reader :queue
83
+
84
+ # @return [TableServices] table_services
85
+ attr_reader :table_services
86
+
87
+ # @return [TableOperations] table_operations
88
+ attr_reader :table_operations
89
+
78
90
  #
79
91
  # Creates initializes a new instance of the StorageManagementClient class.
80
92
  # @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
@@ -101,6 +113,10 @@ module Azure::Storage::Mgmt::V2019_06_01
101
113
  @blob_containers = BlobContainers.new(self)
102
114
  @file_services = FileServices.new(self)
103
115
  @file_shares = FileShares.new(self)
116
+ @queue_services = QueueServices.new(self)
117
+ @queue = Queue.new(self)
118
+ @table_services = TableServices.new(self)
119
+ @table_operations = TableOperations.new(self)
104
120
  @api_version = '2019-06-01'
105
121
  @accept_language = 'en-US'
106
122
  @long_running_operation_retry_timeout = 30
@@ -173,7 +189,7 @@ module Azure::Storage::Mgmt::V2019_06_01
173
189
  #
174
190
  def add_telemetry
175
191
  sdk_information = 'azure_mgmt_storage'
176
- sdk_information = "#{sdk_information}/0.21.1"
192
+ sdk_information = "#{sdk_information}/0.21.2"
177
193
  add_user_agent_information(sdk_information)
178
194
  end
179
195
  end
@@ -0,0 +1,743 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::Storage::Mgmt::V2019_06_01
7
+ #
8
+ # The Azure Storage Management API.
9
+ #
10
+ class TableOperations
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the TableOperations class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [StorageManagementClient] reference to the StorageManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Creates a new table with the specified table name, under the specified
26
+ # account.
27
+ #
28
+ # @param resource_group_name [String] The name of the resource group within the
29
+ # user's subscription. The name is case insensitive.
30
+ # @param account_name [String] The name of the storage account within the
31
+ # specified resource group. Storage account names must be between 3 and 24
32
+ # characters in length and use numbers and lower-case letters only.
33
+ # @param table_name [String] A table name must be unique within a storage
34
+ # account and must be between 3 and 63 characters.The name must comprise of
35
+ # only alphanumeric characters and it cannot begin with a numeric character.
36
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
37
+ # will be added to the HTTP request.
38
+ #
39
+ # @return [Table] operation results.
40
+ #
41
+ def create(resource_group_name, account_name, table_name, custom_headers:nil)
42
+ response = create_async(resource_group_name, account_name, table_name, custom_headers:custom_headers).value!
43
+ response.body unless response.nil?
44
+ end
45
+
46
+ #
47
+ # Creates a new table with the specified table name, under the specified
48
+ # account.
49
+ #
50
+ # @param resource_group_name [String] The name of the resource group within the
51
+ # user's subscription. The name is case insensitive.
52
+ # @param account_name [String] The name of the storage account within the
53
+ # specified resource group. Storage account names must be between 3 and 24
54
+ # characters in length and use numbers and lower-case letters only.
55
+ # @param table_name [String] A table name must be unique within a storage
56
+ # account and must be between 3 and 63 characters.The name must comprise of
57
+ # only alphanumeric characters and it cannot begin with a numeric character.
58
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
59
+ # will be added to the HTTP request.
60
+ #
61
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
62
+ #
63
+ def create_with_http_info(resource_group_name, account_name, table_name, custom_headers:nil)
64
+ create_async(resource_group_name, account_name, table_name, custom_headers:custom_headers).value!
65
+ end
66
+
67
+ #
68
+ # Creates a new table with the specified table name, under the specified
69
+ # account.
70
+ #
71
+ # @param resource_group_name [String] The name of the resource group within the
72
+ # user's subscription. The name is case insensitive.
73
+ # @param account_name [String] The name of the storage account within the
74
+ # specified resource group. Storage account names must be between 3 and 24
75
+ # characters in length and use numbers and lower-case letters only.
76
+ # @param table_name [String] A table name must be unique within a storage
77
+ # account and must be between 3 and 63 characters.The name must comprise of
78
+ # only alphanumeric characters and it cannot begin with a numeric character.
79
+ # @param [Hash{String => String}] A hash of custom headers that will be added
80
+ # to the HTTP request.
81
+ #
82
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
83
+ #
84
+ def create_async(resource_group_name, account_name, table_name, custom_headers:nil)
85
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
86
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
87
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
88
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
89
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
90
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
91
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
92
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
93
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
94
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
95
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
96
+ fail ArgumentError, 'table_name is nil' if table_name.nil?
97
+ fail ArgumentError, "'table_name' should satisfy the constraint - 'MaxLength': '63'" if !table_name.nil? && table_name.length > 63
98
+ fail ArgumentError, "'table_name' should satisfy the constraint - 'MinLength': '3'" if !table_name.nil? && table_name.length < 3
99
+ fail ArgumentError, "'table_name' should satisfy the constraint - 'Pattern': '^[A-Za-z][A-Za-z0-9]{2,62}$'" if !table_name.nil? && table_name.match(Regexp.new('^^[A-Za-z][A-Za-z0-9]{2,62}$$')).nil?
100
+
101
+
102
+ request_headers = {}
103
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
104
+
105
+ # Set Headers
106
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
107
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
108
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}'
109
+
110
+ request_url = @base_url || @client.base_url
111
+
112
+ options = {
113
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
114
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id,'tableName' => table_name},
115
+ query_params: {'api-version' => @client.api_version},
116
+ headers: request_headers.merge(custom_headers || {}),
117
+ base_url: request_url
118
+ }
119
+ promise = @client.make_request_async(:put, path_template, options)
120
+
121
+ promise = promise.then do |result|
122
+ http_response = result.response
123
+ status_code = http_response.status
124
+ response_content = http_response.body
125
+ unless status_code == 200
126
+ error_model = JSON.load(response_content)
127
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
128
+ end
129
+
130
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
131
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
132
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
133
+ # Deserialize Response
134
+ if status_code == 200
135
+ begin
136
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
137
+ result_mapper = Azure::Storage::Mgmt::V2019_06_01::Models::Table.mapper()
138
+ result.body = @client.deserialize(result_mapper, parsed_response)
139
+ rescue Exception => e
140
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
141
+ end
142
+ end
143
+
144
+ result
145
+ end
146
+
147
+ promise.execute
148
+ end
149
+
150
+ #
151
+ # Creates a new table with the specified table name, under the specified
152
+ # account.
153
+ #
154
+ # @param resource_group_name [String] The name of the resource group within the
155
+ # user's subscription. The name is case insensitive.
156
+ # @param account_name [String] The name of the storage account within the
157
+ # specified resource group. Storage account names must be between 3 and 24
158
+ # characters in length and use numbers and lower-case letters only.
159
+ # @param table_name [String] A table name must be unique within a storage
160
+ # account and must be between 3 and 63 characters.The name must comprise of
161
+ # only alphanumeric characters and it cannot begin with a numeric character.
162
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
163
+ # will be added to the HTTP request.
164
+ #
165
+ # @return [Table] operation results.
166
+ #
167
+ def update(resource_group_name, account_name, table_name, custom_headers:nil)
168
+ response = update_async(resource_group_name, account_name, table_name, custom_headers:custom_headers).value!
169
+ response.body unless response.nil?
170
+ end
171
+
172
+ #
173
+ # Creates a new table with the specified table name, under the specified
174
+ # account.
175
+ #
176
+ # @param resource_group_name [String] The name of the resource group within the
177
+ # user's subscription. The name is case insensitive.
178
+ # @param account_name [String] The name of the storage account within the
179
+ # specified resource group. Storage account names must be between 3 and 24
180
+ # characters in length and use numbers and lower-case letters only.
181
+ # @param table_name [String] A table name must be unique within a storage
182
+ # account and must be between 3 and 63 characters.The name must comprise of
183
+ # only alphanumeric characters and it cannot begin with a numeric character.
184
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
185
+ # will be added to the HTTP request.
186
+ #
187
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
188
+ #
189
+ def update_with_http_info(resource_group_name, account_name, table_name, custom_headers:nil)
190
+ update_async(resource_group_name, account_name, table_name, custom_headers:custom_headers).value!
191
+ end
192
+
193
+ #
194
+ # Creates a new table with the specified table name, under the specified
195
+ # account.
196
+ #
197
+ # @param resource_group_name [String] The name of the resource group within the
198
+ # user's subscription. The name is case insensitive.
199
+ # @param account_name [String] The name of the storage account within the
200
+ # specified resource group. Storage account names must be between 3 and 24
201
+ # characters in length and use numbers and lower-case letters only.
202
+ # @param table_name [String] A table name must be unique within a storage
203
+ # account and must be between 3 and 63 characters.The name must comprise of
204
+ # only alphanumeric characters and it cannot begin with a numeric character.
205
+ # @param [Hash{String => String}] A hash of custom headers that will be added
206
+ # to the HTTP request.
207
+ #
208
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
209
+ #
210
+ def update_async(resource_group_name, account_name, table_name, custom_headers:nil)
211
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
212
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
213
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
214
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
215
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
216
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
217
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
218
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
219
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
220
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
221
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
222
+ fail ArgumentError, 'table_name is nil' if table_name.nil?
223
+ fail ArgumentError, "'table_name' should satisfy the constraint - 'MaxLength': '63'" if !table_name.nil? && table_name.length > 63
224
+ fail ArgumentError, "'table_name' should satisfy the constraint - 'MinLength': '3'" if !table_name.nil? && table_name.length < 3
225
+ fail ArgumentError, "'table_name' should satisfy the constraint - 'Pattern': '^[A-Za-z][A-Za-z0-9]{2,62}$'" if !table_name.nil? && table_name.match(Regexp.new('^^[A-Za-z][A-Za-z0-9]{2,62}$$')).nil?
226
+
227
+
228
+ request_headers = {}
229
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
230
+
231
+ # Set Headers
232
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
233
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
234
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}'
235
+
236
+ request_url = @base_url || @client.base_url
237
+
238
+ options = {
239
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
240
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id,'tableName' => table_name},
241
+ query_params: {'api-version' => @client.api_version},
242
+ headers: request_headers.merge(custom_headers || {}),
243
+ base_url: request_url
244
+ }
245
+ promise = @client.make_request_async(:patch, path_template, options)
246
+
247
+ promise = promise.then do |result|
248
+ http_response = result.response
249
+ status_code = http_response.status
250
+ response_content = http_response.body
251
+ unless status_code == 200
252
+ error_model = JSON.load(response_content)
253
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
254
+ end
255
+
256
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
257
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
258
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
259
+ # Deserialize Response
260
+ if status_code == 200
261
+ begin
262
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
263
+ result_mapper = Azure::Storage::Mgmt::V2019_06_01::Models::Table.mapper()
264
+ result.body = @client.deserialize(result_mapper, parsed_response)
265
+ rescue Exception => e
266
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
267
+ end
268
+ end
269
+
270
+ result
271
+ end
272
+
273
+ promise.execute
274
+ end
275
+
276
+ #
277
+ # Gets the table with the specified table name, under the specified account if
278
+ # it exists.
279
+ #
280
+ # @param resource_group_name [String] The name of the resource group within the
281
+ # user's subscription. The name is case insensitive.
282
+ # @param account_name [String] The name of the storage account within the
283
+ # specified resource group. Storage account names must be between 3 and 24
284
+ # characters in length and use numbers and lower-case letters only.
285
+ # @param table_name [String] A table name must be unique within a storage
286
+ # account and must be between 3 and 63 characters.The name must comprise of
287
+ # only alphanumeric characters and it cannot begin with a numeric character.
288
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
289
+ # will be added to the HTTP request.
290
+ #
291
+ # @return [Table] operation results.
292
+ #
293
+ def get(resource_group_name, account_name, table_name, custom_headers:nil)
294
+ response = get_async(resource_group_name, account_name, table_name, custom_headers:custom_headers).value!
295
+ response.body unless response.nil?
296
+ end
297
+
298
+ #
299
+ # Gets the table with the specified table name, under the specified account if
300
+ # it exists.
301
+ #
302
+ # @param resource_group_name [String] The name of the resource group within the
303
+ # user's subscription. The name is case insensitive.
304
+ # @param account_name [String] The name of the storage account within the
305
+ # specified resource group. Storage account names must be between 3 and 24
306
+ # characters in length and use numbers and lower-case letters only.
307
+ # @param table_name [String] A table name must be unique within a storage
308
+ # account and must be between 3 and 63 characters.The name must comprise of
309
+ # only alphanumeric characters and it cannot begin with a numeric character.
310
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
311
+ # will be added to the HTTP request.
312
+ #
313
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
314
+ #
315
+ def get_with_http_info(resource_group_name, account_name, table_name, custom_headers:nil)
316
+ get_async(resource_group_name, account_name, table_name, custom_headers:custom_headers).value!
317
+ end
318
+
319
+ #
320
+ # Gets the table with the specified table name, under the specified account if
321
+ # it exists.
322
+ #
323
+ # @param resource_group_name [String] The name of the resource group within the
324
+ # user's subscription. The name is case insensitive.
325
+ # @param account_name [String] The name of the storage account within the
326
+ # specified resource group. Storage account names must be between 3 and 24
327
+ # characters in length and use numbers and lower-case letters only.
328
+ # @param table_name [String] A table name must be unique within a storage
329
+ # account and must be between 3 and 63 characters.The name must comprise of
330
+ # only alphanumeric characters and it cannot begin with a numeric character.
331
+ # @param [Hash{String => String}] A hash of custom headers that will be added
332
+ # to the HTTP request.
333
+ #
334
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
335
+ #
336
+ def get_async(resource_group_name, account_name, table_name, custom_headers:nil)
337
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
338
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
339
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
340
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
341
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
342
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
343
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
344
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
345
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
346
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
347
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
348
+ fail ArgumentError, 'table_name is nil' if table_name.nil?
349
+ fail ArgumentError, "'table_name' should satisfy the constraint - 'MaxLength': '63'" if !table_name.nil? && table_name.length > 63
350
+ fail ArgumentError, "'table_name' should satisfy the constraint - 'MinLength': '3'" if !table_name.nil? && table_name.length < 3
351
+ fail ArgumentError, "'table_name' should satisfy the constraint - 'Pattern': '^[A-Za-z][A-Za-z0-9]{2,62}$'" if !table_name.nil? && table_name.match(Regexp.new('^^[A-Za-z][A-Za-z0-9]{2,62}$$')).nil?
352
+
353
+
354
+ request_headers = {}
355
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
356
+
357
+ # Set Headers
358
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
359
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
360
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}'
361
+
362
+ request_url = @base_url || @client.base_url
363
+
364
+ options = {
365
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
366
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id,'tableName' => table_name},
367
+ query_params: {'api-version' => @client.api_version},
368
+ headers: request_headers.merge(custom_headers || {}),
369
+ base_url: request_url
370
+ }
371
+ promise = @client.make_request_async(:get, path_template, options)
372
+
373
+ promise = promise.then do |result|
374
+ http_response = result.response
375
+ status_code = http_response.status
376
+ response_content = http_response.body
377
+ unless status_code == 200
378
+ error_model = JSON.load(response_content)
379
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
380
+ end
381
+
382
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
383
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
384
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
385
+ # Deserialize Response
386
+ if status_code == 200
387
+ begin
388
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
389
+ result_mapper = Azure::Storage::Mgmt::V2019_06_01::Models::Table.mapper()
390
+ result.body = @client.deserialize(result_mapper, parsed_response)
391
+ rescue Exception => e
392
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
393
+ end
394
+ end
395
+
396
+ result
397
+ end
398
+
399
+ promise.execute
400
+ end
401
+
402
+ #
403
+ # Deletes the table with the specified table name, under the specified account
404
+ # if it exists.
405
+ #
406
+ # @param resource_group_name [String] The name of the resource group within the
407
+ # user's subscription. The name is case insensitive.
408
+ # @param account_name [String] The name of the storage account within the
409
+ # specified resource group. Storage account names must be between 3 and 24
410
+ # characters in length and use numbers and lower-case letters only.
411
+ # @param table_name [String] A table name must be unique within a storage
412
+ # account and must be between 3 and 63 characters.The name must comprise of
413
+ # only alphanumeric characters and it cannot begin with a numeric character.
414
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
415
+ # will be added to the HTTP request.
416
+ #
417
+ #
418
+ def delete(resource_group_name, account_name, table_name, custom_headers:nil)
419
+ response = delete_async(resource_group_name, account_name, table_name, custom_headers:custom_headers).value!
420
+ nil
421
+ end
422
+
423
+ #
424
+ # Deletes the table with the specified table name, under the specified account
425
+ # if it exists.
426
+ #
427
+ # @param resource_group_name [String] The name of the resource group within the
428
+ # user's subscription. The name is case insensitive.
429
+ # @param account_name [String] The name of the storage account within the
430
+ # specified resource group. Storage account names must be between 3 and 24
431
+ # characters in length and use numbers and lower-case letters only.
432
+ # @param table_name [String] A table name must be unique within a storage
433
+ # account and must be between 3 and 63 characters.The name must comprise of
434
+ # only alphanumeric characters and it cannot begin with a numeric character.
435
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
436
+ # will be added to the HTTP request.
437
+ #
438
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
439
+ #
440
+ def delete_with_http_info(resource_group_name, account_name, table_name, custom_headers:nil)
441
+ delete_async(resource_group_name, account_name, table_name, custom_headers:custom_headers).value!
442
+ end
443
+
444
+ #
445
+ # Deletes the table with the specified table name, under the specified account
446
+ # if it exists.
447
+ #
448
+ # @param resource_group_name [String] The name of the resource group within the
449
+ # user's subscription. The name is case insensitive.
450
+ # @param account_name [String] The name of the storage account within the
451
+ # specified resource group. Storage account names must be between 3 and 24
452
+ # characters in length and use numbers and lower-case letters only.
453
+ # @param table_name [String] A table name must be unique within a storage
454
+ # account and must be between 3 and 63 characters.The name must comprise of
455
+ # only alphanumeric characters and it cannot begin with a numeric character.
456
+ # @param [Hash{String => String}] A hash of custom headers that will be added
457
+ # to the HTTP request.
458
+ #
459
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
460
+ #
461
+ def delete_async(resource_group_name, account_name, table_name, custom_headers:nil)
462
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
463
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
464
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
465
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
466
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
467
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
468
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
469
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
470
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
471
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
472
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
473
+ fail ArgumentError, 'table_name is nil' if table_name.nil?
474
+ fail ArgumentError, "'table_name' should satisfy the constraint - 'MaxLength': '63'" if !table_name.nil? && table_name.length > 63
475
+ fail ArgumentError, "'table_name' should satisfy the constraint - 'MinLength': '3'" if !table_name.nil? && table_name.length < 3
476
+ fail ArgumentError, "'table_name' should satisfy the constraint - 'Pattern': '^[A-Za-z][A-Za-z0-9]{2,62}$'" if !table_name.nil? && table_name.match(Regexp.new('^^[A-Za-z][A-Za-z0-9]{2,62}$$')).nil?
477
+
478
+
479
+ request_headers = {}
480
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
481
+
482
+ # Set Headers
483
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
484
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
485
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}'
486
+
487
+ request_url = @base_url || @client.base_url
488
+
489
+ options = {
490
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
491
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id,'tableName' => table_name},
492
+ query_params: {'api-version' => @client.api_version},
493
+ headers: request_headers.merge(custom_headers || {}),
494
+ base_url: request_url
495
+ }
496
+ promise = @client.make_request_async(:delete, path_template, options)
497
+
498
+ promise = promise.then do |result|
499
+ http_response = result.response
500
+ status_code = http_response.status
501
+ response_content = http_response.body
502
+ unless status_code == 204
503
+ error_model = JSON.load(response_content)
504
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
505
+ end
506
+
507
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
508
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
509
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
510
+
511
+ result
512
+ end
513
+
514
+ promise.execute
515
+ end
516
+
517
+ #
518
+ # Gets a list of all the tables under the specified storage account
519
+ #
520
+ # @param resource_group_name [String] The name of the resource group within the
521
+ # user's subscription. The name is case insensitive.
522
+ # @param account_name [String] The name of the storage account within the
523
+ # specified resource group. Storage account names must be between 3 and 24
524
+ # characters in length and use numbers and lower-case letters only.
525
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
526
+ # will be added to the HTTP request.
527
+ #
528
+ # @return [Array<Table>] operation results.
529
+ #
530
+ def list(resource_group_name, account_name, custom_headers:nil)
531
+ first_page = list_as_lazy(resource_group_name, account_name, custom_headers:custom_headers)
532
+ first_page.get_all_items
533
+ end
534
+
535
+ #
536
+ # Gets a list of all the tables under the specified storage account
537
+ #
538
+ # @param resource_group_name [String] The name of the resource group within the
539
+ # user's subscription. The name is case insensitive.
540
+ # @param account_name [String] The name of the storage account within the
541
+ # specified resource group. Storage account names must be between 3 and 24
542
+ # characters in length and use numbers and lower-case letters only.
543
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
544
+ # will be added to the HTTP request.
545
+ #
546
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
547
+ #
548
+ def list_with_http_info(resource_group_name, account_name, custom_headers:nil)
549
+ list_async(resource_group_name, account_name, custom_headers:custom_headers).value!
550
+ end
551
+
552
+ #
553
+ # Gets a list of all the tables under the specified storage account
554
+ #
555
+ # @param resource_group_name [String] The name of the resource group within the
556
+ # user's subscription. The name is case insensitive.
557
+ # @param account_name [String] The name of the storage account within the
558
+ # specified resource group. Storage account names must be between 3 and 24
559
+ # characters in length and use numbers and lower-case letters only.
560
+ # @param [Hash{String => String}] A hash of custom headers that will be added
561
+ # to the HTTP request.
562
+ #
563
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
564
+ #
565
+ def list_async(resource_group_name, account_name, custom_headers:nil)
566
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
567
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
568
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
569
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
570
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
571
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MaxLength': '24'" if !account_name.nil? && account_name.length > 24
572
+ fail ArgumentError, "'account_name' should satisfy the constraint - 'MinLength': '3'" if !account_name.nil? && account_name.length < 3
573
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
574
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
575
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
576
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
577
+
578
+
579
+ request_headers = {}
580
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
581
+
582
+ # Set Headers
583
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
584
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
585
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables'
586
+
587
+ request_url = @base_url || @client.base_url
588
+
589
+ options = {
590
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
591
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
592
+ query_params: {'api-version' => @client.api_version},
593
+ headers: request_headers.merge(custom_headers || {}),
594
+ base_url: request_url
595
+ }
596
+ promise = @client.make_request_async(:get, path_template, options)
597
+
598
+ promise = promise.then do |result|
599
+ http_response = result.response
600
+ status_code = http_response.status
601
+ response_content = http_response.body
602
+ unless status_code == 200
603
+ error_model = JSON.load(response_content)
604
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
605
+ end
606
+
607
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
608
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
609
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
610
+ # Deserialize Response
611
+ if status_code == 200
612
+ begin
613
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
614
+ result_mapper = Azure::Storage::Mgmt::V2019_06_01::Models::ListTableResource.mapper()
615
+ result.body = @client.deserialize(result_mapper, parsed_response)
616
+ rescue Exception => e
617
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
618
+ end
619
+ end
620
+
621
+ result
622
+ end
623
+
624
+ promise.execute
625
+ end
626
+
627
+ #
628
+ # Gets a list of all the tables under the specified storage account
629
+ #
630
+ # @param next_page_link [String] The NextLink from the previous successful call
631
+ # to List operation.
632
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
633
+ # will be added to the HTTP request.
634
+ #
635
+ # @return [ListTableResource] operation results.
636
+ #
637
+ def list_next(next_page_link, custom_headers:nil)
638
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
639
+ response.body unless response.nil?
640
+ end
641
+
642
+ #
643
+ # Gets a list of all the tables under the specified storage account
644
+ #
645
+ # @param next_page_link [String] The NextLink from the previous successful call
646
+ # to List operation.
647
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
648
+ # will be added to the HTTP request.
649
+ #
650
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
651
+ #
652
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
653
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
654
+ end
655
+
656
+ #
657
+ # Gets a list of all the tables under the specified storage account
658
+ #
659
+ # @param next_page_link [String] The NextLink from the previous successful call
660
+ # to List operation.
661
+ # @param [Hash{String => String}] A hash of custom headers that will be added
662
+ # to the HTTP request.
663
+ #
664
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
665
+ #
666
+ def list_next_async(next_page_link, custom_headers:nil)
667
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
668
+
669
+
670
+ request_headers = {}
671
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
672
+
673
+ # Set Headers
674
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
675
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
676
+ path_template = '{nextLink}'
677
+
678
+ request_url = @base_url || @client.base_url
679
+
680
+ options = {
681
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
682
+ skip_encoding_path_params: {'nextLink' => next_page_link},
683
+ headers: request_headers.merge(custom_headers || {}),
684
+ base_url: request_url
685
+ }
686
+ promise = @client.make_request_async(:get, path_template, options)
687
+
688
+ promise = promise.then do |result|
689
+ http_response = result.response
690
+ status_code = http_response.status
691
+ response_content = http_response.body
692
+ unless status_code == 200
693
+ error_model = JSON.load(response_content)
694
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
695
+ end
696
+
697
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
698
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
699
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
700
+ # Deserialize Response
701
+ if status_code == 200
702
+ begin
703
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
704
+ result_mapper = Azure::Storage::Mgmt::V2019_06_01::Models::ListTableResource.mapper()
705
+ result.body = @client.deserialize(result_mapper, parsed_response)
706
+ rescue Exception => e
707
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
708
+ end
709
+ end
710
+
711
+ result
712
+ end
713
+
714
+ promise.execute
715
+ end
716
+
717
+ #
718
+ # Gets a list of all the tables under the specified storage account
719
+ #
720
+ # @param resource_group_name [String] The name of the resource group within the
721
+ # user's subscription. The name is case insensitive.
722
+ # @param account_name [String] The name of the storage account within the
723
+ # specified resource group. Storage account names must be between 3 and 24
724
+ # characters in length and use numbers and lower-case letters only.
725
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
726
+ # will be added to the HTTP request.
727
+ #
728
+ # @return [ListTableResource] which provide lazy access to pages of the
729
+ # response.
730
+ #
731
+ def list_as_lazy(resource_group_name, account_name, custom_headers:nil)
732
+ response = list_async(resource_group_name, account_name, custom_headers:custom_headers).value!
733
+ unless response.nil?
734
+ page = response.body
735
+ page.next_method = Proc.new do |next_page_link|
736
+ list_next_async(next_page_link, custom_headers:custom_headers)
737
+ end
738
+ page
739
+ end
740
+ end
741
+
742
+ end
743
+ end