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.
@@ -31,10 +31,6 @@ module Azure::ARM::Graph
31
31
  # is generated and included in each request. Default is true.
32
32
  attr_accessor :generate_client_request_id
33
33
 
34
- # @return Subscription credentials which uniquely identify client
35
- # subscription.
36
- attr_accessor :credentials
37
-
38
34
  # @return [Objects] objects
39
35
  attr_reader :objects
40
36
 
@@ -74,5 +70,60 @@ module Azure::ARM::Graph
74
70
  @generate_client_request_id = true
75
71
  end
76
72
 
73
+ #
74
+ # Makes a request and returns the body of the response.
75
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
76
+ # @param path [String] the path, relative to {base_url}.
77
+ # @param options [Hash{String=>String}] specifying any request options like :body.
78
+ # @return [Hash{String=>String}] containing the body of the response.
79
+ # Example:
80
+ #
81
+ # request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
82
+ # path = "/path"
83
+ # options = {
84
+ # body: request_content,
85
+ # query_params: {'api-version' => '2016-02-01'}
86
+ # }
87
+ # result = @client.make_request(:put, path, options)
88
+ #
89
+ def make_request(method, path, options = {})
90
+ result = make_request_with_http_info(method, path, options)
91
+ result.body unless result.nil?
92
+ end
93
+
94
+ #
95
+ # Makes a request and returns the operation response.
96
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
97
+ # @param path [String] the path, relative to {base_url}.
98
+ # @param options [Hash{String=>String}] specifying any request options like :body.
99
+ # @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status.
100
+ #
101
+ def make_request_with_http_info(method, path, options = {})
102
+ result = make_request_async(method, path, options).value!
103
+ result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
104
+ result
105
+ end
106
+
107
+ #
108
+ # Makes a request asynchronously.
109
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
110
+ # @param path [String] the path, relative to {base_url}.
111
+ # @param options [Hash{String=>String}] specifying any request options like :body.
112
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
113
+ #
114
+ def make_request_async(method, path, options = {})
115
+ fail ArgumentError, 'method is nil' if method.nil?
116
+ fail ArgumentError, 'path is nil' if path.nil?
117
+
118
+ request_url = options[:base_url] || @base_url
119
+
120
+ request_headers = @request_headers
121
+ request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
122
+ options.merge!({headers: request_headers.merge(options[:headers] || {})})
123
+ options.merge!({credentials: @credentials}) unless @credentials.nil?
124
+
125
+ super(request_url, method, path, options)
126
+ end
127
+
77
128
  end
78
129
  end
@@ -84,31 +84,28 @@ module Azure::ARM::Graph
84
84
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
85
85
 
86
86
  path_template = '/{tenantID}/isMemberOf'
87
+
88
+ request_url = @base_url || @client.base_url
89
+
87
90
  options = {
88
91
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
89
92
  path_params: {'tenantID' => @client.tenant_id},
90
93
  query_params: {'api-version' => api_version},
91
94
  body: request_content,
92
- headers: request_headers.merge(custom_headers || {})
95
+ headers: request_headers.merge(custom_headers || {}),
96
+ base_url: request_url
93
97
  }
98
+ promise = @client.make_request_async(:post, path_template, options)
94
99
 
95
- request_url = @base_url || @client.base_url
96
-
97
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options)
98
- promise = request.run_promise do |req|
99
- @client.credentials.sign_request(req) unless @client.credentials.nil?
100
- end
101
-
102
- promise = promise.then do |http_response|
100
+ promise = promise.then do |result|
101
+ http_response = result.response
103
102
  status_code = http_response.status
104
103
  response_content = http_response.body
105
104
  unless status_code == 200
106
105
  error_model = JSON.load(response_content)
107
- fail MsRest::HttpOperationError.new(request, http_response, error_model)
106
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
108
107
  end
109
108
 
110
- # Create Result
111
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
112
109
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
113
110
  # Deserialize Response
114
111
  if status_code == 200
@@ -181,31 +178,28 @@ module Azure::ARM::Graph
181
178
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
182
179
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
183
180
  path_template = '/{tenantID}/groups/{groupObjectId}/$links/members/{memberObjectId}'
181
+
182
+ request_url = @base_url || @client.base_url
183
+
184
184
  options = {
185
185
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
186
186
  path_params: {'tenantID' => @client.tenant_id},
187
187
  skip_encoding_path_params: {'groupObjectId' => group_object_id,'memberObjectId' => member_object_id},
188
188
  query_params: {'api-version' => api_version},
189
- headers: request_headers.merge(custom_headers || {})
189
+ headers: request_headers.merge(custom_headers || {}),
190
+ base_url: request_url
190
191
  }
192
+ promise = @client.make_request_async(:delete, path_template, options)
191
193
 
192
- request_url = @base_url || @client.base_url
193
-
194
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :delete, options)
195
- promise = request.run_promise do |req|
196
- @client.credentials.sign_request(req) unless @client.credentials.nil?
197
- end
198
-
199
- promise = promise.then do |http_response|
194
+ promise = promise.then do |result|
195
+ http_response = result.response
200
196
  status_code = http_response.status
201
197
  response_content = http_response.body
202
198
  unless status_code == 204
203
199
  error_model = JSON.load(response_content)
204
- fail MsRest::HttpOperationError.new(request, http_response, error_model)
200
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
205
201
  end
206
202
 
207
- # Create Result
208
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
209
203
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
210
204
 
211
205
  result
@@ -279,32 +273,29 @@ module Azure::ARM::Graph
279
273
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
280
274
 
281
275
  path_template = '/{tenantID}/groups/{groupObjectId}/$links/members'
276
+
277
+ request_url = @base_url || @client.base_url
278
+
282
279
  options = {
283
280
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
284
281
  path_params: {'tenantID' => @client.tenant_id},
285
282
  skip_encoding_path_params: {'groupObjectId' => group_object_id},
286
283
  query_params: {'api-version' => api_version},
287
284
  body: request_content,
288
- headers: request_headers.merge(custom_headers || {})
285
+ headers: request_headers.merge(custom_headers || {}),
286
+ base_url: request_url
289
287
  }
288
+ promise = @client.make_request_async(:post, path_template, options)
290
289
 
291
- request_url = @base_url || @client.base_url
292
-
293
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options)
294
- promise = request.run_promise do |req|
295
- @client.credentials.sign_request(req) unless @client.credentials.nil?
296
- end
297
-
298
- promise = promise.then do |http_response|
290
+ promise = promise.then do |result|
291
+ http_response = result.response
299
292
  status_code = http_response.status
300
293
  response_content = http_response.body
301
294
  unless status_code == 204
302
295
  error_model = JSON.load(response_content)
303
- fail MsRest::HttpOperationError.new(request, http_response, error_model)
296
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
304
297
  end
305
298
 
306
- # Create Result
307
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
308
299
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
309
300
 
310
301
  result
@@ -363,31 +354,28 @@ module Azure::ARM::Graph
363
354
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
364
355
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
365
356
  path_template = '/{tenantID}/groups/{groupObjectId}'
357
+
358
+ request_url = @base_url || @client.base_url
359
+
366
360
  options = {
367
361
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
368
362
  path_params: {'tenantID' => @client.tenant_id},
369
363
  skip_encoding_path_params: {'groupObjectId' => group_object_id},
370
364
  query_params: {'api-version' => api_version},
371
- headers: request_headers.merge(custom_headers || {})
365
+ headers: request_headers.merge(custom_headers || {}),
366
+ base_url: request_url
372
367
  }
368
+ promise = @client.make_request_async(:delete, path_template, options)
373
369
 
374
- request_url = @base_url || @client.base_url
375
-
376
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :delete, 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|
370
+ promise = promise.then do |result|
371
+ http_response = result.response
382
372
  status_code = http_response.status
383
373
  response_content = http_response.body
384
374
  unless status_code == 204
385
375
  error_model = JSON.load(response_content)
386
- fail MsRest::HttpOperationError.new(request, http_response, error_model)
376
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
387
377
  end
388
378
 
389
- # Create Result
390
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
391
379
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
392
380
 
393
381
  result
@@ -455,31 +443,28 @@ module Azure::ARM::Graph
455
443
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
456
444
 
457
445
  path_template = '/{tenantID}/groups'
446
+
447
+ request_url = @base_url || @client.base_url
448
+
458
449
  options = {
459
450
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
460
451
  path_params: {'tenantID' => @client.tenant_id},
461
452
  query_params: {'api-version' => api_version},
462
453
  body: request_content,
463
- headers: request_headers.merge(custom_headers || {})
454
+ headers: request_headers.merge(custom_headers || {}),
455
+ base_url: request_url
464
456
  }
457
+ promise = @client.make_request_async(:post, path_template, options)
465
458
 
466
- request_url = @base_url || @client.base_url
467
-
468
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options)
469
- promise = request.run_promise do |req|
470
- @client.credentials.sign_request(req) unless @client.credentials.nil?
471
- end
472
-
473
- promise = promise.then do |http_response|
459
+ promise = promise.then do |result|
460
+ http_response = result.response
474
461
  status_code = http_response.status
475
462
  response_content = http_response.body
476
463
  unless status_code == 201
477
464
  error_model = JSON.load(response_content)
478
- fail MsRest::HttpOperationError.new(request, http_response, error_model)
465
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
479
466
  end
480
467
 
481
- # Create Result
482
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
483
468
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
484
469
  # Deserialize Response
485
470
  if status_code == 201
@@ -501,7 +486,6 @@ module Azure::ARM::Graph
501
486
  #
502
487
  # Gets list of groups for the current tenant.
503
488
  #
504
- # @param api_version [String] Client Api Version.
505
489
  # @param filter [String] The filter to apply on the operation.
506
490
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
507
491
  # will be added to the HTTP request.
@@ -566,30 +550,27 @@ module Azure::ARM::Graph
566
550
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
567
551
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
568
552
  path_template = '/{tenantID}/groups'
553
+
554
+ request_url = @base_url || @client.base_url
555
+
569
556
  options = {
570
557
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
571
558
  path_params: {'tenantID' => @client.tenant_id},
572
559
  query_params: {'$filter' => filter,'api-version' => api_version},
573
- headers: request_headers.merge(custom_headers || {})
560
+ headers: request_headers.merge(custom_headers || {}),
561
+ base_url: request_url
574
562
  }
563
+ promise = @client.make_request_async(:get, path_template, options)
575
564
 
576
- request_url = @base_url || @client.base_url
577
-
578
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
579
- promise = request.run_promise do |req|
580
- @client.credentials.sign_request(req) unless @client.credentials.nil?
581
- end
582
-
583
- promise = promise.then do |http_response|
565
+ promise = promise.then do |result|
566
+ http_response = result.response
584
567
  status_code = http_response.status
585
568
  response_content = http_response.body
586
569
  unless status_code == 200
587
570
  error_model = JSON.load(response_content)
588
- fail MsRest::HttpOperationError.new(request, http_response, error_model)
571
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
589
572
  end
590
573
 
591
- # Create Result
592
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
593
574
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
594
575
  # Deserialize Response
595
576
  if status_code == 200
@@ -612,7 +593,6 @@ module Azure::ARM::Graph
612
593
  # Gets the members of a group.
613
594
  #
614
595
  # @param object_id [String] Group object Id who's members should be retrieved.
615
- # @param api_version [String] Client Api Version.
616
596
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
617
597
  # will be added to the HTTP request.
618
598
  #
@@ -678,31 +658,28 @@ module Azure::ARM::Graph
678
658
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
679
659
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
680
660
  path_template = '/{tenantID}/groups/{objectId}/members'
661
+
662
+ request_url = @base_url || @client.base_url
663
+
681
664
  options = {
682
665
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
683
666
  path_params: {'tenantID' => @client.tenant_id},
684
667
  skip_encoding_path_params: {'objectId' => object_id},
685
668
  query_params: {'api-version' => api_version},
686
- headers: request_headers.merge(custom_headers || {})
669
+ headers: request_headers.merge(custom_headers || {}),
670
+ base_url: request_url
687
671
  }
672
+ promise = @client.make_request_async(:get, path_template, options)
688
673
 
689
- request_url = @base_url || @client.base_url
690
-
691
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
692
- promise = request.run_promise do |req|
693
- @client.credentials.sign_request(req) unless @client.credentials.nil?
694
- end
695
-
696
- promise = promise.then do |http_response|
674
+ promise = promise.then do |result|
675
+ http_response = result.response
697
676
  status_code = http_response.status
698
677
  response_content = http_response.body
699
678
  unless status_code == 200
700
679
  error_model = JSON.load(response_content)
701
- fail MsRest::HttpOperationError.new(request, http_response, error_model)
680
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
702
681
  end
703
682
 
704
- # Create Result
705
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
706
683
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
707
684
  # Deserialize Response
708
685
  if status_code == 200
@@ -769,31 +746,28 @@ module Azure::ARM::Graph
769
746
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
770
747
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
771
748
  path_template = '/{tenantID}/groups/{objectId}'
749
+
750
+ request_url = @base_url || @client.base_url
751
+
772
752
  options = {
773
753
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
774
754
  path_params: {'tenantID' => @client.tenant_id},
775
755
  skip_encoding_path_params: {'objectId' => object_id},
776
756
  query_params: {'api-version' => api_version},
777
- headers: request_headers.merge(custom_headers || {})
757
+ headers: request_headers.merge(custom_headers || {}),
758
+ base_url: request_url
778
759
  }
760
+ promise = @client.make_request_async(:get, path_template, options)
779
761
 
780
- request_url = @base_url || @client.base_url
781
-
782
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
783
- promise = request.run_promise do |req|
784
- @client.credentials.sign_request(req) unless @client.credentials.nil?
785
- end
786
-
787
- promise = promise.then do |http_response|
762
+ promise = promise.then do |result|
763
+ http_response = result.response
788
764
  status_code = http_response.status
789
765
  response_content = http_response.body
790
766
  unless status_code == 200
791
767
  error_model = JSON.load(response_content)
792
- fail MsRest::HttpOperationError.new(request, http_response, error_model)
768
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
793
769
  end
794
770
 
795
- # Create Result
796
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
797
771
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
798
772
  # Deserialize Response
799
773
  if status_code == 200
@@ -878,32 +852,29 @@ module Azure::ARM::Graph
878
852
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
879
853
 
880
854
  path_template = '/{tenantID}/groups/{objectId}/getMemberGroups'
855
+
856
+ request_url = @base_url || @client.base_url
857
+
881
858
  options = {
882
859
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
883
860
  path_params: {'tenantID' => @client.tenant_id},
884
861
  skip_encoding_path_params: {'objectId' => object_id},
885
862
  query_params: {'api-version' => api_version},
886
863
  body: request_content,
887
- headers: request_headers.merge(custom_headers || {})
864
+ headers: request_headers.merge(custom_headers || {}),
865
+ base_url: request_url
888
866
  }
867
+ promise = @client.make_request_async(:post, path_template, options)
889
868
 
890
- request_url = @base_url || @client.base_url
891
-
892
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options)
893
- promise = request.run_promise do |req|
894
- @client.credentials.sign_request(req) unless @client.credentials.nil?
895
- end
896
-
897
- promise = promise.then do |http_response|
869
+ promise = promise.then do |result|
870
+ http_response = result.response
898
871
  status_code = http_response.status
899
872
  response_content = http_response.body
900
873
  unless status_code == 200
901
874
  error_model = JSON.load(response_content)
902
- fail MsRest::HttpOperationError.new(request, http_response, error_model)
875
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
903
876
  end
904
877
 
905
- # Create Result
906
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
907
878
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
908
879
  # Deserialize Response
909
880
  if status_code == 200
@@ -970,31 +941,28 @@ module Azure::ARM::Graph
970
941
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
971
942
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
972
943
  path_template = '/{tenantID}/{nextLink}'
944
+
945
+ request_url = @base_url || @client.base_url
946
+
973
947
  options = {
974
948
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
975
949
  path_params: {'tenantID' => @client.tenant_id},
976
950
  skip_encoding_path_params: {'nextLink' => next_link},
977
951
  query_params: {'api-version' => api_version},
978
- headers: request_headers.merge(custom_headers || {})
952
+ headers: request_headers.merge(custom_headers || {}),
953
+ base_url: request_url
979
954
  }
955
+ promise = @client.make_request_async(:get, path_template, options)
980
956
 
981
- request_url = @base_url || @client.base_url
982
-
983
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, 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|
957
+ promise = promise.then do |result|
958
+ http_response = result.response
989
959
  status_code = http_response.status
990
960
  response_content = http_response.body
991
961
  unless status_code == 200
992
962
  error_model = JSON.load(response_content)
993
- fail MsRest::HttpOperationError.new(request, http_response, error_model)
963
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
994
964
  end
995
965
 
996
- # Create Result
997
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
998
966
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
999
967
  # Deserialize Response
1000
968
  if status_code == 200
@@ -1061,31 +1029,28 @@ module Azure::ARM::Graph
1061
1029
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1062
1030
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1063
1031
  path_template = '/{tenantID}/{nextLink}'
1032
+
1033
+ request_url = @base_url || @client.base_url
1034
+
1064
1035
  options = {
1065
1036
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1066
1037
  path_params: {'tenantID' => @client.tenant_id},
1067
1038
  skip_encoding_path_params: {'nextLink' => next_link},
1068
1039
  query_params: {'api-version' => api_version},
1069
- headers: request_headers.merge(custom_headers || {})
1040
+ headers: request_headers.merge(custom_headers || {}),
1041
+ base_url: request_url
1070
1042
  }
1043
+ promise = @client.make_request_async(:get, path_template, options)
1071
1044
 
1072
- request_url = @base_url || @client.base_url
1073
-
1074
- request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
1075
- promise = request.run_promise do |req|
1076
- @client.credentials.sign_request(req) unless @client.credentials.nil?
1077
- end
1078
-
1079
- promise = promise.then do |http_response|
1045
+ promise = promise.then do |result|
1046
+ http_response = result.response
1080
1047
  status_code = http_response.status
1081
1048
  response_content = http_response.body
1082
1049
  unless status_code == 200
1083
1050
  error_model = JSON.load(response_content)
1084
- fail MsRest::HttpOperationError.new(request, http_response, error_model)
1051
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1085
1052
  end
1086
1053
 
1087
- # Create Result
1088
- result = MsRestAzure::AzureOperationResponse.new(request, http_response)
1089
1054
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1090
1055
  # Deserialize Response
1091
1056
  if status_code == 200