azure_mgmt_graph 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -15,6 +15,40 @@ module Azure::ARM::Graph
15
15
  # @return [Array<Application>] Application list.
16
16
  attr_accessor :value
17
17
 
18
+ # @return [String] the URL to get the next set of results.
19
+ attr_accessor :odatanext_link
20
+
21
+ # return [Proc] with next page method call.
22
+ attr_accessor :next_method
23
+
24
+ #
25
+ # Gets the rest of the items for the request, enabling auto-pagination.
26
+ #
27
+ # @return [Array<Application>] operation results.
28
+ #
29
+ def get_all_items
30
+ items = @value
31
+ page = self
32
+ while page.odatanext_link != nil do
33
+ page = page.get_next_page
34
+ items.concat(page.value)
35
+ end
36
+ items
37
+ end
38
+
39
+ #
40
+ # Gets the next page of results.
41
+ #
42
+ # @return [ApplicationListResult] with next page content.
43
+ #
44
+ def get_next_page
45
+ response = @next_method.call(@odatanext_link).value! unless @next_method.nil?
46
+ unless response.nil?
47
+ @odatanext_link = response.body.odatanext_link
48
+ @value = response.body.value
49
+ self
50
+ end
51
+ end
18
52
 
19
53
  #
20
54
  # Mapper for ApplicationListResult class as Ruby Hash.
@@ -42,6 +76,13 @@ module Azure::ARM::Graph
42
76
  }
43
77
  }
44
78
  }
79
+ },
80
+ odatanext_link: {
81
+ required: false,
82
+ serialized_name: 'odata\\.nextLink',
83
+ type: {
84
+ name: 'String'
85
+ }
45
86
  }
46
87
  }
47
88
  }
@@ -29,7 +29,7 @@ module Azure::ARM::Graph
29
29
  class_name: 'KeyCredentialsUpdateParameters',
30
30
  model_properties: {
31
31
  value: {
32
- required: false,
32
+ required: true,
33
33
  serialized_name: 'value',
34
34
  type: {
35
35
  name: 'Sequence',
@@ -29,7 +29,7 @@ module Azure::ARM::Graph
29
29
  class_name: 'PasswordCredentialsUpdateParameters',
30
30
  model_properties: {
31
31
  value: {
32
- required: false,
32
+ required: true,
33
33
  serialized_name: 'value',
34
34
  type: {
35
35
  name: 'Sequence',
@@ -66,30 +66,27 @@ module Azure::ARM::Graph
66
66
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
67
67
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
68
68
  path_template = '/{tenantID}/me'
69
+
70
+ request_url = @base_url || @client.base_url
71
+
69
72
  options = {
70
73
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
71
74
  path_params: {'tenantID' => @client.tenant_id},
72
75
  query_params: {'api-version' => api_version},
73
- headers: request_headers.merge(custom_headers || {})
76
+ headers: request_headers.merge(custom_headers || {}),
77
+ base_url: request_url
74
78
  }
79
+ promise = @client.make_request_async(:get, path_template, options)
75
80
 
76
- request_url = @base_url || @client.base_url
77
-
78
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
79
- promise = request.run_promise do |req|
80
- @client.credentials.sign_request(req) unless @client.credentials.nil?
81
- end
82
-
83
- promise = promise.then do |http_response|
81
+ promise = promise.then do |result|
82
+ http_response = result.response
84
83
  status_code = http_response.status
85
84
  response_content = http_response.body
86
85
  unless status_code == 200
87
86
  error_model = JSON.load(response_content)
88
- fail MsRest::HttpOperationError.new(request, http_response, error_model)
87
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
89
88
  end
90
89
 
91
- # Create Result
92
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
93
90
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
94
91
  # Deserialize Response
95
92
  if status_code == 200
@@ -112,7 +109,6 @@ module Azure::ARM::Graph
112
109
  # Gets AD group membership by provided AD object Ids
113
110
  #
114
111
  # @param parameters [GetObjectsParameters] Objects filtering parameters.
115
- # @param api_version [String] Client Api Version.
116
112
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
117
113
  # will be added to the HTTP request.
118
114
  #
@@ -186,31 +182,28 @@ module Azure::ARM::Graph
186
182
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
187
183
 
188
184
  path_template = '/{tenantID}/getObjectsByObjectIds'
185
+
186
+ request_url = @base_url || @client.base_url
187
+
189
188
  options = {
190
189
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
191
190
  path_params: {'tenantID' => @client.tenant_id},
192
191
  query_params: {'api-version' => api_version},
193
192
  body: request_content,
194
- headers: request_headers.merge(custom_headers || {})
193
+ headers: request_headers.merge(custom_headers || {}),
194
+ base_url: request_url
195
195
  }
196
+ promise = @client.make_request_async(:post, path_template, options)
196
197
 
197
- request_url = @base_url || @client.base_url
198
-
199
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options)
200
- promise = request.run_promise do |req|
201
- @client.credentials.sign_request(req) unless @client.credentials.nil?
202
- end
203
-
204
- promise = promise.then do |http_response|
198
+ promise = promise.then do |result|
199
+ http_response = result.response
205
200
  status_code = http_response.status
206
201
  response_content = http_response.body
207
202
  unless status_code == 200
208
203
  error_model = JSON.load(response_content)
209
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
204
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
210
205
  end
211
206
 
212
- # Create Result
213
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
214
207
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
215
208
  # Deserialize Response
216
209
  if status_code == 200
@@ -277,31 +270,28 @@ module Azure::ARM::Graph
277
270
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
278
271
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
279
272
  path_template = '/{tenantID}/{nextLink}'
273
+
274
+ request_url = @base_url || @client.base_url
275
+
280
276
  options = {
281
277
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
282
278
  path_params: {'tenantID' => @client.tenant_id},
283
279
  skip_encoding_path_params: {'nextLink' => next_link},
284
280
  query_params: {'api-version' => api_version},
285
- headers: request_headers.merge(custom_headers || {})
281
+ headers: request_headers.merge(custom_headers || {}),
282
+ base_url: request_url
286
283
  }
284
+ promise = @client.make_request_async(:post, path_template, options)
287
285
 
288
- request_url = @base_url || @client.base_url
289
-
290
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options)
291
- promise = request.run_promise do |req|
292
- @client.credentials.sign_request(req) unless @client.credentials.nil?
293
- end
294
-
295
- promise = promise.then do |http_response|
286
+ promise = promise.then do |result|
287
+ http_response = result.response
296
288
  status_code = http_response.status
297
289
  response_content = http_response.body
298
290
  unless status_code == 200
299
291
  error_model = JSON.load(response_content)
300
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
292
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
301
293
  end
302
294
 
303
- # Create Result
304
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
305
295
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
306
296
  # Deserialize Response
307
297
  if status_code == 200
@@ -81,31 +81,28 @@ module Azure::ARM::Graph
81
81
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
82
82
 
83
83
  path_template = '/{tenantID}/servicePrincipals'
84
+
85
+ request_url = @base_url || @client.base_url
86
+
84
87
  options = {
85
88
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
86
89
  path_params: {'tenantID' => @client.tenant_id},
87
90
  query_params: {'api-version' => api_version},
88
91
  body: request_content,
89
- headers: request_headers.merge(custom_headers || {})
92
+ headers: request_headers.merge(custom_headers || {}),
93
+ base_url: request_url
90
94
  }
95
+ promise = @client.make_request_async(:post, path_template, options)
91
96
 
92
- request_url = @base_url || @client.base_url
93
-
94
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options)
95
- promise = request.run_promise do |req|
96
- @client.credentials.sign_request(req) unless @client.credentials.nil?
97
- end
98
-
99
- promise = promise.then do |http_response|
97
+ promise = promise.then do |result|
98
+ http_response = result.response
100
99
  status_code = http_response.status
101
100
  response_content = http_response.body
102
101
  unless status_code == 201
103
102
  error_model = JSON.load(response_content)
104
- fail MsRest::HttpOperationError.new(request, http_response, error_model)
103
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
105
104
  end
106
105
 
107
- # Create Result
108
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
109
106
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
110
107
  # Deserialize Response
111
108
  if status_code == 201
@@ -127,7 +124,6 @@ module Azure::ARM::Graph
127
124
  #
128
125
  # Gets list of service principals from the current tenant.
129
126
  #
130
- # @param api_version [String] Client Api Version.
131
127
  # @param filter [String] The filter to apply on the operation.
132
128
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
133
129
  # will be added to the HTTP request.
@@ -193,30 +189,27 @@ module Azure::ARM::Graph
193
189
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
194
190
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
195
191
  path_template = '/{tenantID}/servicePrincipals'
192
+
193
+ request_url = @base_url || @client.base_url
194
+
196
195
  options = {
197
196
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
198
197
  path_params: {'tenantID' => @client.tenant_id},
199
198
  query_params: {'$filter' => filter,'api-version' => api_version},
200
- headers: request_headers.merge(custom_headers || {})
199
+ headers: request_headers.merge(custom_headers || {}),
200
+ base_url: request_url
201
201
  }
202
+ promise = @client.make_request_async(:get, path_template, options)
202
203
 
203
- request_url = @base_url || @client.base_url
204
-
205
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
206
- promise = request.run_promise do |req|
207
- @client.credentials.sign_request(req) unless @client.credentials.nil?
208
- end
209
-
210
- promise = promise.then do |http_response|
204
+ promise = promise.then do |result|
205
+ http_response = result.response
211
206
  status_code = http_response.status
212
207
  response_content = http_response.body
213
208
  unless status_code == 200
214
209
  error_model = JSON.load(response_content)
215
- fail MsRest::HttpOperationError.new(request, http_response, error_model)
210
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
216
211
  end
217
212
 
218
- # Create Result
219
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
220
213
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
221
214
  # Deserialize Response
222
215
  if status_code == 200
@@ -282,31 +275,28 @@ module Azure::ARM::Graph
282
275
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
283
276
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
284
277
  path_template = '/{tenantID}/servicePrincipals/{objectId}'
278
+
279
+ request_url = @base_url || @client.base_url
280
+
285
281
  options = {
286
282
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
287
283
  path_params: {'tenantID' => @client.tenant_id},
288
284
  skip_encoding_path_params: {'objectId' => object_id},
289
285
  query_params: {'api-version' => api_version},
290
- headers: request_headers.merge(custom_headers || {})
286
+ headers: request_headers.merge(custom_headers || {}),
287
+ base_url: request_url
291
288
  }
289
+ promise = @client.make_request_async(:delete, path_template, options)
292
290
 
293
- request_url = @base_url || @client.base_url
294
-
295
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :delete, options)
296
- promise = request.run_promise do |req|
297
- @client.credentials.sign_request(req) unless @client.credentials.nil?
298
- end
299
-
300
- promise = promise.then do |http_response|
291
+ promise = promise.then do |result|
292
+ http_response = result.response
301
293
  status_code = http_response.status
302
294
  response_content = http_response.body
303
295
  unless status_code == 204
304
296
  error_model = JSON.load(response_content)
305
- fail MsRest::HttpOperationError.new(request, http_response, error_model)
297
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
306
298
  end
307
299
 
308
- # Create Result
309
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
310
300
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
311
301
 
312
302
  result
@@ -363,31 +353,28 @@ module Azure::ARM::Graph
363
353
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
364
354
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
365
355
  path_template = '/{tenantID}/servicePrincipals/{objectId}'
356
+
357
+ request_url = @base_url || @client.base_url
358
+
366
359
  options = {
367
360
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
368
361
  path_params: {'tenantID' => @client.tenant_id},
369
362
  skip_encoding_path_params: {'objectId' => object_id},
370
363
  query_params: {'api-version' => api_version},
371
- headers: request_headers.merge(custom_headers || {})
364
+ headers: request_headers.merge(custom_headers || {}),
365
+ base_url: request_url
372
366
  }
367
+ promise = @client.make_request_async(:get, path_template, options)
373
368
 
374
- request_url = @base_url || @client.base_url
375
-
376
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
377
- promise = request.run_promise do |req|
378
- @client.credentials.sign_request(req) unless @client.credentials.nil?
379
- end
380
-
381
- promise = promise.then do |http_response|
369
+ promise = promise.then do |result|
370
+ http_response = result.response
382
371
  status_code = http_response.status
383
372
  response_content = http_response.body
384
373
  unless status_code == 200
385
374
  error_model = JSON.load(response_content)
386
- fail MsRest::HttpOperationError.new(request, http_response, error_model)
375
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
387
376
  end
388
377
 
389
- # Create Result
390
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
391
378
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
392
379
  # Deserialize Response
393
380
  if status_code == 200
@@ -460,31 +447,28 @@ module Azure::ARM::Graph
460
447
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
461
448
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
462
449
  path_template = '/{tenantID}/servicePrincipals/{objectId}/keyCredentials'
450
+
451
+ request_url = @base_url || @client.base_url
452
+
463
453
  options = {
464
454
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
465
455
  path_params: {'tenantID' => @client.tenant_id},
466
456
  skip_encoding_path_params: {'objectId' => object_id},
467
457
  query_params: {'api-version' => api_version},
468
- headers: request_headers.merge(custom_headers || {})
458
+ headers: request_headers.merge(custom_headers || {}),
459
+ base_url: request_url
469
460
  }
461
+ promise = @client.make_request_async(:get, path_template, options)
470
462
 
471
- request_url = @base_url || @client.base_url
472
-
473
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
474
- promise = request.run_promise do |req|
475
- @client.credentials.sign_request(req) unless @client.credentials.nil?
476
- end
477
-
478
- promise = promise.then do |http_response|
463
+ promise = promise.then do |result|
464
+ http_response = result.response
479
465
  status_code = http_response.status
480
466
  response_content = http_response.body
481
467
  unless status_code == 200
482
468
  error_model = JSON.load(response_content)
483
- fail MsRest::HttpOperationError.new(request, http_response, error_model)
469
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
484
470
  end
485
471
 
486
- # Create Result
487
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
488
472
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
489
473
  # Deserialize Response
490
474
  if status_code == 200
@@ -571,32 +555,29 @@ module Azure::ARM::Graph
571
555
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
572
556
 
573
557
  path_template = '/{tenantID}/servicePrincipals/{objectId}/keyCredentials'
558
+
559
+ request_url = @base_url || @client.base_url
560
+
574
561
  options = {
575
562
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
576
563
  path_params: {'tenantID' => @client.tenant_id},
577
564
  skip_encoding_path_params: {'objectId' => object_id},
578
565
  query_params: {'api-version' => api_version},
579
566
  body: request_content,
580
- headers: request_headers.merge(custom_headers || {})
567
+ headers: request_headers.merge(custom_headers || {}),
568
+ base_url: request_url
581
569
  }
570
+ promise = @client.make_request_async(:patch, path_template, options)
582
571
 
583
- request_url = @base_url || @client.base_url
584
-
585
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :patch, options)
586
- promise = request.run_promise do |req|
587
- @client.credentials.sign_request(req) unless @client.credentials.nil?
588
- end
589
-
590
- promise = promise.then do |http_response|
572
+ promise = promise.then do |result|
573
+ http_response = result.response
591
574
  status_code = http_response.status
592
575
  response_content = http_response.body
593
576
  unless status_code == 204
594
577
  error_model = JSON.load(response_content)
595
- fail MsRest::HttpOperationError.new(request, http_response, error_model)
578
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
596
579
  end
597
580
 
598
- # Create Result
599
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
600
581
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
601
582
 
602
583
  result
@@ -659,31 +640,28 @@ module Azure::ARM::Graph
659
640
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
660
641
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
661
642
  path_template = '/{tenantID}/servicePrincipals/{objectId}/passwordCredentials'
643
+
644
+ request_url = @base_url || @client.base_url
645
+
662
646
  options = {
663
647
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
664
648
  path_params: {'tenantID' => @client.tenant_id},
665
649
  skip_encoding_path_params: {'objectId' => object_id},
666
650
  query_params: {'api-version' => api_version},
667
- headers: request_headers.merge(custom_headers || {})
651
+ headers: request_headers.merge(custom_headers || {}),
652
+ base_url: request_url
668
653
  }
654
+ promise = @client.make_request_async(:get, path_template, options)
669
655
 
670
- request_url = @base_url || @client.base_url
671
-
672
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
673
- promise = request.run_promise do |req|
674
- @client.credentials.sign_request(req) unless @client.credentials.nil?
675
- end
676
-
677
- promise = promise.then do |http_response|
656
+ promise = promise.then do |result|
657
+ http_response = result.response
678
658
  status_code = http_response.status
679
659
  response_content = http_response.body
680
660
  unless status_code == 200
681
661
  error_model = JSON.load(response_content)
682
- fail MsRest::HttpOperationError.new(request, http_response, error_model)
662
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
683
663
  end
684
664
 
685
- # Create Result
686
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
687
665
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
688
666
  # Deserialize Response
689
667
  if status_code == 200
@@ -770,32 +748,29 @@ module Azure::ARM::Graph
770
748
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
771
749
 
772
750
  path_template = '/{tenantID}/servicePrincipals/{objectId}/passwordCredentials'
751
+
752
+ request_url = @base_url || @client.base_url
753
+
773
754
  options = {
774
755
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
775
756
  path_params: {'tenantID' => @client.tenant_id},
776
757
  skip_encoding_path_params: {'objectId' => object_id},
777
758
  query_params: {'api-version' => api_version},
778
759
  body: request_content,
779
- headers: request_headers.merge(custom_headers || {})
760
+ headers: request_headers.merge(custom_headers || {}),
761
+ base_url: request_url
780
762
  }
763
+ promise = @client.make_request_async(:patch, path_template, options)
781
764
 
782
- request_url = @base_url || @client.base_url
783
-
784
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :patch, options)
785
- promise = request.run_promise do |req|
786
- @client.credentials.sign_request(req) unless @client.credentials.nil?
787
- end
788
-
789
- promise = promise.then do |http_response|
765
+ promise = promise.then do |result|
766
+ http_response = result.response
790
767
  status_code = http_response.status
791
768
  response_content = http_response.body
792
769
  unless status_code == 204
793
770
  error_model = JSON.load(response_content)
794
- fail MsRest::HttpOperationError.new(request, http_response, error_model)
771
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
795
772
  end
796
773
 
797
- # Create Result
798
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
799
774
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
800
775
 
801
776
  result
@@ -852,31 +827,28 @@ module Azure::ARM::Graph
852
827
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
853
828
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
854
829
  path_template = '/{tenantID}/{nextLink}'
830
+
831
+ request_url = @base_url || @client.base_url
832
+
855
833
  options = {
856
834
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
857
835
  path_params: {'tenantID' => @client.tenant_id},
858
836
  skip_encoding_path_params: {'nextLink' => next_link},
859
837
  query_params: {'api-version' => api_version},
860
- headers: request_headers.merge(custom_headers || {})
838
+ headers: request_headers.merge(custom_headers || {}),
839
+ base_url: request_url
861
840
  }
841
+ promise = @client.make_request_async(:get, path_template, options)
862
842
 
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|
843
+ promise = promise.then do |result|
844
+ http_response = result.response
871
845
  status_code = http_response.status
872
846
  response_content = http_response.body
873
847
  unless status_code == 200
874
848
  error_model = JSON.load(response_content)
875
- fail MsRest::HttpOperationError.new(request, http_response, error_model)
849
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
876
850
  end
877
851
 
878
- # Create Result
879
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
880
852
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
881
853
  # Deserialize Response
882
854
  if status_code == 200