azure_mgmt_privatedns 0.17.0

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