azure_mgmt_web 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -44,8 +44,8 @@ module Azure::ARM::Web
44
44
  response = get_server_farms_async(resource_group_name, custom_headers).value!
45
45
  unless response.nil?
46
46
  page = response.body
47
- page.next_method = Proc.new do |next_link|
48
- get_server_farms_next_async(next_link, custom_headers)
47
+ page.next_method = Proc.new do |next_page_link|
48
+ get_server_farms_next_async(next_page_link, custom_headers)
49
49
  end
50
50
  page
51
51
  end
@@ -102,30 +102,27 @@ module Azure::ARM::Web
102
102
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
103
103
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
104
104
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms'
105
+
106
+ request_url = @base_url || @client.base_url
107
+
105
108
  options = {
106
109
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
107
110
  path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
108
111
  query_params: {'api-version' => @client.api_version},
109
- headers: request_headers.merge(custom_headers || {})
112
+ headers: request_headers.merge(custom_headers || {}),
113
+ base_url: request_url
110
114
  }
115
+ promise = @client.make_request_async(:get, path_template, options)
111
116
 
112
- request_url = @base_url || @client.base_url
113
-
114
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
115
- promise = request.run_promise do |req|
116
- @client.credentials.sign_request(req) unless @client.credentials.nil?
117
- end
118
-
119
- promise = promise.then do |http_response|
117
+ promise = promise.then do |result|
118
+ http_response = result.response
120
119
  status_code = http_response.status
121
120
  response_content = http_response.body
122
121
  unless status_code == 200
123
122
  error_model = JSON.load(response_content)
124
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
123
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
125
124
  end
126
125
 
127
- # Create Result
128
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
129
126
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
130
127
  # Deserialize Response
131
128
  if status_code == 200
@@ -196,30 +193,27 @@ module Azure::ARM::Web
196
193
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
197
194
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
198
195
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}'
196
+
197
+ request_url = @base_url || @client.base_url
198
+
199
199
  options = {
200
200
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
201
201
  path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
202
202
  query_params: {'api-version' => @client.api_version},
203
- headers: request_headers.merge(custom_headers || {})
203
+ headers: request_headers.merge(custom_headers || {}),
204
+ base_url: request_url
204
205
  }
206
+ promise = @client.make_request_async(:get, path_template, options)
205
207
 
206
- request_url = @base_url || @client.base_url
207
-
208
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
209
- promise = request.run_promise do |req|
210
- @client.credentials.sign_request(req) unless @client.credentials.nil?
211
- end
212
-
213
- promise = promise.then do |http_response|
208
+ promise = promise.then do |result|
209
+ http_response = result.response
214
210
  status_code = http_response.status
215
211
  response_content = http_response.body
216
212
  unless status_code == 200
217
213
  error_model = JSON.load(response_content)
218
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
214
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
219
215
  end
220
216
 
221
- # Create Result
222
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
223
217
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
224
218
  # Deserialize Response
225
219
  if status_code == 200
@@ -361,31 +355,28 @@ module Azure::ARM::Web
361
355
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
362
356
 
363
357
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}'
358
+
359
+ request_url = @base_url || @client.base_url
360
+
364
361
  options = {
365
362
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
366
363
  path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
367
364
  query_params: {'allowPendingState' => allow_pending_state,'api-version' => @client.api_version},
368
365
  body: request_content,
369
- headers: request_headers.merge(custom_headers || {})
366
+ headers: request_headers.merge(custom_headers || {}),
367
+ base_url: request_url
370
368
  }
369
+ promise = @client.make_request_async(:put, path_template, options)
371
370
 
372
- request_url = @base_url || @client.base_url
373
-
374
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :put, options)
375
- promise = request.run_promise do |req|
376
- @client.credentials.sign_request(req) unless @client.credentials.nil?
377
- end
378
-
379
- promise = promise.then do |http_response|
371
+ promise = promise.then do |result|
372
+ http_response = result.response
380
373
  status_code = http_response.status
381
374
  response_content = http_response.body
382
375
  unless status_code == 200 || status_code == 202
383
376
  error_model = JSON.load(response_content)
384
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
377
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
385
378
  end
386
379
 
387
- # Create Result
388
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
389
380
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
390
381
  # Deserialize Response
391
382
  if status_code == 200
@@ -466,30 +457,27 @@ module Azure::ARM::Web
466
457
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
467
458
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
468
459
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}'
460
+
461
+ request_url = @base_url || @client.base_url
462
+
469
463
  options = {
470
464
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
471
465
  path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
472
466
  query_params: {'api-version' => @client.api_version},
473
- headers: request_headers.merge(custom_headers || {})
467
+ headers: request_headers.merge(custom_headers || {}),
468
+ base_url: request_url
474
469
  }
470
+ promise = @client.make_request_async(:delete, path_template, options)
475
471
 
476
- request_url = @base_url || @client.base_url
477
-
478
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :delete, options)
479
- promise = request.run_promise do |req|
480
- @client.credentials.sign_request(req) unless @client.credentials.nil?
481
- end
482
-
483
- promise = promise.then do |http_response|
472
+ promise = promise.then do |result|
473
+ http_response = result.response
484
474
  status_code = http_response.status
485
475
  response_content = http_response.body
486
476
  unless status_code == 200
487
477
  error_model = JSON.load(response_content)
488
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
478
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
489
479
  end
490
480
 
491
- # Create Result
492
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
493
481
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
494
482
 
495
483
  result
@@ -520,8 +508,8 @@ module Azure::ARM::Web
520
508
  response = get_server_farm_metrics_async(resource_group_name, name, details, filter, custom_headers).value!
521
509
  unless response.nil?
522
510
  page = response.body
523
- page.next_method = Proc.new do |next_link|
524
- get_server_farm_metrics_next_async(next_link, custom_headers)
511
+ page.next_method = Proc.new do |next_page_link|
512
+ get_server_farm_metrics_next_async(next_page_link, custom_headers)
525
513
  end
526
514
  page
527
515
  end
@@ -600,30 +588,27 @@ module Azure::ARM::Web
600
588
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
601
589
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
602
590
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/metrics'
591
+
592
+ request_url = @base_url || @client.base_url
593
+
603
594
  options = {
604
595
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
605
596
  path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
606
597
  query_params: {'details' => details,'$filter' => filter,'api-version' => @client.api_version},
607
- headers: request_headers.merge(custom_headers || {})
598
+ headers: request_headers.merge(custom_headers || {}),
599
+ base_url: request_url
608
600
  }
601
+ promise = @client.make_request_async(:get, path_template, options)
609
602
 
610
- request_url = @base_url || @client.base_url
611
-
612
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
613
- promise = request.run_promise do |req|
614
- @client.credentials.sign_request(req) unless @client.credentials.nil?
615
- end
616
-
617
- promise = promise.then do |http_response|
603
+ promise = promise.then do |result|
604
+ http_response = result.response
618
605
  status_code = http_response.status
619
606
  response_content = http_response.body
620
607
  unless status_code == 200
621
608
  error_model = JSON.load(response_content)
622
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
609
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
623
610
  end
624
611
 
625
- # Create Result
626
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
627
612
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
628
613
  # Deserialize Response
629
614
  if status_code == 200
@@ -657,8 +642,8 @@ module Azure::ARM::Web
657
642
  response = get_server_farm_metric_defintions_async(resource_group_name, name, custom_headers).value!
658
643
  unless response.nil?
659
644
  page = response.body
660
- page.next_method = Proc.new do |next_link|
661
- get_server_farm_metric_defintions_next_async(next_link, custom_headers)
645
+ page.next_method = Proc.new do |next_page_link|
646
+ get_server_farm_metric_defintions_next_async(next_page_link, custom_headers)
662
647
  end
663
648
  page
664
649
  end
@@ -716,30 +701,27 @@ module Azure::ARM::Web
716
701
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
717
702
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
718
703
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/metricdefinitions'
704
+
705
+ request_url = @base_url || @client.base_url
706
+
719
707
  options = {
720
708
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
721
709
  path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
722
710
  query_params: {'api-version' => @client.api_version},
723
- headers: request_headers.merge(custom_headers || {})
711
+ headers: request_headers.merge(custom_headers || {}),
712
+ base_url: request_url
724
713
  }
714
+ promise = @client.make_request_async(:get, path_template, options)
725
715
 
726
- request_url = @base_url || @client.base_url
727
-
728
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
729
- promise = request.run_promise do |req|
730
- @client.credentials.sign_request(req) unless @client.credentials.nil?
731
- end
732
-
733
- promise = promise.then do |http_response|
716
+ promise = promise.then do |result|
717
+ http_response = result.response
734
718
  status_code = http_response.status
735
719
  response_content = http_response.body
736
720
  unless status_code == 200
737
721
  error_model = JSON.load(response_content)
738
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
722
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
739
723
  end
740
724
 
741
- # Create Result
742
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
743
725
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
744
726
  # Deserialize Response
745
727
  if status_code == 200
@@ -810,30 +792,27 @@ module Azure::ARM::Web
810
792
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
811
793
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
812
794
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections'
795
+
796
+ request_url = @base_url || @client.base_url
797
+
813
798
  options = {
814
799
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
815
800
  path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
816
801
  query_params: {'api-version' => @client.api_version},
817
- headers: request_headers.merge(custom_headers || {})
802
+ headers: request_headers.merge(custom_headers || {}),
803
+ base_url: request_url
818
804
  }
805
+ promise = @client.make_request_async(:get, path_template, options)
819
806
 
820
- request_url = @base_url || @client.base_url
821
-
822
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
823
- promise = request.run_promise do |req|
824
- @client.credentials.sign_request(req) unless @client.credentials.nil?
825
- end
826
-
827
- promise = promise.then do |http_response|
807
+ promise = promise.then do |result|
808
+ http_response = result.response
828
809
  status_code = http_response.status
829
810
  response_content = http_response.body
830
811
  unless status_code == 200
831
812
  error_model = JSON.load(response_content)
832
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
813
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
833
814
  end
834
815
 
835
- # Create Result
836
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
837
816
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
838
817
  # Deserialize Response
839
818
  if status_code == 200
@@ -922,30 +901,27 @@ module Azure::ARM::Web
922
901
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
923
902
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
924
903
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}'
904
+
905
+ request_url = @base_url || @client.base_url
906
+
925
907
  options = {
926
908
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
927
909
  path_params: {'resourceGroupName' => resource_group_name,'name' => name,'vnetName' => vnet_name,'subscriptionId' => @client.subscription_id},
928
910
  query_params: {'api-version' => @client.api_version},
929
- headers: request_headers.merge(custom_headers || {})
911
+ headers: request_headers.merge(custom_headers || {}),
912
+ base_url: request_url
930
913
  }
914
+ promise = @client.make_request_async(:get, path_template, options)
931
915
 
932
- request_url = @base_url || @client.base_url
933
-
934
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
935
- promise = request.run_promise do |req|
936
- @client.credentials.sign_request(req) unless @client.credentials.nil?
937
- end
938
-
939
- promise = promise.then do |http_response|
916
+ promise = promise.then do |result|
917
+ http_response = result.response
940
918
  status_code = http_response.status
941
919
  response_content = http_response.body
942
920
  unless status_code == 200 || status_code == 404
943
921
  error_model = JSON.load(response_content)
944
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
922
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
945
923
  end
946
924
 
947
- # Create Result
948
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
949
925
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
950
926
  # Deserialize Response
951
927
  if status_code == 200
@@ -1020,30 +996,27 @@ module Azure::ARM::Web
1020
996
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1021
997
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1022
998
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes'
999
+
1000
+ request_url = @base_url || @client.base_url
1001
+
1023
1002
  options = {
1024
1003
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1025
1004
  path_params: {'resourceGroupName' => resource_group_name,'name' => name,'vnetName' => vnet_name,'subscriptionId' => @client.subscription_id},
1026
1005
  query_params: {'api-version' => @client.api_version},
1027
- headers: request_headers.merge(custom_headers || {})
1006
+ headers: request_headers.merge(custom_headers || {}),
1007
+ base_url: request_url
1028
1008
  }
1009
+ promise = @client.make_request_async(:get, path_template, options)
1029
1010
 
1030
- request_url = @base_url || @client.base_url
1031
-
1032
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
1033
- promise = request.run_promise do |req|
1034
- @client.credentials.sign_request(req) unless @client.credentials.nil?
1035
- end
1036
-
1037
- promise = promise.then do |http_response|
1011
+ promise = promise.then do |result|
1012
+ http_response = result.response
1038
1013
  status_code = http_response.status
1039
1014
  response_content = http_response.body
1040
1015
  unless status_code == 200
1041
1016
  error_model = JSON.load(response_content)
1042
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
1017
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1043
1018
  end
1044
1019
 
1045
- # Create Result
1046
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
1047
1020
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1048
1021
  # Deserialize Response
1049
1022
  if status_code == 200
@@ -1136,30 +1109,27 @@ module Azure::ARM::Web
1136
1109
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1137
1110
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1138
1111
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}'
1112
+
1113
+ request_url = @base_url || @client.base_url
1114
+
1139
1115
  options = {
1140
1116
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1141
1117
  path_params: {'resourceGroupName' => resource_group_name,'name' => name,'vnetName' => vnet_name,'routeName' => route_name,'subscriptionId' => @client.subscription_id},
1142
1118
  query_params: {'api-version' => @client.api_version},
1143
- headers: request_headers.merge(custom_headers || {})
1119
+ headers: request_headers.merge(custom_headers || {}),
1120
+ base_url: request_url
1144
1121
  }
1122
+ promise = @client.make_request_async(:get, path_template, options)
1145
1123
 
1146
- request_url = @base_url || @client.base_url
1147
-
1148
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
1149
- promise = request.run_promise do |req|
1150
- @client.credentials.sign_request(req) unless @client.credentials.nil?
1151
- end
1152
-
1153
- promise = promise.then do |http_response|
1124
+ promise = promise.then do |result|
1125
+ http_response = result.response
1154
1126
  status_code = http_response.status
1155
1127
  response_content = http_response.body
1156
1128
  unless status_code == 200 || status_code == 404
1157
1129
  error_model = JSON.load(response_content)
1158
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
1130
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1159
1131
  end
1160
1132
 
1161
- # Create Result
1162
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
1163
1133
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1164
1134
  # Deserialize Response
1165
1135
  if status_code == 200
@@ -1267,31 +1237,28 @@ module Azure::ARM::Web
1267
1237
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1268
1238
 
1269
1239
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}'
1240
+
1241
+ request_url = @base_url || @client.base_url
1242
+
1270
1243
  options = {
1271
1244
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1272
1245
  path_params: {'resourceGroupName' => resource_group_name,'name' => name,'vnetName' => vnet_name,'routeName' => route_name,'subscriptionId' => @client.subscription_id},
1273
1246
  query_params: {'api-version' => @client.api_version},
1274
1247
  body: request_content,
1275
- headers: request_headers.merge(custom_headers || {})
1248
+ headers: request_headers.merge(custom_headers || {}),
1249
+ base_url: request_url
1276
1250
  }
1251
+ promise = @client.make_request_async(:put, path_template, options)
1277
1252
 
1278
- request_url = @base_url || @client.base_url
1279
-
1280
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :put, options)
1281
- promise = request.run_promise do |req|
1282
- @client.credentials.sign_request(req) unless @client.credentials.nil?
1283
- end
1284
-
1285
- promise = promise.then do |http_response|
1253
+ promise = promise.then do |result|
1254
+ http_response = result.response
1286
1255
  status_code = http_response.status
1287
1256
  response_content = http_response.body
1288
1257
  unless status_code == 200 || status_code == 400 || status_code == 404
1289
1258
  error_model = JSON.load(response_content)
1290
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
1259
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1291
1260
  end
1292
1261
 
1293
- # Create Result
1294
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
1295
1262
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1296
1263
  # Deserialize Response
1297
1264
  if status_code == 200
@@ -1370,30 +1337,27 @@ module Azure::ARM::Web
1370
1337
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1371
1338
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1372
1339
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}'
1340
+
1341
+ request_url = @base_url || @client.base_url
1342
+
1373
1343
  options = {
1374
1344
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1375
1345
  path_params: {'resourceGroupName' => resource_group_name,'name' => name,'vnetName' => vnet_name,'routeName' => route_name,'subscriptionId' => @client.subscription_id},
1376
1346
  query_params: {'api-version' => @client.api_version},
1377
- headers: request_headers.merge(custom_headers || {})
1347
+ headers: request_headers.merge(custom_headers || {}),
1348
+ base_url: request_url
1378
1349
  }
1350
+ promise = @client.make_request_async(:delete, path_template, options)
1379
1351
 
1380
- request_url = @base_url || @client.base_url
1381
-
1382
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :delete, options)
1383
- promise = request.run_promise do |req|
1384
- @client.credentials.sign_request(req) unless @client.credentials.nil?
1385
- end
1386
-
1387
- promise = promise.then do |http_response|
1352
+ promise = promise.then do |result|
1353
+ http_response = result.response
1388
1354
  status_code = http_response.status
1389
1355
  response_content = http_response.body
1390
1356
  unless status_code == 200 || status_code == 404
1391
1357
  error_model = JSON.load(response_content)
1392
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
1358
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1393
1359
  end
1394
1360
 
1395
- # Create Result
1396
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
1397
1361
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1398
1362
 
1399
1363
  result
@@ -1477,31 +1441,28 @@ module Azure::ARM::Web
1477
1441
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1478
1442
 
1479
1443
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}'
1444
+
1445
+ request_url = @base_url || @client.base_url
1446
+
1480
1447
  options = {
1481
1448
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1482
1449
  path_params: {'resourceGroupName' => resource_group_name,'name' => name,'vnetName' => vnet_name,'routeName' => route_name,'subscriptionId' => @client.subscription_id},
1483
1450
  query_params: {'api-version' => @client.api_version},
1484
1451
  body: request_content,
1485
- headers: request_headers.merge(custom_headers || {})
1452
+ headers: request_headers.merge(custom_headers || {}),
1453
+ base_url: request_url
1486
1454
  }
1455
+ promise = @client.make_request_async(:patch, path_template, options)
1487
1456
 
1488
- request_url = @base_url || @client.base_url
1489
-
1490
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :patch, options)
1491
- promise = request.run_promise do |req|
1492
- @client.credentials.sign_request(req) unless @client.credentials.nil?
1493
- end
1494
-
1495
- promise = promise.then do |http_response|
1457
+ promise = promise.then do |result|
1458
+ http_response = result.response
1496
1459
  status_code = http_response.status
1497
1460
  response_content = http_response.body
1498
1461
  unless status_code == 200 || status_code == 400 || status_code == 404
1499
1462
  error_model = JSON.load(response_content)
1500
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
1463
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1501
1464
  end
1502
1465
 
1503
- # Create Result
1504
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
1505
1466
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1506
1467
  # Deserialize Response
1507
1468
  if status_code == 200
@@ -1583,30 +1544,27 @@ module Azure::ARM::Web
1583
1544
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1584
1545
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1585
1546
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'
1547
+
1548
+ request_url = @base_url || @client.base_url
1549
+
1586
1550
  options = {
1587
1551
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1588
1552
  path_params: {'resourceGroupName' => resource_group_name,'name' => name,'vnetName' => vnet_name,'gatewayName' => gateway_name,'subscriptionId' => @client.subscription_id},
1589
1553
  query_params: {'api-version' => @client.api_version},
1590
- headers: request_headers.merge(custom_headers || {})
1554
+ headers: request_headers.merge(custom_headers || {}),
1555
+ base_url: request_url
1591
1556
  }
1557
+ promise = @client.make_request_async(:get, path_template, options)
1592
1558
 
1593
- request_url = @base_url || @client.base_url
1594
-
1595
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
1596
- promise = request.run_promise do |req|
1597
- @client.credentials.sign_request(req) unless @client.credentials.nil?
1598
- end
1599
-
1600
- promise = promise.then do |http_response|
1559
+ promise = promise.then do |result|
1560
+ http_response = result.response
1601
1561
  status_code = http_response.status
1602
1562
  response_content = http_response.body
1603
1563
  unless status_code == 200
1604
1564
  error_model = JSON.load(response_content)
1605
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
1565
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1606
1566
  end
1607
1567
 
1608
- # Create Result
1609
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
1610
1568
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1611
1569
  # Deserialize Response
1612
1570
  if status_code == 200
@@ -1700,31 +1658,28 @@ module Azure::ARM::Web
1700
1658
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1701
1659
 
1702
1660
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'
1661
+
1662
+ request_url = @base_url || @client.base_url
1663
+
1703
1664
  options = {
1704
1665
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1705
1666
  path_params: {'resourceGroupName' => resource_group_name,'name' => name,'vnetName' => vnet_name,'gatewayName' => gateway_name,'subscriptionId' => @client.subscription_id},
1706
1667
  query_params: {'api-version' => @client.api_version},
1707
1668
  body: request_content,
1708
- headers: request_headers.merge(custom_headers || {})
1669
+ headers: request_headers.merge(custom_headers || {}),
1670
+ base_url: request_url
1709
1671
  }
1672
+ promise = @client.make_request_async(:put, path_template, options)
1710
1673
 
1711
- request_url = @base_url || @client.base_url
1712
-
1713
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :put, options)
1714
- promise = request.run_promise do |req|
1715
- @client.credentials.sign_request(req) unless @client.credentials.nil?
1716
- end
1717
-
1718
- promise = promise.then do |http_response|
1674
+ promise = promise.then do |result|
1675
+ http_response = result.response
1719
1676
  status_code = http_response.status
1720
1677
  response_content = http_response.body
1721
1678
  unless status_code == 200
1722
1679
  error_model = JSON.load(response_content)
1723
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
1680
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1724
1681
  end
1725
1682
 
1726
- # Create Result
1727
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
1728
1683
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1729
1684
  # Deserialize Response
1730
1685
  if status_code == 200
@@ -1764,8 +1719,8 @@ module Azure::ARM::Web
1764
1719
  response = get_server_farm_sites_async(resource_group_name, name, skip_token, filter, top, custom_headers).value!
1765
1720
  unless response.nil?
1766
1721
  page = response.body
1767
- page.next_method = Proc.new do |next_link|
1768
- get_server_farm_sites_next_async(next_link, custom_headers)
1722
+ page.next_method = Proc.new do |next_page_link|
1723
+ get_server_farm_sites_next_async(next_page_link, custom_headers)
1769
1724
  end
1770
1725
  page
1771
1726
  end
@@ -1844,30 +1799,27 @@ module Azure::ARM::Web
1844
1799
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1845
1800
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1846
1801
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/sites'
1802
+
1803
+ request_url = @base_url || @client.base_url
1804
+
1847
1805
  options = {
1848
1806
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1849
1807
  path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
1850
1808
  query_params: {'$skipToken' => skip_token,'$filter' => filter,'$top' => top,'api-version' => @client.api_version},
1851
- headers: request_headers.merge(custom_headers || {})
1809
+ headers: request_headers.merge(custom_headers || {}),
1810
+ base_url: request_url
1852
1811
  }
1812
+ promise = @client.make_request_async(:get, path_template, options)
1853
1813
 
1854
- request_url = @base_url || @client.base_url
1855
-
1856
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
1857
- promise = request.run_promise do |req|
1858
- @client.credentials.sign_request(req) unless @client.credentials.nil?
1859
- end
1860
-
1861
- promise = promise.then do |http_response|
1814
+ promise = promise.then do |result|
1815
+ http_response = result.response
1862
1816
  status_code = http_response.status
1863
1817
  response_content = http_response.body
1864
1818
  unless status_code == 200
1865
1819
  error_model = JSON.load(response_content)
1866
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
1820
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1867
1821
  end
1868
1822
 
1869
- # Create Result
1870
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
1871
1823
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1872
1824
  # Deserialize Response
1873
1825
  if status_code == 200
@@ -1942,30 +1894,27 @@ module Azure::ARM::Web
1942
1894
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1943
1895
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1944
1896
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/workers/{workerName}/reboot'
1897
+
1898
+ request_url = @base_url || @client.base_url
1899
+
1945
1900
  options = {
1946
1901
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1947
1902
  path_params: {'resourceGroupName' => resource_group_name,'name' => name,'workerName' => worker_name,'subscriptionId' => @client.subscription_id},
1948
1903
  query_params: {'api-version' => @client.api_version},
1949
- headers: request_headers.merge(custom_headers || {})
1904
+ headers: request_headers.merge(custom_headers || {}),
1905
+ base_url: request_url
1950
1906
  }
1907
+ promise = @client.make_request_async(:post, path_template, options)
1951
1908
 
1952
- request_url = @base_url || @client.base_url
1953
-
1954
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options)
1955
- promise = request.run_promise do |req|
1956
- @client.credentials.sign_request(req) unless @client.credentials.nil?
1957
- end
1958
-
1959
- promise = promise.then do |http_response|
1909
+ promise = promise.then do |result|
1910
+ http_response = result.response
1960
1911
  status_code = http_response.status
1961
1912
  response_content = http_response.body
1962
1913
  unless status_code == 200
1963
1914
  error_model = JSON.load(response_content)
1964
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
1915
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1965
1916
  end
1966
1917
 
1967
- # Create Result
1968
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
1969
1918
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1970
1919
 
1971
1920
  result
@@ -2035,30 +1984,27 @@ module Azure::ARM::Web
2035
1984
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2036
1985
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2037
1986
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/restartSites'
1987
+
1988
+ request_url = @base_url || @client.base_url
1989
+
2038
1990
  options = {
2039
1991
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2040
1992
  path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
2041
1993
  query_params: {'softRestart' => soft_restart,'api-version' => @client.api_version},
2042
- headers: request_headers.merge(custom_headers || {})
1994
+ headers: request_headers.merge(custom_headers || {}),
1995
+ base_url: request_url
2043
1996
  }
1997
+ promise = @client.make_request_async(:post, path_template, options)
2044
1998
 
2045
- request_url = @base_url || @client.base_url
2046
-
2047
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options)
2048
- promise = request.run_promise do |req|
2049
- @client.credentials.sign_request(req) unless @client.credentials.nil?
2050
- end
2051
-
2052
- promise = promise.then do |http_response|
1999
+ promise = promise.then do |result|
2000
+ http_response = result.response
2053
2001
  status_code = http_response.status
2054
2002
  response_content = http_response.body
2055
2003
  unless status_code == 200
2056
2004
  error_model = JSON.load(response_content)
2057
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
2005
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2058
2006
  end
2059
2007
 
2060
- # Create Result
2061
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
2062
2008
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2063
2009
 
2064
2010
  result
@@ -2123,30 +2069,27 @@ module Azure::ARM::Web
2123
2069
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2124
2070
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2125
2071
  path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/operationresults/{operationId}'
2072
+
2073
+ request_url = @base_url || @client.base_url
2074
+
2126
2075
  options = {
2127
2076
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2128
2077
  path_params: {'resourceGroupName' => resource_group_name,'name' => name,'operationId' => operation_id,'subscriptionId' => @client.subscription_id},
2129
2078
  query_params: {'api-version' => @client.api_version},
2130
- headers: request_headers.merge(custom_headers || {})
2079
+ headers: request_headers.merge(custom_headers || {}),
2080
+ base_url: request_url
2131
2081
  }
2082
+ promise = @client.make_request_async(:get, path_template, options)
2132
2083
 
2133
- request_url = @base_url || @client.base_url
2134
-
2135
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
2136
- promise = request.run_promise do |req|
2137
- @client.credentials.sign_request(req) unless @client.credentials.nil?
2138
- end
2139
-
2140
- promise = promise.then do |http_response|
2084
+ promise = promise.then do |result|
2085
+ http_response = result.response
2141
2086
  status_code = http_response.status
2142
2087
  response_content = http_response.body
2143
2088
  unless status_code == 200
2144
2089
  error_model = JSON.load(response_content)
2145
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
2090
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2146
2091
  end
2147
2092
 
2148
- # Create Result
2149
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
2150
2093
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2151
2094
  # Deserialize Response
2152
2095
  if status_code == 200
@@ -2217,29 +2160,26 @@ module Azure::ARM::Web
2217
2160
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2218
2161
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2219
2162
  path_template = '{nextLink}'
2163
+
2164
+ request_url = @base_url || @client.base_url
2165
+
2220
2166
  options = {
2221
2167
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2222
2168
  skip_encoding_path_params: {'nextLink' => next_page_link},
2223
- headers: request_headers.merge(custom_headers || {})
2169
+ headers: request_headers.merge(custom_headers || {}),
2170
+ base_url: request_url
2224
2171
  }
2172
+ promise = @client.make_request_async(:get, path_template, options)
2225
2173
 
2226
- request_url = @base_url || @client.base_url
2227
-
2228
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
2229
- promise = request.run_promise do |req|
2230
- @client.credentials.sign_request(req) unless @client.credentials.nil?
2231
- end
2232
-
2233
- promise = promise.then do |http_response|
2174
+ promise = promise.then do |result|
2175
+ http_response = result.response
2234
2176
  status_code = http_response.status
2235
2177
  response_content = http_response.body
2236
2178
  unless status_code == 200
2237
2179
  error_model = JSON.load(response_content)
2238
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
2180
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2239
2181
  end
2240
2182
 
2241
- # Create Result
2242
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
2243
2183
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2244
2184
  # Deserialize Response
2245
2185
  if status_code == 200
@@ -2307,29 +2247,26 @@ module Azure::ARM::Web
2307
2247
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2308
2248
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2309
2249
  path_template = '{nextLink}'
2250
+
2251
+ request_url = @base_url || @client.base_url
2252
+
2310
2253
  options = {
2311
2254
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2312
2255
  skip_encoding_path_params: {'nextLink' => next_page_link},
2313
- headers: request_headers.merge(custom_headers || {})
2256
+ headers: request_headers.merge(custom_headers || {}),
2257
+ base_url: request_url
2314
2258
  }
2259
+ promise = @client.make_request_async(:get, path_template, options)
2315
2260
 
2316
- request_url = @base_url || @client.base_url
2317
-
2318
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
2319
- promise = request.run_promise do |req|
2320
- @client.credentials.sign_request(req) unless @client.credentials.nil?
2321
- end
2322
-
2323
- promise = promise.then do |http_response|
2261
+ promise = promise.then do |result|
2262
+ http_response = result.response
2324
2263
  status_code = http_response.status
2325
2264
  response_content = http_response.body
2326
2265
  unless status_code == 200
2327
2266
  error_model = JSON.load(response_content)
2328
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
2267
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2329
2268
  end
2330
2269
 
2331
- # Create Result
2332
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
2333
2270
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2334
2271
  # Deserialize Response
2335
2272
  if status_code == 200
@@ -2397,29 +2334,26 @@ module Azure::ARM::Web
2397
2334
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2398
2335
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2399
2336
  path_template = '{nextLink}'
2337
+
2338
+ request_url = @base_url || @client.base_url
2339
+
2400
2340
  options = {
2401
2341
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2402
2342
  skip_encoding_path_params: {'nextLink' => next_page_link},
2403
- headers: request_headers.merge(custom_headers || {})
2343
+ headers: request_headers.merge(custom_headers || {}),
2344
+ base_url: request_url
2404
2345
  }
2346
+ promise = @client.make_request_async(:get, path_template, options)
2405
2347
 
2406
- request_url = @base_url || @client.base_url
2407
-
2408
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
2409
- promise = request.run_promise do |req|
2410
- @client.credentials.sign_request(req) unless @client.credentials.nil?
2411
- end
2412
-
2413
- promise = promise.then do |http_response|
2348
+ promise = promise.then do |result|
2349
+ http_response = result.response
2414
2350
  status_code = http_response.status
2415
2351
  response_content = http_response.body
2416
2352
  unless status_code == 200
2417
2353
  error_model = JSON.load(response_content)
2418
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
2354
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2419
2355
  end
2420
2356
 
2421
- # Create Result
2422
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
2423
2357
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2424
2358
  # Deserialize Response
2425
2359
  if status_code == 200
@@ -2487,29 +2421,26 @@ module Azure::ARM::Web
2487
2421
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2488
2422
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2489
2423
  path_template = '{nextLink}'
2424
+
2425
+ request_url = @base_url || @client.base_url
2426
+
2490
2427
  options = {
2491
2428
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2492
2429
  skip_encoding_path_params: {'nextLink' => next_page_link},
2493
- headers: request_headers.merge(custom_headers || {})
2430
+ headers: request_headers.merge(custom_headers || {}),
2431
+ base_url: request_url
2494
2432
  }
2433
+ promise = @client.make_request_async(:get, path_template, options)
2495
2434
 
2496
- request_url = @base_url || @client.base_url
2497
-
2498
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
2499
- promise = request.run_promise do |req|
2500
- @client.credentials.sign_request(req) unless @client.credentials.nil?
2501
- end
2502
-
2503
- promise = promise.then do |http_response|
2435
+ promise = promise.then do |result|
2436
+ http_response = result.response
2504
2437
  status_code = http_response.status
2505
2438
  response_content = http_response.body
2506
2439
  unless status_code == 200
2507
2440
  error_model = JSON.load(response_content)
2508
- fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
2441
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2509
2442
  end
2510
2443
 
2511
- # Create Result
2512
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
2513
2444
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2514
2445
  # Deserialize Response
2515
2446
  if status_code == 200