azure_mgmt_import_export 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/2016-11-01/generated/azure_mgmt_import_export.rb +51 -0
  4. data/lib/2016-11-01/generated/azure_mgmt_import_export/bit_locker_keys.rb +122 -0
  5. data/lib/2016-11-01/generated/azure_mgmt_import_export/jobs.rb +886 -0
  6. data/lib/2016-11-01/generated/azure_mgmt_import_export/locations.rb +207 -0
  7. data/lib/2016-11-01/generated/azure_mgmt_import_export/models/drive_bit_locker_key.rb +57 -0
  8. data/lib/2016-11-01/generated/azure_mgmt_import_export/models/drive_state.rb +21 -0
  9. data/lib/2016-11-01/generated/azure_mgmt_import_export/models/drive_status.rb +175 -0
  10. data/lib/2016-11-01/generated/azure_mgmt_import_export/models/error_response.rb +100 -0
  11. data/lib/2016-11-01/generated/azure_mgmt_import_export/models/error_response_error_details_item.rb +69 -0
  12. data/lib/2016-11-01/generated/azure_mgmt_import_export/models/export.rb +89 -0
  13. data/lib/2016-11-01/generated/azure_mgmt_import_export/models/get_bit_locker_keys_response.rb +55 -0
  14. data/lib/2016-11-01/generated/azure_mgmt_import_export/models/job_details.rb +257 -0
  15. data/lib/2016-11-01/generated/azure_mgmt_import_export/models/job_response.rb +105 -0
  16. data/lib/2016-11-01/generated/azure_mgmt_import_export/models/list_jobs_response.rb +98 -0
  17. data/lib/2016-11-01/generated/azure_mgmt_import_export/models/list_operations_response.rb +55 -0
  18. data/lib/2016-11-01/generated/azure_mgmt_import_export/models/location.rb +207 -0
  19. data/lib/2016-11-01/generated/azure_mgmt_import_export/models/locations_response.rb +55 -0
  20. data/lib/2016-11-01/generated/azure_mgmt_import_export/models/operation.rb +92 -0
  21. data/lib/2016-11-01/generated/azure_mgmt_import_export/models/package_infomation.rb +81 -0
  22. data/lib/2016-11-01/generated/azure_mgmt_import_export/models/put_job_parameters.rb +70 -0
  23. data/lib/2016-11-01/generated/azure_mgmt_import_export/models/return_address.rb +139 -0
  24. data/lib/2016-11-01/generated/azure_mgmt_import_export/models/return_shipping.rb +57 -0
  25. data/lib/2016-11-01/generated/azure_mgmt_import_export/models/shipping_information.rb +129 -0
  26. data/lib/2016-11-01/generated/azure_mgmt_import_export/models/update_job_parameters.rb +156 -0
  27. data/lib/2016-11-01/generated/azure_mgmt_import_export/module_definition.rb +9 -0
  28. data/lib/2016-11-01/generated/azure_mgmt_import_export/operations.rb +112 -0
  29. data/lib/2016-11-01/generated/azure_mgmt_import_export/storage_import_export.rb +142 -0
  30. data/lib/azure_mgmt_import_export.rb +6 -0
  31. data/lib/module_definition.rb +7 -0
  32. data/lib/profiles/latest/importexport_latest_profile_client.rb +40 -0
  33. data/lib/profiles/latest/importexport_module_definition.rb +8 -0
  34. data/lib/profiles/latest/modules/importexport_profile_module.rb +147 -0
  35. data/lib/version.rb +7 -0
  36. metadata +151 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: f36925e056dfd8fc8bcf40d92d36b4c34972862a
4
+ data.tar.gz: ba62a78dade8677e326dee39f186a6e0c8d7dab6
5
+ SHA512:
6
+ metadata.gz: 76f2c12a49d9f286b9c0f4e182cf8d8ea5eca2dbc8f33f9d6f056f8d5e8d15dce939f92872ad01c97eacd5cc0f106de5e190fb5ba87e486d90f46800b88a341f
7
+ data.tar.gz: c1a2e51df6932329490538dba83f84e01feb4b7d522424f98a733f45c483718f48d3401207dcd115271699ebae1240cb29d78e4dfa5d7193fc67f20fd6b1b722
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Microsoft Corporation
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,51 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ require 'uri'
7
+ require 'cgi'
8
+ require 'date'
9
+ require 'json'
10
+ require 'base64'
11
+ require 'erb'
12
+ require 'securerandom'
13
+ require 'time'
14
+ require 'timeliness'
15
+ require 'faraday'
16
+ require 'faraday-cookie_jar'
17
+ require 'concurrent'
18
+ require 'ms_rest'
19
+ require '2016-11-01/generated/azure_mgmt_import_export/module_definition'
20
+ require 'ms_rest_azure'
21
+
22
+ module Azure::ImportExport::Mgmt::V2016_11_01
23
+ autoload :Locations, '2016-11-01/generated/azure_mgmt_import_export/locations.rb'
24
+ autoload :Jobs, '2016-11-01/generated/azure_mgmt_import_export/jobs.rb'
25
+ autoload :BitLockerKeys, '2016-11-01/generated/azure_mgmt_import_export/bit_locker_keys.rb'
26
+ autoload :Operations, '2016-11-01/generated/azure_mgmt_import_export/operations.rb'
27
+ autoload :StorageImportExport, '2016-11-01/generated/azure_mgmt_import_export/storage_import_export.rb'
28
+
29
+ module Models
30
+ autoload :PutJobParameters, '2016-11-01/generated/azure_mgmt_import_export/models/put_job_parameters.rb'
31
+ autoload :UpdateJobParameters, '2016-11-01/generated/azure_mgmt_import_export/models/update_job_parameters.rb'
32
+ autoload :ErrorResponse, '2016-11-01/generated/azure_mgmt_import_export/models/error_response.rb'
33
+ autoload :JobResponse, '2016-11-01/generated/azure_mgmt_import_export/models/job_response.rb'
34
+ autoload :ReturnShipping, '2016-11-01/generated/azure_mgmt_import_export/models/return_shipping.rb'
35
+ autoload :ListJobsResponse, '2016-11-01/generated/azure_mgmt_import_export/models/list_jobs_response.rb'
36
+ autoload :PackageInfomation, '2016-11-01/generated/azure_mgmt_import_export/models/package_infomation.rb'
37
+ autoload :Operation, '2016-11-01/generated/azure_mgmt_import_export/models/operation.rb'
38
+ autoload :Export, '2016-11-01/generated/azure_mgmt_import_export/models/export.rb'
39
+ autoload :Location, '2016-11-01/generated/azure_mgmt_import_export/models/location.rb'
40
+ autoload :ErrorResponseErrorDetailsItem, '2016-11-01/generated/azure_mgmt_import_export/models/error_response_error_details_item.rb'
41
+ autoload :LocationsResponse, '2016-11-01/generated/azure_mgmt_import_export/models/locations_response.rb'
42
+ autoload :ShippingInformation, '2016-11-01/generated/azure_mgmt_import_export/models/shipping_information.rb'
43
+ autoload :DriveBitLockerKey, '2016-11-01/generated/azure_mgmt_import_export/models/drive_bit_locker_key.rb'
44
+ autoload :JobDetails, '2016-11-01/generated/azure_mgmt_import_export/models/job_details.rb'
45
+ autoload :GetBitLockerKeysResponse, '2016-11-01/generated/azure_mgmt_import_export/models/get_bit_locker_keys_response.rb'
46
+ autoload :DriveStatus, '2016-11-01/generated/azure_mgmt_import_export/models/drive_status.rb'
47
+ autoload :ListOperationsResponse, '2016-11-01/generated/azure_mgmt_import_export/models/list_operations_response.rb'
48
+ autoload :ReturnAddress, '2016-11-01/generated/azure_mgmt_import_export/models/return_address.rb'
49
+ autoload :DriveState, '2016-11-01/generated/azure_mgmt_import_export/models/drive_state.rb'
50
+ end
51
+ end
@@ -0,0 +1,122 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::ImportExport::Mgmt::V2016_11_01
7
+ #
8
+ # The Storage Import/Export Resource Provider API.
9
+ #
10
+ class BitLockerKeys
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the BitLockerKeys class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [StorageImportExport] reference to the StorageImportExport
22
+ attr_reader :client
23
+
24
+ #
25
+ # Returns the BitLocker Keys for all drives in the specified job.
26
+ #
27
+ # @param job_name [String] The name of the import/export job.
28
+ # @param resource_group_name [String] The resource group name uniquely
29
+ # identifies the resource group within the user subscription.
30
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
31
+ # will be added to the HTTP request.
32
+ #
33
+ # @return [GetBitLockerKeysResponse] operation results.
34
+ #
35
+ def list(job_name, resource_group_name, custom_headers:nil)
36
+ response = list_async(job_name, resource_group_name, custom_headers:custom_headers).value!
37
+ response.body unless response.nil?
38
+ end
39
+
40
+ #
41
+ # Returns the BitLocker Keys for all drives in the specified job.
42
+ #
43
+ # @param job_name [String] The name of the import/export job.
44
+ # @param resource_group_name [String] The resource group name uniquely
45
+ # identifies the resource group within the user subscription.
46
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
47
+ # will be added to the HTTP request.
48
+ #
49
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
50
+ #
51
+ def list_with_http_info(job_name, resource_group_name, custom_headers:nil)
52
+ list_async(job_name, resource_group_name, custom_headers:custom_headers).value!
53
+ end
54
+
55
+ #
56
+ # Returns the BitLocker Keys for all drives in the specified job.
57
+ #
58
+ # @param job_name [String] The name of the import/export job.
59
+ # @param resource_group_name [String] The resource group name uniquely
60
+ # identifies the resource group within the user subscription.
61
+ # @param [Hash{String => String}] A hash of custom headers that will be added
62
+ # to the HTTP request.
63
+ #
64
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
65
+ #
66
+ def list_async(job_name, resource_group_name, custom_headers:nil)
67
+ fail ArgumentError, 'job_name is nil' if job_name.nil?
68
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
69
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
70
+ @client.api_version = '2016-11-01'
71
+
72
+
73
+ request_headers = {}
74
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
75
+
76
+ # Set Headers
77
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
78
+ request_headers['Accept-Language'] = @client.accept_language unless @client.accept_language.nil?
79
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs/{jobName}/listBitLockerKeys'
80
+
81
+ request_url = @base_url || @client.base_url
82
+
83
+ options = {
84
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
85
+ path_params: {'jobName' => job_name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
86
+ query_params: {'api-version' => @client.api_version},
87
+ headers: request_headers.merge(custom_headers || {}),
88
+ base_url: request_url
89
+ }
90
+ promise = @client.make_request_async(:post, path_template, options)
91
+
92
+ promise = promise.then do |result|
93
+ http_response = result.response
94
+ status_code = http_response.status
95
+ response_content = http_response.body
96
+ unless status_code == 200
97
+ error_model = JSON.load(response_content)
98
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
99
+ end
100
+
101
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
102
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
103
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
104
+ # Deserialize Response
105
+ if status_code == 200
106
+ begin
107
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
108
+ result_mapper = Azure::ImportExport::Mgmt::V2016_11_01::Models::GetBitLockerKeysResponse.mapper()
109
+ result.body = @client.deserialize(result_mapper, parsed_response)
110
+ rescue Exception => e
111
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
112
+ end
113
+ end
114
+
115
+ result
116
+ end
117
+
118
+ promise.execute
119
+ end
120
+
121
+ end
122
+ end
@@ -0,0 +1,886 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::ImportExport::Mgmt::V2016_11_01
7
+ #
8
+ # The Storage Import/Export Resource Provider API.
9
+ #
10
+ class Jobs
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Jobs class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [StorageImportExport] reference to the StorageImportExport
22
+ attr_reader :client
23
+
24
+ #
25
+ # Returns all active and completed jobs in a subscription.
26
+ #
27
+ # @param top [Integer] An integer value that specifies how many jobs at most
28
+ # should be returned. The value cannot exceed 100.
29
+ # @param filter [String] Can be used to restrict the results to certain
30
+ # conditions.
31
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
32
+ # will be added to the HTTP request.
33
+ #
34
+ # @return [Array<JobResponse>] operation results.
35
+ #
36
+ def list_by_subscription(top:nil, filter:nil, custom_headers:nil)
37
+ first_page = list_by_subscription_as_lazy(top:top, filter:filter, custom_headers:custom_headers)
38
+ first_page.get_all_items
39
+ end
40
+
41
+ #
42
+ # Returns all active and completed jobs in a subscription.
43
+ #
44
+ # @param top [Integer] An integer value that specifies how many jobs at most
45
+ # should be returned. The value cannot exceed 100.
46
+ # @param filter [String] Can be used to restrict the results to certain
47
+ # conditions.
48
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
49
+ # will be added to the HTTP request.
50
+ #
51
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
52
+ #
53
+ def list_by_subscription_with_http_info(top:nil, filter:nil, custom_headers:nil)
54
+ list_by_subscription_async(top:top, filter:filter, custom_headers:custom_headers).value!
55
+ end
56
+
57
+ #
58
+ # Returns all active and completed jobs in a subscription.
59
+ #
60
+ # @param top [Integer] An integer value that specifies how many jobs at most
61
+ # should be returned. The value cannot exceed 100.
62
+ # @param filter [String] Can be used to restrict the results to certain
63
+ # conditions.
64
+ # @param [Hash{String => String}] A hash of custom headers that will be added
65
+ # to the HTTP request.
66
+ #
67
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
68
+ #
69
+ def list_by_subscription_async(top:nil, filter:nil, custom_headers:nil)
70
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
71
+ @client.api_version = '2016-11-01'
72
+
73
+
74
+ request_headers = {}
75
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
76
+
77
+ # Set Headers
78
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
79
+ request_headers['Accept-Language'] = @client.accept_language unless @client.accept_language.nil?
80
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.ImportExport/jobs'
81
+
82
+ request_url = @base_url || @client.base_url
83
+
84
+ options = {
85
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
86
+ path_params: {'subscriptionId' => @client.subscription_id},
87
+ query_params: {'$top' => top,'$filter' => filter,'api-version' => @client.api_version},
88
+ headers: request_headers.merge(custom_headers || {}),
89
+ base_url: request_url
90
+ }
91
+ promise = @client.make_request_async(:get, path_template, options)
92
+
93
+ promise = promise.then do |result|
94
+ http_response = result.response
95
+ status_code = http_response.status
96
+ response_content = http_response.body
97
+ unless status_code == 200
98
+ error_model = JSON.load(response_content)
99
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
100
+ end
101
+
102
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
103
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
104
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
105
+ # Deserialize Response
106
+ if status_code == 200
107
+ begin
108
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
109
+ result_mapper = Azure::ImportExport::Mgmt::V2016_11_01::Models::ListJobsResponse.mapper()
110
+ result.body = @client.deserialize(result_mapper, parsed_response)
111
+ rescue Exception => e
112
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
113
+ end
114
+ end
115
+
116
+ result
117
+ end
118
+
119
+ promise.execute
120
+ end
121
+
122
+ #
123
+ # Returns all active and completed jobs in a resource group.
124
+ #
125
+ # @param resource_group_name [String] The resource group name uniquely
126
+ # identifies the resource group within the user subscription.
127
+ # @param top [Integer] An integer value that specifies how many jobs at most
128
+ # should be returned. The value cannot exceed 100.
129
+ # @param filter [String] Can be used to restrict the results to certain
130
+ # conditions.
131
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
132
+ # will be added to the HTTP request.
133
+ #
134
+ # @return [Array<JobResponse>] operation results.
135
+ #
136
+ def list_by_resource_group(resource_group_name, top:nil, filter:nil, custom_headers:nil)
137
+ first_page = list_by_resource_group_as_lazy(resource_group_name, top:top, filter:filter, custom_headers:custom_headers)
138
+ first_page.get_all_items
139
+ end
140
+
141
+ #
142
+ # Returns all active and completed jobs in a resource group.
143
+ #
144
+ # @param resource_group_name [String] The resource group name uniquely
145
+ # identifies the resource group within the user subscription.
146
+ # @param top [Integer] An integer value that specifies how many jobs at most
147
+ # should be returned. The value cannot exceed 100.
148
+ # @param filter [String] Can be used to restrict the results to certain
149
+ # conditions.
150
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
151
+ # will be added to the HTTP request.
152
+ #
153
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
154
+ #
155
+ def list_by_resource_group_with_http_info(resource_group_name, top:nil, filter:nil, custom_headers:nil)
156
+ list_by_resource_group_async(resource_group_name, top:top, filter:filter, custom_headers:custom_headers).value!
157
+ end
158
+
159
+ #
160
+ # Returns all active and completed jobs in a resource group.
161
+ #
162
+ # @param resource_group_name [String] The resource group name uniquely
163
+ # identifies the resource group within the user subscription.
164
+ # @param top [Integer] An integer value that specifies how many jobs at most
165
+ # should be returned. The value cannot exceed 100.
166
+ # @param filter [String] Can be used to restrict the results to certain
167
+ # conditions.
168
+ # @param [Hash{String => String}] A hash of custom headers that will be added
169
+ # to the HTTP request.
170
+ #
171
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
172
+ #
173
+ def list_by_resource_group_async(resource_group_name, top:nil, filter:nil, custom_headers:nil)
174
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
175
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
176
+ @client.api_version = '2016-11-01'
177
+
178
+
179
+ request_headers = {}
180
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
181
+
182
+ # Set Headers
183
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
184
+ request_headers['Accept-Language'] = @client.accept_language unless @client.accept_language.nil?
185
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs'
186
+
187
+ request_url = @base_url || @client.base_url
188
+
189
+ options = {
190
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
191
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
192
+ query_params: {'$top' => top,'$filter' => filter,'api-version' => @client.api_version},
193
+ headers: request_headers.merge(custom_headers || {}),
194
+ base_url: request_url
195
+ }
196
+ promise = @client.make_request_async(:get, path_template, options)
197
+
198
+ promise = promise.then do |result|
199
+ http_response = result.response
200
+ status_code = http_response.status
201
+ response_content = http_response.body
202
+ unless status_code == 200
203
+ error_model = JSON.load(response_content)
204
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
205
+ end
206
+
207
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
208
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
209
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
210
+ # Deserialize Response
211
+ if status_code == 200
212
+ begin
213
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
214
+ result_mapper = Azure::ImportExport::Mgmt::V2016_11_01::Models::ListJobsResponse.mapper()
215
+ result.body = @client.deserialize(result_mapper, parsed_response)
216
+ rescue Exception => e
217
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
218
+ end
219
+ end
220
+
221
+ result
222
+ end
223
+
224
+ promise.execute
225
+ end
226
+
227
+ #
228
+ # Gets information about an existing job.
229
+ #
230
+ # @param job_name [String] The name of the import/export job.
231
+ # @param resource_group_name [String] The resource group name uniquely
232
+ # identifies the resource group within the user subscription.
233
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
234
+ # will be added to the HTTP request.
235
+ #
236
+ # @return [JobResponse] operation results.
237
+ #
238
+ def get(job_name, resource_group_name, custom_headers:nil)
239
+ response = get_async(job_name, resource_group_name, custom_headers:custom_headers).value!
240
+ response.body unless response.nil?
241
+ end
242
+
243
+ #
244
+ # Gets information about an existing job.
245
+ #
246
+ # @param job_name [String] The name of the import/export job.
247
+ # @param resource_group_name [String] The resource group name uniquely
248
+ # identifies the resource group within the user subscription.
249
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
250
+ # will be added to the HTTP request.
251
+ #
252
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
253
+ #
254
+ def get_with_http_info(job_name, resource_group_name, custom_headers:nil)
255
+ get_async(job_name, resource_group_name, custom_headers:custom_headers).value!
256
+ end
257
+
258
+ #
259
+ # Gets information about an existing job.
260
+ #
261
+ # @param job_name [String] The name of the import/export job.
262
+ # @param resource_group_name [String] The resource group name uniquely
263
+ # identifies the resource group within the user subscription.
264
+ # @param [Hash{String => String}] A hash of custom headers that will be added
265
+ # to the HTTP request.
266
+ #
267
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
268
+ #
269
+ def get_async(job_name, resource_group_name, custom_headers:nil)
270
+ fail ArgumentError, 'job_name is nil' if job_name.nil?
271
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
272
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
273
+ @client.api_version = '2016-11-01'
274
+
275
+
276
+ request_headers = {}
277
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
278
+
279
+ # Set Headers
280
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
281
+ request_headers['Accept-Language'] = @client.accept_language unless @client.accept_language.nil?
282
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs/{jobName}'
283
+
284
+ request_url = @base_url || @client.base_url
285
+
286
+ options = {
287
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
288
+ path_params: {'jobName' => job_name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
289
+ query_params: {'api-version' => @client.api_version},
290
+ headers: request_headers.merge(custom_headers || {}),
291
+ base_url: request_url
292
+ }
293
+ promise = @client.make_request_async(:get, path_template, options)
294
+
295
+ promise = promise.then do |result|
296
+ http_response = result.response
297
+ status_code = http_response.status
298
+ response_content = http_response.body
299
+ unless status_code == 200
300
+ error_model = JSON.load(response_content)
301
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
302
+ end
303
+
304
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
305
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
306
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
307
+ # Deserialize Response
308
+ if status_code == 200
309
+ begin
310
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
311
+ result_mapper = Azure::ImportExport::Mgmt::V2016_11_01::Models::JobResponse.mapper()
312
+ result.body = @client.deserialize(result_mapper, parsed_response)
313
+ rescue Exception => e
314
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
315
+ end
316
+ end
317
+
318
+ result
319
+ end
320
+
321
+ promise.execute
322
+ end
323
+
324
+ #
325
+ # Updates specific properties of a job. You can call this operation to notify
326
+ # the Import/Export service that the hard drives comprising the import or
327
+ # export job have been shipped to the Microsoft data center. It can also be
328
+ # used to cancel an existing job.
329
+ #
330
+ # @param job_name [String] The name of the import/export job.
331
+ # @param resource_group_name [String] The resource group name uniquely
332
+ # identifies the resource group within the user subscription.
333
+ # @param body [UpdateJobParameters] The parameters to update in the job
334
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
335
+ # will be added to the HTTP request.
336
+ #
337
+ # @return [JobResponse] operation results.
338
+ #
339
+ def update(job_name, resource_group_name, body, custom_headers:nil)
340
+ response = update_async(job_name, resource_group_name, body, custom_headers:custom_headers).value!
341
+ response.body unless response.nil?
342
+ end
343
+
344
+ #
345
+ # Updates specific properties of a job. You can call this operation to notify
346
+ # the Import/Export service that the hard drives comprising the import or
347
+ # export job have been shipped to the Microsoft data center. It can also be
348
+ # used to cancel an existing job.
349
+ #
350
+ # @param job_name [String] The name of the import/export job.
351
+ # @param resource_group_name [String] The resource group name uniquely
352
+ # identifies the resource group within the user subscription.
353
+ # @param body [UpdateJobParameters] The parameters to update in the job
354
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
355
+ # will be added to the HTTP request.
356
+ #
357
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
358
+ #
359
+ def update_with_http_info(job_name, resource_group_name, body, custom_headers:nil)
360
+ update_async(job_name, resource_group_name, body, custom_headers:custom_headers).value!
361
+ end
362
+
363
+ #
364
+ # Updates specific properties of a job. You can call this operation to notify
365
+ # the Import/Export service that the hard drives comprising the import or
366
+ # export job have been shipped to the Microsoft data center. It can also be
367
+ # used to cancel an existing job.
368
+ #
369
+ # @param job_name [String] The name of the import/export job.
370
+ # @param resource_group_name [String] The resource group name uniquely
371
+ # identifies the resource group within the user subscription.
372
+ # @param body [UpdateJobParameters] The parameters to update in the job
373
+ # @param [Hash{String => String}] A hash of custom headers that will be added
374
+ # to the HTTP request.
375
+ #
376
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
377
+ #
378
+ def update_async(job_name, resource_group_name, body, custom_headers:nil)
379
+ fail ArgumentError, 'job_name is nil' if job_name.nil?
380
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
381
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
382
+ @client.api_version = '2016-11-01'
383
+ fail ArgumentError, 'body is nil' if body.nil?
384
+
385
+
386
+ request_headers = {}
387
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
388
+
389
+ # Set Headers
390
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
391
+ request_headers['Accept-Language'] = @client.accept_language unless @client.accept_language.nil?
392
+
393
+ # Serialize Request
394
+ request_mapper = Azure::ImportExport::Mgmt::V2016_11_01::Models::UpdateJobParameters.mapper()
395
+ request_content = @client.serialize(request_mapper, body)
396
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
397
+
398
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs/{jobName}'
399
+
400
+ request_url = @base_url || @client.base_url
401
+
402
+ options = {
403
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
404
+ path_params: {'jobName' => job_name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
405
+ query_params: {'api-version' => @client.api_version},
406
+ body: request_content,
407
+ headers: request_headers.merge(custom_headers || {}),
408
+ base_url: request_url
409
+ }
410
+ promise = @client.make_request_async(:patch, path_template, options)
411
+
412
+ promise = promise.then do |result|
413
+ http_response = result.response
414
+ status_code = http_response.status
415
+ response_content = http_response.body
416
+ unless status_code == 200
417
+ error_model = JSON.load(response_content)
418
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
419
+ end
420
+
421
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
422
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
423
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
424
+ # Deserialize Response
425
+ if status_code == 200
426
+ begin
427
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
428
+ result_mapper = Azure::ImportExport::Mgmt::V2016_11_01::Models::JobResponse.mapper()
429
+ result.body = @client.deserialize(result_mapper, parsed_response)
430
+ rescue Exception => e
431
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
432
+ end
433
+ end
434
+
435
+ result
436
+ end
437
+
438
+ promise.execute
439
+ end
440
+
441
+ #
442
+ # Creates a new job or updates an existing job in the specified subscription.
443
+ #
444
+ # @param job_name [String] The name of the import/export job.
445
+ # @param resource_group_name [String] The resource group name uniquely
446
+ # identifies the resource group within the user subscription.
447
+ # @param body [PutJobParameters] The parameters used for creating the job
448
+ # @param client_tenant_id [String] The tenant ID of the client making the
449
+ # request.
450
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
451
+ # will be added to the HTTP request.
452
+ #
453
+ # @return [JobResponse] operation results.
454
+ #
455
+ def create(job_name, resource_group_name, body, client_tenant_id:nil, custom_headers:nil)
456
+ response = create_async(job_name, resource_group_name, body, client_tenant_id:client_tenant_id, custom_headers:custom_headers).value!
457
+ response.body unless response.nil?
458
+ end
459
+
460
+ #
461
+ # Creates a new job or updates an existing job in the specified subscription.
462
+ #
463
+ # @param job_name [String] The name of the import/export job.
464
+ # @param resource_group_name [String] The resource group name uniquely
465
+ # identifies the resource group within the user subscription.
466
+ # @param body [PutJobParameters] The parameters used for creating the job
467
+ # @param client_tenant_id [String] The tenant ID of the client making the
468
+ # request.
469
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
470
+ # will be added to the HTTP request.
471
+ #
472
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
473
+ #
474
+ def create_with_http_info(job_name, resource_group_name, body, client_tenant_id:nil, custom_headers:nil)
475
+ create_async(job_name, resource_group_name, body, client_tenant_id:client_tenant_id, custom_headers:custom_headers).value!
476
+ end
477
+
478
+ #
479
+ # Creates a new job or updates an existing job in the specified subscription.
480
+ #
481
+ # @param job_name [String] The name of the import/export job.
482
+ # @param resource_group_name [String] The resource group name uniquely
483
+ # identifies the resource group within the user subscription.
484
+ # @param body [PutJobParameters] The parameters used for creating the job
485
+ # @param client_tenant_id [String] The tenant ID of the client making the
486
+ # request.
487
+ # @param [Hash{String => String}] A hash of custom headers that will be added
488
+ # to the HTTP request.
489
+ #
490
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
491
+ #
492
+ def create_async(job_name, resource_group_name, body, client_tenant_id:nil, custom_headers:nil)
493
+ fail ArgumentError, 'job_name is nil' if job_name.nil?
494
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
495
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
496
+ @client.api_version = '2016-11-01'
497
+ fail ArgumentError, 'body is nil' if body.nil?
498
+
499
+
500
+ request_headers = {}
501
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
502
+
503
+ # Set Headers
504
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
505
+ request_headers['Accept-Language'] = @client.accept_language unless @client.accept_language.nil?
506
+ request_headers['x-ms-client-tenant-id'] = client_tenant_id unless client_tenant_id.nil?
507
+
508
+ # Serialize Request
509
+ request_mapper = Azure::ImportExport::Mgmt::V2016_11_01::Models::PutJobParameters.mapper()
510
+ request_content = @client.serialize(request_mapper, body)
511
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
512
+
513
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs/{jobName}'
514
+
515
+ request_url = @base_url || @client.base_url
516
+
517
+ options = {
518
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
519
+ path_params: {'jobName' => job_name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
520
+ query_params: {'api-version' => @client.api_version},
521
+ body: request_content,
522
+ headers: request_headers.merge(custom_headers || {}),
523
+ base_url: request_url
524
+ }
525
+ promise = @client.make_request_async(:put, path_template, options)
526
+
527
+ promise = promise.then do |result|
528
+ http_response = result.response
529
+ status_code = http_response.status
530
+ response_content = http_response.body
531
+ unless status_code == 200 || status_code == 201
532
+ error_model = JSON.load(response_content)
533
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
534
+ end
535
+
536
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
537
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
538
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
539
+ # Deserialize Response
540
+ if status_code == 200
541
+ begin
542
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
543
+ result_mapper = Azure::ImportExport::Mgmt::V2016_11_01::Models::JobResponse.mapper()
544
+ result.body = @client.deserialize(result_mapper, parsed_response)
545
+ rescue Exception => e
546
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
547
+ end
548
+ end
549
+ # Deserialize Response
550
+ if status_code == 201
551
+ begin
552
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
553
+ result_mapper = Azure::ImportExport::Mgmt::V2016_11_01::Models::JobResponse.mapper()
554
+ result.body = @client.deserialize(result_mapper, parsed_response)
555
+ rescue Exception => e
556
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
557
+ end
558
+ end
559
+
560
+ result
561
+ end
562
+
563
+ promise.execute
564
+ end
565
+
566
+ #
567
+ # Deletes an existing job. Only jobs in the Creating or Completed states can be
568
+ # deleted.
569
+ #
570
+ # @param job_name [String] The name of the import/export job.
571
+ # @param resource_group_name [String] The resource group name uniquely
572
+ # identifies the resource group within the user subscription.
573
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
574
+ # will be added to the HTTP request.
575
+ #
576
+ #
577
+ def delete(job_name, resource_group_name, custom_headers:nil)
578
+ response = delete_async(job_name, resource_group_name, custom_headers:custom_headers).value!
579
+ nil
580
+ end
581
+
582
+ #
583
+ # Deletes an existing job. Only jobs in the Creating or Completed states can be
584
+ # deleted.
585
+ #
586
+ # @param job_name [String] The name of the import/export job.
587
+ # @param resource_group_name [String] The resource group name uniquely
588
+ # identifies the resource group within the user subscription.
589
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
590
+ # will be added to the HTTP request.
591
+ #
592
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
593
+ #
594
+ def delete_with_http_info(job_name, resource_group_name, custom_headers:nil)
595
+ delete_async(job_name, resource_group_name, custom_headers:custom_headers).value!
596
+ end
597
+
598
+ #
599
+ # Deletes an existing job. Only jobs in the Creating or Completed states can be
600
+ # deleted.
601
+ #
602
+ # @param job_name [String] The name of the import/export job.
603
+ # @param resource_group_name [String] The resource group name uniquely
604
+ # identifies the resource group within the user subscription.
605
+ # @param [Hash{String => String}] A hash of custom headers that will be added
606
+ # to the HTTP request.
607
+ #
608
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
609
+ #
610
+ def delete_async(job_name, resource_group_name, custom_headers:nil)
611
+ fail ArgumentError, 'job_name is nil' if job_name.nil?
612
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
613
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
614
+ @client.api_version = '2016-11-01'
615
+
616
+
617
+ request_headers = {}
618
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
619
+
620
+ # Set Headers
621
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
622
+ request_headers['Accept-Language'] = @client.accept_language unless @client.accept_language.nil?
623
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs/{jobName}'
624
+
625
+ request_url = @base_url || @client.base_url
626
+
627
+ options = {
628
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
629
+ path_params: {'jobName' => job_name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
630
+ query_params: {'api-version' => @client.api_version},
631
+ headers: request_headers.merge(custom_headers || {}),
632
+ base_url: request_url
633
+ }
634
+ promise = @client.make_request_async(:delete, path_template, options)
635
+
636
+ promise = promise.then do |result|
637
+ http_response = result.response
638
+ status_code = http_response.status
639
+ response_content = http_response.body
640
+ unless status_code == 200
641
+ error_model = JSON.load(response_content)
642
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
643
+ end
644
+
645
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
646
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
647
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
648
+
649
+ result
650
+ end
651
+
652
+ promise.execute
653
+ end
654
+
655
+ #
656
+ # Returns all active and completed jobs in a subscription.
657
+ #
658
+ # @param next_page_link [String] The NextLink from the previous successful call
659
+ # to List operation.
660
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
661
+ # will be added to the HTTP request.
662
+ #
663
+ # @return [ListJobsResponse] operation results.
664
+ #
665
+ def list_by_subscription_next(next_page_link, custom_headers:nil)
666
+ response = list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
667
+ response.body unless response.nil?
668
+ end
669
+
670
+ #
671
+ # Returns all active and completed jobs in a subscription.
672
+ #
673
+ # @param next_page_link [String] The NextLink from the previous successful call
674
+ # to List operation.
675
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
676
+ # will be added to the HTTP request.
677
+ #
678
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
679
+ #
680
+ def list_by_subscription_next_with_http_info(next_page_link, custom_headers:nil)
681
+ list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
682
+ end
683
+
684
+ #
685
+ # Returns all active and completed jobs in a subscription.
686
+ #
687
+ # @param next_page_link [String] The NextLink from the previous successful call
688
+ # to List operation.
689
+ # @param [Hash{String => String}] A hash of custom headers that will be added
690
+ # to the HTTP request.
691
+ #
692
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
693
+ #
694
+ def list_by_subscription_next_async(next_page_link, custom_headers:nil)
695
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
696
+
697
+
698
+ request_headers = {}
699
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
700
+
701
+ # Set Headers
702
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
703
+ request_headers['Accept-Language'] = @client.accept_language unless @client.accept_language.nil?
704
+ path_template = '{nextLink}'
705
+
706
+ request_url = @base_url || @client.base_url
707
+
708
+ options = {
709
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
710
+ skip_encoding_path_params: {'nextLink' => next_page_link},
711
+ headers: request_headers.merge(custom_headers || {}),
712
+ base_url: request_url
713
+ }
714
+ promise = @client.make_request_async(:get, path_template, options)
715
+
716
+ promise = promise.then do |result|
717
+ http_response = result.response
718
+ status_code = http_response.status
719
+ response_content = http_response.body
720
+ unless status_code == 200
721
+ error_model = JSON.load(response_content)
722
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
723
+ end
724
+
725
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
726
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
727
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
728
+ # Deserialize Response
729
+ if status_code == 200
730
+ begin
731
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
732
+ result_mapper = Azure::ImportExport::Mgmt::V2016_11_01::Models::ListJobsResponse.mapper()
733
+ result.body = @client.deserialize(result_mapper, parsed_response)
734
+ rescue Exception => e
735
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
736
+ end
737
+ end
738
+
739
+ result
740
+ end
741
+
742
+ promise.execute
743
+ end
744
+
745
+ #
746
+ # Returns all active and completed jobs in a resource group.
747
+ #
748
+ # @param next_page_link [String] The NextLink from the previous successful call
749
+ # to List operation.
750
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
751
+ # will be added to the HTTP request.
752
+ #
753
+ # @return [ListJobsResponse] operation results.
754
+ #
755
+ def list_by_resource_group_next(next_page_link, custom_headers:nil)
756
+ response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
757
+ response.body unless response.nil?
758
+ end
759
+
760
+ #
761
+ # Returns all active and completed jobs in a resource group.
762
+ #
763
+ # @param next_page_link [String] The NextLink from the previous successful call
764
+ # to List operation.
765
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
766
+ # will be added to the HTTP request.
767
+ #
768
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
769
+ #
770
+ def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
771
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
772
+ end
773
+
774
+ #
775
+ # Returns all active and completed jobs in a resource group.
776
+ #
777
+ # @param next_page_link [String] The NextLink from the previous successful call
778
+ # to List operation.
779
+ # @param [Hash{String => String}] A hash of custom headers that will be added
780
+ # to the HTTP request.
781
+ #
782
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
783
+ #
784
+ def list_by_resource_group_next_async(next_page_link, custom_headers:nil)
785
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
786
+
787
+
788
+ request_headers = {}
789
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
790
+
791
+ # Set Headers
792
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
793
+ request_headers['Accept-Language'] = @client.accept_language unless @client.accept_language.nil?
794
+ path_template = '{nextLink}'
795
+
796
+ request_url = @base_url || @client.base_url
797
+
798
+ options = {
799
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
800
+ skip_encoding_path_params: {'nextLink' => next_page_link},
801
+ headers: request_headers.merge(custom_headers || {}),
802
+ base_url: request_url
803
+ }
804
+ promise = @client.make_request_async(:get, path_template, options)
805
+
806
+ promise = promise.then do |result|
807
+ http_response = result.response
808
+ status_code = http_response.status
809
+ response_content = http_response.body
810
+ unless status_code == 200
811
+ error_model = JSON.load(response_content)
812
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
813
+ end
814
+
815
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
816
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
817
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
818
+ # Deserialize Response
819
+ if status_code == 200
820
+ begin
821
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
822
+ result_mapper = Azure::ImportExport::Mgmt::V2016_11_01::Models::ListJobsResponse.mapper()
823
+ result.body = @client.deserialize(result_mapper, parsed_response)
824
+ rescue Exception => e
825
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
826
+ end
827
+ end
828
+
829
+ result
830
+ end
831
+
832
+ promise.execute
833
+ end
834
+
835
+ #
836
+ # Returns all active and completed jobs in a subscription.
837
+ #
838
+ # @param top [Integer] An integer value that specifies how many jobs at most
839
+ # should be returned. The value cannot exceed 100.
840
+ # @param filter [String] Can be used to restrict the results to certain
841
+ # conditions.
842
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
843
+ # will be added to the HTTP request.
844
+ #
845
+ # @return [ListJobsResponse] which provide lazy access to pages of the
846
+ # response.
847
+ #
848
+ def list_by_subscription_as_lazy(top:nil, filter:nil, custom_headers:nil)
849
+ response = list_by_subscription_async(top:top, filter:filter, custom_headers:custom_headers).value!
850
+ unless response.nil?
851
+ page = response.body
852
+ page.next_method = Proc.new do |next_page_link|
853
+ list_by_subscription_next_async(next_page_link, custom_headers:custom_headers)
854
+ end
855
+ page
856
+ end
857
+ end
858
+
859
+ #
860
+ # Returns all active and completed jobs in a resource group.
861
+ #
862
+ # @param resource_group_name [String] The resource group name uniquely
863
+ # identifies the resource group within the user subscription.
864
+ # @param top [Integer] An integer value that specifies how many jobs at most
865
+ # should be returned. The value cannot exceed 100.
866
+ # @param filter [String] Can be used to restrict the results to certain
867
+ # conditions.
868
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
869
+ # will be added to the HTTP request.
870
+ #
871
+ # @return [ListJobsResponse] which provide lazy access to pages of the
872
+ # response.
873
+ #
874
+ def list_by_resource_group_as_lazy(resource_group_name, top:nil, filter:nil, custom_headers:nil)
875
+ response = list_by_resource_group_async(resource_group_name, top:top, filter:filter, custom_headers:custom_headers).value!
876
+ unless response.nil?
877
+ page = response.body
878
+ page.next_method = Proc.new do |next_page_link|
879
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
880
+ end
881
+ page
882
+ end
883
+ end
884
+
885
+ end
886
+ end