azure_mgmt_resources 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -73,30 +73,27 @@ module Azure::ARM::Resources
73
73
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
74
74
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
75
75
  path_template = '/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/unregister'
76
+
77
+ request_url = @base_url || @client.base_url
78
+
76
79
  options = {
77
80
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
78
81
  path_params: {'resourceProviderNamespace' => resource_provider_namespace,'subscriptionId' => @client.subscription_id},
79
82
  query_params: {'api-version' => @client.api_version},
80
- headers: request_headers.merge(custom_headers || {})
83
+ headers: request_headers.merge(custom_headers || {}),
84
+ base_url: request_url
81
85
  }
86
+ promise = @client.make_request_async(:post, path_template, options)
82
87
 
83
- request_url = @base_url || @client.base_url
84
-
85
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options)
86
- promise = request.run_promise do |req|
87
- @client.credentials.sign_request(req) unless @client.credentials.nil?
88
- end
89
-
90
- promise = promise.then do |http_response|
88
+ promise = promise.then do |result|
89
+ http_response = result.response
91
90
  status_code = http_response.status
92
91
  response_content = http_response.body
93
92
  unless status_code == 200
94
93
  error_model = JSON.load(response_content)
95
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
94
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
96
95
  end
97
96
 
98
- # Create Result
99
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
100
97
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
101
98
  # Deserialize Response
102
99
  if status_code == 200
@@ -166,30 +163,27 @@ module Azure::ARM::Resources
166
163
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
167
164
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
168
165
  path_template = '/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/register'
166
+
167
+ request_url = @base_url || @client.base_url
168
+
169
169
  options = {
170
170
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
171
171
  path_params: {'resourceProviderNamespace' => resource_provider_namespace,'subscriptionId' => @client.subscription_id},
172
172
  query_params: {'api-version' => @client.api_version},
173
- headers: request_headers.merge(custom_headers || {})
173
+ headers: request_headers.merge(custom_headers || {}),
174
+ base_url: request_url
174
175
  }
176
+ promise = @client.make_request_async(:post, path_template, options)
175
177
 
176
- request_url = @base_url || @client.base_url
177
-
178
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options)
179
- promise = request.run_promise do |req|
180
- @client.credentials.sign_request(req) unless @client.credentials.nil?
181
- end
182
-
183
- promise = promise.then do |http_response|
178
+ promise = promise.then do |result|
179
+ http_response = result.response
184
180
  status_code = http_response.status
185
181
  response_content = http_response.body
186
182
  unless status_code == 200
187
183
  error_model = JSON.load(response_content)
188
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
184
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
189
185
  end
190
186
 
191
- # Create Result
192
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
193
187
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
194
188
  # Deserialize Response
195
189
  if status_code == 200
@@ -225,8 +219,8 @@ module Azure::ARM::Resources
225
219
  response = list_async(top, expand, custom_headers).value!
226
220
  unless response.nil?
227
221
  page = response.body
228
- page.next_method = Proc.new do |next_link|
229
- list_next_async(next_link, custom_headers)
222
+ page.next_method = Proc.new do |next_page_link|
223
+ list_next_async(next_page_link, custom_headers)
230
224
  end
231
225
  page
232
226
  end
@@ -288,30 +282,27 @@ module Azure::ARM::Resources
288
282
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
289
283
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
290
284
  path_template = '/subscriptions/{subscriptionId}/providers'
285
+
286
+ request_url = @base_url || @client.base_url
287
+
291
288
  options = {
292
289
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
293
290
  path_params: {'subscriptionId' => @client.subscription_id},
294
291
  query_params: {'$top' => top,'$expand' => expand,'api-version' => @client.api_version},
295
- headers: request_headers.merge(custom_headers || {})
292
+ headers: request_headers.merge(custom_headers || {}),
293
+ base_url: request_url
296
294
  }
295
+ promise = @client.make_request_async(:get, path_template, options)
297
296
 
298
- request_url = @base_url || @client.base_url
299
-
300
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
301
- promise = request.run_promise do |req|
302
- @client.credentials.sign_request(req) unless @client.credentials.nil?
303
- end
304
-
305
- promise = promise.then do |http_response|
297
+ promise = promise.then do |result|
298
+ http_response = result.response
306
299
  status_code = http_response.status
307
300
  response_content = http_response.body
308
301
  unless status_code == 200
309
302
  error_model = JSON.load(response_content)
310
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
303
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
311
304
  end
312
305
 
313
- # Create Result
314
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
315
306
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
316
307
  # Deserialize Response
317
308
  if status_code == 200
@@ -387,30 +378,27 @@ module Azure::ARM::Resources
387
378
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
388
379
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
389
380
  path_template = '/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}'
381
+
382
+ request_url = @base_url || @client.base_url
383
+
390
384
  options = {
391
385
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
392
386
  path_params: {'resourceProviderNamespace' => resource_provider_namespace,'subscriptionId' => @client.subscription_id},
393
387
  query_params: {'$expand' => expand,'api-version' => @client.api_version},
394
- headers: request_headers.merge(custom_headers || {})
388
+ headers: request_headers.merge(custom_headers || {}),
389
+ base_url: request_url
395
390
  }
391
+ promise = @client.make_request_async(:get, path_template, options)
396
392
 
397
- request_url = @base_url || @client.base_url
398
-
399
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, 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|
393
+ promise = promise.then do |result|
394
+ http_response = result.response
405
395
  status_code = http_response.status
406
396
  response_content = http_response.body
407
397
  unless status_code == 200
408
398
  error_model = JSON.load(response_content)
409
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
399
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
410
400
  end
411
401
 
412
- # Create Result
413
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
414
402
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
415
403
  # Deserialize Response
416
404
  if status_code == 200
@@ -478,29 +466,26 @@ module Azure::ARM::Resources
478
466
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
479
467
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
480
468
  path_template = '{nextLink}'
469
+
470
+ request_url = @base_url || @client.base_url
471
+
481
472
  options = {
482
473
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
483
474
  skip_encoding_path_params: {'nextLink' => next_page_link},
484
- headers: request_headers.merge(custom_headers || {})
475
+ headers: request_headers.merge(custom_headers || {}),
476
+ base_url: request_url
485
477
  }
478
+ promise = @client.make_request_async(:get, path_template, options)
486
479
 
487
- request_url = @base_url || @client.base_url
488
-
489
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
490
- promise = request.run_promise do |req|
491
- @client.credentials.sign_request(req) unless @client.credentials.nil?
492
- end
493
-
494
- promise = promise.then do |http_response|
480
+ promise = promise.then do |result|
481
+ http_response = result.response
495
482
  status_code = http_response.status
496
483
  response_content = http_response.body
497
484
  unless status_code == 200
498
485
  error_model = JSON.load(response_content)
499
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
486
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
500
487
  end
501
488
 
502
- # Create Result
503
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
504
489
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
505
490
  # Deserialize Response
506
491
  if status_code == 200
@@ -41,8 +41,8 @@ module Azure::ARM::Resources
41
41
  response = list_resources_async(resource_group_name, filter, expand, top, custom_headers).value!
42
42
  unless response.nil?
43
43
  page = response.body
44
- page.next_method = Proc.new do |next_link|
45
- list_resources_next_async(next_link, custom_headers)
44
+ page.next_method = Proc.new do |next_page_link|
45
+ list_resources_next_async(next_page_link, custom_headers)
46
46
  end
47
47
  page
48
48
  end
@@ -111,30 +111,27 @@ module Azure::ARM::Resources
111
111
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
112
112
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
113
113
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/resources'
114
+
115
+ request_url = @base_url || @client.base_url
116
+
114
117
  options = {
115
118
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
116
119
  path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
117
120
  query_params: {'$filter' => filter,'$expand' => expand,'$top' => top,'api-version' => @client.api_version},
118
- headers: request_headers.merge(custom_headers || {})
121
+ headers: request_headers.merge(custom_headers || {}),
122
+ base_url: request_url
119
123
  }
124
+ promise = @client.make_request_async(:get, path_template, options)
120
125
 
121
- request_url = @base_url || @client.base_url
122
-
123
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
124
- promise = request.run_promise do |req|
125
- @client.credentials.sign_request(req) unless @client.credentials.nil?
126
- end
127
-
128
- promise = promise.then do |http_response|
126
+ promise = promise.then do |result|
127
+ http_response = result.response
129
128
  status_code = http_response.status
130
129
  response_content = http_response.body
131
130
  unless status_code == 200
132
131
  error_model = JSON.load(response_content)
133
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
132
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
134
133
  end
135
134
 
136
- # Create Result
137
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
138
135
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
139
136
  # Deserialize Response
140
137
  if status_code == 200
@@ -204,30 +201,27 @@ module Azure::ARM::Resources
204
201
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
205
202
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
206
203
  path_template = '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}'
204
+
205
+ request_url = @base_url || @client.base_url
206
+
207
207
  options = {
208
208
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
209
209
  path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
210
210
  query_params: {'api-version' => @client.api_version},
211
- headers: request_headers.merge(custom_headers || {})
211
+ headers: request_headers.merge(custom_headers || {}),
212
+ base_url: request_url
212
213
  }
214
+ promise = @client.make_request_async(:head, path_template, options)
213
215
 
214
- request_url = @base_url || @client.base_url
215
-
216
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :head, options)
217
- promise = request.run_promise do |req|
218
- @client.credentials.sign_request(req) unless @client.credentials.nil?
219
- end
220
-
221
- promise = promise.then do |http_response|
216
+ promise = promise.then do |result|
217
+ http_response = result.response
222
218
  status_code = http_response.status
223
219
  response_content = http_response.body
224
220
  unless status_code == 204 || status_code == 404
225
221
  error_model = JSON.load(response_content)
226
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
222
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
227
223
  end
228
224
 
229
- # Create Result
230
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
231
225
  result.body = (status_code == 204)
232
226
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
233
227
 
@@ -303,31 +297,28 @@ module Azure::ARM::Resources
303
297
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
304
298
 
305
299
  path_template = '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}'
300
+
301
+ request_url = @base_url || @client.base_url
302
+
306
303
  options = {
307
304
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
308
305
  path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
309
306
  query_params: {'api-version' => @client.api_version},
310
307
  body: request_content,
311
- headers: request_headers.merge(custom_headers || {})
308
+ headers: request_headers.merge(custom_headers || {}),
309
+ base_url: request_url
312
310
  }
311
+ promise = @client.make_request_async(:put, path_template, options)
313
312
 
314
- request_url = @base_url || @client.base_url
315
-
316
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :put, options)
317
- promise = request.run_promise do |req|
318
- @client.credentials.sign_request(req) unless @client.credentials.nil?
319
- end
320
-
321
- promise = promise.then do |http_response|
313
+ promise = promise.then do |result|
314
+ http_response = result.response
322
315
  status_code = http_response.status
323
316
  response_content = http_response.body
324
317
  unless status_code == 201 || status_code == 200
325
318
  error_model = JSON.load(response_content)
326
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
319
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
327
320
  end
328
321
 
329
- # Create Result
330
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
331
322
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
332
323
  # Deserialize Response
333
324
  if status_code == 201
@@ -444,30 +435,27 @@ module Azure::ARM::Resources
444
435
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
445
436
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
446
437
  path_template = '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}'
438
+
439
+ request_url = @base_url || @client.base_url
440
+
447
441
  options = {
448
442
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
449
443
  path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
450
444
  query_params: {'api-version' => @client.api_version},
451
- headers: request_headers.merge(custom_headers || {})
445
+ headers: request_headers.merge(custom_headers || {}),
446
+ base_url: request_url
452
447
  }
448
+ promise = @client.make_request_async(:delete, path_template, options)
453
449
 
454
- request_url = @base_url || @client.base_url
455
-
456
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :delete, options)
457
- promise = request.run_promise do |req|
458
- @client.credentials.sign_request(req) unless @client.credentials.nil?
459
- end
460
-
461
- promise = promise.then do |http_response|
450
+ promise = promise.then do |result|
451
+ http_response = result.response
462
452
  status_code = http_response.status
463
453
  response_content = http_response.body
464
454
  unless status_code == 202 || status_code == 200
465
455
  error_model = JSON.load(response_content)
466
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
456
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
467
457
  end
468
458
 
469
- # Create Result
470
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
471
459
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
472
460
 
473
461
  result
@@ -527,30 +515,27 @@ module Azure::ARM::Resources
527
515
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
528
516
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
529
517
  path_template = '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}'
518
+
519
+ request_url = @base_url || @client.base_url
520
+
530
521
  options = {
531
522
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
532
523
  path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
533
524
  query_params: {'api-version' => @client.api_version},
534
- headers: request_headers.merge(custom_headers || {})
525
+ headers: request_headers.merge(custom_headers || {}),
526
+ base_url: request_url
535
527
  }
528
+ promise = @client.make_request_async(:get, path_template, options)
536
529
 
537
- request_url = @base_url || @client.base_url
538
-
539
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
540
- promise = request.run_promise do |req|
541
- @client.credentials.sign_request(req) unless @client.credentials.nil?
542
- end
543
-
544
- promise = promise.then do |http_response|
530
+ promise = promise.then do |result|
531
+ http_response = result.response
545
532
  status_code = http_response.status
546
533
  response_content = http_response.body
547
534
  unless status_code == 200
548
535
  error_model = JSON.load(response_content)
549
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
536
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
550
537
  end
551
538
 
552
- # Create Result
553
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
554
539
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
555
540
  # Deserialize Response
556
541
  if status_code == 200
@@ -644,31 +629,28 @@ module Azure::ARM::Resources
644
629
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
645
630
 
646
631
  path_template = '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}'
632
+
633
+ request_url = @base_url || @client.base_url
634
+
647
635
  options = {
648
636
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
649
637
  path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
650
638
  query_params: {'api-version' => @client.api_version},
651
639
  body: request_content,
652
- headers: request_headers.merge(custom_headers || {})
640
+ headers: request_headers.merge(custom_headers || {}),
641
+ base_url: request_url
653
642
  }
643
+ promise = @client.make_request_async(:patch, path_template, options)
654
644
 
655
- request_url = @base_url || @client.base_url
656
-
657
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :patch, options)
658
- promise = request.run_promise do |req|
659
- @client.credentials.sign_request(req) unless @client.credentials.nil?
660
- end
661
-
662
- promise = promise.then do |http_response|
645
+ promise = promise.then do |result|
646
+ http_response = result.response
663
647
  status_code = http_response.status
664
648
  response_content = http_response.body
665
649
  unless status_code == 200
666
650
  error_model = JSON.load(response_content)
667
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
651
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
668
652
  end
669
653
 
670
- # Create Result
671
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
672
654
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
673
655
  # Deserialize Response
674
656
  if status_code == 200
@@ -753,31 +735,28 @@ module Azure::ARM::Resources
753
735
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
754
736
 
755
737
  path_template = '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/exportTemplate'
738
+
739
+ request_url = @base_url || @client.base_url
740
+
756
741
  options = {
757
742
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
758
743
  path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
759
744
  query_params: {'api-version' => @client.api_version},
760
745
  body: request_content,
761
- headers: request_headers.merge(custom_headers || {})
746
+ headers: request_headers.merge(custom_headers || {}),
747
+ base_url: request_url
762
748
  }
749
+ promise = @client.make_request_async(:post, path_template, options)
763
750
 
764
- request_url = @base_url || @client.base_url
765
-
766
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options)
767
- promise = request.run_promise do |req|
768
- @client.credentials.sign_request(req) unless @client.credentials.nil?
769
- end
770
-
771
- promise = promise.then do |http_response|
751
+ promise = promise.then do |result|
752
+ http_response = result.response
772
753
  status_code = http_response.status
773
754
  response_content = http_response.body
774
755
  unless status_code == 200
775
756
  error_model = JSON.load(response_content)
776
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
757
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
777
758
  end
778
759
 
779
- # Create Result
780
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
781
760
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
782
761
  # Deserialize Response
783
762
  if status_code == 200
@@ -812,8 +791,8 @@ module Azure::ARM::Resources
812
791
  response = list_async(filter, top, custom_headers).value!
813
792
  unless response.nil?
814
793
  page = response.body
815
- page.next_method = Proc.new do |next_link|
816
- list_next_async(next_link, custom_headers)
794
+ page.next_method = Proc.new do |next_page_link|
795
+ list_next_async(next_page_link, custom_headers)
817
796
  end
818
797
  page
819
798
  end
@@ -872,30 +851,27 @@ module Azure::ARM::Resources
872
851
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
873
852
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
874
853
  path_template = '/subscriptions/{subscriptionId}/resourcegroups'
854
+
855
+ request_url = @base_url || @client.base_url
856
+
875
857
  options = {
876
858
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
877
859
  path_params: {'subscriptionId' => @client.subscription_id},
878
860
  query_params: {'$filter' => filter,'$top' => top,'api-version' => @client.api_version},
879
- headers: request_headers.merge(custom_headers || {})
861
+ headers: request_headers.merge(custom_headers || {}),
862
+ base_url: request_url
880
863
  }
864
+ promise = @client.make_request_async(:get, path_template, options)
881
865
 
882
- request_url = @base_url || @client.base_url
883
-
884
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
885
- promise = request.run_promise do |req|
886
- @client.credentials.sign_request(req) unless @client.credentials.nil?
887
- end
888
-
889
- promise = promise.then do |http_response|
866
+ promise = promise.then do |result|
867
+ http_response = result.response
890
868
  status_code = http_response.status
891
869
  response_content = http_response.body
892
870
  unless status_code == 200
893
871
  error_model = JSON.load(response_content)
894
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
872
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
895
873
  end
896
874
 
897
- # Create Result
898
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
899
875
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
900
876
  # Deserialize Response
901
877
  if status_code == 200
@@ -963,29 +939,26 @@ module Azure::ARM::Resources
963
939
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
964
940
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
965
941
  path_template = '{nextLink}'
942
+
943
+ request_url = @base_url || @client.base_url
944
+
966
945
  options = {
967
946
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
968
947
  skip_encoding_path_params: {'nextLink' => next_page_link},
969
- headers: request_headers.merge(custom_headers || {})
948
+ headers: request_headers.merge(custom_headers || {}),
949
+ base_url: request_url
970
950
  }
951
+ promise = @client.make_request_async(:get, path_template, options)
971
952
 
972
- request_url = @base_url || @client.base_url
973
-
974
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
975
- promise = request.run_promise do |req|
976
- @client.credentials.sign_request(req) unless @client.credentials.nil?
977
- end
978
-
979
- promise = promise.then do |http_response|
953
+ promise = promise.then do |result|
954
+ http_response = result.response
980
955
  status_code = http_response.status
981
956
  response_content = http_response.body
982
957
  unless status_code == 200
983
958
  error_model = JSON.load(response_content)
984
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
959
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
985
960
  end
986
961
 
987
- # Create Result
988
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
989
962
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
990
963
  # Deserialize Response
991
964
  if status_code == 200
@@ -1053,29 +1026,26 @@ module Azure::ARM::Resources
1053
1026
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1054
1027
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1055
1028
  path_template = '{nextLink}'
1029
+
1030
+ request_url = @base_url || @client.base_url
1031
+
1056
1032
  options = {
1057
1033
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1058
1034
  skip_encoding_path_params: {'nextLink' => next_page_link},
1059
- headers: request_headers.merge(custom_headers || {})
1035
+ headers: request_headers.merge(custom_headers || {}),
1036
+ base_url: request_url
1060
1037
  }
1038
+ promise = @client.make_request_async(:get, path_template, options)
1061
1039
 
1062
- request_url = @base_url || @client.base_url
1063
-
1064
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
1065
- promise = request.run_promise do |req|
1066
- @client.credentials.sign_request(req) unless @client.credentials.nil?
1067
- end
1068
-
1069
- promise = promise.then do |http_response|
1040
+ promise = promise.then do |result|
1041
+ http_response = result.response
1070
1042
  status_code = http_response.status
1071
1043
  response_content = http_response.body
1072
1044
  unless status_code == 200
1073
1045
  error_model = JSON.load(response_content)
1074
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
1046
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1075
1047
  end
1076
1048
 
1077
- # Create Result
1078
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
1079
1049
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1080
1050
  # Deserialize Response
1081
1051
  if status_code == 200