azure_mgmt_managed_applications 0.14.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (28) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/azure_mgmt_managed_applications.rb +7 -0
  4. data/lib/generated/azure_mgmt_managed_applications.rb +47 -0
  5. data/lib/generated/azure_mgmt_managed_applications/appliance_definitions.rb +1014 -0
  6. data/lib/generated/azure_mgmt_managed_applications/appliances.rb +1400 -0
  7. data/lib/generated/azure_mgmt_managed_applications/managed_application_client.rb +133 -0
  8. data/lib/generated/azure_mgmt_managed_applications/models/appliance.rb +192 -0
  9. data/lib/generated/azure_mgmt_managed_applications/models/appliance_artifact.rb +66 -0
  10. data/lib/generated/azure_mgmt_managed_applications/models/appliance_artifact_type.rb +16 -0
  11. data/lib/generated/azure_mgmt_managed_applications/models/appliance_definition.rb +184 -0
  12. data/lib/generated/azure_mgmt_managed_applications/models/appliance_definition_list_result.rb +95 -0
  13. data/lib/generated/azure_mgmt_managed_applications/models/appliance_list_result.rb +94 -0
  14. data/lib/generated/azure_mgmt_managed_applications/models/appliance_lock_level.rb +17 -0
  15. data/lib/generated/azure_mgmt_managed_applications/models/appliance_patchable.rb +192 -0
  16. data/lib/generated/azure_mgmt_managed_applications/models/appliance_provider_authorization.rb +59 -0
  17. data/lib/generated/azure_mgmt_managed_applications/models/error_response.rb +65 -0
  18. data/lib/generated/azure_mgmt_managed_applications/models/generic_resource.rb +111 -0
  19. data/lib/generated/azure_mgmt_managed_applications/models/identity.rb +68 -0
  20. data/lib/generated/azure_mgmt_managed_applications/models/plan.rb +84 -0
  21. data/lib/generated/azure_mgmt_managed_applications/models/plan_patchable.rb +84 -0
  22. data/lib/generated/azure_mgmt_managed_applications/models/provisioning_state.rb +25 -0
  23. data/lib/generated/azure_mgmt_managed_applications/models/resource.rb +94 -0
  24. data/lib/generated/azure_mgmt_managed_applications/models/resource_identity_type.rb +15 -0
  25. data/lib/generated/azure_mgmt_managed_applications/models/sku.rb +94 -0
  26. data/lib/generated/azure_mgmt_managed_applications/module_definition.rb +8 -0
  27. data/lib/generated/azure_mgmt_managed_applications/version.rb +8 -0
  28. metadata +139 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: b6c2c12b4524cc57a68c05b8aac3d3cf3ce90f24
4
+ data.tar.gz: 53f9fce5f7c4c8c81f328281e2d1a7b32c8046fb
5
+ SHA512:
6
+ metadata.gz: 958abe57496ff9e0e9d5fc019f44d2caa1ae943297128f6c4edbbda7a5e280628f31d057492ea57d9386b07b0913ef653aafb9d5bfffba78261b760a35e027a5
7
+ data.tar.gz: 4865ed7638d11231f9b5940e545a8fbff7070d9c6159193b541a974eec5d477e1cc3be806e6fd4858257998e3529b2848ffdc975bc59f7e61bb4bc1aa193577c
data/LICENSE.txt ADDED
@@ -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,7 @@
1
+ # encoding: utf-8
2
+ # Copyright (c) Microsoft Corporation. All rights reserved.
3
+ # Licensed under the MIT License. See License.txt in the project root for license information.
4
+
5
+ require 'generated/azure_mgmt_managed_applications'
6
+
7
+
@@ -0,0 +1,47 @@
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 'generated/azure_mgmt_managed_applications/module_definition'
20
+ require 'ms_rest_azure'
21
+
22
+ module Azure::ARM::ManagedApplications
23
+ autoload :Appliances, 'generated/azure_mgmt_managed_applications/appliances.rb'
24
+ autoload :ApplianceDefinitions, 'generated/azure_mgmt_managed_applications/appliance_definitions.rb'
25
+ autoload :ManagedApplicationClient, 'generated/azure_mgmt_managed_applications/managed_application_client.rb'
26
+
27
+ module Models
28
+ autoload :Sku, 'generated/azure_mgmt_managed_applications/models/sku.rb'
29
+ autoload :Plan, 'generated/azure_mgmt_managed_applications/models/plan.rb'
30
+ autoload :Identity, 'generated/azure_mgmt_managed_applications/models/identity.rb'
31
+ autoload :PlanPatchable, 'generated/azure_mgmt_managed_applications/models/plan_patchable.rb'
32
+ autoload :ErrorResponse, 'generated/azure_mgmt_managed_applications/models/error_response.rb'
33
+ autoload :ApplianceProviderAuthorization, 'generated/azure_mgmt_managed_applications/models/appliance_provider_authorization.rb'
34
+ autoload :ApplianceDefinitionListResult, 'generated/azure_mgmt_managed_applications/models/appliance_definition_list_result.rb'
35
+ autoload :ApplianceListResult, 'generated/azure_mgmt_managed_applications/models/appliance_list_result.rb'
36
+ autoload :ApplianceArtifact, 'generated/azure_mgmt_managed_applications/models/appliance_artifact.rb'
37
+ autoload :Resource, 'generated/azure_mgmt_managed_applications/models/resource.rb'
38
+ autoload :GenericResource, 'generated/azure_mgmt_managed_applications/models/generic_resource.rb'
39
+ autoload :Appliance, 'generated/azure_mgmt_managed_applications/models/appliance.rb'
40
+ autoload :AppliancePatchable, 'generated/azure_mgmt_managed_applications/models/appliance_patchable.rb'
41
+ autoload :ApplianceDefinition, 'generated/azure_mgmt_managed_applications/models/appliance_definition.rb'
42
+ autoload :ProvisioningState, 'generated/azure_mgmt_managed_applications/models/provisioning_state.rb'
43
+ autoload :ApplianceLockLevel, 'generated/azure_mgmt_managed_applications/models/appliance_lock_level.rb'
44
+ autoload :ApplianceArtifactType, 'generated/azure_mgmt_managed_applications/models/appliance_artifact_type.rb'
45
+ autoload :ResourceIdentityType, 'generated/azure_mgmt_managed_applications/models/resource_identity_type.rb'
46
+ end
47
+ end
@@ -0,0 +1,1014 @@
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::ARM::ManagedApplications
7
+ #
8
+ # ARM managed applications (appliances)
9
+ #
10
+ class ApplianceDefinitions
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the ApplianceDefinitions class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [ManagedApplicationClient] reference to the ManagedApplicationClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Gets the appliance definition.
26
+ #
27
+ # @param resource_group_name [String] The name of the resource group. The name
28
+ # is case insensitive.
29
+ # @param appliance_definition_name [String] The name of the appliance
30
+ # definition.
31
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
32
+ # will be added to the HTTP request.
33
+ #
34
+ # @return [ApplianceDefinition] operation results.
35
+ #
36
+ def get(resource_group_name, appliance_definition_name, custom_headers = nil)
37
+ response = get_async(resource_group_name, appliance_definition_name, custom_headers).value!
38
+ response.body unless response.nil?
39
+ end
40
+
41
+ #
42
+ # Gets the appliance definition.
43
+ #
44
+ # @param resource_group_name [String] The name of the resource group. The name
45
+ # is case insensitive.
46
+ # @param appliance_definition_name [String] The name of the appliance
47
+ # definition.
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 get_with_http_info(resource_group_name, appliance_definition_name, custom_headers = nil)
54
+ get_async(resource_group_name, appliance_definition_name, custom_headers).value!
55
+ end
56
+
57
+ #
58
+ # Gets the appliance definition.
59
+ #
60
+ # @param resource_group_name [String] The name of the resource group. The name
61
+ # is case insensitive.
62
+ # @param appliance_definition_name [String] The name of the appliance
63
+ # definition.
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 get_async(resource_group_name, appliance_definition_name, custom_headers = nil)
70
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
71
+ fail ArgumentError, 'appliance_definition_name is nil' if appliance_definition_name.nil?
72
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
73
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
74
+
75
+
76
+ request_headers = {}
77
+
78
+ # Set Headers
79
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
80
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
81
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applianceDefinitions/{applianceDefinitionName}'
82
+
83
+ request_url = @base_url || @client.base_url
84
+
85
+ options = {
86
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
87
+ path_params: {'resourceGroupName' => resource_group_name,'applianceDefinitionName' => appliance_definition_name,'subscriptionId' => @client.subscription_id},
88
+ query_params: {'api-version' => @client.api_version},
89
+ headers: request_headers.merge(custom_headers || {}),
90
+ base_url: request_url
91
+ }
92
+ promise = @client.make_request_async(:get, path_template, options)
93
+
94
+ promise = promise.then do |result|
95
+ http_response = result.response
96
+ status_code = http_response.status
97
+ response_content = http_response.body
98
+ unless status_code == 200 || status_code == 404
99
+ error_model = JSON.load(response_content)
100
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
101
+ end
102
+
103
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-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::ARM::ManagedApplications::Models::ApplianceDefinition.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
+ #
122
+ # Deletes the appliance definition.
123
+ #
124
+ # @param resource_group_name [String] The name of the resource group. The name
125
+ # is case insensitive.
126
+ # @param appliance_definition_name [String] The name of the appliance
127
+ # definition to delete.
128
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
129
+ # will be added to the HTTP request.
130
+ #
131
+ def delete(resource_group_name, appliance_definition_name, custom_headers = nil)
132
+ response = delete_async(resource_group_name, appliance_definition_name, custom_headers).value!
133
+ nil
134
+ end
135
+
136
+ #
137
+ # @param resource_group_name [String] The name of the resource group. The name
138
+ # is case insensitive.
139
+ # @param appliance_definition_name [String] The name of the appliance
140
+ # definition to delete.
141
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
142
+ # will be added to the HTTP request.
143
+ #
144
+ # @return [Concurrent::Promise] promise which provides async access to http
145
+ # response.
146
+ #
147
+ def delete_async(resource_group_name, appliance_definition_name, custom_headers = nil)
148
+ # Send request
149
+ promise = begin_delete_async(resource_group_name, appliance_definition_name, custom_headers)
150
+
151
+ promise = promise.then do |response|
152
+ # Defining deserialization method.
153
+ deserialize_method = lambda do |parsed_response|
154
+ end
155
+
156
+ # Waiting for response.
157
+ @client.get_long_running_operation_result(response, deserialize_method)
158
+ end
159
+
160
+ promise
161
+ end
162
+
163
+ #
164
+ # Creates a new appliance definition.
165
+ #
166
+ # @param resource_group_name [String] The name of the resource group. The name
167
+ # is case insensitive.
168
+ # @param appliance_definition_name [String] The name of the appliance
169
+ # definition.
170
+ # @param parameters [ApplianceDefinition] Parameters supplied to the create or
171
+ # update an appliance definition.
172
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
173
+ # will be added to the HTTP request.
174
+ #
175
+ # @return [ApplianceDefinition] operation results.
176
+ #
177
+ def create_or_update(resource_group_name, appliance_definition_name, parameters, custom_headers = nil)
178
+ response = create_or_update_async(resource_group_name, appliance_definition_name, parameters, custom_headers).value!
179
+ response.body unless response.nil?
180
+ end
181
+
182
+ #
183
+ # @param resource_group_name [String] The name of the resource group. The name
184
+ # is case insensitive.
185
+ # @param appliance_definition_name [String] The name of the appliance
186
+ # definition.
187
+ # @param parameters [ApplianceDefinition] Parameters supplied to the create or
188
+ # update an appliance definition.
189
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
190
+ # will be added to the HTTP request.
191
+ #
192
+ # @return [Concurrent::Promise] promise which provides async access to http
193
+ # response.
194
+ #
195
+ def create_or_update_async(resource_group_name, appliance_definition_name, parameters, custom_headers = nil)
196
+ # Send request
197
+ promise = begin_create_or_update_async(resource_group_name, appliance_definition_name, parameters, custom_headers)
198
+
199
+ promise = promise.then do |response|
200
+ # Defining deserialization method.
201
+ deserialize_method = lambda do |parsed_response|
202
+ result_mapper = Azure::ARM::ManagedApplications::Models::ApplianceDefinition.mapper()
203
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
204
+ end
205
+
206
+ # Waiting for response.
207
+ @client.get_long_running_operation_result(response, deserialize_method)
208
+ end
209
+
210
+ promise
211
+ end
212
+
213
+ #
214
+ # Lists the appliance definitions in a resource group.
215
+ #
216
+ # @param resource_group_name [String] The name of the resource group. The name
217
+ # is case insensitive.
218
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
219
+ # will be added to the HTTP request.
220
+ #
221
+ # @return [Array<ApplianceDefinition>] operation results.
222
+ #
223
+ def list_by_resource_group(resource_group_name, custom_headers = nil)
224
+ first_page = list_by_resource_group_as_lazy(resource_group_name, custom_headers)
225
+ first_page.get_all_items
226
+ end
227
+
228
+ #
229
+ # Lists the appliance definitions in a resource group.
230
+ #
231
+ # @param resource_group_name [String] The name of the resource group. The name
232
+ # is case insensitive.
233
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
234
+ # will be added to the HTTP request.
235
+ #
236
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
237
+ #
238
+ def list_by_resource_group_with_http_info(resource_group_name, custom_headers = nil)
239
+ list_by_resource_group_async(resource_group_name, custom_headers).value!
240
+ end
241
+
242
+ #
243
+ # Lists the appliance definitions in a resource group.
244
+ #
245
+ # @param resource_group_name [String] The name of the resource group. The name
246
+ # is case insensitive.
247
+ # @param [Hash{String => String}] A hash of custom headers that will be added
248
+ # to the HTTP request.
249
+ #
250
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
251
+ #
252
+ def list_by_resource_group_async(resource_group_name, custom_headers = nil)
253
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
254
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
255
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
256
+
257
+
258
+ request_headers = {}
259
+
260
+ # Set Headers
261
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
262
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
263
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applianceDefinitions'
264
+
265
+ request_url = @base_url || @client.base_url
266
+
267
+ options = {
268
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
269
+ path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
270
+ query_params: {'api-version' => @client.api_version},
271
+ headers: request_headers.merge(custom_headers || {}),
272
+ base_url: request_url
273
+ }
274
+ promise = @client.make_request_async(:get, path_template, options)
275
+
276
+ promise = promise.then do |result|
277
+ http_response = result.response
278
+ status_code = http_response.status
279
+ response_content = http_response.body
280
+ unless status_code == 200
281
+ error_model = JSON.load(response_content)
282
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
283
+ end
284
+
285
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
286
+ # Deserialize Response
287
+ if status_code == 200
288
+ begin
289
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
290
+ result_mapper = Azure::ARM::ManagedApplications::Models::ApplianceDefinitionListResult.mapper()
291
+ result.body = @client.deserialize(result_mapper, parsed_response)
292
+ rescue Exception => e
293
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
294
+ end
295
+ end
296
+
297
+ result
298
+ end
299
+
300
+ promise.execute
301
+ end
302
+
303
+ #
304
+ # Gets the appliance definition.
305
+ #
306
+ # @param appliance_definition_id [String] The fully qualified ID of the
307
+ # appliance definition, including the appliance name and the appliance
308
+ # definition resource type. Use the format,
309
+ # /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applianceDefinitions/{applianceDefinition-name}
310
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
311
+ # will be added to the HTTP request.
312
+ #
313
+ # @return [ApplianceDefinition] operation results.
314
+ #
315
+ def get_by_id(appliance_definition_id, custom_headers = nil)
316
+ response = get_by_id_async(appliance_definition_id, custom_headers).value!
317
+ response.body unless response.nil?
318
+ end
319
+
320
+ #
321
+ # Gets the appliance definition.
322
+ #
323
+ # @param appliance_definition_id [String] The fully qualified ID of the
324
+ # appliance definition, including the appliance name and the appliance
325
+ # definition resource type. Use the format,
326
+ # /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applianceDefinitions/{applianceDefinition-name}
327
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
328
+ # will be added to the HTTP request.
329
+ #
330
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
331
+ #
332
+ def get_by_id_with_http_info(appliance_definition_id, custom_headers = nil)
333
+ get_by_id_async(appliance_definition_id, custom_headers).value!
334
+ end
335
+
336
+ #
337
+ # Gets the appliance definition.
338
+ #
339
+ # @param appliance_definition_id [String] The fully qualified ID of the
340
+ # appliance definition, including the appliance name and the appliance
341
+ # definition resource type. Use the format,
342
+ # /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applianceDefinitions/{applianceDefinition-name}
343
+ # @param [Hash{String => String}] A hash of custom headers that will be added
344
+ # to the HTTP request.
345
+ #
346
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
347
+ #
348
+ def get_by_id_async(appliance_definition_id, custom_headers = nil)
349
+ fail ArgumentError, 'appliance_definition_id is nil' if appliance_definition_id.nil?
350
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
351
+
352
+
353
+ request_headers = {}
354
+
355
+ # Set Headers
356
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
357
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
358
+ path_template = '{applianceDefinitionId}'
359
+
360
+ request_url = @base_url || @client.base_url
361
+
362
+ options = {
363
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
364
+ skip_encoding_path_params: {'applianceDefinitionId' => appliance_definition_id},
365
+ query_params: {'api-version' => @client.api_version},
366
+ headers: request_headers.merge(custom_headers || {}),
367
+ base_url: request_url
368
+ }
369
+ promise = @client.make_request_async(:get, path_template, options)
370
+
371
+ promise = promise.then do |result|
372
+ http_response = result.response
373
+ status_code = http_response.status
374
+ response_content = http_response.body
375
+ unless status_code == 200 || status_code == 404
376
+ error_model = JSON.load(response_content)
377
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
378
+ end
379
+
380
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
381
+ # Deserialize Response
382
+ if status_code == 200
383
+ begin
384
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
385
+ result_mapper = Azure::ARM::ManagedApplications::Models::ApplianceDefinition.mapper()
386
+ result.body = @client.deserialize(result_mapper, parsed_response)
387
+ rescue Exception => e
388
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
389
+ end
390
+ end
391
+
392
+ result
393
+ end
394
+
395
+ promise.execute
396
+ end
397
+
398
+ #
399
+ # Deletes the appliance definition.
400
+ #
401
+ # @param appliance_definition_id [String] The fully qualified ID of the
402
+ # appliance definition, including the appliance name and the appliance
403
+ # definition resource type. Use the format,
404
+ # /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applianceDefinitions/{applianceDefinition-name}
405
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
406
+ # will be added to the HTTP request.
407
+ #
408
+ def delete_by_id(appliance_definition_id, custom_headers = nil)
409
+ response = delete_by_id_async(appliance_definition_id, custom_headers).value!
410
+ nil
411
+ end
412
+
413
+ #
414
+ # @param appliance_definition_id [String] The fully qualified ID of the
415
+ # appliance definition, including the appliance name and the appliance
416
+ # definition resource type. Use the format,
417
+ # /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applianceDefinitions/{applianceDefinition-name}
418
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
419
+ # will be added to the HTTP request.
420
+ #
421
+ # @return [Concurrent::Promise] promise which provides async access to http
422
+ # response.
423
+ #
424
+ def delete_by_id_async(appliance_definition_id, custom_headers = nil)
425
+ # Send request
426
+ promise = begin_delete_by_id_async(appliance_definition_id, custom_headers)
427
+
428
+ promise = promise.then do |response|
429
+ # Defining deserialization method.
430
+ deserialize_method = lambda do |parsed_response|
431
+ end
432
+
433
+ # Waiting for response.
434
+ @client.get_long_running_operation_result(response, deserialize_method)
435
+ end
436
+
437
+ promise
438
+ end
439
+
440
+ #
441
+ # Creates a new appliance definition.
442
+ #
443
+ # @param appliance_definition_id [String] The fully qualified ID of the
444
+ # appliance definition, including the appliance name and the appliance
445
+ # definition resource type. Use the format,
446
+ # /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applianceDefinitions/{applianceDefinition-name}
447
+ # @param parameters [ApplianceDefinition] Parameters supplied to the create or
448
+ # update an appliance definition.
449
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
450
+ # will be added to the HTTP request.
451
+ #
452
+ # @return [ApplianceDefinition] operation results.
453
+ #
454
+ def create_or_update_by_id(appliance_definition_id, parameters, custom_headers = nil)
455
+ response = create_or_update_by_id_async(appliance_definition_id, parameters, custom_headers).value!
456
+ response.body unless response.nil?
457
+ end
458
+
459
+ #
460
+ # @param appliance_definition_id [String] The fully qualified ID of the
461
+ # appliance definition, including the appliance name and the appliance
462
+ # definition resource type. Use the format,
463
+ # /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applianceDefinitions/{applianceDefinition-name}
464
+ # @param parameters [ApplianceDefinition] Parameters supplied to the create or
465
+ # update an appliance definition.
466
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
467
+ # will be added to the HTTP request.
468
+ #
469
+ # @return [Concurrent::Promise] promise which provides async access to http
470
+ # response.
471
+ #
472
+ def create_or_update_by_id_async(appliance_definition_id, parameters, custom_headers = nil)
473
+ # Send request
474
+ promise = begin_create_or_update_by_id_async(appliance_definition_id, parameters, custom_headers)
475
+
476
+ promise = promise.then do |response|
477
+ # Defining deserialization method.
478
+ deserialize_method = lambda do |parsed_response|
479
+ result_mapper = Azure::ARM::ManagedApplications::Models::ApplianceDefinition.mapper()
480
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
481
+ end
482
+
483
+ # Waiting for response.
484
+ @client.get_long_running_operation_result(response, deserialize_method)
485
+ end
486
+
487
+ promise
488
+ end
489
+
490
+ #
491
+ # Deletes the appliance definition.
492
+ #
493
+ # @param resource_group_name [String] The name of the resource group. The name
494
+ # is case insensitive.
495
+ # @param appliance_definition_name [String] The name of the appliance
496
+ # definition to delete.
497
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
498
+ # will be added to the HTTP request.
499
+ #
500
+ #
501
+ def begin_delete(resource_group_name, appliance_definition_name, custom_headers = nil)
502
+ response = begin_delete_async(resource_group_name, appliance_definition_name, custom_headers).value!
503
+ nil
504
+ end
505
+
506
+ #
507
+ # Deletes the appliance definition.
508
+ #
509
+ # @param resource_group_name [String] The name of the resource group. The name
510
+ # is case insensitive.
511
+ # @param appliance_definition_name [String] The name of the appliance
512
+ # definition to delete.
513
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
514
+ # will be added to the HTTP request.
515
+ #
516
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
517
+ #
518
+ def begin_delete_with_http_info(resource_group_name, appliance_definition_name, custom_headers = nil)
519
+ begin_delete_async(resource_group_name, appliance_definition_name, custom_headers).value!
520
+ end
521
+
522
+ #
523
+ # Deletes the appliance definition.
524
+ #
525
+ # @param resource_group_name [String] The name of the resource group. The name
526
+ # is case insensitive.
527
+ # @param appliance_definition_name [String] The name of the appliance
528
+ # definition to delete.
529
+ # @param [Hash{String => String}] A hash of custom headers that will be added
530
+ # to the HTTP request.
531
+ #
532
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
533
+ #
534
+ def begin_delete_async(resource_group_name, appliance_definition_name, custom_headers = nil)
535
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
536
+ fail ArgumentError, 'appliance_definition_name is nil' if appliance_definition_name.nil?
537
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
538
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
539
+
540
+
541
+ request_headers = {}
542
+
543
+ # Set Headers
544
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
545
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
546
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applianceDefinitions/{applianceDefinitionName}'
547
+
548
+ request_url = @base_url || @client.base_url
549
+
550
+ options = {
551
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
552
+ path_params: {'resourceGroupName' => resource_group_name,'applianceDefinitionName' => appliance_definition_name,'subscriptionId' => @client.subscription_id},
553
+ query_params: {'api-version' => @client.api_version},
554
+ headers: request_headers.merge(custom_headers || {}),
555
+ base_url: request_url
556
+ }
557
+ promise = @client.make_request_async(:delete, path_template, options)
558
+
559
+ promise = promise.then do |result|
560
+ http_response = result.response
561
+ status_code = http_response.status
562
+ response_content = http_response.body
563
+ unless status_code == 204 || status_code == 200 || status_code == 202
564
+ error_model = JSON.load(response_content)
565
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
566
+ end
567
+
568
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
569
+
570
+ result
571
+ end
572
+
573
+ promise.execute
574
+ end
575
+
576
+ #
577
+ # Creates a new appliance definition.
578
+ #
579
+ # @param resource_group_name [String] The name of the resource group. The name
580
+ # is case insensitive.
581
+ # @param appliance_definition_name [String] The name of the appliance
582
+ # definition.
583
+ # @param parameters [ApplianceDefinition] Parameters supplied to the create or
584
+ # update an appliance definition.
585
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
586
+ # will be added to the HTTP request.
587
+ #
588
+ # @return [ApplianceDefinition] operation results.
589
+ #
590
+ def begin_create_or_update(resource_group_name, appliance_definition_name, parameters, custom_headers = nil)
591
+ response = begin_create_or_update_async(resource_group_name, appliance_definition_name, parameters, custom_headers).value!
592
+ response.body unless response.nil?
593
+ end
594
+
595
+ #
596
+ # Creates a new appliance definition.
597
+ #
598
+ # @param resource_group_name [String] The name of the resource group. The name
599
+ # is case insensitive.
600
+ # @param appliance_definition_name [String] The name of the appliance
601
+ # definition.
602
+ # @param parameters [ApplianceDefinition] Parameters supplied to the create or
603
+ # update an appliance definition.
604
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
605
+ # will be added to the HTTP request.
606
+ #
607
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
608
+ #
609
+ def begin_create_or_update_with_http_info(resource_group_name, appliance_definition_name, parameters, custom_headers = nil)
610
+ begin_create_or_update_async(resource_group_name, appliance_definition_name, parameters, custom_headers).value!
611
+ end
612
+
613
+ #
614
+ # Creates a new appliance definition.
615
+ #
616
+ # @param resource_group_name [String] The name of the resource group. The name
617
+ # is case insensitive.
618
+ # @param appliance_definition_name [String] The name of the appliance
619
+ # definition.
620
+ # @param parameters [ApplianceDefinition] Parameters supplied to the create or
621
+ # update an appliance definition.
622
+ # @param [Hash{String => String}] A hash of custom headers that will be added
623
+ # to the HTTP request.
624
+ #
625
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
626
+ #
627
+ def begin_create_or_update_async(resource_group_name, appliance_definition_name, parameters, custom_headers = nil)
628
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
629
+ fail ArgumentError, 'appliance_definition_name is nil' if appliance_definition_name.nil?
630
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
631
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
632
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
633
+
634
+
635
+ request_headers = {}
636
+
637
+ # Set Headers
638
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
639
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
640
+
641
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
642
+
643
+ # Serialize Request
644
+ request_mapper = Azure::ARM::ManagedApplications::Models::ApplianceDefinition.mapper()
645
+ request_content = @client.serialize(request_mapper, parameters)
646
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
647
+
648
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Solutions/applianceDefinitions/{applianceDefinitionName}'
649
+
650
+ request_url = @base_url || @client.base_url
651
+
652
+ options = {
653
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
654
+ path_params: {'resourceGroupName' => resource_group_name,'applianceDefinitionName' => appliance_definition_name,'subscriptionId' => @client.subscription_id},
655
+ query_params: {'api-version' => @client.api_version},
656
+ body: request_content,
657
+ headers: request_headers.merge(custom_headers || {}),
658
+ base_url: request_url
659
+ }
660
+ promise = @client.make_request_async(:put, path_template, options)
661
+
662
+ promise = promise.then do |result|
663
+ http_response = result.response
664
+ status_code = http_response.status
665
+ response_content = http_response.body
666
+ unless status_code == 200 || status_code == 201
667
+ error_model = JSON.load(response_content)
668
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
669
+ end
670
+
671
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
672
+ # Deserialize Response
673
+ if status_code == 200
674
+ begin
675
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
676
+ result_mapper = Azure::ARM::ManagedApplications::Models::ApplianceDefinition.mapper()
677
+ result.body = @client.deserialize(result_mapper, parsed_response)
678
+ rescue Exception => e
679
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
680
+ end
681
+ end
682
+ # Deserialize Response
683
+ if status_code == 201
684
+ begin
685
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
686
+ result_mapper = Azure::ARM::ManagedApplications::Models::ApplianceDefinition.mapper()
687
+ result.body = @client.deserialize(result_mapper, parsed_response)
688
+ rescue Exception => e
689
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
690
+ end
691
+ end
692
+
693
+ result
694
+ end
695
+
696
+ promise.execute
697
+ end
698
+
699
+ #
700
+ # Deletes the appliance definition.
701
+ #
702
+ # @param appliance_definition_id [String] The fully qualified ID of the
703
+ # appliance definition, including the appliance name and the appliance
704
+ # definition resource type. Use the format,
705
+ # /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applianceDefinitions/{applianceDefinition-name}
706
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
707
+ # will be added to the HTTP request.
708
+ #
709
+ #
710
+ def begin_delete_by_id(appliance_definition_id, custom_headers = nil)
711
+ response = begin_delete_by_id_async(appliance_definition_id, custom_headers).value!
712
+ nil
713
+ end
714
+
715
+ #
716
+ # Deletes the appliance definition.
717
+ #
718
+ # @param appliance_definition_id [String] The fully qualified ID of the
719
+ # appliance definition, including the appliance name and the appliance
720
+ # definition resource type. Use the format,
721
+ # /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applianceDefinitions/{applianceDefinition-name}
722
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
723
+ # will be added to the HTTP request.
724
+ #
725
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
726
+ #
727
+ def begin_delete_by_id_with_http_info(appliance_definition_id, custom_headers = nil)
728
+ begin_delete_by_id_async(appliance_definition_id, custom_headers).value!
729
+ end
730
+
731
+ #
732
+ # Deletes the appliance definition.
733
+ #
734
+ # @param appliance_definition_id [String] The fully qualified ID of the
735
+ # appliance definition, including the appliance name and the appliance
736
+ # definition resource type. Use the format,
737
+ # /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applianceDefinitions/{applianceDefinition-name}
738
+ # @param [Hash{String => String}] A hash of custom headers that will be added
739
+ # to the HTTP request.
740
+ #
741
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
742
+ #
743
+ def begin_delete_by_id_async(appliance_definition_id, custom_headers = nil)
744
+ fail ArgumentError, 'appliance_definition_id is nil' if appliance_definition_id.nil?
745
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
746
+
747
+
748
+ request_headers = {}
749
+
750
+ # Set Headers
751
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
752
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
753
+ path_template = '{applianceDefinitionId}'
754
+
755
+ request_url = @base_url || @client.base_url
756
+
757
+ options = {
758
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
759
+ skip_encoding_path_params: {'applianceDefinitionId' => appliance_definition_id},
760
+ query_params: {'api-version' => @client.api_version},
761
+ headers: request_headers.merge(custom_headers || {}),
762
+ base_url: request_url
763
+ }
764
+ promise = @client.make_request_async(:delete, path_template, options)
765
+
766
+ promise = promise.then do |result|
767
+ http_response = result.response
768
+ status_code = http_response.status
769
+ response_content = http_response.body
770
+ unless status_code == 204 || status_code == 200 || status_code == 202
771
+ error_model = JSON.load(response_content)
772
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
773
+ end
774
+
775
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
776
+
777
+ result
778
+ end
779
+
780
+ promise.execute
781
+ end
782
+
783
+ #
784
+ # Creates a new appliance definition.
785
+ #
786
+ # @param appliance_definition_id [String] The fully qualified ID of the
787
+ # appliance definition, including the appliance name and the appliance
788
+ # definition resource type. Use the format,
789
+ # /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applianceDefinitions/{applianceDefinition-name}
790
+ # @param parameters [ApplianceDefinition] Parameters supplied to the create or
791
+ # update an appliance definition.
792
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
793
+ # will be added to the HTTP request.
794
+ #
795
+ # @return [ApplianceDefinition] operation results.
796
+ #
797
+ def begin_create_or_update_by_id(appliance_definition_id, parameters, custom_headers = nil)
798
+ response = begin_create_or_update_by_id_async(appliance_definition_id, parameters, custom_headers).value!
799
+ response.body unless response.nil?
800
+ end
801
+
802
+ #
803
+ # Creates a new appliance definition.
804
+ #
805
+ # @param appliance_definition_id [String] The fully qualified ID of the
806
+ # appliance definition, including the appliance name and the appliance
807
+ # definition resource type. Use the format,
808
+ # /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applianceDefinitions/{applianceDefinition-name}
809
+ # @param parameters [ApplianceDefinition] Parameters supplied to the create or
810
+ # update an appliance definition.
811
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
812
+ # will be added to the HTTP request.
813
+ #
814
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
815
+ #
816
+ def begin_create_or_update_by_id_with_http_info(appliance_definition_id, parameters, custom_headers = nil)
817
+ begin_create_or_update_by_id_async(appliance_definition_id, parameters, custom_headers).value!
818
+ end
819
+
820
+ #
821
+ # Creates a new appliance definition.
822
+ #
823
+ # @param appliance_definition_id [String] The fully qualified ID of the
824
+ # appliance definition, including the appliance name and the appliance
825
+ # definition resource type. Use the format,
826
+ # /subscriptions/{guid}/resourceGroups/{resource-group-name}/Microsoft.Solutions/applianceDefinitions/{applianceDefinition-name}
827
+ # @param parameters [ApplianceDefinition] Parameters supplied to the create or
828
+ # update an appliance definition.
829
+ # @param [Hash{String => String}] A hash of custom headers that will be added
830
+ # to the HTTP request.
831
+ #
832
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
833
+ #
834
+ def begin_create_or_update_by_id_async(appliance_definition_id, parameters, custom_headers = nil)
835
+ fail ArgumentError, 'appliance_definition_id is nil' if appliance_definition_id.nil?
836
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
837
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
838
+
839
+
840
+ request_headers = {}
841
+
842
+ # Set Headers
843
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
844
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
845
+
846
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
847
+
848
+ # Serialize Request
849
+ request_mapper = Azure::ARM::ManagedApplications::Models::ApplianceDefinition.mapper()
850
+ request_content = @client.serialize(request_mapper, parameters)
851
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
852
+
853
+ path_template = '{applianceDefinitionId}'
854
+
855
+ request_url = @base_url || @client.base_url
856
+
857
+ options = {
858
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
859
+ skip_encoding_path_params: {'applianceDefinitionId' => appliance_definition_id},
860
+ query_params: {'api-version' => @client.api_version},
861
+ body: request_content,
862
+ headers: request_headers.merge(custom_headers || {}),
863
+ base_url: request_url
864
+ }
865
+ promise = @client.make_request_async(:put, path_template, options)
866
+
867
+ promise = promise.then do |result|
868
+ http_response = result.response
869
+ status_code = http_response.status
870
+ response_content = http_response.body
871
+ unless status_code == 200 || status_code == 201
872
+ error_model = JSON.load(response_content)
873
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
874
+ end
875
+
876
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
877
+ # Deserialize Response
878
+ if status_code == 200
879
+ begin
880
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
881
+ result_mapper = Azure::ARM::ManagedApplications::Models::ApplianceDefinition.mapper()
882
+ result.body = @client.deserialize(result_mapper, parsed_response)
883
+ rescue Exception => e
884
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
885
+ end
886
+ end
887
+ # Deserialize Response
888
+ if status_code == 201
889
+ begin
890
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
891
+ result_mapper = Azure::ARM::ManagedApplications::Models::ApplianceDefinition.mapper()
892
+ result.body = @client.deserialize(result_mapper, parsed_response)
893
+ rescue Exception => e
894
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
895
+ end
896
+ end
897
+
898
+ result
899
+ end
900
+
901
+ promise.execute
902
+ end
903
+
904
+ #
905
+ # Lists the appliance definitions in a resource group.
906
+ #
907
+ # @param next_page_link [String] The NextLink from the previous successful call
908
+ # to List operation.
909
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
910
+ # will be added to the HTTP request.
911
+ #
912
+ # @return [ApplianceDefinitionListResult] operation results.
913
+ #
914
+ def list_by_resource_group_next(next_page_link, custom_headers = nil)
915
+ response = list_by_resource_group_next_async(next_page_link, custom_headers).value!
916
+ response.body unless response.nil?
917
+ end
918
+
919
+ #
920
+ # Lists the appliance definitions in a resource group.
921
+ #
922
+ # @param next_page_link [String] The NextLink from the previous successful call
923
+ # to List operation.
924
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
925
+ # will be added to the HTTP request.
926
+ #
927
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
928
+ #
929
+ def list_by_resource_group_next_with_http_info(next_page_link, custom_headers = nil)
930
+ list_by_resource_group_next_async(next_page_link, custom_headers).value!
931
+ end
932
+
933
+ #
934
+ # Lists the appliance definitions in a resource group.
935
+ #
936
+ # @param next_page_link [String] The NextLink from the previous successful call
937
+ # to List operation.
938
+ # @param [Hash{String => String}] A hash of custom headers that will be added
939
+ # to the HTTP request.
940
+ #
941
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
942
+ #
943
+ def list_by_resource_group_next_async(next_page_link, custom_headers = nil)
944
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
945
+
946
+
947
+ request_headers = {}
948
+
949
+ # Set Headers
950
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
951
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
952
+ path_template = '{nextLink}'
953
+
954
+ request_url = @base_url || @client.base_url
955
+
956
+ options = {
957
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
958
+ skip_encoding_path_params: {'nextLink' => next_page_link},
959
+ headers: request_headers.merge(custom_headers || {}),
960
+ base_url: request_url
961
+ }
962
+ promise = @client.make_request_async(:get, path_template, options)
963
+
964
+ promise = promise.then do |result|
965
+ http_response = result.response
966
+ status_code = http_response.status
967
+ response_content = http_response.body
968
+ unless status_code == 200
969
+ error_model = JSON.load(response_content)
970
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
971
+ end
972
+
973
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
974
+ # Deserialize Response
975
+ if status_code == 200
976
+ begin
977
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
978
+ result_mapper = Azure::ARM::ManagedApplications::Models::ApplianceDefinitionListResult.mapper()
979
+ result.body = @client.deserialize(result_mapper, parsed_response)
980
+ rescue Exception => e
981
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
982
+ end
983
+ end
984
+
985
+ result
986
+ end
987
+
988
+ promise.execute
989
+ end
990
+
991
+ #
992
+ # Lists the appliance definitions in a resource group.
993
+ #
994
+ # @param resource_group_name [String] The name of the resource group. The name
995
+ # is case insensitive.
996
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
997
+ # will be added to the HTTP request.
998
+ #
999
+ # @return [ApplianceDefinitionListResult] which provide lazy access to pages of
1000
+ # the response.
1001
+ #
1002
+ def list_by_resource_group_as_lazy(resource_group_name, custom_headers = nil)
1003
+ response = list_by_resource_group_async(resource_group_name, custom_headers).value!
1004
+ unless response.nil?
1005
+ page = response.body
1006
+ page.next_method = Proc.new do |next_page_link|
1007
+ list_by_resource_group_next_async(next_page_link, custom_headers)
1008
+ end
1009
+ page
1010
+ end
1011
+ end
1012
+
1013
+ end
1014
+ end