azure_mgmt_devtestlabs 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -42,8 +42,8 @@ module Azure::ARM::DevTestLabs
42
42
  response = list_async(resource_group_name, lab_name, filter, top, order_by, custom_headers).value!
43
43
  unless response.nil?
44
44
  page = response.body
45
- page.next_method = Proc.new do |next_link|
46
- list_next_async(next_link, custom_headers)
45
+ page.next_method = Proc.new do |next_page_link|
46
+ list_next_async(next_page_link, custom_headers)
47
47
  end
48
48
  page
49
49
  end
@@ -116,30 +116,27 @@ module Azure::ARM::DevTestLabs
116
116
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
117
117
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
118
118
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/galleryimages'
119
+
120
+ request_url = @base_url || @client.base_url
121
+
119
122
  options = {
120
123
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
121
124
  path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labName' => lab_name},
122
125
  query_params: {'$filter' => filter,'$top' => top,'$orderBy' => order_by,'api-version' => @client.api_version},
123
- headers: request_headers.merge(custom_headers || {})
126
+ headers: request_headers.merge(custom_headers || {}),
127
+ base_url: request_url
124
128
  }
129
+ promise = @client.make_request_async(:get, path_template, options)
125
130
 
126
- request_url = @base_url || @client.base_url
127
-
128
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
129
- promise = request.run_promise do |req|
130
- @client.credentials.sign_request(req) unless @client.credentials.nil?
131
- end
132
-
133
- promise = promise.then do |http_response|
131
+ promise = promise.then do |result|
132
+ http_response = result.response
134
133
  status_code = http_response.status
135
134
  response_content = http_response.body
136
135
  unless status_code == 200
137
136
  error_model = JSON.load(response_content)
138
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
137
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
139
138
  end
140
139
 
141
- # Create Result
142
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
143
140
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
144
141
  # Deserialize Response
145
142
  if status_code == 200
@@ -207,29 +204,26 @@ module Azure::ARM::DevTestLabs
207
204
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
208
205
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
209
206
  path_template = '{nextLink}'
207
+
208
+ request_url = @base_url || @client.base_url
209
+
210
210
  options = {
211
211
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
212
212
  skip_encoding_path_params: {'nextLink' => next_page_link},
213
- headers: request_headers.merge(custom_headers || {})
213
+ headers: request_headers.merge(custom_headers || {}),
214
+ base_url: request_url
214
215
  }
216
+ promise = @client.make_request_async(:get, path_template, options)
215
217
 
216
- request_url = @base_url || @client.base_url
217
-
218
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
219
- promise = request.run_promise do |req|
220
- @client.credentials.sign_request(req) unless @client.credentials.nil?
221
- end
222
-
223
- promise = promise.then do |http_response|
218
+ promise = promise.then do |result|
219
+ http_response = result.response
224
220
  status_code = http_response.status
225
221
  response_content = http_response.body
226
222
  unless status_code == 200
227
223
  error_model = JSON.load(response_content)
228
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
224
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
229
225
  end
230
226
 
231
- # Create Result
232
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
233
227
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
234
228
  # Deserialize Response
235
229
  if status_code == 200
@@ -40,8 +40,8 @@ module Azure::ARM::DevTestLabs
40
40
  response = list_by_subscription_async(filter, top, order_by, custom_headers).value!
41
41
  unless response.nil?
42
42
  page = response.body
43
- page.next_method = Proc.new do |next_link|
44
- list_by_subscription_next_async(next_link, custom_headers)
43
+ page.next_method = Proc.new do |next_page_link|
44
+ list_by_subscription_next_async(next_page_link, custom_headers)
45
45
  end
46
46
  page
47
47
  end
@@ -106,30 +106,27 @@ module Azure::ARM::DevTestLabs
106
106
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
107
107
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
108
108
  path_template = '/subscriptions/{subscriptionId}/providers/Microsoft.DevTestLab/labs'
109
+
110
+ request_url = @base_url || @client.base_url
111
+
109
112
  options = {
110
113
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
111
114
  path_params: {'subscriptionId' => @client.subscription_id},
112
115
  query_params: {'$filter' => filter,'$top' => top,'$orderBy' => order_by,'api-version' => @client.api_version},
113
- headers: request_headers.merge(custom_headers || {})
116
+ headers: request_headers.merge(custom_headers || {}),
117
+ base_url: request_url
114
118
  }
119
+ promise = @client.make_request_async(:get, path_template, options)
115
120
 
116
- request_url = @base_url || @client.base_url
117
-
118
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
119
- promise = request.run_promise do |req|
120
- @client.credentials.sign_request(req) unless @client.credentials.nil?
121
- end
122
-
123
- promise = promise.then do |http_response|
121
+ promise = promise.then do |result|
122
+ http_response = result.response
124
123
  status_code = http_response.status
125
124
  response_content = http_response.body
126
125
  unless status_code == 200
127
126
  error_model = JSON.load(response_content)
128
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
127
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
129
128
  end
130
129
 
131
- # Create Result
132
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
133
130
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
134
131
  # Deserialize Response
135
132
  if status_code == 200
@@ -167,8 +164,8 @@ module Azure::ARM::DevTestLabs
167
164
  response = list_by_resource_group_async(resource_group_name, filter, top, order_by, custom_headers).value!
168
165
  unless response.nil?
169
166
  page = response.body
170
- page.next_method = Proc.new do |next_link|
171
- list_by_resource_group_next_async(next_link, custom_headers)
167
+ page.next_method = Proc.new do |next_page_link|
168
+ list_by_resource_group_next_async(next_page_link, custom_headers)
172
169
  end
173
170
  page
174
171
  end
@@ -237,30 +234,27 @@ module Azure::ARM::DevTestLabs
237
234
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
238
235
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
239
236
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs'
237
+
238
+ request_url = @base_url || @client.base_url
239
+
240
240
  options = {
241
241
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
242
242
  path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
243
243
  query_params: {'$filter' => filter,'$top' => top,'$orderBy' => order_by,'api-version' => @client.api_version},
244
- headers: request_headers.merge(custom_headers || {})
244
+ headers: request_headers.merge(custom_headers || {}),
245
+ base_url: request_url
245
246
  }
247
+ promise = @client.make_request_async(:get, path_template, options)
246
248
 
247
- request_url = @base_url || @client.base_url
248
-
249
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
250
- promise = request.run_promise do |req|
251
- @client.credentials.sign_request(req) unless @client.credentials.nil?
252
- end
253
-
254
- promise = promise.then do |http_response|
249
+ promise = promise.then do |result|
250
+ http_response = result.response
255
251
  status_code = http_response.status
256
252
  response_content = http_response.body
257
253
  unless status_code == 200
258
254
  error_model = JSON.load(response_content)
259
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
255
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
260
256
  end
261
257
 
262
- # Create Result
263
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
264
258
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
265
259
  # Deserialize Response
266
260
  if status_code == 200
@@ -331,30 +325,27 @@ module Azure::ARM::DevTestLabs
331
325
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
332
326
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
333
327
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name}'
328
+
329
+ request_url = @base_url || @client.base_url
330
+
334
331
  options = {
335
332
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
336
333
  path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'name' => name},
337
334
  query_params: {'api-version' => @client.api_version},
338
- headers: request_headers.merge(custom_headers || {})
335
+ headers: request_headers.merge(custom_headers || {}),
336
+ base_url: request_url
339
337
  }
338
+ promise = @client.make_request_async(:get, path_template, options)
340
339
 
341
- request_url = @base_url || @client.base_url
342
-
343
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
344
- promise = request.run_promise do |req|
345
- @client.credentials.sign_request(req) unless @client.credentials.nil?
346
- end
347
-
348
- promise = promise.then do |http_response|
340
+ promise = promise.then do |result|
341
+ http_response = result.response
349
342
  status_code = http_response.status
350
343
  response_content = http_response.body
351
344
  unless status_code == 200
352
345
  error_model = JSON.load(response_content)
353
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
346
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
354
347
  end
355
348
 
356
- # Create Result
357
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
358
349
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
359
350
  # Deserialize Response
360
351
  if status_code == 200
@@ -485,31 +476,28 @@ module Azure::ARM::DevTestLabs
485
476
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
486
477
 
487
478
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name}'
479
+
480
+ request_url = @base_url || @client.base_url
481
+
488
482
  options = {
489
483
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
490
484
  path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'name' => name},
491
485
  query_params: {'api-version' => @client.api_version},
492
486
  body: request_content,
493
- headers: request_headers.merge(custom_headers || {})
487
+ headers: request_headers.merge(custom_headers || {}),
488
+ base_url: request_url
494
489
  }
490
+ promise = @client.make_request_async(:put, path_template, options)
495
491
 
496
- request_url = @base_url || @client.base_url
497
-
498
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :put, 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|
492
+ promise = promise.then do |result|
493
+ http_response = result.response
504
494
  status_code = http_response.status
505
495
  response_content = http_response.body
506
496
  unless status_code == 200 || status_code == 201
507
497
  error_model = JSON.load(response_content)
508
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
498
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
509
499
  end
510
500
 
511
- # Create Result
512
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
513
501
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
514
502
  # Deserialize Response
515
503
  if status_code == 200
@@ -627,30 +615,27 @@ module Azure::ARM::DevTestLabs
627
615
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
628
616
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
629
617
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name}'
618
+
619
+ request_url = @base_url || @client.base_url
620
+
630
621
  options = {
631
622
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
632
623
  path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'name' => name},
633
624
  query_params: {'api-version' => @client.api_version},
634
- headers: request_headers.merge(custom_headers || {})
625
+ headers: request_headers.merge(custom_headers || {}),
626
+ base_url: request_url
635
627
  }
628
+ promise = @client.make_request_async(:delete, path_template, options)
636
629
 
637
- request_url = @base_url || @client.base_url
638
-
639
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :delete, options)
640
- promise = request.run_promise do |req|
641
- @client.credentials.sign_request(req) unless @client.credentials.nil?
642
- end
643
-
644
- promise = promise.then do |http_response|
630
+ promise = promise.then do |result|
631
+ http_response = result.response
645
632
  status_code = http_response.status
646
633
  response_content = http_response.body
647
634
  unless status_code == 202 || status_code == 204
648
635
  error_model = JSON.load(response_content)
649
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
636
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
650
637
  end
651
638
 
652
- # Create Result
653
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
654
639
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
655
640
 
656
641
  result
@@ -723,31 +708,28 @@ module Azure::ARM::DevTestLabs
723
708
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
724
709
 
725
710
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name}'
711
+
712
+ request_url = @base_url || @client.base_url
713
+
726
714
  options = {
727
715
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
728
716
  path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'name' => name},
729
717
  query_params: {'api-version' => @client.api_version},
730
718
  body: request_content,
731
- headers: request_headers.merge(custom_headers || {})
719
+ headers: request_headers.merge(custom_headers || {}),
720
+ base_url: request_url
732
721
  }
722
+ promise = @client.make_request_async(:patch, path_template, options)
733
723
 
734
- request_url = @base_url || @client.base_url
735
-
736
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :patch, options)
737
- promise = request.run_promise do |req|
738
- @client.credentials.sign_request(req) unless @client.credentials.nil?
739
- end
740
-
741
- promise = promise.then do |http_response|
724
+ promise = promise.then do |result|
725
+ http_response = result.response
742
726
  status_code = http_response.status
743
727
  response_content = http_response.body
744
728
  unless status_code == 200
745
729
  error_model = JSON.load(response_content)
746
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
730
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
747
731
  end
748
732
 
749
- # Create Result
750
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
751
733
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
752
734
  # Deserialize Response
753
735
  if status_code == 200
@@ -873,31 +855,28 @@ module Azure::ARM::DevTestLabs
873
855
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
874
856
 
875
857
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name}/createEnvironment'
858
+
859
+ request_url = @base_url || @client.base_url
860
+
876
861
  options = {
877
862
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
878
863
  path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'name' => name},
879
864
  query_params: {'api-version' => @client.api_version},
880
865
  body: request_content,
881
- headers: request_headers.merge(custom_headers || {})
866
+ headers: request_headers.merge(custom_headers || {}),
867
+ base_url: request_url
882
868
  }
869
+ promise = @client.make_request_async(:post, path_template, options)
883
870
 
884
- request_url = @base_url || @client.base_url
885
-
886
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options)
887
- promise = request.run_promise do |req|
888
- @client.credentials.sign_request(req) unless @client.credentials.nil?
889
- end
890
-
891
- promise = promise.then do |http_response|
871
+ promise = promise.then do |result|
872
+ http_response = result.response
892
873
  status_code = http_response.status
893
874
  response_content = http_response.body
894
875
  unless status_code == 200 || status_code == 202
895
876
  error_model = JSON.load(response_content)
896
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
877
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
897
878
  end
898
879
 
899
- # Create Result
900
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
901
880
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
902
881
 
903
882
  result
@@ -970,31 +949,28 @@ module Azure::ARM::DevTestLabs
970
949
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
971
950
 
972
951
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name}/generateUploadUri'
952
+
953
+ request_url = @base_url || @client.base_url
954
+
973
955
  options = {
974
956
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
975
957
  path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'name' => name},
976
958
  query_params: {'api-version' => @client.api_version},
977
959
  body: request_content,
978
- headers: request_headers.merge(custom_headers || {})
960
+ headers: request_headers.merge(custom_headers || {}),
961
+ base_url: request_url
979
962
  }
963
+ promise = @client.make_request_async(:post, path_template, options)
980
964
 
981
- request_url = @base_url || @client.base_url
982
-
983
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options)
984
- promise = request.run_promise do |req|
985
- @client.credentials.sign_request(req) unless @client.credentials.nil?
986
- end
987
-
988
- promise = promise.then do |http_response|
965
+ promise = promise.then do |result|
966
+ http_response = result.response
989
967
  status_code = http_response.status
990
968
  response_content = http_response.body
991
969
  unless status_code == 200
992
970
  error_model = JSON.load(response_content)
993
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
971
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
994
972
  end
995
973
 
996
- # Create Result
997
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
998
974
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
999
975
  # Deserialize Response
1000
976
  if status_code == 200
@@ -1028,8 +1004,8 @@ module Azure::ARM::DevTestLabs
1028
1004
  response = list_vhds_async(resource_group_name, name, custom_headers).value!
1029
1005
  unless response.nil?
1030
1006
  page = response.body
1031
- page.next_method = Proc.new do |next_link|
1032
- list_vhds_next_async(next_link, custom_headers)
1007
+ page.next_method = Proc.new do |next_page_link|
1008
+ list_vhds_next_async(next_page_link, custom_headers)
1033
1009
  end
1034
1010
  page
1035
1011
  end
@@ -1087,30 +1063,27 @@ module Azure::ARM::DevTestLabs
1087
1063
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1088
1064
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1089
1065
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{name}/listVhds'
1066
+
1067
+ request_url = @base_url || @client.base_url
1068
+
1090
1069
  options = {
1091
1070
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1092
1071
  path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'name' => name},
1093
1072
  query_params: {'api-version' => @client.api_version},
1094
- headers: request_headers.merge(custom_headers || {})
1073
+ headers: request_headers.merge(custom_headers || {}),
1074
+ base_url: request_url
1095
1075
  }
1076
+ promise = @client.make_request_async(:post, path_template, options)
1096
1077
 
1097
- request_url = @base_url || @client.base_url
1098
-
1099
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options)
1100
- promise = request.run_promise do |req|
1101
- @client.credentials.sign_request(req) unless @client.credentials.nil?
1102
- end
1103
-
1104
- promise = promise.then do |http_response|
1078
+ promise = promise.then do |result|
1079
+ http_response = result.response
1105
1080
  status_code = http_response.status
1106
1081
  response_content = http_response.body
1107
1082
  unless status_code == 200
1108
1083
  error_model = JSON.load(response_content)
1109
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
1084
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1110
1085
  end
1111
1086
 
1112
- # Create Result
1113
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
1114
1087
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1115
1088
  # Deserialize Response
1116
1089
  if status_code == 200
@@ -1178,29 +1151,26 @@ module Azure::ARM::DevTestLabs
1178
1151
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1179
1152
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1180
1153
  path_template = '{nextLink}'
1154
+
1155
+ request_url = @base_url || @client.base_url
1156
+
1181
1157
  options = {
1182
1158
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1183
1159
  skip_encoding_path_params: {'nextLink' => next_page_link},
1184
- headers: request_headers.merge(custom_headers || {})
1160
+ headers: request_headers.merge(custom_headers || {}),
1161
+ base_url: request_url
1185
1162
  }
1163
+ promise = @client.make_request_async(:get, path_template, options)
1186
1164
 
1187
- request_url = @base_url || @client.base_url
1188
-
1189
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
1190
- promise = request.run_promise do |req|
1191
- @client.credentials.sign_request(req) unless @client.credentials.nil?
1192
- end
1193
-
1194
- promise = promise.then do |http_response|
1165
+ promise = promise.then do |result|
1166
+ http_response = result.response
1195
1167
  status_code = http_response.status
1196
1168
  response_content = http_response.body
1197
1169
  unless status_code == 200
1198
1170
  error_model = JSON.load(response_content)
1199
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
1171
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1200
1172
  end
1201
1173
 
1202
- # Create Result
1203
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
1204
1174
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1205
1175
  # Deserialize Response
1206
1176
  if status_code == 200
@@ -1268,29 +1238,26 @@ module Azure::ARM::DevTestLabs
1268
1238
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1269
1239
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1270
1240
  path_template = '{nextLink}'
1241
+
1242
+ request_url = @base_url || @client.base_url
1243
+
1271
1244
  options = {
1272
1245
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1273
1246
  skip_encoding_path_params: {'nextLink' => next_page_link},
1274
- headers: request_headers.merge(custom_headers || {})
1247
+ headers: request_headers.merge(custom_headers || {}),
1248
+ base_url: request_url
1275
1249
  }
1250
+ promise = @client.make_request_async(:get, path_template, options)
1276
1251
 
1277
- request_url = @base_url || @client.base_url
1278
-
1279
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
1280
- promise = request.run_promise do |req|
1281
- @client.credentials.sign_request(req) unless @client.credentials.nil?
1282
- end
1283
-
1284
- promise = promise.then do |http_response|
1252
+ promise = promise.then do |result|
1253
+ http_response = result.response
1285
1254
  status_code = http_response.status
1286
1255
  response_content = http_response.body
1287
1256
  unless status_code == 200
1288
1257
  error_model = JSON.load(response_content)
1289
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
1258
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1290
1259
  end
1291
1260
 
1292
- # Create Result
1293
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
1294
1261
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1295
1262
  # Deserialize Response
1296
1263
  if status_code == 200
@@ -1358,29 +1325,26 @@ module Azure::ARM::DevTestLabs
1358
1325
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1359
1326
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1360
1327
  path_template = '{nextLink}'
1328
+
1329
+ request_url = @base_url || @client.base_url
1330
+
1361
1331
  options = {
1362
1332
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1363
1333
  skip_encoding_path_params: {'nextLink' => next_page_link},
1364
- headers: request_headers.merge(custom_headers || {})
1334
+ headers: request_headers.merge(custom_headers || {}),
1335
+ base_url: request_url
1365
1336
  }
1337
+ promise = @client.make_request_async(:post, path_template, options)
1366
1338
 
1367
- request_url = @base_url || @client.base_url
1368
-
1369
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options)
1370
- promise = request.run_promise do |req|
1371
- @client.credentials.sign_request(req) unless @client.credentials.nil?
1372
- end
1373
-
1374
- promise = promise.then do |http_response|
1339
+ promise = promise.then do |result|
1340
+ http_response = result.response
1375
1341
  status_code = http_response.status
1376
1342
  response_content = http_response.body
1377
1343
  unless status_code == 200
1378
1344
  error_model = JSON.load(response_content)
1379
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
1345
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1380
1346
  end
1381
1347
 
1382
- # Create Result
1383
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
1384
1348
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1385
1349
  # Deserialize Response
1386
1350
  if status_code == 200