azure_mgmt_netapp 0.22.0 → 0.23.0

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