azure_mgmt_dns 0.4.0

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