azure_mgmt_netapp 0.20.2 → 0.21.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2017-08-15-preview/generated/azure_mgmt_netapp/azure_net_app_files_management_client.rb +1 -1
  3. data/lib/2019-05-01/generated/azure_mgmt_netapp/azure_net_app_files_management_client.rb +1 -1
  4. data/lib/2019-06-01/generated/azure_mgmt_netapp/azure_net_app_files_management_client.rb +1 -1
  5. data/lib/2019-07-01/generated/azure_mgmt_netapp/azure_net_app_files_management_client.rb +1 -1
  6. data/lib/2019-08-01/generated/azure_mgmt_netapp/azure_net_app_files_management_client.rb +1 -1
  7. data/lib/2019-10-01/generated/azure_mgmt_netapp/azure_net_app_files_management_client.rb +1 -1
  8. data/lib/2019-11-01/generated/azure_mgmt_netapp/azure_net_app_files_management_client.rb +1 -1
  9. data/lib/2020-02-01/generated/azure_mgmt_netapp/azure_net_app_files_management_client.rb +1 -1
  10. data/lib/2020-06-01/generated/azure_mgmt_netapp/azure_net_app_files_management_client.rb +1 -1
  11. data/lib/2020-07-01/generated/azure_mgmt_netapp.rb +104 -0
  12. data/lib/2020-07-01/generated/azure_mgmt_netapp/account_backups.rb +373 -0
  13. data/lib/2020-07-01/generated/azure_mgmt_netapp/accounts.rb +709 -0
  14. data/lib/2020-07-01/generated/azure_mgmt_netapp/azure_net_app_files_management_client.rb +173 -0
  15. data/lib/2020-07-01/generated/azure_mgmt_netapp/backup_policies.rb +691 -0
  16. data/lib/2020-07-01/generated/azure_mgmt_netapp/backups.rb +747 -0
  17. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/active_directory.rb +253 -0
  18. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/active_directory_status.rb +19 -0
  19. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/authorize_request.rb +46 -0
  20. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/backup.rb +158 -0
  21. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/backup_patch.rb +130 -0
  22. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/backup_policies_list.rb +55 -0
  23. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/backup_policy.rb +212 -0
  24. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/backup_policy_details.rb +212 -0
  25. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/backup_policy_patch.rb +212 -0
  26. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/backups_list.rb +55 -0
  27. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/break_replication_request.rb +47 -0
  28. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/capacity_pool.rb +198 -0
  29. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/capacity_pool_list.rb +55 -0
  30. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/capacity_pool_patch.rb +132 -0
  31. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/check_availability_response.rb +78 -0
  32. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/check_name_resource_types.rb +18 -0
  33. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/check_quota_name_resource_types.rb +18 -0
  34. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/daily_schedule.rb +81 -0
  35. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/dimension.rb +57 -0
  36. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/endpoint_type.rb +16 -0
  37. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/export_policy_rule.rb +205 -0
  38. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/hourly_schedule.rb +69 -0
  39. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/in_availability_reason_type.rb +16 -0
  40. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/metric_specification.rb +145 -0
  41. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/mirror_state.rb +17 -0
  42. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/monthly_schedule.rb +93 -0
  43. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/mount_target.rb +159 -0
  44. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/mount_target_properties.rb +93 -0
  45. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/net_app_account.rb +133 -0
  46. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/net_app_account_list.rb +55 -0
  47. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/net_app_account_patch.rb +133 -0
  48. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/operation.rb +83 -0
  49. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/operation_display.rb +79 -0
  50. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/operation_list_result.rb +57 -0
  51. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/pool_change_request.rb +46 -0
  52. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/qos_type.rb +16 -0
  53. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/quota_availability_request.rb +73 -0
  54. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/relationship_status.rb +16 -0
  55. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/replication_object.rb +94 -0
  56. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/replication_schedule.rb +17 -0
  57. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/replication_status.rb +93 -0
  58. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/resource_name_availability_request.rb +72 -0
  59. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/security_style.rb +16 -0
  60. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/service_level.rb +17 -0
  61. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/service_specification.rb +56 -0
  62. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/snapshot.rb +123 -0
  63. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/snapshot_policies_list.rb +55 -0
  64. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/snapshot_policy.rb +185 -0
  65. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/snapshot_policy_details.rb +185 -0
  66. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/snapshot_policy_patch.rb +185 -0
  67. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/snapshot_policy_volume_list.rb +54 -0
  68. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/snapshots_list.rb +55 -0
  69. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/vault.rb +93 -0
  70. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/vault_list.rb +55 -0
  71. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/volume.rb +382 -0
  72. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/volume_backup_properties.rb +79 -0
  73. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/volume_backups.rb +68 -0
  74. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/volume_list.rb +55 -0
  75. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/volume_patch.rb +178 -0
  76. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/volume_patch_properties_data_protection.rb +50 -0
  77. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/volume_patch_properties_export_policy.rb +58 -0
  78. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/volume_properties_data_protection.rb +74 -0
  79. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/volume_properties_export_policy.rb +58 -0
  80. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/volume_revert.rb +46 -0
  81. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/volume_snapshot_properties.rb +46 -0
  82. data/lib/2020-07-01/generated/azure_mgmt_netapp/models/weekly_schedule.rb +94 -0
  83. data/lib/2020-07-01/generated/azure_mgmt_netapp/module_definition.rb +9 -0
  84. data/lib/2020-07-01/generated/azure_mgmt_netapp/net_app_resource.rb +424 -0
  85. data/lib/2020-07-01/generated/azure_mgmt_netapp/operations.rb +115 -0
  86. data/lib/2020-07-01/generated/azure_mgmt_netapp/pools.rb +737 -0
  87. data/lib/2020-07-01/generated/azure_mgmt_netapp/snapshot_policies.rb +700 -0
  88. data/lib/2020-07-01/generated/azure_mgmt_netapp/snapshots.rb +794 -0
  89. data/lib/2020-07-01/generated/azure_mgmt_netapp/vaults.rb +128 -0
  90. data/lib/2020-07-01/generated/azure_mgmt_netapp/volumes.rb +2023 -0
  91. data/lib/azure_mgmt_netapp.rb +6 -5
  92. data/lib/profiles/latest/modules/netapp_profile_module.rb +153 -153
  93. data/lib/version.rb +1 -1
  94. metadata +83 -3
@@ -0,0 +1,709 @@
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::NetApp::Mgmt::V2020_07_01
7
+ #
8
+ # Microsoft NetApp Azure Resource Provider specification
9
+ #
10
+ class Accounts
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Accounts class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [AzureNetAppFilesManagementClient] reference to the AzureNetAppFilesManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Describe all NetApp Accounts in a resource group
26
+ #
27
+ # List and describe all NetApp accounts in the resource group.
28
+ #
29
+ # @param resource_group_name [String] The name of the resource group.
30
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
31
+ # will be added to the HTTP request.
32
+ #
33
+ # @return [NetAppAccountList] operation results.
34
+ #
35
+ def list(resource_group_name, custom_headers:nil)
36
+ response = list_async(resource_group_name, custom_headers:custom_headers).value!
37
+ response.body unless response.nil?
38
+ end
39
+
40
+ #
41
+ # Describe all NetApp Accounts in a resource group
42
+ #
43
+ # List and describe all NetApp accounts in the resource group.
44
+ #
45
+ # @param resource_group_name [String] The name of the resource group.
46
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
47
+ # will be added to the HTTP request.
48
+ #
49
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
50
+ #
51
+ def list_with_http_info(resource_group_name, custom_headers:nil)
52
+ list_async(resource_group_name, custom_headers:custom_headers).value!
53
+ end
54
+
55
+ #
56
+ # Describe all NetApp Accounts in a resource group
57
+ #
58
+ # List and describe all NetApp accounts in the resource group.
59
+ #
60
+ # @param resource_group_name [String] The name of the resource group.
61
+ # @param [Hash{String => String}] A hash of custom headers that will be added
62
+ # to the HTTP request.
63
+ #
64
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
65
+ #
66
+ def list_async(resource_group_name, custom_headers:nil)
67
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
68
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
69
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
70
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
71
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
72
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
73
+
74
+
75
+ request_headers = {}
76
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
77
+
78
+ # Set Headers
79
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
80
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
81
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts'
82
+
83
+ request_url = @base_url || @client.base_url
84
+
85
+ options = {
86
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
87
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
88
+ query_params: {'api-version' => @client.api_version},
89
+ headers: request_headers.merge(custom_headers || {}),
90
+ base_url: request_url
91
+ }
92
+ promise = @client.make_request_async(:get, path_template, options)
93
+
94
+ promise = promise.then do |result|
95
+ http_response = result.response
96
+ status_code = http_response.status
97
+ response_content = http_response.body
98
+ unless status_code == 200
99
+ error_model = JSON.load(response_content)
100
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
101
+ end
102
+
103
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
104
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
105
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
106
+ # Deserialize Response
107
+ if status_code == 200
108
+ begin
109
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
110
+ result_mapper = Azure::NetApp::Mgmt::V2020_07_01::Models::NetAppAccountList.mapper()
111
+ result.body = @client.deserialize(result_mapper, parsed_response)
112
+ rescue Exception => e
113
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
114
+ end
115
+ end
116
+
117
+ result
118
+ end
119
+
120
+ promise.execute
121
+ end
122
+
123
+ #
124
+ # Describe a NetApp Account
125
+ #
126
+ # Get the NetApp account
127
+ #
128
+ # @param resource_group_name [String] The name of the resource group.
129
+ # @param account_name [String] The name of the NetApp account
130
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
131
+ # will be added to the HTTP request.
132
+ #
133
+ # @return [NetAppAccount] operation results.
134
+ #
135
+ def get(resource_group_name, account_name, custom_headers:nil)
136
+ response = get_async(resource_group_name, account_name, custom_headers:custom_headers).value!
137
+ response.body unless response.nil?
138
+ end
139
+
140
+ #
141
+ # Describe a NetApp Account
142
+ #
143
+ # Get the NetApp account
144
+ #
145
+ # @param resource_group_name [String] The name of the resource group.
146
+ # @param account_name [String] The name of the NetApp account
147
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
148
+ # will be added to the HTTP request.
149
+ #
150
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
151
+ #
152
+ def get_with_http_info(resource_group_name, account_name, custom_headers:nil)
153
+ get_async(resource_group_name, account_name, custom_headers:custom_headers).value!
154
+ end
155
+
156
+ #
157
+ # Describe a NetApp Account
158
+ #
159
+ # Get the NetApp account
160
+ #
161
+ # @param resource_group_name [String] The name of the resource group.
162
+ # @param account_name [String] The name of the NetApp account
163
+ # @param [Hash{String => String}] A hash of custom headers that will be added
164
+ # to the HTTP request.
165
+ #
166
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
167
+ #
168
+ def get_async(resource_group_name, account_name, custom_headers:nil)
169
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
170
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
171
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
172
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
173
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
174
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
175
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
176
+
177
+
178
+ request_headers = {}
179
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
180
+
181
+ # Set Headers
182
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
183
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
184
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}'
185
+
186
+ request_url = @base_url || @client.base_url
187
+
188
+ options = {
189
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
190
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name},
191
+ query_params: {'api-version' => @client.api_version},
192
+ headers: request_headers.merge(custom_headers || {}),
193
+ base_url: request_url
194
+ }
195
+ promise = @client.make_request_async(:get, path_template, options)
196
+
197
+ promise = promise.then do |result|
198
+ http_response = result.response
199
+ status_code = http_response.status
200
+ response_content = http_response.body
201
+ unless status_code == 200
202
+ error_model = JSON.load(response_content)
203
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
204
+ end
205
+
206
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
207
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
208
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
209
+ # Deserialize Response
210
+ if status_code == 200
211
+ begin
212
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
213
+ result_mapper = Azure::NetApp::Mgmt::V2020_07_01::Models::NetAppAccount.mapper()
214
+ result.body = @client.deserialize(result_mapper, parsed_response)
215
+ rescue Exception => e
216
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
217
+ end
218
+ end
219
+
220
+ result
221
+ end
222
+
223
+ promise.execute
224
+ end
225
+
226
+ #
227
+ # Create or update a NetApp account
228
+ #
229
+ # Create or update the specified NetApp account within the resource group
230
+ #
231
+ # @param body [NetAppAccount] NetApp Account object supplied in the body of the
232
+ # operation.
233
+ # @param resource_group_name [String] The name of the resource group.
234
+ # @param account_name [String] The name of the NetApp account
235
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
236
+ # will be added to the HTTP request.
237
+ #
238
+ # @return [NetAppAccount] operation results.
239
+ #
240
+ def create_or_update(body, resource_group_name, account_name, custom_headers:nil)
241
+ response = create_or_update_async(body, resource_group_name, account_name, custom_headers:custom_headers).value!
242
+ response.body unless response.nil?
243
+ end
244
+
245
+ #
246
+ # @param body [NetAppAccount] NetApp Account object supplied in the body of the
247
+ # operation.
248
+ # @param resource_group_name [String] The name of the resource group.
249
+ # @param account_name [String] The name of the NetApp account
250
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
251
+ # will be added to the HTTP request.
252
+ #
253
+ # @return [Concurrent::Promise] promise which provides async access to http
254
+ # response.
255
+ #
256
+ def create_or_update_async(body, resource_group_name, account_name, custom_headers:nil)
257
+ # Send request
258
+ promise = begin_create_or_update_async(body, resource_group_name, account_name, custom_headers:custom_headers)
259
+
260
+ promise = promise.then do |response|
261
+ # Defining deserialization method.
262
+ deserialize_method = lambda do |parsed_response|
263
+ result_mapper = Azure::NetApp::Mgmt::V2020_07_01::Models::NetAppAccount.mapper()
264
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
265
+ end
266
+
267
+ # Waiting for response.
268
+ @client.get_long_running_operation_result(response, deserialize_method)
269
+ end
270
+
271
+ promise
272
+ end
273
+
274
+ #
275
+ # Delete a NetApp account
276
+ #
277
+ # Delete the specified NetApp account
278
+ #
279
+ # @param resource_group_name [String] The name of the resource group.
280
+ # @param account_name [String] The name of the NetApp account
281
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
282
+ # will be added to the HTTP request.
283
+ #
284
+ def delete(resource_group_name, account_name, custom_headers:nil)
285
+ response = delete_async(resource_group_name, account_name, custom_headers:custom_headers).value!
286
+ nil
287
+ end
288
+
289
+ #
290
+ # @param resource_group_name [String] The name of the resource group.
291
+ # @param account_name [String] The name of the NetApp account
292
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
293
+ # will be added to the HTTP request.
294
+ #
295
+ # @return [Concurrent::Promise] promise which provides async access to http
296
+ # response.
297
+ #
298
+ def delete_async(resource_group_name, account_name, custom_headers:nil)
299
+ # Send request
300
+ promise = begin_delete_async(resource_group_name, account_name, custom_headers:custom_headers)
301
+
302
+ promise = promise.then do |response|
303
+ # Defining deserialization method.
304
+ deserialize_method = lambda do |parsed_response|
305
+ end
306
+
307
+ # Waiting for response.
308
+ @client.get_long_running_operation_result(response, deserialize_method)
309
+ end
310
+
311
+ promise
312
+ end
313
+
314
+ #
315
+ # Update a NetApp account
316
+ #
317
+ # Patch the specified NetApp account
318
+ #
319
+ # @param body [NetAppAccountPatch] NetApp Account object supplied in the body
320
+ # of the operation.
321
+ # @param resource_group_name [String] The name of the resource group.
322
+ # @param account_name [String] The name of the NetApp account
323
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
324
+ # will be added to the HTTP request.
325
+ #
326
+ # @return [NetAppAccount] operation results.
327
+ #
328
+ def update(body, resource_group_name, account_name, custom_headers:nil)
329
+ response = update_async(body, resource_group_name, account_name, custom_headers:custom_headers).value!
330
+ response.body unless response.nil?
331
+ end
332
+
333
+ #
334
+ # @param body [NetAppAccountPatch] NetApp Account object supplied in the body
335
+ # of the operation.
336
+ # @param resource_group_name [String] The name of the resource group.
337
+ # @param account_name [String] The name of the NetApp account
338
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
339
+ # will be added to the HTTP request.
340
+ #
341
+ # @return [Concurrent::Promise] promise which provides async access to http
342
+ # response.
343
+ #
344
+ def update_async(body, resource_group_name, account_name, custom_headers:nil)
345
+ # Send request
346
+ promise = begin_update_async(body, resource_group_name, account_name, custom_headers:custom_headers)
347
+
348
+ promise = promise.then do |response|
349
+ # Defining deserialization method.
350
+ deserialize_method = lambda do |parsed_response|
351
+ result_mapper = Azure::NetApp::Mgmt::V2020_07_01::Models::NetAppAccount.mapper()
352
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
353
+ end
354
+
355
+ # Waiting for response.
356
+ @client.get_long_running_operation_result(response, deserialize_method)
357
+ end
358
+
359
+ promise
360
+ end
361
+
362
+ #
363
+ # Create or update a NetApp account
364
+ #
365
+ # Create or update the specified NetApp account within the resource group
366
+ #
367
+ # @param body [NetAppAccount] NetApp Account object supplied in the body of the
368
+ # operation.
369
+ # @param resource_group_name [String] The name of the resource group.
370
+ # @param account_name [String] The name of the NetApp account
371
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
372
+ # will be added to the HTTP request.
373
+ #
374
+ # @return [NetAppAccount] operation results.
375
+ #
376
+ def begin_create_or_update(body, resource_group_name, account_name, custom_headers:nil)
377
+ response = begin_create_or_update_async(body, resource_group_name, account_name, custom_headers:custom_headers).value!
378
+ response.body unless response.nil?
379
+ end
380
+
381
+ #
382
+ # Create or update a NetApp account
383
+ #
384
+ # Create or update the specified NetApp account within the resource group
385
+ #
386
+ # @param body [NetAppAccount] NetApp Account object supplied in the body of the
387
+ # operation.
388
+ # @param resource_group_name [String] The name of the resource group.
389
+ # @param account_name [String] The name of the NetApp account
390
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
391
+ # will be added to the HTTP request.
392
+ #
393
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
394
+ #
395
+ def begin_create_or_update_with_http_info(body, resource_group_name, account_name, custom_headers:nil)
396
+ begin_create_or_update_async(body, resource_group_name, account_name, custom_headers:custom_headers).value!
397
+ end
398
+
399
+ #
400
+ # Create or update a NetApp account
401
+ #
402
+ # Create or update the specified NetApp account within the resource group
403
+ #
404
+ # @param body [NetAppAccount] NetApp Account object supplied in the body of the
405
+ # operation.
406
+ # @param resource_group_name [String] The name of the resource group.
407
+ # @param account_name [String] The name of the NetApp account
408
+ # @param [Hash{String => String}] A hash of custom headers that will be added
409
+ # to the HTTP request.
410
+ #
411
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
412
+ #
413
+ def begin_create_or_update_async(body, resource_group_name, account_name, custom_headers:nil)
414
+ fail ArgumentError, 'body is nil' if body.nil?
415
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
416
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
417
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
418
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
419
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
420
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
421
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
422
+
423
+
424
+ request_headers = {}
425
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
426
+
427
+ # Set Headers
428
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
429
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
430
+
431
+ # Serialize Request
432
+ request_mapper = Azure::NetApp::Mgmt::V2020_07_01::Models::NetAppAccount.mapper()
433
+ request_content = @client.serialize(request_mapper, body)
434
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
435
+
436
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}'
437
+
438
+ request_url = @base_url || @client.base_url
439
+
440
+ options = {
441
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
442
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name},
443
+ query_params: {'api-version' => @client.api_version},
444
+ body: request_content,
445
+ headers: request_headers.merge(custom_headers || {}),
446
+ base_url: request_url
447
+ }
448
+ promise = @client.make_request_async(:put, path_template, options)
449
+
450
+ promise = promise.then do |result|
451
+ http_response = result.response
452
+ status_code = http_response.status
453
+ response_content = http_response.body
454
+ unless status_code == 200 || status_code == 201 || status_code == 202
455
+ error_model = JSON.load(response_content)
456
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
457
+ end
458
+
459
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
460
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
461
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
462
+ # Deserialize Response
463
+ if status_code == 200
464
+ begin
465
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
466
+ result_mapper = Azure::NetApp::Mgmt::V2020_07_01::Models::NetAppAccount.mapper()
467
+ result.body = @client.deserialize(result_mapper, parsed_response)
468
+ rescue Exception => e
469
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
470
+ end
471
+ end
472
+ # Deserialize Response
473
+ if status_code == 201
474
+ begin
475
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
476
+ result_mapper = Azure::NetApp::Mgmt::V2020_07_01::Models::NetAppAccount.mapper()
477
+ result.body = @client.deserialize(result_mapper, parsed_response)
478
+ rescue Exception => e
479
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
480
+ end
481
+ end
482
+
483
+ result
484
+ end
485
+
486
+ promise.execute
487
+ end
488
+
489
+ #
490
+ # Delete a NetApp account
491
+ #
492
+ # Delete the specified NetApp account
493
+ #
494
+ # @param resource_group_name [String] The name of the resource group.
495
+ # @param account_name [String] The name of the NetApp account
496
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
497
+ # will be added to the HTTP request.
498
+ #
499
+ #
500
+ def begin_delete(resource_group_name, account_name, custom_headers:nil)
501
+ response = begin_delete_async(resource_group_name, account_name, custom_headers:custom_headers).value!
502
+ nil
503
+ end
504
+
505
+ #
506
+ # Delete a NetApp account
507
+ #
508
+ # Delete the specified NetApp account
509
+ #
510
+ # @param resource_group_name [String] The name of the resource group.
511
+ # @param account_name [String] The name of the NetApp account
512
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
513
+ # will be added to the HTTP request.
514
+ #
515
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
516
+ #
517
+ def begin_delete_with_http_info(resource_group_name, account_name, custom_headers:nil)
518
+ begin_delete_async(resource_group_name, account_name, custom_headers:custom_headers).value!
519
+ end
520
+
521
+ #
522
+ # Delete a NetApp account
523
+ #
524
+ # Delete the specified NetApp account
525
+ #
526
+ # @param resource_group_name [String] The name of the resource group.
527
+ # @param account_name [String] The name of the NetApp account
528
+ # @param [Hash{String => String}] A hash of custom headers that will be added
529
+ # to the HTTP request.
530
+ #
531
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
532
+ #
533
+ def begin_delete_async(resource_group_name, account_name, custom_headers:nil)
534
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
535
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
536
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
537
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
538
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
539
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
540
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
541
+
542
+
543
+ request_headers = {}
544
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
545
+
546
+ # Set Headers
547
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
548
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
549
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}'
550
+
551
+ request_url = @base_url || @client.base_url
552
+
553
+ options = {
554
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
555
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name},
556
+ query_params: {'api-version' => @client.api_version},
557
+ headers: request_headers.merge(custom_headers || {}),
558
+ base_url: request_url
559
+ }
560
+ promise = @client.make_request_async(:delete, path_template, options)
561
+
562
+ promise = promise.then do |result|
563
+ http_response = result.response
564
+ status_code = http_response.status
565
+ response_content = http_response.body
566
+ unless status_code == 202 || status_code == 204
567
+ error_model = JSON.load(response_content)
568
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
569
+ end
570
+
571
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
572
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
573
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
574
+
575
+ result
576
+ end
577
+
578
+ promise.execute
579
+ end
580
+
581
+ #
582
+ # Update a NetApp account
583
+ #
584
+ # Patch the specified NetApp account
585
+ #
586
+ # @param body [NetAppAccountPatch] NetApp Account object supplied in the body
587
+ # of the operation.
588
+ # @param resource_group_name [String] The name of the resource group.
589
+ # @param account_name [String] The name of the NetApp account
590
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
591
+ # will be added to the HTTP request.
592
+ #
593
+ # @return [NetAppAccount] operation results.
594
+ #
595
+ def begin_update(body, resource_group_name, account_name, custom_headers:nil)
596
+ response = begin_update_async(body, resource_group_name, account_name, custom_headers:custom_headers).value!
597
+ response.body unless response.nil?
598
+ end
599
+
600
+ #
601
+ # Update a NetApp account
602
+ #
603
+ # Patch the specified NetApp account
604
+ #
605
+ # @param body [NetAppAccountPatch] NetApp Account object supplied in the body
606
+ # of the operation.
607
+ # @param resource_group_name [String] The name of the resource group.
608
+ # @param account_name [String] The name of the NetApp account
609
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
610
+ # will be added to the HTTP request.
611
+ #
612
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
613
+ #
614
+ def begin_update_with_http_info(body, resource_group_name, account_name, custom_headers:nil)
615
+ begin_update_async(body, resource_group_name, account_name, custom_headers:custom_headers).value!
616
+ end
617
+
618
+ #
619
+ # Update a NetApp account
620
+ #
621
+ # Patch the specified NetApp account
622
+ #
623
+ # @param body [NetAppAccountPatch] NetApp Account object supplied in the body
624
+ # of the operation.
625
+ # @param resource_group_name [String] The name of the resource group.
626
+ # @param account_name [String] The name of the NetApp account
627
+ # @param [Hash{String => String}] A hash of custom headers that will be added
628
+ # to the HTTP request.
629
+ #
630
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
631
+ #
632
+ def begin_update_async(body, resource_group_name, account_name, custom_headers:nil)
633
+ fail ArgumentError, 'body is nil' if body.nil?
634
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
635
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
636
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
637
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
638
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
639
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
640
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
641
+
642
+
643
+ request_headers = {}
644
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
645
+
646
+ # Set Headers
647
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
648
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
649
+
650
+ # Serialize Request
651
+ request_mapper = Azure::NetApp::Mgmt::V2020_07_01::Models::NetAppAccountPatch.mapper()
652
+ request_content = @client.serialize(request_mapper, body)
653
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
654
+
655
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}'
656
+
657
+ request_url = @base_url || @client.base_url
658
+
659
+ options = {
660
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
661
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name},
662
+ query_params: {'api-version' => @client.api_version},
663
+ body: request_content,
664
+ headers: request_headers.merge(custom_headers || {}),
665
+ base_url: request_url
666
+ }
667
+ promise = @client.make_request_async(:patch, path_template, options)
668
+
669
+ promise = promise.then do |result|
670
+ http_response = result.response
671
+ status_code = http_response.status
672
+ response_content = http_response.body
673
+ unless status_code == 200 || status_code == 201 || status_code == 202
674
+ error_model = JSON.load(response_content)
675
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
676
+ end
677
+
678
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
679
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
680
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
681
+ # Deserialize Response
682
+ if status_code == 200
683
+ begin
684
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
685
+ result_mapper = Azure::NetApp::Mgmt::V2020_07_01::Models::NetAppAccount.mapper()
686
+ result.body = @client.deserialize(result_mapper, parsed_response)
687
+ rescue Exception => e
688
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
689
+ end
690
+ end
691
+ # Deserialize Response
692
+ if status_code == 201
693
+ begin
694
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
695
+ result_mapper = Azure::NetApp::Mgmt::V2020_07_01::Models::NetAppAccount.mapper()
696
+ result.body = @client.deserialize(result_mapper, parsed_response)
697
+ rescue Exception => e
698
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
699
+ end
700
+ end
701
+
702
+ result
703
+ end
704
+
705
+ promise.execute
706
+ end
707
+
708
+ end
709
+ end