azure_mgmt_privatedns 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/2018-09-01/generated/azure_mgmt_privatedns.rb +51 -0
  4. data/lib/2018-09-01/generated/azure_mgmt_privatedns/models/aaaa_record.rb +46 -0
  5. data/lib/2018-09-01/generated/azure_mgmt_privatedns/models/arecord.rb +46 -0
  6. data/lib/2018-09-01/generated/azure_mgmt_privatedns/models/cname_record.rb +46 -0
  7. data/lib/2018-09-01/generated/azure_mgmt_privatedns/models/mx_record.rb +57 -0
  8. data/lib/2018-09-01/generated/azure_mgmt_privatedns/models/private_zone.rb +196 -0
  9. data/lib/2018-09-01/generated/azure_mgmt_privatedns/models/private_zone_list_result.rb +99 -0
  10. data/lib/2018-09-01/generated/azure_mgmt_privatedns/models/provisioning_state.rb +20 -0
  11. data/lib/2018-09-01/generated/azure_mgmt_privatedns/models/proxy_resource.rb +62 -0
  12. data/lib/2018-09-01/generated/azure_mgmt_privatedns/models/ptr_record.rb +46 -0
  13. data/lib/2018-09-01/generated/azure_mgmt_privatedns/models/record_set.rb +275 -0
  14. data/lib/2018-09-01/generated/azure_mgmt_privatedns/models/record_set_list_result.rb +100 -0
  15. data/lib/2018-09-01/generated/azure_mgmt_privatedns/models/record_type.rb +22 -0
  16. data/lib/2018-09-01/generated/azure_mgmt_privatedns/models/resource.rb +83 -0
  17. data/lib/2018-09-01/generated/azure_mgmt_privatedns/models/soa_record.rb +114 -0
  18. data/lib/2018-09-01/generated/azure_mgmt_privatedns/models/srv_record.rb +79 -0
  19. data/lib/2018-09-01/generated/azure_mgmt_privatedns/models/sub_resource.rb +46 -0
  20. data/lib/2018-09-01/generated/azure_mgmt_privatedns/models/tracked_resource.rb +92 -0
  21. data/lib/2018-09-01/generated/azure_mgmt_privatedns/models/txt_record.rb +54 -0
  22. data/lib/2018-09-01/generated/azure_mgmt_privatedns/models/virtual_network_link.rb +151 -0
  23. data/lib/2018-09-01/generated/azure_mgmt_privatedns/models/virtual_network_link_list_result.rb +101 -0
  24. data/lib/2018-09-01/generated/azure_mgmt_privatedns/models/virtual_network_link_state.rb +16 -0
  25. data/lib/2018-09-01/generated/azure_mgmt_privatedns/module_definition.rb +9 -0
  26. data/lib/2018-09-01/generated/azure_mgmt_privatedns/private_dns_management_client.rb +141 -0
  27. data/lib/2018-09-01/generated/azure_mgmt_privatedns/private_zones.rb +1051 -0
  28. data/lib/2018-09-01/generated/azure_mgmt_privatedns/record_sets.rb +1023 -0
  29. data/lib/2018-09-01/generated/azure_mgmt_privatedns/virtual_network_links.rb +908 -0
  30. data/lib/azure_mgmt_privatedns.rb +6 -0
  31. data/lib/module_definition.rb +8 -0
  32. data/lib/profiles/latest/modules/privatedns_profile_module.rb +149 -0
  33. data/lib/profiles/latest/privatedns_latest_profile_client.rb +40 -0
  34. data/lib/profiles/latest/privatedns_module_definition.rb +8 -0
  35. data/lib/version.rb +7 -0
  36. metadata +153 -0
@@ -0,0 +1,1051 @@
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::PrivateDns::Mgmt::V2018_09_01
7
+ #
8
+ # The Private DNS Management Client.
9
+ #
10
+ class PrivateZones
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the PrivateZones class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [PrivateDnsManagementClient] reference to the PrivateDnsManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Creates or updates a Private DNS zone. Does not modify Links to virtual
26
+ # networks or DNS records within the zone.
27
+ #
28
+ # @param resource_group_name [String] The name of the resource group.
29
+ # @param private_zone_name [String] The name of the Private DNS zone (without a
30
+ # terminating dot).
31
+ # @param parameters [PrivateZone] Parameters supplied to the CreateOrUpdate
32
+ # operation.
33
+ # @param if_match [String] The ETag of the Private DNS zone. Omit this value to
34
+ # always overwrite the current zone. Specify the last-seen ETag value to
35
+ # prevent accidentally overwriting any concurrent changes.
36
+ # @param if_none_match [String] Set to '*' to allow a new Private DNS zone to
37
+ # be created, but to prevent updating an existing zone. Other values will be
38
+ # ignored.
39
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
40
+ # will be added to the HTTP request.
41
+ #
42
+ # @return [PrivateZone] operation results.
43
+ #
44
+ def create_or_update(resource_group_name, private_zone_name, parameters, if_match:nil, if_none_match:nil, custom_headers:nil)
45
+ response = create_or_update_async(resource_group_name, private_zone_name, parameters, if_match:if_match, if_none_match:if_none_match, custom_headers:custom_headers).value!
46
+ response.body unless response.nil?
47
+ end
48
+
49
+ #
50
+ # @param resource_group_name [String] The name of the resource group.
51
+ # @param private_zone_name [String] The name of the Private DNS zone (without a
52
+ # terminating dot).
53
+ # @param parameters [PrivateZone] Parameters supplied to the CreateOrUpdate
54
+ # operation.
55
+ # @param if_match [String] The ETag of the Private DNS zone. Omit this value to
56
+ # always overwrite the current zone. Specify the last-seen ETag value to
57
+ # prevent accidentally overwriting any concurrent changes.
58
+ # @param if_none_match [String] Set to '*' to allow a new Private DNS zone to
59
+ # be created, but to prevent updating an existing zone. Other values will be
60
+ # ignored.
61
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
62
+ # will be added to the HTTP request.
63
+ #
64
+ # @return [Concurrent::Promise] promise which provides async access to http
65
+ # response.
66
+ #
67
+ def create_or_update_async(resource_group_name, private_zone_name, parameters, if_match:nil, if_none_match:nil, custom_headers:nil)
68
+ # Send request
69
+ promise = begin_create_or_update_async(resource_group_name, private_zone_name, parameters, if_match:if_match, if_none_match:if_none_match, custom_headers:custom_headers)
70
+
71
+ promise = promise.then do |response|
72
+ # Defining deserialization method.
73
+ deserialize_method = lambda do |parsed_response|
74
+ result_mapper = Azure::PrivateDns::Mgmt::V2018_09_01::Models::PrivateZone.mapper()
75
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
76
+ end
77
+
78
+ # Waiting for response.
79
+ @client.get_long_running_operation_result(response, deserialize_method)
80
+ end
81
+
82
+ promise
83
+ end
84
+
85
+ #
86
+ # Updates a Private DNS zone. Does not modify virtual network links or DNS
87
+ # records within the zone.
88
+ #
89
+ # @param resource_group_name [String] The name of the resource group.
90
+ # @param private_zone_name [String] The name of the Private DNS zone (without a
91
+ # terminating dot).
92
+ # @param parameters [PrivateZone] Parameters supplied to the Update operation.
93
+ # @param if_match [String] The ETag of the Private DNS zone. Omit this value to
94
+ # always overwrite the current zone. Specify the last-seen ETag value to
95
+ # prevent accidentally overwriting any concurrent changes.
96
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
97
+ # will be added to the HTTP request.
98
+ #
99
+ # @return [PrivateZone] operation results.
100
+ #
101
+ def update(resource_group_name, private_zone_name, parameters, if_match:nil, custom_headers:nil)
102
+ response = update_async(resource_group_name, private_zone_name, parameters, if_match:if_match, custom_headers:custom_headers).value!
103
+ response.body unless response.nil?
104
+ end
105
+
106
+ #
107
+ # @param resource_group_name [String] The name of the resource group.
108
+ # @param private_zone_name [String] The name of the Private DNS zone (without a
109
+ # terminating dot).
110
+ # @param parameters [PrivateZone] Parameters supplied to the Update operation.
111
+ # @param if_match [String] The ETag of the Private DNS zone. Omit this value to
112
+ # always overwrite the current zone. Specify the last-seen ETag value to
113
+ # prevent accidentally overwriting any concurrent changes.
114
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
115
+ # will be added to the HTTP request.
116
+ #
117
+ # @return [Concurrent::Promise] promise which provides async access to http
118
+ # response.
119
+ #
120
+ def update_async(resource_group_name, private_zone_name, parameters, if_match:nil, custom_headers:nil)
121
+ # Send request
122
+ promise = begin_update_async(resource_group_name, private_zone_name, parameters, if_match:if_match, custom_headers:custom_headers)
123
+
124
+ promise = promise.then do |response|
125
+ # Defining deserialization method.
126
+ deserialize_method = lambda do |parsed_response|
127
+ result_mapper = Azure::PrivateDns::Mgmt::V2018_09_01::Models::PrivateZone.mapper()
128
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
129
+ end
130
+
131
+ # Waiting for response.
132
+ @client.get_long_running_operation_result(response, deserialize_method)
133
+ end
134
+
135
+ promise
136
+ end
137
+
138
+ #
139
+ # Deletes a Private DNS zone. WARNING: All DNS records in the zone will also be
140
+ # deleted. This operation cannot be undone. Private DNS zone cannot be deleted
141
+ # unless all virtual network links to it are removed.
142
+ #
143
+ # @param resource_group_name [String] The name of the resource group.
144
+ # @param private_zone_name [String] The name of the Private DNS zone (without a
145
+ # terminating dot).
146
+ # @param if_match [String] The ETag of the Private DNS zone. Omit this value to
147
+ # always delete the current zone. Specify the last-seen ETag value to prevent
148
+ # accidentally deleting any concurrent changes.
149
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
150
+ # will be added to the HTTP request.
151
+ #
152
+ def delete(resource_group_name, private_zone_name, if_match:nil, custom_headers:nil)
153
+ response = delete_async(resource_group_name, private_zone_name, if_match:if_match, custom_headers:custom_headers).value!
154
+ nil
155
+ end
156
+
157
+ #
158
+ # @param resource_group_name [String] The name of the resource group.
159
+ # @param private_zone_name [String] The name of the Private DNS zone (without a
160
+ # terminating dot).
161
+ # @param if_match [String] The ETag of the Private DNS zone. Omit this value to
162
+ # always delete the current zone. Specify the last-seen ETag value to prevent
163
+ # accidentally deleting any concurrent changes.
164
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
165
+ # will be added to the HTTP request.
166
+ #
167
+ # @return [Concurrent::Promise] promise which provides async access to http
168
+ # response.
169
+ #
170
+ def delete_async(resource_group_name, private_zone_name, if_match:nil, custom_headers:nil)
171
+ # Send request
172
+ promise = begin_delete_async(resource_group_name, private_zone_name, if_match:if_match, custom_headers:custom_headers)
173
+
174
+ promise = promise.then do |response|
175
+ # Defining deserialization method.
176
+ deserialize_method = lambda do |parsed_response|
177
+ end
178
+
179
+ # Waiting for response.
180
+ @client.get_long_running_operation_result(response, deserialize_method)
181
+ end
182
+
183
+ promise
184
+ end
185
+
186
+ #
187
+ # Gets a Private DNS zone. Retrieves the zone properties, but not the virtual
188
+ # networks links or the record sets within the zone.
189
+ #
190
+ # @param resource_group_name [String] The name of the resource group.
191
+ # @param private_zone_name [String] The name of the Private DNS zone (without a
192
+ # terminating dot).
193
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
194
+ # will be added to the HTTP request.
195
+ #
196
+ # @return [PrivateZone] operation results.
197
+ #
198
+ def get(resource_group_name, private_zone_name, custom_headers:nil)
199
+ response = get_async(resource_group_name, private_zone_name, custom_headers:custom_headers).value!
200
+ response.body unless response.nil?
201
+ end
202
+
203
+ #
204
+ # Gets a Private DNS zone. Retrieves the zone properties, but not the virtual
205
+ # networks links or the record sets within the zone.
206
+ #
207
+ # @param resource_group_name [String] The name of the resource group.
208
+ # @param private_zone_name [String] The name of the Private DNS zone (without a
209
+ # terminating dot).
210
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
211
+ # will be added to the HTTP request.
212
+ #
213
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
214
+ #
215
+ def get_with_http_info(resource_group_name, private_zone_name, custom_headers:nil)
216
+ get_async(resource_group_name, private_zone_name, custom_headers:custom_headers).value!
217
+ end
218
+
219
+ #
220
+ # Gets a Private DNS zone. Retrieves the zone properties, but not the virtual
221
+ # networks links or the record sets within the zone.
222
+ #
223
+ # @param resource_group_name [String] The name of the resource group.
224
+ # @param private_zone_name [String] The name of the Private DNS zone (without a
225
+ # terminating dot).
226
+ # @param [Hash{String => String}] A hash of custom headers that will be added
227
+ # to the HTTP request.
228
+ #
229
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
230
+ #
231
+ def get_async(resource_group_name, private_zone_name, custom_headers:nil)
232
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
233
+ fail ArgumentError, 'private_zone_name is nil' if private_zone_name.nil?
234
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
235
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
236
+
237
+
238
+ request_headers = {}
239
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
240
+
241
+ # Set Headers
242
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
243
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
244
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateDnsZones/{privateZoneName}'
245
+
246
+ request_url = @base_url || @client.base_url
247
+
248
+ options = {
249
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
250
+ path_params: {'resourceGroupName' => resource_group_name,'privateZoneName' => private_zone_name,'subscriptionId' => @client.subscription_id},
251
+ query_params: {'api-version' => @client.api_version},
252
+ headers: request_headers.merge(custom_headers || {}),
253
+ base_url: request_url
254
+ }
255
+ promise = @client.make_request_async(:get, path_template, options)
256
+
257
+ promise = promise.then do |result|
258
+ http_response = result.response
259
+ status_code = http_response.status
260
+ response_content = http_response.body
261
+ unless status_code == 200
262
+ error_model = JSON.load(response_content)
263
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
264
+ end
265
+
266
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
267
+ # Deserialize Response
268
+ if status_code == 200
269
+ begin
270
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
271
+ result_mapper = Azure::PrivateDns::Mgmt::V2018_09_01::Models::PrivateZone.mapper()
272
+ result.body = @client.deserialize(result_mapper, parsed_response)
273
+ rescue Exception => e
274
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
275
+ end
276
+ end
277
+
278
+ result
279
+ end
280
+
281
+ promise.execute
282
+ end
283
+
284
+ #
285
+ # Lists the Private DNS zones in all resource groups in a subscription.
286
+ #
287
+ # @param top [Integer] The maximum number of Private DNS zones to return. If
288
+ # not specified, returns up to 100 zones.
289
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
290
+ # will be added to the HTTP request.
291
+ #
292
+ # @return [Array<PrivateZone>] operation results.
293
+ #
294
+ def list(top:nil, custom_headers:nil)
295
+ first_page = list_as_lazy(top:top, custom_headers:custom_headers)
296
+ first_page.get_all_items
297
+ end
298
+
299
+ #
300
+ # Lists the Private DNS zones in all resource groups in a subscription.
301
+ #
302
+ # @param top [Integer] The maximum number of Private DNS zones to return. If
303
+ # not specified, returns up to 100 zones.
304
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
305
+ # will be added to the HTTP request.
306
+ #
307
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
308
+ #
309
+ def list_with_http_info(top:nil, custom_headers:nil)
310
+ list_async(top:top, custom_headers:custom_headers).value!
311
+ end
312
+
313
+ #
314
+ # Lists the Private DNS zones in all resource groups in a subscription.
315
+ #
316
+ # @param top [Integer] The maximum number of Private DNS zones to return. If
317
+ # not specified, returns up to 100 zones.
318
+ # @param [Hash{String => String}] A hash of custom headers that will be added
319
+ # to the HTTP request.
320
+ #
321
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
322
+ #
323
+ def list_async(top:nil, custom_headers:nil)
324
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
325
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
326
+
327
+
328
+ request_headers = {}
329
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
330
+
331
+ # Set Headers
332
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
333
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
334
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Network/privateDnsZones'
335
+
336
+ request_url = @base_url || @client.base_url
337
+
338
+ options = {
339
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
340
+ path_params: {'subscriptionId' => @client.subscription_id},
341
+ query_params: {'$top' => top,'api-version' => @client.api_version},
342
+ headers: request_headers.merge(custom_headers || {}),
343
+ base_url: request_url
344
+ }
345
+ promise = @client.make_request_async(:get, path_template, options)
346
+
347
+ promise = promise.then do |result|
348
+ http_response = result.response
349
+ status_code = http_response.status
350
+ response_content = http_response.body
351
+ unless status_code == 200
352
+ error_model = JSON.load(response_content)
353
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
354
+ end
355
+
356
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
357
+ # Deserialize Response
358
+ if status_code == 200
359
+ begin
360
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
361
+ result_mapper = Azure::PrivateDns::Mgmt::V2018_09_01::Models::PrivateZoneListResult.mapper()
362
+ result.body = @client.deserialize(result_mapper, parsed_response)
363
+ rescue Exception => e
364
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
365
+ end
366
+ end
367
+
368
+ result
369
+ end
370
+
371
+ promise.execute
372
+ end
373
+
374
+ #
375
+ # Lists the Private DNS zones within a resource group.
376
+ #
377
+ # @param resource_group_name [String] The name of the resource group.
378
+ # @param top [Integer] The maximum number of record sets to return. If not
379
+ # specified, returns up to 100 record sets.
380
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
381
+ # will be added to the HTTP request.
382
+ #
383
+ # @return [Array<PrivateZone>] operation results.
384
+ #
385
+ def list_by_resource_group(resource_group_name, top:nil, custom_headers:nil)
386
+ first_page = list_by_resource_group_as_lazy(resource_group_name, top:top, custom_headers:custom_headers)
387
+ first_page.get_all_items
388
+ end
389
+
390
+ #
391
+ # Lists the Private DNS zones within a resource group.
392
+ #
393
+ # @param resource_group_name [String] The name of the resource group.
394
+ # @param top [Integer] The maximum number of record sets to return. If not
395
+ # specified, returns up to 100 record sets.
396
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
397
+ # will be added to the HTTP request.
398
+ #
399
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
400
+ #
401
+ def list_by_resource_group_with_http_info(resource_group_name, top:nil, custom_headers:nil)
402
+ list_by_resource_group_async(resource_group_name, top:top, custom_headers:custom_headers).value!
403
+ end
404
+
405
+ #
406
+ # Lists the Private DNS zones within a resource group.
407
+ #
408
+ # @param resource_group_name [String] The name of the resource group.
409
+ # @param top [Integer] The maximum number of record sets to return. If not
410
+ # specified, returns up to 100 record sets.
411
+ # @param [Hash{String => String}] A hash of custom headers that will be added
412
+ # to the HTTP request.
413
+ #
414
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
415
+ #
416
+ def list_by_resource_group_async(resource_group_name, top:nil, custom_headers:nil)
417
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
418
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
419
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
420
+
421
+
422
+ request_headers = {}
423
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
424
+
425
+ # Set Headers
426
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
427
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
428
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateDnsZones'
429
+
430
+ request_url = @base_url || @client.base_url
431
+
432
+ options = {
433
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
434
+ path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
435
+ query_params: {'$top' => top,'api-version' => @client.api_version},
436
+ headers: request_headers.merge(custom_headers || {}),
437
+ base_url: request_url
438
+ }
439
+ promise = @client.make_request_async(:get, path_template, options)
440
+
441
+ promise = promise.then do |result|
442
+ http_response = result.response
443
+ status_code = http_response.status
444
+ response_content = http_response.body
445
+ unless status_code == 200
446
+ error_model = JSON.load(response_content)
447
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
448
+ end
449
+
450
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
451
+ # Deserialize Response
452
+ if status_code == 200
453
+ begin
454
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
455
+ result_mapper = Azure::PrivateDns::Mgmt::V2018_09_01::Models::PrivateZoneListResult.mapper()
456
+ result.body = @client.deserialize(result_mapper, parsed_response)
457
+ rescue Exception => e
458
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
459
+ end
460
+ end
461
+
462
+ result
463
+ end
464
+
465
+ promise.execute
466
+ end
467
+
468
+ #
469
+ # Creates or updates a Private DNS zone. Does not modify Links to virtual
470
+ # networks or DNS records within the zone.
471
+ #
472
+ # @param resource_group_name [String] The name of the resource group.
473
+ # @param private_zone_name [String] The name of the Private DNS zone (without a
474
+ # terminating dot).
475
+ # @param parameters [PrivateZone] Parameters supplied to the CreateOrUpdate
476
+ # operation.
477
+ # @param if_match [String] The ETag of the Private DNS zone. Omit this value to
478
+ # always overwrite the current zone. Specify the last-seen ETag value to
479
+ # prevent accidentally overwriting any concurrent changes.
480
+ # @param if_none_match [String] Set to '*' to allow a new Private DNS zone to
481
+ # be created, but to prevent updating an existing zone. Other values will be
482
+ # ignored.
483
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
484
+ # will be added to the HTTP request.
485
+ #
486
+ # @return [PrivateZone] operation results.
487
+ #
488
+ def begin_create_or_update(resource_group_name, private_zone_name, parameters, if_match:nil, if_none_match:nil, custom_headers:nil)
489
+ response = begin_create_or_update_async(resource_group_name, private_zone_name, parameters, if_match:if_match, if_none_match:if_none_match, custom_headers:custom_headers).value!
490
+ response.body unless response.nil?
491
+ end
492
+
493
+ #
494
+ # Creates or updates a Private DNS zone. Does not modify Links to virtual
495
+ # networks or DNS records within the zone.
496
+ #
497
+ # @param resource_group_name [String] The name of the resource group.
498
+ # @param private_zone_name [String] The name of the Private DNS zone (without a
499
+ # terminating dot).
500
+ # @param parameters [PrivateZone] Parameters supplied to the CreateOrUpdate
501
+ # operation.
502
+ # @param if_match [String] The ETag of the Private DNS zone. Omit this value to
503
+ # always overwrite the current zone. Specify the last-seen ETag value to
504
+ # prevent accidentally overwriting any concurrent changes.
505
+ # @param if_none_match [String] Set to '*' to allow a new Private DNS zone to
506
+ # be created, but to prevent updating an existing zone. Other values will be
507
+ # ignored.
508
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
509
+ # will be added to the HTTP request.
510
+ #
511
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
512
+ #
513
+ def begin_create_or_update_with_http_info(resource_group_name, private_zone_name, parameters, if_match:nil, if_none_match:nil, custom_headers:nil)
514
+ begin_create_or_update_async(resource_group_name, private_zone_name, parameters, if_match:if_match, if_none_match:if_none_match, custom_headers:custom_headers).value!
515
+ end
516
+
517
+ #
518
+ # Creates or updates a Private DNS zone. Does not modify Links to virtual
519
+ # networks or DNS records within the zone.
520
+ #
521
+ # @param resource_group_name [String] The name of the resource group.
522
+ # @param private_zone_name [String] The name of the Private DNS zone (without a
523
+ # terminating dot).
524
+ # @param parameters [PrivateZone] Parameters supplied to the CreateOrUpdate
525
+ # operation.
526
+ # @param if_match [String] The ETag of the Private DNS zone. Omit this value to
527
+ # always overwrite the current zone. Specify the last-seen ETag value to
528
+ # prevent accidentally overwriting any concurrent changes.
529
+ # @param if_none_match [String] Set to '*' to allow a new Private DNS zone to
530
+ # be created, but to prevent updating an existing zone. Other values will be
531
+ # ignored.
532
+ # @param [Hash{String => String}] A hash of custom headers that will be added
533
+ # to the HTTP request.
534
+ #
535
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
536
+ #
537
+ def begin_create_or_update_async(resource_group_name, private_zone_name, parameters, if_match:nil, if_none_match:nil, custom_headers:nil)
538
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
539
+ fail ArgumentError, 'private_zone_name is nil' if private_zone_name.nil?
540
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
541
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
542
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
543
+
544
+
545
+ request_headers = {}
546
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
547
+
548
+ # Set Headers
549
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
550
+ request_headers['If-Match'] = if_match unless if_match.nil?
551
+ request_headers['If-None-Match'] = if_none_match unless if_none_match.nil?
552
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
553
+
554
+ # Serialize Request
555
+ request_mapper = Azure::PrivateDns::Mgmt::V2018_09_01::Models::PrivateZone.mapper()
556
+ request_content = @client.serialize(request_mapper, parameters)
557
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
558
+
559
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateDnsZones/{privateZoneName}'
560
+
561
+ request_url = @base_url || @client.base_url
562
+
563
+ options = {
564
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
565
+ path_params: {'resourceGroupName' => resource_group_name,'privateZoneName' => private_zone_name,'subscriptionId' => @client.subscription_id},
566
+ query_params: {'api-version' => @client.api_version},
567
+ body: request_content,
568
+ headers: request_headers.merge(custom_headers || {}),
569
+ base_url: request_url
570
+ }
571
+ promise = @client.make_request_async(:put, path_template, options)
572
+
573
+ promise = promise.then do |result|
574
+ http_response = result.response
575
+ status_code = http_response.status
576
+ response_content = http_response.body
577
+ unless status_code == 201 || status_code == 200 || status_code == 202
578
+ error_model = JSON.load(response_content)
579
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
580
+ end
581
+
582
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
583
+ # Deserialize Response
584
+ if status_code == 201
585
+ begin
586
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
587
+ result_mapper = Azure::PrivateDns::Mgmt::V2018_09_01::Models::PrivateZone.mapper()
588
+ result.body = @client.deserialize(result_mapper, parsed_response)
589
+ rescue Exception => e
590
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
591
+ end
592
+ end
593
+ # Deserialize Response
594
+ if status_code == 200
595
+ begin
596
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
597
+ result_mapper = Azure::PrivateDns::Mgmt::V2018_09_01::Models::PrivateZone.mapper()
598
+ result.body = @client.deserialize(result_mapper, parsed_response)
599
+ rescue Exception => e
600
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
601
+ end
602
+ end
603
+
604
+ result
605
+ end
606
+
607
+ promise.execute
608
+ end
609
+
610
+ #
611
+ # Updates a Private DNS zone. Does not modify virtual network links or DNS
612
+ # records within the zone.
613
+ #
614
+ # @param resource_group_name [String] The name of the resource group.
615
+ # @param private_zone_name [String] The name of the Private DNS zone (without a
616
+ # terminating dot).
617
+ # @param parameters [PrivateZone] Parameters supplied to the Update operation.
618
+ # @param if_match [String] The ETag of the Private DNS zone. Omit this value to
619
+ # always overwrite the current zone. Specify the last-seen ETag value to
620
+ # prevent accidentally overwriting any concurrent changes.
621
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
622
+ # will be added to the HTTP request.
623
+ #
624
+ # @return [PrivateZone] operation results.
625
+ #
626
+ def begin_update(resource_group_name, private_zone_name, parameters, if_match:nil, custom_headers:nil)
627
+ response = begin_update_async(resource_group_name, private_zone_name, parameters, if_match:if_match, custom_headers:custom_headers).value!
628
+ response.body unless response.nil?
629
+ end
630
+
631
+ #
632
+ # Updates a Private DNS zone. Does not modify virtual network links or DNS
633
+ # records within the zone.
634
+ #
635
+ # @param resource_group_name [String] The name of the resource group.
636
+ # @param private_zone_name [String] The name of the Private DNS zone (without a
637
+ # terminating dot).
638
+ # @param parameters [PrivateZone] Parameters supplied to the Update operation.
639
+ # @param if_match [String] The ETag of the Private DNS zone. Omit this value to
640
+ # always overwrite the current zone. Specify the last-seen ETag value to
641
+ # prevent accidentally overwriting any concurrent changes.
642
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
643
+ # will be added to the HTTP request.
644
+ #
645
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
646
+ #
647
+ def begin_update_with_http_info(resource_group_name, private_zone_name, parameters, if_match:nil, custom_headers:nil)
648
+ begin_update_async(resource_group_name, private_zone_name, parameters, if_match:if_match, custom_headers:custom_headers).value!
649
+ end
650
+
651
+ #
652
+ # Updates a Private DNS zone. Does not modify virtual network links or DNS
653
+ # records within the zone.
654
+ #
655
+ # @param resource_group_name [String] The name of the resource group.
656
+ # @param private_zone_name [String] The name of the Private DNS zone (without a
657
+ # terminating dot).
658
+ # @param parameters [PrivateZone] Parameters supplied to the Update operation.
659
+ # @param if_match [String] The ETag of the Private DNS zone. Omit this value to
660
+ # always overwrite the current zone. Specify the last-seen ETag value to
661
+ # prevent accidentally overwriting any concurrent changes.
662
+ # @param [Hash{String => String}] A hash of custom headers that will be added
663
+ # to the HTTP request.
664
+ #
665
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
666
+ #
667
+ def begin_update_async(resource_group_name, private_zone_name, parameters, if_match:nil, custom_headers:nil)
668
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
669
+ fail ArgumentError, 'private_zone_name is nil' if private_zone_name.nil?
670
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
671
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
672
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
673
+
674
+
675
+ request_headers = {}
676
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
677
+
678
+ # Set Headers
679
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
680
+ request_headers['If-Match'] = if_match unless if_match.nil?
681
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
682
+
683
+ # Serialize Request
684
+ request_mapper = Azure::PrivateDns::Mgmt::V2018_09_01::Models::PrivateZone.mapper()
685
+ request_content = @client.serialize(request_mapper, parameters)
686
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
687
+
688
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateDnsZones/{privateZoneName}'
689
+
690
+ request_url = @base_url || @client.base_url
691
+
692
+ options = {
693
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
694
+ path_params: {'resourceGroupName' => resource_group_name,'privateZoneName' => private_zone_name,'subscriptionId' => @client.subscription_id},
695
+ query_params: {'api-version' => @client.api_version},
696
+ body: request_content,
697
+ headers: request_headers.merge(custom_headers || {}),
698
+ base_url: request_url
699
+ }
700
+ promise = @client.make_request_async(:patch, path_template, options)
701
+
702
+ promise = promise.then do |result|
703
+ http_response = result.response
704
+ status_code = http_response.status
705
+ response_content = http_response.body
706
+ unless status_code == 200 || status_code == 202
707
+ error_model = JSON.load(response_content)
708
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
709
+ end
710
+
711
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
712
+ # Deserialize Response
713
+ if status_code == 200
714
+ begin
715
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
716
+ result_mapper = Azure::PrivateDns::Mgmt::V2018_09_01::Models::PrivateZone.mapper()
717
+ result.body = @client.deserialize(result_mapper, parsed_response)
718
+ rescue Exception => e
719
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
720
+ end
721
+ end
722
+
723
+ result
724
+ end
725
+
726
+ promise.execute
727
+ end
728
+
729
+ #
730
+ # Deletes a Private DNS zone. WARNING: All DNS records in the zone will also be
731
+ # deleted. This operation cannot be undone. Private DNS zone cannot be deleted
732
+ # unless all virtual network links to it are removed.
733
+ #
734
+ # @param resource_group_name [String] The name of the resource group.
735
+ # @param private_zone_name [String] The name of the Private DNS zone (without a
736
+ # terminating dot).
737
+ # @param if_match [String] The ETag of the Private DNS zone. Omit this value to
738
+ # always delete the current zone. Specify the last-seen ETag value to prevent
739
+ # accidentally deleting any concurrent changes.
740
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
741
+ # will be added to the HTTP request.
742
+ #
743
+ #
744
+ def begin_delete(resource_group_name, private_zone_name, if_match:nil, custom_headers:nil)
745
+ response = begin_delete_async(resource_group_name, private_zone_name, if_match:if_match, custom_headers:custom_headers).value!
746
+ nil
747
+ end
748
+
749
+ #
750
+ # Deletes a Private DNS zone. WARNING: All DNS records in the zone will also be
751
+ # deleted. This operation cannot be undone. Private DNS zone cannot be deleted
752
+ # unless all virtual network links to it are removed.
753
+ #
754
+ # @param resource_group_name [String] The name of the resource group.
755
+ # @param private_zone_name [String] The name of the Private DNS zone (without a
756
+ # terminating dot).
757
+ # @param if_match [String] The ETag of the Private DNS zone. Omit this value to
758
+ # always delete the current zone. Specify the last-seen ETag value to prevent
759
+ # accidentally deleting any concurrent changes.
760
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
761
+ # will be added to the HTTP request.
762
+ #
763
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
764
+ #
765
+ def begin_delete_with_http_info(resource_group_name, private_zone_name, if_match:nil, custom_headers:nil)
766
+ begin_delete_async(resource_group_name, private_zone_name, if_match:if_match, custom_headers:custom_headers).value!
767
+ end
768
+
769
+ #
770
+ # Deletes a Private DNS zone. WARNING: All DNS records in the zone will also be
771
+ # deleted. This operation cannot be undone. Private DNS zone cannot be deleted
772
+ # unless all virtual network links to it are removed.
773
+ #
774
+ # @param resource_group_name [String] The name of the resource group.
775
+ # @param private_zone_name [String] The name of the Private DNS zone (without a
776
+ # terminating dot).
777
+ # @param if_match [String] The ETag of the Private DNS zone. Omit this value to
778
+ # always delete the current zone. Specify the last-seen ETag value to prevent
779
+ # accidentally deleting any concurrent changes.
780
+ # @param [Hash{String => String}] A hash of custom headers that will be added
781
+ # to the HTTP request.
782
+ #
783
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
784
+ #
785
+ def begin_delete_async(resource_group_name, private_zone_name, if_match:nil, custom_headers:nil)
786
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
787
+ fail ArgumentError, 'private_zone_name is nil' if private_zone_name.nil?
788
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
789
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
790
+
791
+
792
+ request_headers = {}
793
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
794
+
795
+ # Set Headers
796
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
797
+ request_headers['If-Match'] = if_match unless if_match.nil?
798
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
799
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/privateDnsZones/{privateZoneName}'
800
+
801
+ request_url = @base_url || @client.base_url
802
+
803
+ options = {
804
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
805
+ path_params: {'resourceGroupName' => resource_group_name,'privateZoneName' => private_zone_name,'subscriptionId' => @client.subscription_id},
806
+ query_params: {'api-version' => @client.api_version},
807
+ headers: request_headers.merge(custom_headers || {}),
808
+ base_url: request_url
809
+ }
810
+ promise = @client.make_request_async(:delete, path_template, options)
811
+
812
+ promise = promise.then do |result|
813
+ http_response = result.response
814
+ status_code = http_response.status
815
+ response_content = http_response.body
816
+ unless status_code == 200 || status_code == 202 || status_code == 204
817
+ error_model = JSON.load(response_content)
818
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
819
+ end
820
+
821
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
822
+
823
+ result
824
+ end
825
+
826
+ promise.execute
827
+ end
828
+
829
+ #
830
+ # Lists the Private DNS zones in all resource groups in a subscription.
831
+ #
832
+ # @param next_page_link [String] The NextLink from the previous successful call
833
+ # to List operation.
834
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
835
+ # will be added to the HTTP request.
836
+ #
837
+ # @return [PrivateZoneListResult] operation results.
838
+ #
839
+ def list_next(next_page_link, custom_headers:nil)
840
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
841
+ response.body unless response.nil?
842
+ end
843
+
844
+ #
845
+ # Lists the Private DNS zones in all resource groups in a subscription.
846
+ #
847
+ # @param next_page_link [String] The NextLink from the previous successful call
848
+ # to List operation.
849
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
850
+ # will be added to the HTTP request.
851
+ #
852
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
853
+ #
854
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
855
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
856
+ end
857
+
858
+ #
859
+ # Lists the Private DNS zones in all resource groups in a subscription.
860
+ #
861
+ # @param next_page_link [String] The NextLink from the previous successful call
862
+ # to List operation.
863
+ # @param [Hash{String => String}] A hash of custom headers that will be added
864
+ # to the HTTP request.
865
+ #
866
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
867
+ #
868
+ def list_next_async(next_page_link, custom_headers:nil)
869
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
870
+
871
+
872
+ request_headers = {}
873
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
874
+
875
+ # Set Headers
876
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
877
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
878
+ path_template = '{nextLink}'
879
+
880
+ request_url = @base_url || @client.base_url
881
+
882
+ options = {
883
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
884
+ skip_encoding_path_params: {'nextLink' => next_page_link},
885
+ headers: request_headers.merge(custom_headers || {}),
886
+ base_url: request_url
887
+ }
888
+ promise = @client.make_request_async(:get, path_template, options)
889
+
890
+ promise = promise.then do |result|
891
+ http_response = result.response
892
+ status_code = http_response.status
893
+ response_content = http_response.body
894
+ unless status_code == 200
895
+ error_model = JSON.load(response_content)
896
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
897
+ end
898
+
899
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
900
+ # Deserialize Response
901
+ if status_code == 200
902
+ begin
903
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
904
+ result_mapper = Azure::PrivateDns::Mgmt::V2018_09_01::Models::PrivateZoneListResult.mapper()
905
+ result.body = @client.deserialize(result_mapper, parsed_response)
906
+ rescue Exception => e
907
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
908
+ end
909
+ end
910
+
911
+ result
912
+ end
913
+
914
+ promise.execute
915
+ end
916
+
917
+ #
918
+ # Lists the Private DNS zones within a resource group.
919
+ #
920
+ # @param next_page_link [String] The NextLink from the previous successful call
921
+ # to List operation.
922
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
923
+ # will be added to the HTTP request.
924
+ #
925
+ # @return [PrivateZoneListResult] operation results.
926
+ #
927
+ def list_by_resource_group_next(next_page_link, custom_headers:nil)
928
+ response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
929
+ response.body unless response.nil?
930
+ end
931
+
932
+ #
933
+ # Lists the Private DNS zones within a resource group.
934
+ #
935
+ # @param next_page_link [String] The NextLink from the previous successful call
936
+ # to List operation.
937
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
938
+ # will be added to the HTTP request.
939
+ #
940
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
941
+ #
942
+ def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
943
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
944
+ end
945
+
946
+ #
947
+ # Lists the Private DNS zones within a resource group.
948
+ #
949
+ # @param next_page_link [String] The NextLink from the previous successful call
950
+ # to List operation.
951
+ # @param [Hash{String => String}] A hash of custom headers that will be added
952
+ # to the HTTP request.
953
+ #
954
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
955
+ #
956
+ def list_by_resource_group_next_async(next_page_link, custom_headers:nil)
957
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
958
+
959
+
960
+ request_headers = {}
961
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
962
+
963
+ # Set Headers
964
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
965
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
966
+ path_template = '{nextLink}'
967
+
968
+ request_url = @base_url || @client.base_url
969
+
970
+ options = {
971
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
972
+ skip_encoding_path_params: {'nextLink' => next_page_link},
973
+ headers: request_headers.merge(custom_headers || {}),
974
+ base_url: request_url
975
+ }
976
+ promise = @client.make_request_async(:get, path_template, options)
977
+
978
+ promise = promise.then do |result|
979
+ http_response = result.response
980
+ status_code = http_response.status
981
+ response_content = http_response.body
982
+ unless status_code == 200
983
+ error_model = JSON.load(response_content)
984
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
985
+ end
986
+
987
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
988
+ # Deserialize Response
989
+ if status_code == 200
990
+ begin
991
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
992
+ result_mapper = Azure::PrivateDns::Mgmt::V2018_09_01::Models::PrivateZoneListResult.mapper()
993
+ result.body = @client.deserialize(result_mapper, parsed_response)
994
+ rescue Exception => e
995
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
996
+ end
997
+ end
998
+
999
+ result
1000
+ end
1001
+
1002
+ promise.execute
1003
+ end
1004
+
1005
+ #
1006
+ # Lists the Private DNS zones in all resource groups in a subscription.
1007
+ #
1008
+ # @param top [Integer] The maximum number of Private DNS zones to return. If
1009
+ # not specified, returns up to 100 zones.
1010
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1011
+ # will be added to the HTTP request.
1012
+ #
1013
+ # @return [PrivateZoneListResult] which provide lazy access to pages of the
1014
+ # response.
1015
+ #
1016
+ def list_as_lazy(top:nil, custom_headers:nil)
1017
+ response = list_async(top:top, custom_headers:custom_headers).value!
1018
+ unless response.nil?
1019
+ page = response.body
1020
+ page.next_method = Proc.new do |next_page_link|
1021
+ list_next_async(next_page_link, custom_headers:custom_headers)
1022
+ end
1023
+ page
1024
+ end
1025
+ end
1026
+
1027
+ #
1028
+ # Lists the Private DNS zones within a resource group.
1029
+ #
1030
+ # @param resource_group_name [String] The name of the resource group.
1031
+ # @param top [Integer] The maximum number of record sets to return. If not
1032
+ # specified, returns up to 100 record sets.
1033
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1034
+ # will be added to the HTTP request.
1035
+ #
1036
+ # @return [PrivateZoneListResult] which provide lazy access to pages of the
1037
+ # response.
1038
+ #
1039
+ def list_by_resource_group_as_lazy(resource_group_name, top:nil, custom_headers:nil)
1040
+ response = list_by_resource_group_async(resource_group_name, top:top, custom_headers:custom_headers).value!
1041
+ unless response.nil?
1042
+ page = response.body
1043
+ page.next_method = Proc.new do |next_page_link|
1044
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
1045
+ end
1046
+ page
1047
+ end
1048
+ end
1049
+
1050
+ end
1051
+ end