azure_mgmt_recovery_services 0.17.3 → 0.18.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (29) hide show
  1. checksums.yaml +5 -5
  2. data/lib/2016-06-01/generated/azure_mgmt_recovery_services.rb +27 -16
  3. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/models/identity_data.rb +71 -0
  4. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/models/private_endpoint.rb +48 -0
  5. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/models/private_endpoint_connection.rb +73 -0
  6. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/models/private_endpoint_connection_status.rb +18 -0
  7. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/models/private_endpoint_connection_vault_properties.rb +61 -0
  8. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/models/private_link_resource.rb +127 -0
  9. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/models/private_link_resources.rb +99 -0
  10. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/models/private_link_service_connection_state.rb +73 -0
  11. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/models/provisioning_state.rb +18 -0
  12. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/models/resource_identity_type.rb +16 -0
  13. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/models/vault.rb +12 -0
  14. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/models/vault_private_endpoint_state.rb +16 -0
  15. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/models/vault_properties.rb +48 -0
  16. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/operations.rb +4 -0
  17. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/private_link_resources_operations.rb +346 -0
  18. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/recovery_services.rb +4 -2
  19. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/recovery_services_client.rb +6 -1
  20. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/registered_identities.rb +2 -0
  21. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/replication_usages.rb +2 -0
  22. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/usages.rb +2 -0
  23. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/vault_certificates.rb +2 -0
  24. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/vault_extended_info_operations.rb +6 -0
  25. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/vaults.rb +16 -0
  26. data/lib/profiles/latest/modules/recoveryservices_profile_module.rb +95 -53
  27. data/lib/version.rb +1 -1
  28. metadata +17 -6
  29. data/lib/2016-06-01/generated/azure_mgmt_recovery_services/models/check_name_availability_result_resource.rb +0 -84
@@ -0,0 +1,99 @@
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_06_01
7
+ module Models
8
+ #
9
+ # Class which represent the stamps associated with the vault.
10
+ #
11
+ class PrivateLinkResources
12
+
13
+ include MsRestAzure
14
+
15
+ include MsRest::JSONable
16
+ # @return [Array<PrivateLinkResource>] A collection of private link
17
+ # resources
18
+ attr_accessor :value
19
+
20
+ # @return [String] Link to the next chunk of the response
21
+ attr_accessor :next_link
22
+
23
+ # return [Proc] with next page method call.
24
+ attr_accessor :next_method
25
+
26
+ #
27
+ # Gets the rest of the items for the request, enabling auto-pagination.
28
+ #
29
+ # @return [Array<PrivateLinkResource>] operation results.
30
+ #
31
+ def get_all_items
32
+ items = @value
33
+ page = self
34
+ while page.next_link != nil && !page.next_link.strip.empty? do
35
+ page = page.get_next_page
36
+ items.concat(page.value)
37
+ end
38
+ items
39
+ end
40
+
41
+ #
42
+ # Gets the next page of results.
43
+ #
44
+ # @return [PrivateLinkResources] with next page content.
45
+ #
46
+ def get_next_page
47
+ response = @next_method.call(@next_link).value! unless @next_method.nil?
48
+ unless response.nil?
49
+ @next_link = response.body.next_link
50
+ @value = response.body.value
51
+ self
52
+ end
53
+ end
54
+
55
+ #
56
+ # Mapper for PrivateLinkResources class as Ruby Hash.
57
+ # This will be used for serialization/deserialization.
58
+ #
59
+ def self.mapper()
60
+ {
61
+ client_side_validation: true,
62
+ required: false,
63
+ serialized_name: 'PrivateLinkResources',
64
+ type: {
65
+ name: 'Composite',
66
+ class_name: 'PrivateLinkResources',
67
+ model_properties: {
68
+ value: {
69
+ client_side_validation: true,
70
+ required: false,
71
+ serialized_name: 'value',
72
+ type: {
73
+ name: 'Sequence',
74
+ element: {
75
+ client_side_validation: true,
76
+ required: false,
77
+ serialized_name: 'PrivateLinkResourceElementType',
78
+ type: {
79
+ name: 'Composite',
80
+ class_name: 'PrivateLinkResource'
81
+ }
82
+ }
83
+ }
84
+ },
85
+ next_link: {
86
+ client_side_validation: true,
87
+ required: false,
88
+ serialized_name: 'nextLink',
89
+ type: {
90
+ name: 'String'
91
+ }
92
+ }
93
+ }
94
+ }
95
+ }
96
+ end
97
+ end
98
+ end
99
+ end
@@ -0,0 +1,73 @@
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_06_01
7
+ module Models
8
+ #
9
+ # Gets or sets private link service connection state.
10
+ #
11
+ class PrivateLinkServiceConnectionState
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [PrivateEndpointConnectionStatus] Gets or sets the status.
16
+ # Possible values include: 'Pending', 'Approved', 'Rejected',
17
+ # 'Disconnected'
18
+ attr_accessor :status
19
+
20
+ # @return [String] Gets or sets description.
21
+ attr_accessor :description
22
+
23
+ # @return [String] Gets or sets actions required.
24
+ attr_accessor :actions_required
25
+
26
+
27
+ #
28
+ # Mapper for PrivateLinkServiceConnectionState class as Ruby Hash.
29
+ # This will be used for serialization/deserialization.
30
+ #
31
+ def self.mapper()
32
+ {
33
+ client_side_validation: true,
34
+ required: false,
35
+ serialized_name: 'PrivateLinkServiceConnectionState',
36
+ type: {
37
+ name: 'Composite',
38
+ class_name: 'PrivateLinkServiceConnectionState',
39
+ model_properties: {
40
+ status: {
41
+ client_side_validation: true,
42
+ required: false,
43
+ read_only: true,
44
+ serialized_name: 'status',
45
+ type: {
46
+ name: 'String'
47
+ }
48
+ },
49
+ description: {
50
+ client_side_validation: true,
51
+ required: false,
52
+ read_only: true,
53
+ serialized_name: 'description',
54
+ type: {
55
+ name: 'String'
56
+ }
57
+ },
58
+ actions_required: {
59
+ client_side_validation: true,
60
+ required: false,
61
+ read_only: true,
62
+ serialized_name: 'actionsRequired',
63
+ type: {
64
+ name: 'String'
65
+ }
66
+ }
67
+ }
68
+ }
69
+ }
70
+ end
71
+ end
72
+ end
73
+ end
@@ -0,0 +1,18 @@
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_06_01
7
+ module Models
8
+ #
9
+ # Defines values for ProvisioningState
10
+ #
11
+ module ProvisioningState
12
+ Succeeded = "Succeeded"
13
+ Deleting = "Deleting"
14
+ Failed = "Failed"
15
+ Pending = "Pending"
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,16 @@
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_06_01
7
+ module Models
8
+ #
9
+ # Defines values for ResourceIdentityType
10
+ #
11
+ module ResourceIdentityType
12
+ SystemAssigned = "SystemAssigned"
13
+ None = "None"
14
+ end
15
+ end
16
+ end
@@ -12,6 +12,9 @@ module Azure::RecoveryServices::Mgmt::V2016_06_01
12
12
 
13
13
  include MsRestAzure
14
14
 
15
+ # @return [IdentityData]
16
+ attr_accessor :identity
17
+
15
18
  # @return [VaultProperties]
16
19
  attr_accessor :properties
17
20
 
@@ -91,6 +94,15 @@ module Azure::RecoveryServices::Mgmt::V2016_06_01
91
94
  }
92
95
  }
93
96
  },
97
+ identity: {
98
+ client_side_validation: true,
99
+ required: false,
100
+ serialized_name: 'identity',
101
+ type: {
102
+ name: 'Composite',
103
+ class_name: 'IdentityData'
104
+ }
105
+ },
94
106
  properties: {
95
107
  client_side_validation: true,
96
108
  required: false,
@@ -0,0 +1,16 @@
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_06_01
7
+ module Models
8
+ #
9
+ # Defines values for VaultPrivateEndpointState
10
+ #
11
+ module VaultPrivateEndpointState
12
+ None = "None"
13
+ Enabled = "Enabled"
14
+ end
15
+ end
16
+ end
@@ -18,6 +18,18 @@ module Azure::RecoveryServices::Mgmt::V2016_06_01
18
18
  # @return [UpgradeDetails]
19
19
  attr_accessor :upgrade_details
20
20
 
21
+ # @return [Array<PrivateEndpointConnectionVaultProperties>] List of
22
+ # private endpoint connection.
23
+ attr_accessor :private_endpoint_connections
24
+
25
+ # @return [VaultPrivateEndpointState] Private endpoint state for backup.
26
+ # Possible values include: 'None', 'Enabled'
27
+ attr_accessor :private_endpoint_state_for_backup
28
+
29
+ # @return [VaultPrivateEndpointState] Private endpoint state for site
30
+ # recovery. Possible values include: 'None', 'Enabled'
31
+ attr_accessor :private_endpoint_state_for_site_recovery
32
+
21
33
 
22
34
  #
23
35
  # Mapper for VaultProperties class as Ruby Hash.
@@ -49,6 +61,42 @@ module Azure::RecoveryServices::Mgmt::V2016_06_01
49
61
  name: 'Composite',
50
62
  class_name: 'UpgradeDetails'
51
63
  }
64
+ },
65
+ private_endpoint_connections: {
66
+ client_side_validation: true,
67
+ required: false,
68
+ read_only: true,
69
+ serialized_name: 'privateEndpointConnections',
70
+ type: {
71
+ name: 'Sequence',
72
+ element: {
73
+ client_side_validation: true,
74
+ required: false,
75
+ serialized_name: 'PrivateEndpointConnectionVaultPropertiesElementType',
76
+ type: {
77
+ name: 'Composite',
78
+ class_name: 'PrivateEndpointConnectionVaultProperties'
79
+ }
80
+ }
81
+ }
82
+ },
83
+ private_endpoint_state_for_backup: {
84
+ client_side_validation: true,
85
+ required: false,
86
+ read_only: true,
87
+ serialized_name: 'privateEndpointStateForBackup',
88
+ type: {
89
+ name: 'String'
90
+ }
91
+ },
92
+ private_endpoint_state_for_site_recovery: {
93
+ client_side_validation: true,
94
+ required: false,
95
+ read_only: true,
96
+ serialized_name: 'privateEndpointStateForSiteRecovery',
97
+ type: {
98
+ name: 'String'
99
+ }
52
100
  }
53
101
  }
54
102
  }
@@ -86,6 +86,8 @@ module Azure::RecoveryServices::Mgmt::V2016_06_01
86
86
  end
87
87
 
88
88
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
89
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
90
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
89
91
  # Deserialize Response
90
92
  if status_code == 200
91
93
  begin
@@ -174,6 +176,8 @@ module Azure::RecoveryServices::Mgmt::V2016_06_01
174
176
  end
175
177
 
176
178
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
179
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
180
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
177
181
  # Deserialize Response
178
182
  if status_code == 200
179
183
  begin
@@ -0,0 +1,346 @@
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_06_01
7
+ #
8
+ # Recovery Services Client
9
+ #
10
+ class PrivateLinkResourcesOperations
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the PrivateLinkResourcesOperations 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
+ # Returns the list of private link resources that need to be created for Backup
26
+ # and SiteRecovery
27
+ #
28
+ # @param resource_group_name [String] The name of the resource group where the
29
+ # recovery services vault is present.
30
+ # @param vault_name [String] The name of the recovery services vault.
31
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
32
+ # will be added to the HTTP request.
33
+ #
34
+ # @return [Array<PrivateLinkResource>] operation results.
35
+ #
36
+ def list(resource_group_name, vault_name, custom_headers:nil)
37
+ first_page = list_as_lazy(resource_group_name, vault_name, custom_headers:custom_headers)
38
+ first_page.get_all_items
39
+ end
40
+
41
+ #
42
+ # Returns the list of private link resources that need to be created for Backup
43
+ # and SiteRecovery
44
+ #
45
+ # @param resource_group_name [String] The name of the resource group where the
46
+ # recovery services vault is present.
47
+ # @param vault_name [String] The name of the recovery services vault.
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, vault_name, custom_headers:nil)
54
+ list_async(resource_group_name, vault_name, custom_headers:custom_headers).value!
55
+ end
56
+
57
+ #
58
+ # Returns the list of private link resources that need to be created for Backup
59
+ # and SiteRecovery
60
+ #
61
+ # @param resource_group_name [String] The name of the resource group where the
62
+ # recovery services vault is present.
63
+ # @param vault_name [String] The name of the recovery services vault.
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, vault_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, 'vault_name is nil' if vault_name.nil?
73
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
74
+
75
+
76
+ request_headers = {}
77
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
78
+
79
+ # Set Headers
80
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
81
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
82
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/privateLinkResources'
83
+
84
+ request_url = @base_url || @client.base_url
85
+
86
+ options = {
87
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
88
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'vaultName' => vault_name},
89
+ query_params: {'api-version' => @client.api_version},
90
+ headers: request_headers.merge(custom_headers || {}),
91
+ base_url: request_url
92
+ }
93
+ promise = @client.make_request_async(:get, path_template, options)
94
+
95
+ promise = promise.then do |result|
96
+ http_response = result.response
97
+ status_code = http_response.status
98
+ response_content = http_response.body
99
+ unless status_code == 200
100
+ error_model = JSON.load(response_content)
101
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
102
+ end
103
+
104
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
105
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
106
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
107
+ # Deserialize Response
108
+ if status_code == 200
109
+ begin
110
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
111
+ result_mapper = Azure::RecoveryServices::Mgmt::V2016_06_01::Models::PrivateLinkResources.mapper()
112
+ result.body = @client.deserialize(result_mapper, parsed_response)
113
+ rescue Exception => e
114
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
115
+ end
116
+ end
117
+
118
+ result
119
+ end
120
+
121
+ promise.execute
122
+ end
123
+
124
+ #
125
+ # Returns a specified private link resource that need to be created for Backup
126
+ # and SiteRecovery
127
+ #
128
+ # @param resource_group_name [String] The name of the resource group where the
129
+ # recovery services vault is present.
130
+ # @param vault_name [String] The name of the recovery services vault.
131
+ # @param private_link_resource_name [String]
132
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
133
+ # will be added to the HTTP request.
134
+ #
135
+ # @return [PrivateLinkResource] operation results.
136
+ #
137
+ def get(resource_group_name, vault_name, private_link_resource_name, custom_headers:nil)
138
+ response = get_async(resource_group_name, vault_name, private_link_resource_name, custom_headers:custom_headers).value!
139
+ response.body unless response.nil?
140
+ end
141
+
142
+ #
143
+ # Returns a specified private link resource that need to be created for Backup
144
+ # and SiteRecovery
145
+ #
146
+ # @param resource_group_name [String] The name of the resource group where the
147
+ # recovery services vault is present.
148
+ # @param vault_name [String] The name of the recovery services vault.
149
+ # @param private_link_resource_name [String]
150
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
151
+ # will be added to the HTTP request.
152
+ #
153
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
154
+ #
155
+ def get_with_http_info(resource_group_name, vault_name, private_link_resource_name, custom_headers:nil)
156
+ get_async(resource_group_name, vault_name, private_link_resource_name, custom_headers:custom_headers).value!
157
+ end
158
+
159
+ #
160
+ # Returns a specified private link resource that need to be created for Backup
161
+ # and SiteRecovery
162
+ #
163
+ # @param resource_group_name [String] The name of the resource group where the
164
+ # recovery services vault is present.
165
+ # @param vault_name [String] The name of the recovery services vault.
166
+ # @param private_link_resource_name [String]
167
+ # @param [Hash{String => String}] A hash of custom headers that will be added
168
+ # to the HTTP request.
169
+ #
170
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
171
+ #
172
+ def get_async(resource_group_name, vault_name, private_link_resource_name, custom_headers:nil)
173
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
174
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
175
+ fail ArgumentError, 'vault_name is nil' if vault_name.nil?
176
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
177
+ fail ArgumentError, 'private_link_resource_name is nil' if private_link_resource_name.nil?
178
+
179
+
180
+ request_headers = {}
181
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
182
+
183
+ # Set Headers
184
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
185
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
186
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/privateLinkResources/{privateLinkResourceName}'
187
+
188
+ request_url = @base_url || @client.base_url
189
+
190
+ options = {
191
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
192
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'vaultName' => vault_name,'privateLinkResourceName' => private_link_resource_name},
193
+ query_params: {'api-version' => @client.api_version},
194
+ headers: request_headers.merge(custom_headers || {}),
195
+ base_url: request_url
196
+ }
197
+ promise = @client.make_request_async(:get, path_template, options)
198
+
199
+ promise = promise.then do |result|
200
+ http_response = result.response
201
+ status_code = http_response.status
202
+ response_content = http_response.body
203
+ unless status_code == 200
204
+ error_model = JSON.load(response_content)
205
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
206
+ end
207
+
208
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
209
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
210
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-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::RecoveryServices::Mgmt::V2016_06_01::Models::PrivateLinkResource.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
+ # Returns the list of private link resources that need to be created for Backup
230
+ # and SiteRecovery
231
+ #
232
+ # @param next_page_link [String] The NextLink from the previous successful call
233
+ # to List operation.
234
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
235
+ # will be added to the HTTP request.
236
+ #
237
+ # @return [PrivateLinkResources] operation results.
238
+ #
239
+ def list_next(next_page_link, custom_headers:nil)
240
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
241
+ response.body unless response.nil?
242
+ end
243
+
244
+ #
245
+ # Returns the list of private link resources that need to be created for Backup
246
+ # and SiteRecovery
247
+ #
248
+ # @param next_page_link [String] The NextLink from the previous successful call
249
+ # to List operation.
250
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
251
+ # will be added to the HTTP request.
252
+ #
253
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
254
+ #
255
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
256
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
257
+ end
258
+
259
+ #
260
+ # Returns the list of private link resources that need to be created for Backup
261
+ # and SiteRecovery
262
+ #
263
+ # @param next_page_link [String] The NextLink from the previous successful call
264
+ # to List operation.
265
+ # @param [Hash{String => String}] A hash of custom headers that will be added
266
+ # to the HTTP request.
267
+ #
268
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
269
+ #
270
+ def list_next_async(next_page_link, custom_headers:nil)
271
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
272
+
273
+
274
+ request_headers = {}
275
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
276
+
277
+ # Set Headers
278
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
279
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
280
+ path_template = '{nextLink}'
281
+
282
+ request_url = @base_url || @client.base_url
283
+
284
+ options = {
285
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
286
+ skip_encoding_path_params: {'nextLink' => next_page_link},
287
+ headers: request_headers.merge(custom_headers || {}),
288
+ base_url: request_url
289
+ }
290
+ promise = @client.make_request_async(:get, path_template, options)
291
+
292
+ promise = promise.then do |result|
293
+ http_response = result.response
294
+ status_code = http_response.status
295
+ response_content = http_response.body
296
+ unless status_code == 200
297
+ error_model = JSON.load(response_content)
298
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
299
+ end
300
+
301
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
302
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
303
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
304
+ # Deserialize Response
305
+ if status_code == 200
306
+ begin
307
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
308
+ result_mapper = Azure::RecoveryServices::Mgmt::V2016_06_01::Models::PrivateLinkResources.mapper()
309
+ result.body = @client.deserialize(result_mapper, parsed_response)
310
+ rescue Exception => e
311
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
312
+ end
313
+ end
314
+
315
+ result
316
+ end
317
+
318
+ promise.execute
319
+ end
320
+
321
+ #
322
+ # Returns the list of private link resources that need to be created for Backup
323
+ # and SiteRecovery
324
+ #
325
+ # @param resource_group_name [String] The name of the resource group where the
326
+ # recovery services vault is present.
327
+ # @param vault_name [String] The name of the recovery services vault.
328
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
329
+ # will be added to the HTTP request.
330
+ #
331
+ # @return [PrivateLinkResources] which provide lazy access to pages of the
332
+ # response.
333
+ #
334
+ def list_as_lazy(resource_group_name, vault_name, custom_headers:nil)
335
+ response = list_async(resource_group_name, vault_name, custom_headers:custom_headers).value!
336
+ unless response.nil?
337
+ page = response.body
338
+ page.next_method = Proc.new do |next_page_link|
339
+ list_next_async(next_page_link, custom_headers:custom_headers)
340
+ end
341
+ page
342
+ end
343
+ end
344
+
345
+ end
346
+ end