azure_mgmt_recovery_services 0.10.0 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/lib/generated/azure_mgmt_recovery_services.rb +40 -1
  3. data/lib/generated/azure_mgmt_recovery_services/backup_storage_configs.rb +215 -0
  4. data/lib/generated/azure_mgmt_recovery_services/backup_vault_configs.rb +226 -0
  5. data/lib/generated/azure_mgmt_recovery_services/models/auth_type.rb +19 -0
  6. data/lib/generated/azure_mgmt_recovery_services/models/backup_storage_config.rb +100 -0
  7. data/lib/generated/azure_mgmt_recovery_services/models/backup_vault_config.rb +100 -0
  8. data/lib/generated/azure_mgmt_recovery_services/models/certificate_request.rb +46 -0
  9. data/lib/generated/azure_mgmt_recovery_services/models/client_discovery_display.rb +79 -0
  10. data/lib/generated/azure_mgmt_recovery_services/models/client_discovery_for_log_specification.rb +68 -0
  11. data/lib/generated/azure_mgmt_recovery_services/models/client_discovery_for_service_specification.rb +55 -0
  12. data/lib/generated/azure_mgmt_recovery_services/models/client_discovery_response.rb +97 -0
  13. data/lib/generated/azure_mgmt_recovery_services/models/client_discovery_value_for_single_api.rb +82 -0
  14. data/lib/generated/azure_mgmt_recovery_services/models/enhanced_security_state.rb +17 -0
  15. data/lib/generated/azure_mgmt_recovery_services/models/jobs_summary.rb +65 -0
  16. data/lib/generated/azure_mgmt_recovery_services/models/monitoring_summary.rb +97 -0
  17. data/lib/generated/azure_mgmt_recovery_services/models/name_info.rb +55 -0
  18. data/lib/generated/azure_mgmt_recovery_services/models/raw_certificate_data.rb +57 -0
  19. data/lib/generated/azure_mgmt_recovery_services/models/replication_usage.rb +100 -0
  20. data/lib/generated/azure_mgmt_recovery_services/models/replication_usage_list.rb +54 -0
  21. data/lib/generated/azure_mgmt_recovery_services/models/resource.rb +7 -29
  22. data/lib/generated/azure_mgmt_recovery_services/models/resource_certificate_and_aad_details.rb +155 -0
  23. data/lib/generated/azure_mgmt_recovery_services/models/resource_certificate_and_acs_details.rb +135 -0
  24. data/lib/generated/azure_mgmt_recovery_services/models/resource_certificate_details.rb +128 -0
  25. data/lib/generated/azure_mgmt_recovery_services/models/sku.rb +2 -1
  26. data/lib/generated/azure_mgmt_recovery_services/models/sku_name.rb +1 -1
  27. data/lib/generated/azure_mgmt_recovery_services/models/storage_model_type.rb +17 -0
  28. data/lib/generated/azure_mgmt_recovery_services/models/storage_type.rb +17 -0
  29. data/lib/generated/azure_mgmt_recovery_services/models/storage_type_state.rb +17 -0
  30. data/lib/generated/azure_mgmt_recovery_services/models/tracked_resource.rb +93 -0
  31. data/lib/generated/azure_mgmt_recovery_services/models/trigger_type.rb +16 -0
  32. data/lib/generated/azure_mgmt_recovery_services/models/upgrade_details.rb +138 -0
  33. data/lib/generated/azure_mgmt_recovery_services/models/usages_unit.rb +20 -0
  34. data/lib/generated/azure_mgmt_recovery_services/models/vault.rb +19 -19
  35. data/lib/generated/azure_mgmt_recovery_services/models/vault_certificate_response.rb +79 -0
  36. data/lib/generated/azure_mgmt_recovery_services/models/vault_extended_info_resource.rb +106 -0
  37. data/lib/generated/azure_mgmt_recovery_services/models/vault_list.rb +13 -32
  38. data/lib/generated/azure_mgmt_recovery_services/models/vault_properties.rb +13 -1
  39. data/lib/generated/azure_mgmt_recovery_services/models/vault_upgrade_state.rb +18 -0
  40. data/lib/generated/azure_mgmt_recovery_services/models/vault_usage.rb +98 -0
  41. data/lib/generated/azure_mgmt_recovery_services/models/vault_usage_list.rb +53 -0
  42. data/lib/generated/azure_mgmt_recovery_services/module_definition.rb +1 -1
  43. data/lib/generated/azure_mgmt_recovery_services/operations.rb +224 -0
  44. data/lib/generated/azure_mgmt_recovery_services/recovery_services_client.rb +33 -5
  45. data/lib/generated/azure_mgmt_recovery_services/registered_identities.rb +112 -0
  46. data/lib/generated/azure_mgmt_recovery_services/replication_usages.rb +119 -0
  47. data/lib/generated/azure_mgmt_recovery_services/usages.rb +119 -0
  48. data/lib/generated/azure_mgmt_recovery_services/vault_certificates.rb +139 -0
  49. data/lib/generated/azure_mgmt_recovery_services/vault_extended_info_operations.rb +339 -0
  50. data/lib/generated/azure_mgmt_recovery_services/vaults.rb +230 -139
  51. data/lib/generated/azure_mgmt_recovery_services/version.rb +2 -2
  52. metadata +43 -4
@@ -0,0 +1,119 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::ARM::RecoveryServices
7
+ #
8
+ # Recovery Services Client
9
+ #
10
+ class ReplicationUsages
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the ReplicationUsages class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [RecoveryServicesClient] reference to the RecoveryServicesClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Fetches the replication usages of the vault.
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 [ReplicationUsageList] operation results.
34
+ #
35
+ def list(resource_group_name, vault_name, custom_headers = nil)
36
+ response = list_async(resource_group_name, vault_name, custom_headers).value!
37
+ response.body unless response.nil?
38
+ end
39
+
40
+ #
41
+ # Fetches the replication usages of the vault.
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 list_with_http_info(resource_group_name, vault_name, custom_headers = nil)
52
+ list_async(resource_group_name, vault_name, custom_headers).value!
53
+ end
54
+
55
+ #
56
+ # Fetches the replication usages of the vault.
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 list_async(resource_group_name, vault_name, custom_headers = nil)
67
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
68
+ api_version = '2016-06-01'
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}/replicationUsages'
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' => 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::ARM::RecoveryServices::Models::ReplicationUsageList.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
+ end
119
+ end
@@ -0,0 +1,119 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::ARM::RecoveryServices
7
+ #
8
+ # Recovery Services Client
9
+ #
10
+ class Usages
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Usages class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [RecoveryServicesClient] reference to the RecoveryServicesClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Fetches the usages of the vault.
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 [VaultUsageList] operation results.
34
+ #
35
+ def list_by_vaults(resource_group_name, vault_name, custom_headers = nil)
36
+ response = list_by_vaults_async(resource_group_name, vault_name, custom_headers).value!
37
+ response.body unless response.nil?
38
+ end
39
+
40
+ #
41
+ # Fetches the usages of the vault.
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 list_by_vaults_with_http_info(resource_group_name, vault_name, custom_headers = nil)
52
+ list_by_vaults_async(resource_group_name, vault_name, custom_headers).value!
53
+ end
54
+
55
+ #
56
+ # Fetches the usages of the vault.
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 list_by_vaults_async(resource_group_name, vault_name, custom_headers = nil)
67
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
68
+ api_version = '2016-06-01'
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}/usages'
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' => 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::ARM::RecoveryServices::Models::VaultUsageList.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
+ end
119
+ end
@@ -0,0 +1,139 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::ARM::RecoveryServices
7
+ #
8
+ # Recovery Services Client
9
+ #
10
+ class VaultCertificates
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the VaultCertificates class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [RecoveryServicesClient] reference to the RecoveryServicesClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Upload a certificate for a resource.
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 certificate_name [String] Certificate friendly name.
31
+ # @param certificate_request [CertificateRequest] Input parameters for
32
+ # uploading the vault certificate.
33
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
34
+ # will be added to the HTTP request.
35
+ #
36
+ # @return [VaultCertificateResponse] operation results.
37
+ #
38
+ def create(resource_group_name, vault_name, certificate_name, certificate_request, custom_headers = nil)
39
+ response = create_async(resource_group_name, vault_name, certificate_name, certificate_request, custom_headers).value!
40
+ response.body unless response.nil?
41
+ end
42
+
43
+ #
44
+ # Upload a certificate for a resource.
45
+ #
46
+ # @param resource_group_name [String] The name of the resource group where the
47
+ # recovery services vault is present.
48
+ # @param vault_name [String] The name of the recovery services vault.
49
+ # @param certificate_name [String] Certificate friendly name.
50
+ # @param certificate_request [CertificateRequest] Input parameters for
51
+ # uploading the vault certificate.
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 create_with_http_info(resource_group_name, vault_name, certificate_name, certificate_request, custom_headers = nil)
58
+ create_async(resource_group_name, vault_name, certificate_name, certificate_request, custom_headers).value!
59
+ end
60
+
61
+ #
62
+ # Upload a certificate for a resource.
63
+ #
64
+ # @param resource_group_name [String] The name of the resource group where the
65
+ # recovery services vault is present.
66
+ # @param vault_name [String] The name of the recovery services vault.
67
+ # @param certificate_name [String] Certificate friendly name.
68
+ # @param certificate_request [CertificateRequest] Input parameters for
69
+ # uploading the vault certificate.
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 create_async(resource_group_name, vault_name, certificate_name, certificate_request, custom_headers = nil)
76
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
77
+ api_version = '2016-06-01'
78
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
79
+ fail ArgumentError, 'vault_name is nil' if vault_name.nil?
80
+ fail ArgumentError, 'certificate_name is nil' if certificate_name.nil?
81
+ fail ArgumentError, 'certificate_request is nil' if certificate_request.nil?
82
+
83
+
84
+ request_headers = {}
85
+
86
+ # Set Headers
87
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
88
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
89
+
90
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
91
+
92
+ # Serialize Request
93
+ request_mapper = Azure::ARM::RecoveryServices::Models::CertificateRequest.mapper()
94
+ request_content = @client.serialize(request_mapper, certificate_request)
95
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
96
+
97
+ path_template = 'Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/certificates/{certificateName}'
98
+
99
+ request_url = @base_url || @client.base_url
100
+
101
+ options = {
102
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
103
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'vaultName' => vault_name,'certificateName' => certificate_name},
104
+ query_params: {'api-version' => api_version},
105
+ body: request_content,
106
+ headers: request_headers.merge(custom_headers || {}),
107
+ base_url: request_url
108
+ }
109
+ promise = @client.make_request_async(:put, path_template, options)
110
+
111
+ promise = promise.then do |result|
112
+ http_response = result.response
113
+ status_code = http_response.status
114
+ response_content = http_response.body
115
+ unless status_code == 200
116
+ error_model = JSON.load(response_content)
117
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
118
+ end
119
+
120
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
121
+ # Deserialize Response
122
+ if status_code == 200
123
+ begin
124
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
125
+ result_mapper = Azure::ARM::RecoveryServices::Models::VaultCertificateResponse.mapper()
126
+ result.body = @client.deserialize(result_mapper, parsed_response)
127
+ rescue Exception => e
128
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
129
+ end
130
+ end
131
+
132
+ result
133
+ end
134
+
135
+ promise.execute
136
+ end
137
+
138
+ end
139
+ end
@@ -0,0 +1,339 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::ARM::RecoveryServices
7
+ #
8
+ # Recovery Services Client
9
+ #
10
+ class VaultExtendedInfoOperations
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the VaultExtendedInfoOperations class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [RecoveryServicesClient] reference to the RecoveryServicesClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Get the vault extended info.
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 [VaultExtendedInfoResource] 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
+ # Get the vault extended info.
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
+ # Get the vault extended info.
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
+ api_version = '2016-06-01'
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}/extendedInformation/vaultExtendedInfo'
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' => 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::ARM::RecoveryServices::Models::VaultExtendedInfoResource.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
+ # Create vault extended info.
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 resource_resource_extended_info_details [VaultExtendedInfoResource]
125
+ # resourceResourceExtendedInfoDetails
126
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
127
+ # will be added to the HTTP request.
128
+ #
129
+ # @return [VaultExtendedInfoResource] operation results.
130
+ #
131
+ def create_or_update(resource_group_name, vault_name, resource_resource_extended_info_details, custom_headers = nil)
132
+ response = create_or_update_async(resource_group_name, vault_name, resource_resource_extended_info_details, custom_headers).value!
133
+ response.body unless response.nil?
134
+ end
135
+
136
+ #
137
+ # Create vault extended info.
138
+ #
139
+ # @param resource_group_name [String] The name of the resource group where the
140
+ # recovery services vault is present.
141
+ # @param vault_name [String] The name of the recovery services vault.
142
+ # @param resource_resource_extended_info_details [VaultExtendedInfoResource]
143
+ # resourceResourceExtendedInfoDetails
144
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
145
+ # will be added to the HTTP request.
146
+ #
147
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
148
+ #
149
+ def create_or_update_with_http_info(resource_group_name, vault_name, resource_resource_extended_info_details, custom_headers = nil)
150
+ create_or_update_async(resource_group_name, vault_name, resource_resource_extended_info_details, custom_headers).value!
151
+ end
152
+
153
+ #
154
+ # Create vault extended info.
155
+ #
156
+ # @param resource_group_name [String] The name of the resource group where the
157
+ # recovery services vault is present.
158
+ # @param vault_name [String] The name of the recovery services vault.
159
+ # @param resource_resource_extended_info_details [VaultExtendedInfoResource]
160
+ # resourceResourceExtendedInfoDetails
161
+ # @param [Hash{String => String}] A hash of custom headers that will be added
162
+ # to the HTTP request.
163
+ #
164
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
165
+ #
166
+ def create_or_update_async(resource_group_name, vault_name, resource_resource_extended_info_details, custom_headers = nil)
167
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
168
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
169
+ fail ArgumentError, 'vault_name is nil' if vault_name.nil?
170
+ api_version = '2016-06-01'
171
+ fail ArgumentError, 'resource_resource_extended_info_details is nil' if resource_resource_extended_info_details.nil?
172
+
173
+
174
+ request_headers = {}
175
+
176
+ # Set Headers
177
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
178
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
179
+
180
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
181
+
182
+ # Serialize Request
183
+ request_mapper = Azure::ARM::RecoveryServices::Models::VaultExtendedInfoResource.mapper()
184
+ request_content = @client.serialize(request_mapper, resource_resource_extended_info_details)
185
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
186
+
187
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/extendedInformation/vaultExtendedInfo'
188
+
189
+ request_url = @base_url || @client.base_url
190
+
191
+ options = {
192
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
193
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'vaultName' => vault_name},
194
+ query_params: {'api-version' => api_version},
195
+ body: request_content,
196
+ headers: request_headers.merge(custom_headers || {}),
197
+ base_url: request_url
198
+ }
199
+ promise = @client.make_request_async(:put, path_template, options)
200
+
201
+ promise = promise.then do |result|
202
+ http_response = result.response
203
+ status_code = http_response.status
204
+ response_content = http_response.body
205
+ unless status_code == 200
206
+ error_model = JSON.load(response_content)
207
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
208
+ end
209
+
210
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
211
+ # Deserialize Response
212
+ if status_code == 200
213
+ begin
214
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
215
+ result_mapper = Azure::ARM::RecoveryServices::Models::VaultExtendedInfoResource.mapper()
216
+ result.body = @client.deserialize(result_mapper, parsed_response)
217
+ rescue Exception => e
218
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
219
+ end
220
+ end
221
+
222
+ result
223
+ end
224
+
225
+ promise.execute
226
+ end
227
+
228
+ #
229
+ # Update vault extended info.
230
+ #
231
+ # @param resource_group_name [String] The name of the resource group where the
232
+ # recovery services vault is present.
233
+ # @param vault_name [String] The name of the recovery services vault.
234
+ # @param resource_resource_extended_info_details [VaultExtendedInfoResource]
235
+ # resourceResourceExtendedInfoDetails
236
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
237
+ # will be added to the HTTP request.
238
+ #
239
+ # @return [VaultExtendedInfoResource] operation results.
240
+ #
241
+ def update(resource_group_name, vault_name, resource_resource_extended_info_details, custom_headers = nil)
242
+ response = update_async(resource_group_name, vault_name, resource_resource_extended_info_details, custom_headers).value!
243
+ response.body unless response.nil?
244
+ end
245
+
246
+ #
247
+ # Update vault extended info.
248
+ #
249
+ # @param resource_group_name [String] The name of the resource group where the
250
+ # recovery services vault is present.
251
+ # @param vault_name [String] The name of the recovery services vault.
252
+ # @param resource_resource_extended_info_details [VaultExtendedInfoResource]
253
+ # resourceResourceExtendedInfoDetails
254
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
255
+ # will be added to the HTTP request.
256
+ #
257
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
258
+ #
259
+ def update_with_http_info(resource_group_name, vault_name, resource_resource_extended_info_details, custom_headers = nil)
260
+ update_async(resource_group_name, vault_name, resource_resource_extended_info_details, custom_headers).value!
261
+ end
262
+
263
+ #
264
+ # Update vault extended info.
265
+ #
266
+ # @param resource_group_name [String] The name of the resource group where the
267
+ # recovery services vault is present.
268
+ # @param vault_name [String] The name of the recovery services vault.
269
+ # @param resource_resource_extended_info_details [VaultExtendedInfoResource]
270
+ # resourceResourceExtendedInfoDetails
271
+ # @param [Hash{String => String}] A hash of custom headers that will be added
272
+ # to the HTTP request.
273
+ #
274
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
275
+ #
276
+ def update_async(resource_group_name, vault_name, resource_resource_extended_info_details, custom_headers = nil)
277
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
278
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
279
+ fail ArgumentError, 'vault_name is nil' if vault_name.nil?
280
+ api_version = '2016-06-01'
281
+ fail ArgumentError, 'resource_resource_extended_info_details is nil' if resource_resource_extended_info_details.nil?
282
+
283
+
284
+ request_headers = {}
285
+
286
+ # Set Headers
287
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
288
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
289
+
290
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
291
+
292
+ # Serialize Request
293
+ request_mapper = Azure::ARM::RecoveryServices::Models::VaultExtendedInfoResource.mapper()
294
+ request_content = @client.serialize(request_mapper, resource_resource_extended_info_details)
295
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
296
+
297
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/extendedInformation/vaultExtendedInfo'
298
+
299
+ request_url = @base_url || @client.base_url
300
+
301
+ options = {
302
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
303
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'vaultName' => vault_name},
304
+ query_params: {'api-version' => api_version},
305
+ body: request_content,
306
+ headers: request_headers.merge(custom_headers || {}),
307
+ base_url: request_url
308
+ }
309
+ promise = @client.make_request_async(:patch, path_template, options)
310
+
311
+ promise = promise.then do |result|
312
+ http_response = result.response
313
+ status_code = http_response.status
314
+ response_content = http_response.body
315
+ unless status_code == 200
316
+ error_model = JSON.load(response_content)
317
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
318
+ end
319
+
320
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
321
+ # Deserialize Response
322
+ if status_code == 200
323
+ begin
324
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
325
+ result_mapper = Azure::ARM::RecoveryServices::Models::VaultExtendedInfoResource.mapper()
326
+ result.body = @client.deserialize(result_mapper, parsed_response)
327
+ rescue Exception => e
328
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
329
+ end
330
+ end
331
+
332
+ result
333
+ end
334
+
335
+ promise.execute
336
+ end
337
+
338
+ end
339
+ end