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,173 @@
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
+ # A service client - single point of access to the REST API.
9
+ #
10
+ class AzureNetAppFilesManagementClient < MsRestAzure::AzureServiceClient
11
+ include MsRestAzure
12
+ include MsRestAzure::Serialization
13
+
14
+ # @return [String] the base URI of the service.
15
+ attr_accessor :base_url
16
+
17
+ # @return Credentials needed for the client to connect to Azure.
18
+ attr_reader :credentials
19
+
20
+ # @return [String] Subscription credentials which uniquely identify
21
+ # Microsoft Azure subscription. The subscription ID forms part of the URI
22
+ # for every service call.
23
+ attr_accessor :subscription_id
24
+
25
+ # @return [String] Version of the API to be used with the client request.
26
+ attr_reader :api_version
27
+
28
+ # @return [String] The preferred language for the response.
29
+ attr_accessor :accept_language
30
+
31
+ # @return [Integer] The retry timeout in seconds for Long Running
32
+ # Operations. Default value is 30.
33
+ attr_accessor :long_running_operation_retry_timeout
34
+
35
+ # @return [Boolean] Whether a unique x-ms-client-request-id should be
36
+ # generated. When set to true a unique x-ms-client-request-id value is
37
+ # generated and included in each request. Default is true.
38
+ attr_accessor :generate_client_request_id
39
+
40
+ # @return [Operations] operations
41
+ attr_reader :operations
42
+
43
+ # @return [NetAppResource] net_app_resource
44
+ attr_reader :net_app_resource
45
+
46
+ # @return [Accounts] accounts
47
+ attr_reader :accounts
48
+
49
+ # @return [Pools] pools
50
+ attr_reader :pools
51
+
52
+ # @return [Volumes] volumes
53
+ attr_reader :volumes
54
+
55
+ # @return [Snapshots] snapshots
56
+ attr_reader :snapshots
57
+
58
+ # @return [SnapshotPolicies] snapshot_policies
59
+ attr_reader :snapshot_policies
60
+
61
+ # @return [AccountBackups] account_backups
62
+ attr_reader :account_backups
63
+
64
+ # @return [Backups] backups
65
+ attr_reader :backups
66
+
67
+ # @return [BackupPolicies] backup_policies
68
+ attr_reader :backup_policies
69
+
70
+ # @return [Vaults] vaults
71
+ attr_reader :vaults
72
+
73
+ #
74
+ # Creates initializes a new instance of the AzureNetAppFilesManagementClient class.
75
+ # @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
76
+ # @param base_url [String] the base URI of the service.
77
+ # @param options [Array] filters to be applied to the HTTP requests.
78
+ #
79
+ def initialize(credentials = nil, base_url = nil, options = nil)
80
+ super(credentials, options)
81
+ @base_url = base_url || 'https://management.azure.com'
82
+
83
+ fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
84
+ @credentials = credentials
85
+
86
+ @operations = Operations.new(self)
87
+ @net_app_resource = NetAppResource.new(self)
88
+ @accounts = Accounts.new(self)
89
+ @pools = Pools.new(self)
90
+ @volumes = Volumes.new(self)
91
+ @snapshots = Snapshots.new(self)
92
+ @snapshot_policies = SnapshotPolicies.new(self)
93
+ @account_backups = AccountBackups.new(self)
94
+ @backups = Backups.new(self)
95
+ @backup_policies = BackupPolicies.new(self)
96
+ @vaults = Vaults.new(self)
97
+ @api_version = '2020-11-01'
98
+ @accept_language = 'en-US'
99
+ @long_running_operation_retry_timeout = 30
100
+ @generate_client_request_id = true
101
+ add_telemetry
102
+ end
103
+
104
+ #
105
+ # Makes a request and returns the body of the response.
106
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
107
+ # @param path [String] the path, relative to {base_url}.
108
+ # @param options [Hash{String=>String}] specifying any request options like :body.
109
+ # @return [Hash{String=>String}] containing the body of the response.
110
+ # Example:
111
+ #
112
+ # request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
113
+ # path = "/path"
114
+ # options = {
115
+ # body: request_content,
116
+ # query_params: {'api-version' => '2016-02-01'}
117
+ # }
118
+ # result = @client.make_request(:put, path, options)
119
+ #
120
+ def make_request(method, path, options = {})
121
+ result = make_request_with_http_info(method, path, options)
122
+ result.body unless result.nil?
123
+ end
124
+
125
+ #
126
+ # Makes a request and returns the operation response.
127
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
128
+ # @param path [String] the path, relative to {base_url}.
129
+ # @param options [Hash{String=>String}] specifying any request options like :body.
130
+ # @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status.
131
+ #
132
+ def make_request_with_http_info(method, path, options = {})
133
+ result = make_request_async(method, path, options).value!
134
+ result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
135
+ result
136
+ end
137
+
138
+ #
139
+ # Makes a request asynchronously.
140
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
141
+ # @param path [String] the path, relative to {base_url}.
142
+ # @param options [Hash{String=>String}] specifying any request options like :body.
143
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
144
+ #
145
+ def make_request_async(method, path, options = {})
146
+ fail ArgumentError, 'method is nil' if method.nil?
147
+ fail ArgumentError, 'path is nil' if path.nil?
148
+
149
+ request_url = options[:base_url] || @base_url
150
+ if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?)
151
+ @request_headers['Content-Type'] = options[:headers]['Content-Type']
152
+ end
153
+
154
+ request_headers = @request_headers
155
+ request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
156
+ options.merge!({headers: request_headers.merge(options[:headers] || {})})
157
+ options.merge!({credentials: @credentials}) unless @credentials.nil?
158
+
159
+ super(request_url, method, path, options)
160
+ end
161
+
162
+
163
+ private
164
+ #
165
+ # Adds telemetry information.
166
+ #
167
+ def add_telemetry
168
+ sdk_information = 'azure_mgmt_netapp'
169
+ sdk_information = "#{sdk_information}/0.23.0"
170
+ add_user_agent_information(sdk_information)
171
+ end
172
+ end
173
+ end
@@ -0,0 +1,701 @@
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 BackupPolicies
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the BackupPolicies 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 backup policies
26
+ #
27
+ # List backup policies for Netapp Account
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 custom_headers [Hash{String => String}] A hash of custom headers that
32
+ # will be added to the HTTP request.
33
+ #
34
+ # @return [BackupPoliciesList] operation results.
35
+ #
36
+ def list(resource_group_name, account_name, custom_headers:nil)
37
+ response = list_async(resource_group_name, account_name, custom_headers:custom_headers).value!
38
+ response.body unless response.nil?
39
+ end
40
+
41
+ #
42
+ # List backup policies
43
+ #
44
+ # List backup policies for Netapp Account
45
+ #
46
+ # @param resource_group_name [String] The name of the resource group.
47
+ # @param account_name [String] The name of the NetApp account
48
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
49
+ # will be added to the HTTP request.
50
+ #
51
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
52
+ #
53
+ def list_with_http_info(resource_group_name, account_name, custom_headers:nil)
54
+ list_async(resource_group_name, account_name, custom_headers:custom_headers).value!
55
+ end
56
+
57
+ #
58
+ # List backup policies
59
+ #
60
+ # List backup policies for Netapp Account
61
+ #
62
+ # @param resource_group_name [String] The name of the resource group.
63
+ # @param account_name [String] The name of the NetApp account
64
+ # @param [Hash{String => String}] A hash of custom headers that will be added
65
+ # to the HTTP request.
66
+ #
67
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
68
+ #
69
+ def list_async(resource_group_name, account_name, custom_headers:nil)
70
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
71
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
72
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
73
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
74
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
75
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
76
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
77
+
78
+
79
+ request_headers = {}
80
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
81
+
82
+ # Set Headers
83
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
84
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
85
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupPolicies'
86
+
87
+ request_url = @base_url || @client.base_url
88
+
89
+ options = {
90
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
91
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name},
92
+ query_params: {'api-version' => @client.api_version},
93
+ headers: request_headers.merge(custom_headers || {}),
94
+ base_url: request_url
95
+ }
96
+ promise = @client.make_request_async(:get, path_template, options)
97
+
98
+ promise = promise.then do |result|
99
+ http_response = result.response
100
+ status_code = http_response.status
101
+ response_content = http_response.body
102
+ unless status_code == 200
103
+ error_model = JSON.load(response_content)
104
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
105
+ end
106
+
107
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
108
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
109
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
110
+ # Deserialize Response
111
+ if status_code == 200
112
+ begin
113
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
114
+ result_mapper = Azure::NetApp::Mgmt::V2020_11_01::Models::BackupPoliciesList.mapper()
115
+ result.body = @client.deserialize(result_mapper, parsed_response)
116
+ rescue Exception => e
117
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
118
+ end
119
+ end
120
+
121
+ result
122
+ end
123
+
124
+ promise.execute
125
+ end
126
+
127
+ #
128
+ # Get a backup Policy
129
+ #
130
+ # Get a particular backup Policy
131
+ #
132
+ # @param resource_group_name [String] The name of the resource group.
133
+ # @param account_name [String] The name of the NetApp account
134
+ # @param backup_policy_name [String] Backup policy Name which uniquely identify
135
+ # backup policy.
136
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
137
+ # will be added to the HTTP request.
138
+ #
139
+ # @return [BackupPolicy] operation results.
140
+ #
141
+ def get(resource_group_name, account_name, backup_policy_name, custom_headers:nil)
142
+ response = get_async(resource_group_name, account_name, backup_policy_name, custom_headers:custom_headers).value!
143
+ response.body unless response.nil?
144
+ end
145
+
146
+ #
147
+ # Get a backup Policy
148
+ #
149
+ # Get a particular backup Policy
150
+ #
151
+ # @param resource_group_name [String] The name of the resource group.
152
+ # @param account_name [String] The name of the NetApp account
153
+ # @param backup_policy_name [String] Backup policy Name which uniquely identify
154
+ # backup policy.
155
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
156
+ # will be added to the HTTP request.
157
+ #
158
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
159
+ #
160
+ def get_with_http_info(resource_group_name, account_name, backup_policy_name, custom_headers:nil)
161
+ get_async(resource_group_name, account_name, backup_policy_name, custom_headers:custom_headers).value!
162
+ end
163
+
164
+ #
165
+ # Get a backup Policy
166
+ #
167
+ # Get a particular backup Policy
168
+ #
169
+ # @param resource_group_name [String] The name of the resource group.
170
+ # @param account_name [String] The name of the NetApp account
171
+ # @param backup_policy_name [String] Backup policy Name which uniquely identify
172
+ # backup policy.
173
+ # @param [Hash{String => String}] A hash of custom headers that will be added
174
+ # to the HTTP request.
175
+ #
176
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
177
+ #
178
+ def get_async(resource_group_name, account_name, backup_policy_name, custom_headers:nil)
179
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
180
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
181
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
182
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
183
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
184
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
185
+ fail ArgumentError, 'backup_policy_name is nil' if backup_policy_name.nil?
186
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
187
+
188
+
189
+ request_headers = {}
190
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
191
+
192
+ # Set Headers
193
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
194
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
195
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupPolicies/{backupPolicyName}'
196
+
197
+ request_url = @base_url || @client.base_url
198
+
199
+ options = {
200
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
201
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'backupPolicyName' => backup_policy_name},
202
+ query_params: {'api-version' => @client.api_version},
203
+ headers: request_headers.merge(custom_headers || {}),
204
+ base_url: request_url
205
+ }
206
+ promise = @client.make_request_async(:get, path_template, options)
207
+
208
+ promise = promise.then do |result|
209
+ http_response = result.response
210
+ status_code = http_response.status
211
+ response_content = http_response.body
212
+ unless status_code == 200
213
+ error_model = JSON.load(response_content)
214
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
215
+ end
216
+
217
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
218
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
219
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
220
+ # Deserialize Response
221
+ if status_code == 200
222
+ begin
223
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
224
+ result_mapper = Azure::NetApp::Mgmt::V2020_11_01::Models::BackupPolicy.mapper()
225
+ result.body = @client.deserialize(result_mapper, parsed_response)
226
+ rescue Exception => e
227
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
228
+ end
229
+ end
230
+
231
+ result
232
+ end
233
+
234
+ promise.execute
235
+ end
236
+
237
+ #
238
+ # Create a backup policy
239
+ #
240
+ # Create a backup policy for Netapp Account
241
+ #
242
+ # @param resource_group_name [String] The name of the resource group.
243
+ # @param account_name [String] The name of the NetApp account
244
+ # @param backup_policy_name [String] Backup policy Name which uniquely identify
245
+ # backup policy.
246
+ # @param body [BackupPolicy] Backup policy object supplied in the body of the
247
+ # operation.
248
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
249
+ # will be added to the HTTP request.
250
+ #
251
+ # @return [BackupPolicy] operation results.
252
+ #
253
+ def create(resource_group_name, account_name, backup_policy_name, body, custom_headers:nil)
254
+ response = create_async(resource_group_name, account_name, backup_policy_name, body, custom_headers:custom_headers).value!
255
+ response.body unless response.nil?
256
+ end
257
+
258
+ #
259
+ # @param resource_group_name [String] The name of the resource group.
260
+ # @param account_name [String] The name of the NetApp account
261
+ # @param backup_policy_name [String] Backup policy Name which uniquely identify
262
+ # backup policy.
263
+ # @param body [BackupPolicy] Backup policy object supplied in the body of the
264
+ # operation.
265
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
266
+ # will be added to the HTTP request.
267
+ #
268
+ # @return [Concurrent::Promise] promise which provides async access to http
269
+ # response.
270
+ #
271
+ def create_async(resource_group_name, account_name, backup_policy_name, body, custom_headers:nil)
272
+ # Send request
273
+ promise = begin_create_async(resource_group_name, account_name, backup_policy_name, body, custom_headers:custom_headers)
274
+
275
+ promise = promise.then do |response|
276
+ # Defining deserialization method.
277
+ deserialize_method = lambda do |parsed_response|
278
+ result_mapper = Azure::NetApp::Mgmt::V2020_11_01::Models::BackupPolicy.mapper()
279
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
280
+ end
281
+
282
+ # Waiting for response.
283
+ @client.get_long_running_operation_result(response, deserialize_method)
284
+ end
285
+
286
+ promise
287
+ end
288
+
289
+ #
290
+ # Patch a backup policy
291
+ #
292
+ # Patch a backup policy for Netapp Account
293
+ #
294
+ # @param resource_group_name [String] The name of the resource group.
295
+ # @param account_name [String] The name of the NetApp account
296
+ # @param backup_policy_name [String] Backup policy Name which uniquely identify
297
+ # backup policy.
298
+ # @param body [BackupPolicyPatch] Backup policy object supplied in the body of
299
+ # the operation.
300
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
301
+ # will be added to the HTTP request.
302
+ #
303
+ # @return [BackupPolicy] operation results.
304
+ #
305
+ def update(resource_group_name, account_name, backup_policy_name, body, custom_headers:nil)
306
+ response = update_async(resource_group_name, account_name, backup_policy_name, body, custom_headers:custom_headers).value!
307
+ response.body unless response.nil?
308
+ end
309
+
310
+ #
311
+ # Patch a backup policy
312
+ #
313
+ # Patch a backup policy for Netapp Account
314
+ #
315
+ # @param resource_group_name [String] The name of the resource group.
316
+ # @param account_name [String] The name of the NetApp account
317
+ # @param backup_policy_name [String] Backup policy Name which uniquely identify
318
+ # backup policy.
319
+ # @param body [BackupPolicyPatch] Backup policy object supplied in the body of
320
+ # the operation.
321
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
322
+ # will be added to the HTTP request.
323
+ #
324
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
325
+ #
326
+ def update_with_http_info(resource_group_name, account_name, backup_policy_name, body, custom_headers:nil)
327
+ update_async(resource_group_name, account_name, backup_policy_name, body, custom_headers:custom_headers).value!
328
+ end
329
+
330
+ #
331
+ # Patch a backup policy
332
+ #
333
+ # Patch a backup policy for Netapp Account
334
+ #
335
+ # @param resource_group_name [String] The name of the resource group.
336
+ # @param account_name [String] The name of the NetApp account
337
+ # @param backup_policy_name [String] Backup policy Name which uniquely identify
338
+ # backup policy.
339
+ # @param body [BackupPolicyPatch] Backup policy object supplied in the body of
340
+ # the operation.
341
+ # @param [Hash{String => String}] A hash of custom headers that will be added
342
+ # to the HTTP request.
343
+ #
344
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
345
+ #
346
+ def update_async(resource_group_name, account_name, backup_policy_name, body, custom_headers:nil)
347
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
348
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
349
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
350
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
351
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
352
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
353
+ fail ArgumentError, 'backup_policy_name is nil' if backup_policy_name.nil?
354
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
355
+ fail ArgumentError, 'body is nil' if body.nil?
356
+
357
+
358
+ request_headers = {}
359
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
360
+
361
+ # Set Headers
362
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
363
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
364
+
365
+ # Serialize Request
366
+ request_mapper = Azure::NetApp::Mgmt::V2020_11_01::Models::BackupPolicyPatch.mapper()
367
+ request_content = @client.serialize(request_mapper, body)
368
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
369
+
370
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupPolicies/{backupPolicyName}'
371
+
372
+ request_url = @base_url || @client.base_url
373
+
374
+ options = {
375
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
376
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'backupPolicyName' => backup_policy_name},
377
+ query_params: {'api-version' => @client.api_version},
378
+ body: request_content,
379
+ headers: request_headers.merge(custom_headers || {}),
380
+ base_url: request_url
381
+ }
382
+ promise = @client.make_request_async(:patch, path_template, options)
383
+
384
+ promise = promise.then do |result|
385
+ http_response = result.response
386
+ status_code = http_response.status
387
+ response_content = http_response.body
388
+ unless status_code == 200 || status_code == 202
389
+ error_model = JSON.load(response_content)
390
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
391
+ end
392
+
393
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
394
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
395
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
396
+ # Deserialize Response
397
+ if status_code == 200
398
+ begin
399
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
400
+ result_mapper = Azure::NetApp::Mgmt::V2020_11_01::Models::BackupPolicy.mapper()
401
+ result.body = @client.deserialize(result_mapper, parsed_response)
402
+ rescue Exception => e
403
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
404
+ end
405
+ end
406
+ # Deserialize Response
407
+ if status_code == 202
408
+ begin
409
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
410
+ result_mapper = Azure::NetApp::Mgmt::V2020_11_01::Models::BackupPolicy.mapper()
411
+ result.body = @client.deserialize(result_mapper, parsed_response)
412
+ rescue Exception => e
413
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
414
+ end
415
+ end
416
+
417
+ result
418
+ end
419
+
420
+ promise.execute
421
+ end
422
+
423
+ #
424
+ # Delete a backup policy
425
+ #
426
+ # Delete backup policy
427
+ #
428
+ # @param resource_group_name [String] The name of the resource group.
429
+ # @param account_name [String] The name of the NetApp account
430
+ # @param backup_policy_name [String] Backup policy Name which uniquely identify
431
+ # backup policy.
432
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
433
+ # will be added to the HTTP request.
434
+ #
435
+ def delete(resource_group_name, account_name, backup_policy_name, custom_headers:nil)
436
+ response = delete_async(resource_group_name, account_name, backup_policy_name, custom_headers:custom_headers).value!
437
+ nil
438
+ end
439
+
440
+ #
441
+ # @param resource_group_name [String] The name of the resource group.
442
+ # @param account_name [String] The name of the NetApp account
443
+ # @param backup_policy_name [String] Backup policy Name which uniquely identify
444
+ # backup policy.
445
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
446
+ # will be added to the HTTP request.
447
+ #
448
+ # @return [Concurrent::Promise] promise which provides async access to http
449
+ # response.
450
+ #
451
+ def delete_async(resource_group_name, account_name, backup_policy_name, custom_headers:nil)
452
+ # Send request
453
+ promise = begin_delete_async(resource_group_name, account_name, backup_policy_name, custom_headers:custom_headers)
454
+
455
+ promise = promise.then do |response|
456
+ # Defining deserialization method.
457
+ deserialize_method = lambda do |parsed_response|
458
+ end
459
+
460
+ # Waiting for response.
461
+ @client.get_long_running_operation_result(response, deserialize_method)
462
+ end
463
+
464
+ promise
465
+ end
466
+
467
+ #
468
+ # Create a backup policy
469
+ #
470
+ # Create a backup policy for Netapp Account
471
+ #
472
+ # @param resource_group_name [String] The name of the resource group.
473
+ # @param account_name [String] The name of the NetApp account
474
+ # @param backup_policy_name [String] Backup policy Name which uniquely identify
475
+ # backup policy.
476
+ # @param body [BackupPolicy] Backup policy object supplied in the body of the
477
+ # operation.
478
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
479
+ # will be added to the HTTP request.
480
+ #
481
+ # @return [BackupPolicy] operation results.
482
+ #
483
+ def begin_create(resource_group_name, account_name, backup_policy_name, body, custom_headers:nil)
484
+ response = begin_create_async(resource_group_name, account_name, backup_policy_name, body, custom_headers:custom_headers).value!
485
+ response.body unless response.nil?
486
+ end
487
+
488
+ #
489
+ # Create a backup policy
490
+ #
491
+ # Create a backup policy for Netapp Account
492
+ #
493
+ # @param resource_group_name [String] The name of the resource group.
494
+ # @param account_name [String] The name of the NetApp account
495
+ # @param backup_policy_name [String] Backup policy Name which uniquely identify
496
+ # backup policy.
497
+ # @param body [BackupPolicy] Backup policy object supplied in the body of the
498
+ # operation.
499
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
500
+ # will be added to the HTTP request.
501
+ #
502
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
503
+ #
504
+ def begin_create_with_http_info(resource_group_name, account_name, backup_policy_name, body, custom_headers:nil)
505
+ begin_create_async(resource_group_name, account_name, backup_policy_name, body, custom_headers:custom_headers).value!
506
+ end
507
+
508
+ #
509
+ # Create a backup policy
510
+ #
511
+ # Create a backup policy for Netapp Account
512
+ #
513
+ # @param resource_group_name [String] The name of the resource group.
514
+ # @param account_name [String] The name of the NetApp account
515
+ # @param backup_policy_name [String] Backup policy Name which uniquely identify
516
+ # backup policy.
517
+ # @param body [BackupPolicy] Backup policy object supplied in the body of the
518
+ # operation.
519
+ # @param [Hash{String => String}] A hash of custom headers that will be added
520
+ # to the HTTP request.
521
+ #
522
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
523
+ #
524
+ def begin_create_async(resource_group_name, account_name, backup_policy_name, body, custom_headers:nil)
525
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
526
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
527
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
528
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
529
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
530
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
531
+ fail ArgumentError, 'backup_policy_name is nil' if backup_policy_name.nil?
532
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
533
+ fail ArgumentError, 'body is nil' if body.nil?
534
+
535
+
536
+ request_headers = {}
537
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
538
+
539
+ # Set Headers
540
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
541
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
542
+
543
+ # Serialize Request
544
+ request_mapper = Azure::NetApp::Mgmt::V2020_11_01::Models::BackupPolicy.mapper()
545
+ request_content = @client.serialize(request_mapper, body)
546
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
547
+
548
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupPolicies/{backupPolicyName}'
549
+
550
+ request_url = @base_url || @client.base_url
551
+
552
+ options = {
553
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
554
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'backupPolicyName' => backup_policy_name},
555
+ query_params: {'api-version' => @client.api_version},
556
+ body: request_content,
557
+ headers: request_headers.merge(custom_headers || {}),
558
+ base_url: request_url
559
+ }
560
+ promise = @client.make_request_async(:put, 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 == 200 || status_code == 201 || status_code == 202
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
+ # Deserialize Response
575
+ if status_code == 200
576
+ begin
577
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
578
+ result_mapper = Azure::NetApp::Mgmt::V2020_11_01::Models::BackupPolicy.mapper()
579
+ result.body = @client.deserialize(result_mapper, parsed_response)
580
+ rescue Exception => e
581
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
582
+ end
583
+ end
584
+ # Deserialize Response
585
+ if status_code == 201
586
+ begin
587
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
588
+ result_mapper = Azure::NetApp::Mgmt::V2020_11_01::Models::BackupPolicy.mapper()
589
+ result.body = @client.deserialize(result_mapper, parsed_response)
590
+ rescue Exception => e
591
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
592
+ end
593
+ end
594
+
595
+ result
596
+ end
597
+
598
+ promise.execute
599
+ end
600
+
601
+ #
602
+ # Delete a backup policy
603
+ #
604
+ # Delete backup policy
605
+ #
606
+ # @param resource_group_name [String] The name of the resource group.
607
+ # @param account_name [String] The name of the NetApp account
608
+ # @param backup_policy_name [String] Backup policy Name which uniquely identify
609
+ # backup policy.
610
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
611
+ # will be added to the HTTP request.
612
+ #
613
+ #
614
+ def begin_delete(resource_group_name, account_name, backup_policy_name, custom_headers:nil)
615
+ response = begin_delete_async(resource_group_name, account_name, backup_policy_name, custom_headers:custom_headers).value!
616
+ nil
617
+ end
618
+
619
+ #
620
+ # Delete a backup policy
621
+ #
622
+ # Delete backup policy
623
+ #
624
+ # @param resource_group_name [String] The name of the resource group.
625
+ # @param account_name [String] The name of the NetApp account
626
+ # @param backup_policy_name [String] Backup policy Name which uniquely identify
627
+ # backup policy.
628
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
629
+ # will be added to the HTTP request.
630
+ #
631
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
632
+ #
633
+ def begin_delete_with_http_info(resource_group_name, account_name, backup_policy_name, custom_headers:nil)
634
+ begin_delete_async(resource_group_name, account_name, backup_policy_name, custom_headers:custom_headers).value!
635
+ end
636
+
637
+ #
638
+ # Delete a backup policy
639
+ #
640
+ # Delete backup policy
641
+ #
642
+ # @param resource_group_name [String] The name of the resource group.
643
+ # @param account_name [String] The name of the NetApp account
644
+ # @param backup_policy_name [String] Backup policy Name which uniquely identify
645
+ # backup policy.
646
+ # @param [Hash{String => String}] A hash of custom headers that will be added
647
+ # to the HTTP request.
648
+ #
649
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
650
+ #
651
+ def begin_delete_async(resource_group_name, account_name, backup_policy_name, custom_headers:nil)
652
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
653
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
654
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
655
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
656
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
657
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
658
+ fail ArgumentError, 'backup_policy_name is nil' if backup_policy_name.nil?
659
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
660
+
661
+
662
+ request_headers = {}
663
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
664
+
665
+ # Set Headers
666
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
667
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
668
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/backupPolicies/{backupPolicyName}'
669
+
670
+ request_url = @base_url || @client.base_url
671
+
672
+ options = {
673
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
674
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'accountName' => account_name,'backupPolicyName' => backup_policy_name},
675
+ query_params: {'api-version' => @client.api_version},
676
+ headers: request_headers.merge(custom_headers || {}),
677
+ base_url: request_url
678
+ }
679
+ promise = @client.make_request_async(:delete, path_template, options)
680
+
681
+ promise = promise.then do |result|
682
+ http_response = result.response
683
+ status_code = http_response.status
684
+ response_content = http_response.body
685
+ unless status_code == 200 || status_code == 202 || status_code == 204
686
+ error_model = JSON.load(response_content)
687
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
688
+ end
689
+
690
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
691
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
692
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
693
+
694
+ result
695
+ end
696
+
697
+ promise.execute
698
+ end
699
+
700
+ end
701
+ end