azure_mgmt_recovery_services 0.15.2 → 0.16.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2016-06-01/generated/azure_mgmt_recovery_services.rb +11 -9
  3. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/models/client_discovery_display.rb +9 -7
  4. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/models/client_discovery_response.rb +3 -3
  5. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/models/client_discovery_value_for_single_api.rb +7 -6
  6. data/lib/{2016-12-01/generated/azure_mgmt_recovery_services/models/tracked_resource.rb → 2016-06-01/generated/azure_mgmt_recovery_services/models/patch_tracked_resource.rb} +6 -6
  7. data/lib/{2016-12-01/generated/azure_mgmt_recovery_services/models/vault.rb → 2016-06-01/generated/azure_mgmt_recovery_services/models/patch_vault.rb} +7 -7
  8. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/models/vault_certificate_response.rb +8 -3
  9. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/models/vault_extended_info_resource.rb +1 -1
  10. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/models/vault_list.rb +32 -0
  11. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/operations.rb +15 -13
  12. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/recovery_services_client.rb +4 -1
  13. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/registered_identities.rb +6 -5
  14. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/replication_usages.rb +6 -5
  15. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/usages.rb +6 -5
  16. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/vault_certificates.rb +9 -10
  17. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/vault_extended_info_operations.rb +24 -25
  18. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/vaults.rb +260 -42
  19. data/lib/azure_mgmt_recovery_services.rb +0 -1
  20. data/lib/profiles/latest/modules/recoveryservices_profile_module.rb +155 -161
  21. data/lib/profiles/latest/recoveryservices_latest_profile_client.rb +28 -9
  22. data/lib/profiles/latest/recoveryservices_module_definition.rb +0 -1
  23. data/lib/version.rb +1 -1
  24. metadata +5 -24
  25. data/lib/2016-12-01/generated/azure_mgmt_recovery_services.rb +0 -45
  26. data/lib/2016-12-01/generated/azure_mgmt_recovery_services/backup_storage_configs.rb +0 -215
  27. data/lib/2016-12-01/generated/azure_mgmt_recovery_services/backup_vault_configs.rb +0 -226
  28. data/lib/2016-12-01/generated/azure_mgmt_recovery_services/models/backup_storage_config.rb +0 -107
  29. data/lib/2016-12-01/generated/azure_mgmt_recovery_services/models/backup_vault_config.rb +0 -107
  30. data/lib/2016-12-01/generated/azure_mgmt_recovery_services/models/enhanced_security_state.rb +0 -17
  31. data/lib/2016-12-01/generated/azure_mgmt_recovery_services/models/resource.rb +0 -84
  32. data/lib/2016-12-01/generated/azure_mgmt_recovery_services/models/sku.rb +0 -47
  33. data/lib/2016-12-01/generated/azure_mgmt_recovery_services/models/sku_name.rb +0 -16
  34. data/lib/2016-12-01/generated/azure_mgmt_recovery_services/models/storage_model_type.rb +0 -17
  35. data/lib/2016-12-01/generated/azure_mgmt_recovery_services/models/storage_type.rb +0 -17
  36. data/lib/2016-12-01/generated/azure_mgmt_recovery_services/models/storage_type_state.rb +0 -17
  37. data/lib/2016-12-01/generated/azure_mgmt_recovery_services/models/trigger_type.rb +0 -16
  38. data/lib/2016-12-01/generated/azure_mgmt_recovery_services/models/upgrade_details.rb +0 -147
  39. data/lib/2016-12-01/generated/azure_mgmt_recovery_services/models/vault_extended_info_resource.rb +0 -114
  40. data/lib/2016-12-01/generated/azure_mgmt_recovery_services/models/vault_properties.rb +0 -59
  41. data/lib/2016-12-01/generated/azure_mgmt_recovery_services/models/vault_upgrade_state.rb +0 -18
  42. data/lib/2016-12-01/generated/azure_mgmt_recovery_services/module_definition.rb +0 -9
  43. data/lib/2016-12-01/generated/azure_mgmt_recovery_services/recovery_services_backup_client.rb +0 -131
@@ -1,45 +0,0 @@
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
- require 'uri'
7
- require 'cgi'
8
- require 'date'
9
- require 'json'
10
- require 'base64'
11
- require 'erb'
12
- require 'securerandom'
13
- require 'time'
14
- require 'timeliness'
15
- require 'faraday'
16
- require 'faraday-cookie_jar'
17
- require 'concurrent'
18
- require 'ms_rest'
19
- require '2016-12-01/generated/azure_mgmt_recovery_services/module_definition'
20
- require 'ms_rest_azure'
21
-
22
- module Azure::RecoveryServices::Mgmt::V2016_12_01
23
- autoload :BackupVaultConfigs, '2016-12-01/generated/azure_mgmt_recovery_services/backup_vault_configs.rb'
24
- autoload :BackupStorageConfigs, '2016-12-01/generated/azure_mgmt_recovery_services/backup_storage_configs.rb'
25
- autoload :RecoveryServicesBackupClient, '2016-12-01/generated/azure_mgmt_recovery_services/recovery_services_backup_client.rb'
26
-
27
- module Models
28
- autoload :UpgradeDetails, '2016-12-01/generated/azure_mgmt_recovery_services/models/upgrade_details.rb'
29
- autoload :VaultProperties, '2016-12-01/generated/azure_mgmt_recovery_services/models/vault_properties.rb'
30
- autoload :Sku, '2016-12-01/generated/azure_mgmt_recovery_services/models/sku.rb'
31
- autoload :Resource, '2016-12-01/generated/azure_mgmt_recovery_services/models/resource.rb'
32
- autoload :BackupStorageConfig, '2016-12-01/generated/azure_mgmt_recovery_services/models/backup_storage_config.rb'
33
- autoload :BackupVaultConfig, '2016-12-01/generated/azure_mgmt_recovery_services/models/backup_vault_config.rb'
34
- autoload :VaultExtendedInfoResource, '2016-12-01/generated/azure_mgmt_recovery_services/models/vault_extended_info_resource.rb'
35
- autoload :TrackedResource, '2016-12-01/generated/azure_mgmt_recovery_services/models/tracked_resource.rb'
36
- autoload :Vault, '2016-12-01/generated/azure_mgmt_recovery_services/models/vault.rb'
37
- autoload :StorageModelType, '2016-12-01/generated/azure_mgmt_recovery_services/models/storage_model_type.rb'
38
- autoload :StorageType, '2016-12-01/generated/azure_mgmt_recovery_services/models/storage_type.rb'
39
- autoload :StorageTypeState, '2016-12-01/generated/azure_mgmt_recovery_services/models/storage_type_state.rb'
40
- autoload :EnhancedSecurityState, '2016-12-01/generated/azure_mgmt_recovery_services/models/enhanced_security_state.rb'
41
- autoload :SkuName, '2016-12-01/generated/azure_mgmt_recovery_services/models/sku_name.rb'
42
- autoload :VaultUpgradeState, '2016-12-01/generated/azure_mgmt_recovery_services/models/vault_upgrade_state.rb'
43
- autoload :TriggerType, '2016-12-01/generated/azure_mgmt_recovery_services/models/trigger_type.rb'
44
- end
45
- end
@@ -1,215 +0,0 @@
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::RecoveryServices::Mgmt::V2016_12_01
7
- #
8
- # BackupStorageConfigs
9
- #
10
- class BackupStorageConfigs
11
- include MsRestAzure
12
-
13
- #
14
- # Creates and initializes a new instance of the BackupStorageConfigs class.
15
- # @param client service class for accessing basic functionality.
16
- #
17
- def initialize(client)
18
- @client = client
19
- end
20
-
21
- # @return [RecoveryServicesBackupClient] reference to the RecoveryServicesBackupClient
22
- attr_reader :client
23
-
24
- #
25
- # Fetches resource storage config.
26
- #
27
- # @param resource_group_name [String] The name of the resource group where the
28
- # recovery services vault is present.
29
- # @param vault_name [String] The name of the recovery services vault.
30
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
31
- # will be added to the HTTP request.
32
- #
33
- # @return [BackupStorageConfig] operation results.
34
- #
35
- def get(resource_group_name, vault_name, custom_headers = nil)
36
- response = get_async(resource_group_name, vault_name, custom_headers).value!
37
- response.body unless response.nil?
38
- end
39
-
40
- #
41
- # Fetches resource storage config.
42
- #
43
- # @param resource_group_name [String] The name of the resource group where the
44
- # recovery services vault is present.
45
- # @param vault_name [String] The name of the recovery services vault.
46
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
47
- # will be added to the HTTP request.
48
- #
49
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
50
- #
51
- def get_with_http_info(resource_group_name, vault_name, custom_headers = nil)
52
- get_async(resource_group_name, vault_name, custom_headers).value!
53
- end
54
-
55
- #
56
- # Fetches resource storage config.
57
- #
58
- # @param resource_group_name [String] The name of the resource group where the
59
- # recovery services vault is present.
60
- # @param vault_name [String] The name of the recovery services vault.
61
- # @param [Hash{String => String}] A hash of custom headers that will be added
62
- # to the HTTP request.
63
- #
64
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
65
- #
66
- def get_async(resource_group_name, vault_name, custom_headers = nil)
67
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
68
- fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
69
- fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
70
- fail ArgumentError, 'vault_name is nil' if vault_name.nil?
71
-
72
-
73
- request_headers = {}
74
-
75
- # Set Headers
76
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
77
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
78
- path_template = 'Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig'
79
-
80
- request_url = @base_url || @client.base_url
81
-
82
- options = {
83
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
84
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'vaultName' => vault_name},
85
- query_params: {'api-version' => @client.api_version},
86
- headers: request_headers.merge(custom_headers || {}),
87
- base_url: request_url
88
- }
89
- promise = @client.make_request_async(:get, path_template, options)
90
-
91
- promise = promise.then do |result|
92
- http_response = result.response
93
- status_code = http_response.status
94
- response_content = http_response.body
95
- unless status_code == 200
96
- error_model = JSON.load(response_content)
97
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
98
- end
99
-
100
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
101
- # Deserialize Response
102
- if status_code == 200
103
- begin
104
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
105
- result_mapper = Azure::RecoveryServices::Mgmt::V2016_12_01::Models::BackupStorageConfig.mapper()
106
- result.body = @client.deserialize(result_mapper, parsed_response)
107
- rescue Exception => e
108
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
109
- end
110
- end
111
-
112
- result
113
- end
114
-
115
- promise.execute
116
- end
117
-
118
- #
119
- # Updates vault storage model type.
120
- #
121
- # @param resource_group_name [String] The name of the resource group where the
122
- # recovery services vault is present.
123
- # @param vault_name [String] The name of the recovery services vault.
124
- # @param backup_storage_config [BackupStorageConfig] Backup storage config.
125
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
126
- # will be added to the HTTP request.
127
- #
128
- #
129
- def update(resource_group_name, vault_name, backup_storage_config, custom_headers = nil)
130
- response = update_async(resource_group_name, vault_name, backup_storage_config, custom_headers).value!
131
- nil
132
- end
133
-
134
- #
135
- # Updates vault storage model type.
136
- #
137
- # @param resource_group_name [String] The name of the resource group where the
138
- # recovery services vault is present.
139
- # @param vault_name [String] The name of the recovery services vault.
140
- # @param backup_storage_config [BackupStorageConfig] Backup storage config.
141
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
142
- # will be added to the HTTP request.
143
- #
144
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
145
- #
146
- def update_with_http_info(resource_group_name, vault_name, backup_storage_config, custom_headers = nil)
147
- update_async(resource_group_name, vault_name, backup_storage_config, custom_headers).value!
148
- end
149
-
150
- #
151
- # Updates vault storage model type.
152
- #
153
- # @param resource_group_name [String] The name of the resource group where the
154
- # recovery services vault is present.
155
- # @param vault_name [String] The name of the recovery services vault.
156
- # @param backup_storage_config [BackupStorageConfig] Backup storage config.
157
- # @param [Hash{String => String}] A hash of custom headers that will be added
158
- # to the HTTP request.
159
- #
160
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
161
- #
162
- def update_async(resource_group_name, vault_name, backup_storage_config, custom_headers = nil)
163
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
164
- fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
165
- fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
166
- fail ArgumentError, 'vault_name is nil' if vault_name.nil?
167
- fail ArgumentError, 'backup_storage_config is nil' if backup_storage_config.nil?
168
-
169
-
170
- request_headers = {}
171
-
172
- # Set Headers
173
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
174
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
175
-
176
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
177
-
178
- # Serialize Request
179
- request_mapper = Azure::RecoveryServices::Mgmt::V2016_12_01::Models::BackupStorageConfig.mapper()
180
- request_content = @client.serialize(request_mapper, backup_storage_config)
181
- request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
182
-
183
- path_template = 'Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig'
184
-
185
- request_url = @base_url || @client.base_url
186
-
187
- options = {
188
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
189
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'vaultName' => vault_name},
190
- query_params: {'api-version' => @client.api_version},
191
- body: request_content,
192
- headers: request_headers.merge(custom_headers || {}),
193
- base_url: request_url
194
- }
195
- promise = @client.make_request_async(:patch, path_template, options)
196
-
197
- promise = promise.then do |result|
198
- http_response = result.response
199
- status_code = http_response.status
200
- response_content = http_response.body
201
- unless status_code == 204
202
- error_model = JSON.load(response_content)
203
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
204
- end
205
-
206
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
207
-
208
- result
209
- end
210
-
211
- promise.execute
212
- end
213
-
214
- end
215
- end
@@ -1,226 +0,0 @@
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::RecoveryServices::Mgmt::V2016_12_01
7
- #
8
- # BackupVaultConfigs
9
- #
10
- class BackupVaultConfigs
11
- include MsRestAzure
12
-
13
- #
14
- # Creates and initializes a new instance of the BackupVaultConfigs class.
15
- # @param client service class for accessing basic functionality.
16
- #
17
- def initialize(client)
18
- @client = client
19
- end
20
-
21
- # @return [RecoveryServicesBackupClient] reference to the RecoveryServicesBackupClient
22
- attr_reader :client
23
-
24
- #
25
- # Fetches vault config.
26
- #
27
- # @param resource_group_name [String] The name of the resource group where the
28
- # recovery services vault is present.
29
- # @param vault_name [String] The name of the recovery services vault.
30
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
31
- # will be added to the HTTP request.
32
- #
33
- # @return [BackupVaultConfig] operation results.
34
- #
35
- def get(resource_group_name, vault_name, custom_headers = nil)
36
- response = get_async(resource_group_name, vault_name, custom_headers).value!
37
- response.body unless response.nil?
38
- end
39
-
40
- #
41
- # Fetches vault config.
42
- #
43
- # @param resource_group_name [String] The name of the resource group where the
44
- # recovery services vault is present.
45
- # @param vault_name [String] The name of the recovery services vault.
46
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
47
- # will be added to the HTTP request.
48
- #
49
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
50
- #
51
- def get_with_http_info(resource_group_name, vault_name, custom_headers = nil)
52
- get_async(resource_group_name, vault_name, custom_headers).value!
53
- end
54
-
55
- #
56
- # Fetches vault config.
57
- #
58
- # @param resource_group_name [String] The name of the resource group where the
59
- # recovery services vault is present.
60
- # @param vault_name [String] The name of the recovery services vault.
61
- # @param [Hash{String => String}] A hash of custom headers that will be added
62
- # to the HTTP request.
63
- #
64
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
65
- #
66
- def get_async(resource_group_name, vault_name, custom_headers = nil)
67
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
68
- fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
69
- fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
70
- fail ArgumentError, 'vault_name is nil' if vault_name.nil?
71
-
72
-
73
- request_headers = {}
74
-
75
- # Set Headers
76
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
77
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
78
- path_template = 'Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupconfig/vaultconfig'
79
-
80
- request_url = @base_url || @client.base_url
81
-
82
- options = {
83
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
84
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'vaultName' => vault_name},
85
- query_params: {'api-version' => @client.api_version},
86
- headers: request_headers.merge(custom_headers || {}),
87
- base_url: request_url
88
- }
89
- promise = @client.make_request_async(:get, path_template, options)
90
-
91
- promise = promise.then do |result|
92
- http_response = result.response
93
- status_code = http_response.status
94
- response_content = http_response.body
95
- unless status_code == 200
96
- error_model = JSON.load(response_content)
97
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
98
- end
99
-
100
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
101
- # Deserialize Response
102
- if status_code == 200
103
- begin
104
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
105
- result_mapper = Azure::RecoveryServices::Mgmt::V2016_12_01::Models::BackupVaultConfig.mapper()
106
- result.body = @client.deserialize(result_mapper, parsed_response)
107
- rescue Exception => e
108
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
109
- end
110
- end
111
-
112
- result
113
- end
114
-
115
- promise.execute
116
- end
117
-
118
- #
119
- # Updates vault config model type.
120
- #
121
- # @param resource_group_name [String] The name of the resource group where the
122
- # recovery services vault is present.
123
- # @param vault_name [String] The name of the recovery services vault.
124
- # @param backup_vault_config [BackupVaultConfig] Backup vault config.
125
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
126
- # will be added to the HTTP request.
127
- #
128
- # @return [BackupVaultConfig] operation results.
129
- #
130
- def update(resource_group_name, vault_name, backup_vault_config, custom_headers = nil)
131
- response = update_async(resource_group_name, vault_name, backup_vault_config, custom_headers).value!
132
- response.body unless response.nil?
133
- end
134
-
135
- #
136
- # Updates vault config model type.
137
- #
138
- # @param resource_group_name [String] The name of the resource group where the
139
- # recovery services vault is present.
140
- # @param vault_name [String] The name of the recovery services vault.
141
- # @param backup_vault_config [BackupVaultConfig] Backup vault config.
142
- # @param custom_headers [Hash{String => String}] A hash of custom headers that
143
- # will be added to the HTTP request.
144
- #
145
- # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
146
- #
147
- def update_with_http_info(resource_group_name, vault_name, backup_vault_config, custom_headers = nil)
148
- update_async(resource_group_name, vault_name, backup_vault_config, custom_headers).value!
149
- end
150
-
151
- #
152
- # Updates vault config model type.
153
- #
154
- # @param resource_group_name [String] The name of the resource group where the
155
- # recovery services vault is present.
156
- # @param vault_name [String] The name of the recovery services vault.
157
- # @param backup_vault_config [BackupVaultConfig] Backup vault config.
158
- # @param [Hash{String => String}] A hash of custom headers that will be added
159
- # to the HTTP request.
160
- #
161
- # @return [Concurrent::Promise] Promise object which holds the HTTP response.
162
- #
163
- def update_async(resource_group_name, vault_name, backup_vault_config, custom_headers = nil)
164
- fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
165
- fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
166
- fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
167
- fail ArgumentError, 'vault_name is nil' if vault_name.nil?
168
- fail ArgumentError, 'backup_vault_config is nil' if backup_vault_config.nil?
169
-
170
-
171
- request_headers = {}
172
-
173
- # Set Headers
174
- request_headers['x-ms-client-request-id'] = SecureRandom.uuid
175
- request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
176
-
177
- request_headers['Content-Type'] = 'application/json; charset=utf-8'
178
-
179
- # Serialize Request
180
- request_mapper = Azure::RecoveryServices::Mgmt::V2016_12_01::Models::BackupVaultConfig.mapper()
181
- request_content = @client.serialize(request_mapper, backup_vault_config)
182
- request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
183
-
184
- path_template = 'Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupconfig/vaultconfig'
185
-
186
- request_url = @base_url || @client.base_url
187
-
188
- options = {
189
- middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
190
- path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'vaultName' => vault_name},
191
- query_params: {'api-version' => @client.api_version},
192
- body: request_content,
193
- headers: request_headers.merge(custom_headers || {}),
194
- base_url: request_url
195
- }
196
- promise = @client.make_request_async(:patch, path_template, options)
197
-
198
- promise = promise.then do |result|
199
- http_response = result.response
200
- status_code = http_response.status
201
- response_content = http_response.body
202
- unless status_code == 200
203
- error_model = JSON.load(response_content)
204
- fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
205
- end
206
-
207
- result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
208
- # Deserialize Response
209
- if status_code == 200
210
- begin
211
- parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
212
- result_mapper = Azure::RecoveryServices::Mgmt::V2016_12_01::Models::BackupVaultConfig.mapper()
213
- result.body = @client.deserialize(result_mapper, parsed_response)
214
- rescue Exception => e
215
- fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
216
- end
217
- end
218
-
219
- result
220
- end
221
-
222
- promise.execute
223
- end
224
-
225
- end
226
- end