azure_mgmt_labservices 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/2018-10-15/generated/azure_mgmt_labservices.rb +109 -0
  4. data/lib/2018-10-15/generated/azure_mgmt_labservices/environment_settings.rb +1254 -0
  5. data/lib/2018-10-15/generated/azure_mgmt_labservices/environments.rb +1286 -0
  6. data/lib/2018-10-15/generated/azure_mgmt_labservices/gallery_images.rb +672 -0
  7. data/lib/2018-10-15/generated/azure_mgmt_labservices/global_users.rb +1131 -0
  8. data/lib/2018-10-15/generated/azure_mgmt_labservices/lab_accounts.rb +1093 -0
  9. data/lib/2018-10-15/generated/azure_mgmt_labservices/labs.rb +890 -0
  10. data/lib/2018-10-15/generated/azure_mgmt_labservices/managed_labs_client.rb +163 -0
  11. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/add_remove.rb +16 -0
  12. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/add_users_payload.rb +55 -0
  13. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/configuration_state.rb +16 -0
  14. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/create_lab_properties.rb +101 -0
  15. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/environment.rb +235 -0
  16. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/environment_details.rb +149 -0
  17. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/environment_fragment.rb +121 -0
  18. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/environment_operations_payload.rb +47 -0
  19. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/environment_setting.rb +210 -0
  20. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/environment_setting_creation_parameters.rb +48 -0
  21. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/environment_setting_fragment.rb +157 -0
  22. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/environment_size.rb +110 -0
  23. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/environment_size_fragment.rb +69 -0
  24. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/gallery_image.rb +231 -0
  25. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/gallery_image_fragment.rb +143 -0
  26. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/gallery_image_reference.rb +90 -0
  27. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/gallery_image_reference_fragment.rb +90 -0
  28. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/get_environment_response.rb +48 -0
  29. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/get_personal_preferences_response.rb +65 -0
  30. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/get_regional_availability_response.rb +56 -0
  31. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/lab.rb +219 -0
  32. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/lab_account.rb +147 -0
  33. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/lab_account_fragment.rb +119 -0
  34. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/lab_creation_parameters.rb +46 -0
  35. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/lab_details.rb +82 -0
  36. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/lab_fragment.rb +144 -0
  37. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/lab_user_access_mode.rb +16 -0
  38. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/latest_operation_result.rb +107 -0
  39. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/list_environments_payload.rb +46 -0
  40. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/list_environments_response.rb +55 -0
  41. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/list_labs_response.rb +55 -0
  42. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/managed_lab_vm_size.rb +17 -0
  43. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/network_interface.rb +83 -0
  44. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/operation_batch_status_payload.rb +54 -0
  45. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/operation_batch_status_response.rb +57 -0
  46. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/operation_batch_status_response_item.rb +61 -0
  47. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/operation_error.rb +57 -0
  48. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/operation_metadata.rb +59 -0
  49. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/operation_metadata_display.rb +80 -0
  50. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/operation_result.rb +59 -0
  51. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/operation_status_payload.rb +46 -0
  52. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/operation_status_response.rb +48 -0
  53. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/personal_preferences_operations_payload.rb +71 -0
  54. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/provider_operation_result.rb +101 -0
  55. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/publish_payload.rb +47 -0
  56. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/publishing_state.rb +19 -0
  57. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/reference_vm.rb +84 -0
  58. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/reference_vm_creation_parameters.rb +57 -0
  59. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/reference_vm_fragment.rb +58 -0
  60. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/regional_availability.rb +67 -0
  61. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/register_payload.rb +46 -0
  62. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/reset_password_payload.rb +68 -0
  63. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/resource.rb +110 -0
  64. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/resource_set.rb +57 -0
  65. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/resource_set_fragment.rb +57 -0
  66. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/resource_setting_creation_parameters.rb +94 -0
  67. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/resource_settings.rb +108 -0
  68. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/resource_settings_fragment.rb +71 -0
  69. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/response_with_continuation_environment.rb +98 -0
  70. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/response_with_continuation_environment_setting.rb +100 -0
  71. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/response_with_continuation_gallery_image.rb +98 -0
  72. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/response_with_continuation_lab.rb +98 -0
  73. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/response_with_continuation_lab_account.rb +98 -0
  74. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/response_with_continuation_user.rb +98 -0
  75. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/size_availability.rb +59 -0
  76. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/size_configuration_properties.rb +56 -0
  77. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/size_configuration_properties_fragment.rb +56 -0
  78. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/size_info.rb +82 -0
  79. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/size_info_fragment.rb +82 -0
  80. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/user.rb +186 -0
  81. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/user_fragment.rb +108 -0
  82. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/virtual_machine_details.rb +107 -0
  83. data/lib/2018-10-15/generated/azure_mgmt_labservices/models/vm_state_details.rb +86 -0
  84. data/lib/2018-10-15/generated/azure_mgmt_labservices/module_definition.rb +9 -0
  85. data/lib/2018-10-15/generated/azure_mgmt_labservices/operations.rb +117 -0
  86. data/lib/2018-10-15/generated/azure_mgmt_labservices/provider_operations.rb +215 -0
  87. data/lib/2018-10-15/generated/azure_mgmt_labservices/users.rb +729 -0
  88. data/lib/azure_mgmt_labservices.rb +6 -0
  89. data/lib/module_definition.rb +7 -0
  90. data/lib/profiles/latest/labservices_latest_profile_client.rb +40 -0
  91. data/lib/profiles/latest/labservices_module_definition.rb +8 -0
  92. data/lib/profiles/latest/modules/labservices_profile_module.rb +369 -0
  93. data/lib/version.rb +7 -0
  94. metadata +210 -0
@@ -0,0 +1,1093 @@
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::Labservices::Mgmt::V2018_10_15
7
+ #
8
+ # The Managed Labs Client.
9
+ #
10
+ class LabAccounts
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the LabAccounts class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [ManagedLabsClient] reference to the ManagedLabsClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # List lab accounts in a subscription.
26
+ #
27
+ # @param expand [String] Specify the $expand query. Example:
28
+ # 'properties($expand=sizeConfiguration)'
29
+ # @param filter [String] The filter to apply to the operation.
30
+ # @param top [Integer] The maximum number of resources to return from the
31
+ # operation.
32
+ # @param orderby [String] The ordering expression for the results, using OData
33
+ # notation.
34
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
35
+ # will be added to the HTTP request.
36
+ #
37
+ # @return [Array<LabAccount>] operation results.
38
+ #
39
+ def list_by_subscription(expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil)
40
+ first_page = list_by_subscription_as_lazy(expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers)
41
+ first_page.get_all_items
42
+ end
43
+
44
+ #
45
+ # List lab accounts in a subscription.
46
+ #
47
+ # @param expand [String] Specify the $expand query. Example:
48
+ # 'properties($expand=sizeConfiguration)'
49
+ # @param filter [String] The filter to apply to the operation.
50
+ # @param top [Integer] The maximum number of resources to return from the
51
+ # operation.
52
+ # @param orderby [String] The ordering expression for the results, using OData
53
+ # notation.
54
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
55
+ # will be added to the HTTP request.
56
+ #
57
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
58
+ #
59
+ def list_by_subscription_with_http_info(expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil)
60
+ list_by_subscription_async(expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers).value!
61
+ end
62
+
63
+ #
64
+ # List lab accounts in a subscription.
65
+ #
66
+ # @param expand [String] Specify the $expand query. Example:
67
+ # 'properties($expand=sizeConfiguration)'
68
+ # @param filter [String] The filter to apply to the operation.
69
+ # @param top [Integer] The maximum number of resources to return from the
70
+ # operation.
71
+ # @param orderby [String] The ordering expression for the results, using OData
72
+ # notation.
73
+ # @param [Hash{String => String}] A hash of custom headers that will be added
74
+ # to the HTTP request.
75
+ #
76
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
77
+ #
78
+ def list_by_subscription_async(expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil)
79
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
80
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
81
+
82
+
83
+ request_headers = {}
84
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
85
+
86
+ # Set Headers
87
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
88
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
89
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.LabServices/labaccounts'
90
+
91
+ request_url = @base_url || @client.base_url
92
+
93
+ options = {
94
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
95
+ path_params: {'subscriptionId' => @client.subscription_id},
96
+ query_params: {'$expand' => expand,'$filter' => filter,'$top' => top,'$orderby' => orderby,'api-version' => @client.api_version},
97
+ headers: request_headers.merge(custom_headers || {}),
98
+ base_url: request_url
99
+ }
100
+ promise = @client.make_request_async(:get, path_template, options)
101
+
102
+ promise = promise.then do |result|
103
+ http_response = result.response
104
+ status_code = http_response.status
105
+ response_content = http_response.body
106
+ unless status_code == 200
107
+ error_model = JSON.load(response_content)
108
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
109
+ end
110
+
111
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
112
+ # Deserialize Response
113
+ if status_code == 200
114
+ begin
115
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
116
+ result_mapper = Azure::Labservices::Mgmt::V2018_10_15::Models::ResponseWithContinuationLabAccount.mapper()
117
+ result.body = @client.deserialize(result_mapper, parsed_response)
118
+ rescue Exception => e
119
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
120
+ end
121
+ end
122
+
123
+ result
124
+ end
125
+
126
+ promise.execute
127
+ end
128
+
129
+ #
130
+ # List lab accounts in a resource group.
131
+ #
132
+ # @param resource_group_name [String] The name of the resource group.
133
+ # @param expand [String] Specify the $expand query. Example:
134
+ # 'properties($expand=sizeConfiguration)'
135
+ # @param filter [String] The filter to apply to the operation.
136
+ # @param top [Integer] The maximum number of resources to return from the
137
+ # operation.
138
+ # @param orderby [String] The ordering expression for the results, using OData
139
+ # notation.
140
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
141
+ # will be added to the HTTP request.
142
+ #
143
+ # @return [Array<LabAccount>] operation results.
144
+ #
145
+ def list_by_resource_group(resource_group_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil)
146
+ first_page = list_by_resource_group_as_lazy(resource_group_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers)
147
+ first_page.get_all_items
148
+ end
149
+
150
+ #
151
+ # List lab accounts in a resource group.
152
+ #
153
+ # @param resource_group_name [String] The name of the resource group.
154
+ # @param expand [String] Specify the $expand query. Example:
155
+ # 'properties($expand=sizeConfiguration)'
156
+ # @param filter [String] The filter to apply to the operation.
157
+ # @param top [Integer] The maximum number of resources to return from the
158
+ # operation.
159
+ # @param orderby [String] The ordering expression for the results, using OData
160
+ # notation.
161
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
162
+ # will be added to the HTTP request.
163
+ #
164
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
165
+ #
166
+ def list_by_resource_group_with_http_info(resource_group_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil)
167
+ list_by_resource_group_async(resource_group_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers).value!
168
+ end
169
+
170
+ #
171
+ # List lab accounts in a resource group.
172
+ #
173
+ # @param resource_group_name [String] The name of the resource group.
174
+ # @param expand [String] Specify the $expand query. Example:
175
+ # 'properties($expand=sizeConfiguration)'
176
+ # @param filter [String] The filter to apply to the operation.
177
+ # @param top [Integer] The maximum number of resources to return from the
178
+ # operation.
179
+ # @param orderby [String] The ordering expression for the results, using OData
180
+ # notation.
181
+ # @param [Hash{String => String}] A hash of custom headers that will be added
182
+ # to the HTTP request.
183
+ #
184
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
185
+ #
186
+ def list_by_resource_group_async(resource_group_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil)
187
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
188
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
189
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
190
+
191
+
192
+ request_headers = {}
193
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
194
+
195
+ # Set Headers
196
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
197
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
198
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts'
199
+
200
+ request_url = @base_url || @client.base_url
201
+
202
+ options = {
203
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
204
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
205
+ query_params: {'$expand' => expand,'$filter' => filter,'$top' => top,'$orderby' => orderby,'api-version' => @client.api_version},
206
+ headers: request_headers.merge(custom_headers || {}),
207
+ base_url: request_url
208
+ }
209
+ promise = @client.make_request_async(:get, path_template, options)
210
+
211
+ promise = promise.then do |result|
212
+ http_response = result.response
213
+ status_code = http_response.status
214
+ response_content = http_response.body
215
+ unless status_code == 200
216
+ error_model = JSON.load(response_content)
217
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
218
+ end
219
+
220
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
221
+ # Deserialize Response
222
+ if status_code == 200
223
+ begin
224
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
225
+ result_mapper = Azure::Labservices::Mgmt::V2018_10_15::Models::ResponseWithContinuationLabAccount.mapper()
226
+ result.body = @client.deserialize(result_mapper, parsed_response)
227
+ rescue Exception => e
228
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
229
+ end
230
+ end
231
+
232
+ result
233
+ end
234
+
235
+ promise.execute
236
+ end
237
+
238
+ #
239
+ # Get lab account
240
+ #
241
+ # @param resource_group_name [String] The name of the resource group.
242
+ # @param lab_account_name [String] The name of the lab Account.
243
+ # @param expand [String] Specify the $expand query. Example:
244
+ # 'properties($expand=sizeConfiguration)'
245
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
246
+ # will be added to the HTTP request.
247
+ #
248
+ # @return [LabAccount] operation results.
249
+ #
250
+ def get(resource_group_name, lab_account_name, expand:nil, custom_headers:nil)
251
+ response = get_async(resource_group_name, lab_account_name, expand:expand, custom_headers:custom_headers).value!
252
+ response.body unless response.nil?
253
+ end
254
+
255
+ #
256
+ # Get lab account
257
+ #
258
+ # @param resource_group_name [String] The name of the resource group.
259
+ # @param lab_account_name [String] The name of the lab Account.
260
+ # @param expand [String] Specify the $expand query. Example:
261
+ # 'properties($expand=sizeConfiguration)'
262
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
263
+ # will be added to the HTTP request.
264
+ #
265
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
266
+ #
267
+ def get_with_http_info(resource_group_name, lab_account_name, expand:nil, custom_headers:nil)
268
+ get_async(resource_group_name, lab_account_name, expand:expand, custom_headers:custom_headers).value!
269
+ end
270
+
271
+ #
272
+ # Get lab account
273
+ #
274
+ # @param resource_group_name [String] The name of the resource group.
275
+ # @param lab_account_name [String] The name of the lab Account.
276
+ # @param expand [String] Specify the $expand query. Example:
277
+ # 'properties($expand=sizeConfiguration)'
278
+ # @param [Hash{String => String}] A hash of custom headers that will be added
279
+ # to the HTTP request.
280
+ #
281
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
282
+ #
283
+ def get_async(resource_group_name, lab_account_name, expand:nil, custom_headers:nil)
284
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
285
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
286
+ fail ArgumentError, 'lab_account_name is nil' if lab_account_name.nil?
287
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
288
+
289
+
290
+ request_headers = {}
291
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
292
+
293
+ # Set Headers
294
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
295
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
296
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}'
297
+
298
+ request_url = @base_url || @client.base_url
299
+
300
+ options = {
301
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
302
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labAccountName' => lab_account_name},
303
+ query_params: {'$expand' => expand,'api-version' => @client.api_version},
304
+ headers: request_headers.merge(custom_headers || {}),
305
+ base_url: request_url
306
+ }
307
+ promise = @client.make_request_async(:get, path_template, options)
308
+
309
+ promise = promise.then do |result|
310
+ http_response = result.response
311
+ status_code = http_response.status
312
+ response_content = http_response.body
313
+ unless status_code == 200
314
+ error_model = JSON.load(response_content)
315
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
316
+ end
317
+
318
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
319
+ # Deserialize Response
320
+ if status_code == 200
321
+ begin
322
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
323
+ result_mapper = Azure::Labservices::Mgmt::V2018_10_15::Models::LabAccount.mapper()
324
+ result.body = @client.deserialize(result_mapper, parsed_response)
325
+ rescue Exception => e
326
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
327
+ end
328
+ end
329
+
330
+ result
331
+ end
332
+
333
+ promise.execute
334
+ end
335
+
336
+ #
337
+ # Create or replace an existing Lab Account.
338
+ #
339
+ # @param resource_group_name [String] The name of the resource group.
340
+ # @param lab_account_name [String] The name of the lab Account.
341
+ # @param lab_account [LabAccount] Represents a lab account.
342
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
343
+ # will be added to the HTTP request.
344
+ #
345
+ # @return [LabAccount] operation results.
346
+ #
347
+ def create_or_update(resource_group_name, lab_account_name, lab_account, custom_headers:nil)
348
+ response = create_or_update_async(resource_group_name, lab_account_name, lab_account, custom_headers:custom_headers).value!
349
+ response.body unless response.nil?
350
+ end
351
+
352
+ #
353
+ # Create or replace an existing Lab Account.
354
+ #
355
+ # @param resource_group_name [String] The name of the resource group.
356
+ # @param lab_account_name [String] The name of the lab Account.
357
+ # @param lab_account [LabAccount] Represents a lab account.
358
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
359
+ # will be added to the HTTP request.
360
+ #
361
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
362
+ #
363
+ def create_or_update_with_http_info(resource_group_name, lab_account_name, lab_account, custom_headers:nil)
364
+ create_or_update_async(resource_group_name, lab_account_name, lab_account, custom_headers:custom_headers).value!
365
+ end
366
+
367
+ #
368
+ # Create or replace an existing Lab Account.
369
+ #
370
+ # @param resource_group_name [String] The name of the resource group.
371
+ # @param lab_account_name [String] The name of the lab Account.
372
+ # @param lab_account [LabAccount] Represents a lab account.
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 create_or_update_async(resource_group_name, lab_account_name, lab_account, custom_headers:nil)
379
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
380
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
381
+ fail ArgumentError, 'lab_account_name is nil' if lab_account_name.nil?
382
+ fail ArgumentError, 'lab_account is nil' if lab_account.nil?
383
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.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::Labservices::Mgmt::V2018_10_15::Models::LabAccount.mapper()
395
+ request_content = @client.serialize(request_mapper, lab_account)
396
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
397
+
398
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}'
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: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labAccountName' => lab_account_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(:put, 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 || status_code == 201
417
+ error_model = JSON.load(response_content)
418
+ fail MsRestAzure::AzureOperationError.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
+ # Deserialize Response
423
+ if status_code == 200
424
+ begin
425
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
426
+ result_mapper = Azure::Labservices::Mgmt::V2018_10_15::Models::LabAccount.mapper()
427
+ result.body = @client.deserialize(result_mapper, parsed_response)
428
+ rescue Exception => e
429
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
430
+ end
431
+ end
432
+ # Deserialize Response
433
+ if status_code == 201
434
+ begin
435
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
436
+ result_mapper = Azure::Labservices::Mgmt::V2018_10_15::Models::LabAccount.mapper()
437
+ result.body = @client.deserialize(result_mapper, parsed_response)
438
+ rescue Exception => e
439
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
440
+ end
441
+ end
442
+
443
+ result
444
+ end
445
+
446
+ promise.execute
447
+ end
448
+
449
+ #
450
+ # Delete lab account. This operation can take a while to complete
451
+ #
452
+ # @param resource_group_name [String] The name of the resource group.
453
+ # @param lab_account_name [String] The name of the lab Account.
454
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
455
+ # will be added to the HTTP request.
456
+ #
457
+ def delete(resource_group_name, lab_account_name, custom_headers:nil)
458
+ response = delete_async(resource_group_name, lab_account_name, custom_headers:custom_headers).value!
459
+ nil
460
+ end
461
+
462
+ #
463
+ # @param resource_group_name [String] The name of the resource group.
464
+ # @param lab_account_name [String] The name of the lab Account.
465
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
466
+ # will be added to the HTTP request.
467
+ #
468
+ # @return [Concurrent::Promise] promise which provides async access to http
469
+ # response.
470
+ #
471
+ def delete_async(resource_group_name, lab_account_name, custom_headers:nil)
472
+ # Send request
473
+ promise = begin_delete_async(resource_group_name, lab_account_name, custom_headers:custom_headers)
474
+
475
+ promise = promise.then do |response|
476
+ # Defining deserialization method.
477
+ deserialize_method = lambda do |parsed_response|
478
+ end
479
+
480
+ # Waiting for response.
481
+ @client.get_long_running_operation_result(response, deserialize_method)
482
+ end
483
+
484
+ promise
485
+ end
486
+
487
+ #
488
+ # Modify properties of lab accounts.
489
+ #
490
+ # @param resource_group_name [String] The name of the resource group.
491
+ # @param lab_account_name [String] The name of the lab Account.
492
+ # @param lab_account [LabAccountFragment] Represents a lab account.
493
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
494
+ # will be added to the HTTP request.
495
+ #
496
+ # @return [LabAccount] operation results.
497
+ #
498
+ def update(resource_group_name, lab_account_name, lab_account, custom_headers:nil)
499
+ response = update_async(resource_group_name, lab_account_name, lab_account, custom_headers:custom_headers).value!
500
+ response.body unless response.nil?
501
+ end
502
+
503
+ #
504
+ # Modify properties of lab accounts.
505
+ #
506
+ # @param resource_group_name [String] The name of the resource group.
507
+ # @param lab_account_name [String] The name of the lab Account.
508
+ # @param lab_account [LabAccountFragment] Represents a lab account.
509
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
510
+ # will be added to the HTTP request.
511
+ #
512
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
513
+ #
514
+ def update_with_http_info(resource_group_name, lab_account_name, lab_account, custom_headers:nil)
515
+ update_async(resource_group_name, lab_account_name, lab_account, custom_headers:custom_headers).value!
516
+ end
517
+
518
+ #
519
+ # Modify properties of lab accounts.
520
+ #
521
+ # @param resource_group_name [String] The name of the resource group.
522
+ # @param lab_account_name [String] The name of the lab Account.
523
+ # @param lab_account [LabAccountFragment] Represents a lab account.
524
+ # @param [Hash{String => String}] A hash of custom headers that will be added
525
+ # to the HTTP request.
526
+ #
527
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
528
+ #
529
+ def update_async(resource_group_name, lab_account_name, lab_account, custom_headers:nil)
530
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
531
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
532
+ fail ArgumentError, 'lab_account_name is nil' if lab_account_name.nil?
533
+ fail ArgumentError, 'lab_account is nil' if lab_account.nil?
534
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
535
+
536
+
537
+ request_headers = {}
538
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
539
+
540
+ # Set Headers
541
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
542
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
543
+
544
+ # Serialize Request
545
+ request_mapper = Azure::Labservices::Mgmt::V2018_10_15::Models::LabAccountFragment.mapper()
546
+ request_content = @client.serialize(request_mapper, lab_account)
547
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
548
+
549
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}'
550
+
551
+ request_url = @base_url || @client.base_url
552
+
553
+ options = {
554
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
555
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labAccountName' => lab_account_name},
556
+ query_params: {'api-version' => @client.api_version},
557
+ body: request_content,
558
+ headers: request_headers.merge(custom_headers || {}),
559
+ base_url: request_url
560
+ }
561
+ promise = @client.make_request_async(:patch, path_template, options)
562
+
563
+ promise = promise.then do |result|
564
+ http_response = result.response
565
+ status_code = http_response.status
566
+ response_content = http_response.body
567
+ unless status_code == 200
568
+ error_model = JSON.load(response_content)
569
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
570
+ end
571
+
572
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
573
+ # Deserialize Response
574
+ if status_code == 200
575
+ begin
576
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
577
+ result_mapper = Azure::Labservices::Mgmt::V2018_10_15::Models::LabAccount.mapper()
578
+ result.body = @client.deserialize(result_mapper, parsed_response)
579
+ rescue Exception => e
580
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
581
+ end
582
+ end
583
+
584
+ result
585
+ end
586
+
587
+ promise.execute
588
+ end
589
+
590
+ #
591
+ # Create a lab in a lab account.
592
+ #
593
+ # @param resource_group_name [String] The name of the resource group.
594
+ # @param lab_account_name [String] The name of the lab Account.
595
+ # @param create_lab_properties [CreateLabProperties] Properties for creating a
596
+ # managed lab and a default environment setting
597
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
598
+ # will be added to the HTTP request.
599
+ #
600
+ #
601
+ def create_lab(resource_group_name, lab_account_name, create_lab_properties, custom_headers:nil)
602
+ response = create_lab_async(resource_group_name, lab_account_name, create_lab_properties, custom_headers:custom_headers).value!
603
+ nil
604
+ end
605
+
606
+ #
607
+ # Create a lab in a lab account.
608
+ #
609
+ # @param resource_group_name [String] The name of the resource group.
610
+ # @param lab_account_name [String] The name of the lab Account.
611
+ # @param create_lab_properties [CreateLabProperties] Properties for creating a
612
+ # managed lab and a default environment setting
613
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
614
+ # will be added to the HTTP request.
615
+ #
616
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
617
+ #
618
+ def create_lab_with_http_info(resource_group_name, lab_account_name, create_lab_properties, custom_headers:nil)
619
+ create_lab_async(resource_group_name, lab_account_name, create_lab_properties, custom_headers:custom_headers).value!
620
+ end
621
+
622
+ #
623
+ # Create a lab in a lab account.
624
+ #
625
+ # @param resource_group_name [String] The name of the resource group.
626
+ # @param lab_account_name [String] The name of the lab Account.
627
+ # @param create_lab_properties [CreateLabProperties] Properties for creating a
628
+ # managed lab and a default environment setting
629
+ # @param [Hash{String => String}] A hash of custom headers that will be added
630
+ # to the HTTP request.
631
+ #
632
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
633
+ #
634
+ def create_lab_async(resource_group_name, lab_account_name, create_lab_properties, custom_headers:nil)
635
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
636
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
637
+ fail ArgumentError, 'lab_account_name is nil' if lab_account_name.nil?
638
+ fail ArgumentError, 'create_lab_properties is nil' if create_lab_properties.nil?
639
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
640
+
641
+
642
+ request_headers = {}
643
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
644
+
645
+ # Set Headers
646
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
647
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
648
+
649
+ # Serialize Request
650
+ request_mapper = Azure::Labservices::Mgmt::V2018_10_15::Models::CreateLabProperties.mapper()
651
+ request_content = @client.serialize(request_mapper, create_lab_properties)
652
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
653
+
654
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/createLab'
655
+
656
+ request_url = @base_url || @client.base_url
657
+
658
+ options = {
659
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
660
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labAccountName' => lab_account_name},
661
+ query_params: {'api-version' => @client.api_version},
662
+ body: request_content,
663
+ headers: request_headers.merge(custom_headers || {}),
664
+ base_url: request_url
665
+ }
666
+ promise = @client.make_request_async(:post, path_template, options)
667
+
668
+ promise = promise.then do |result|
669
+ http_response = result.response
670
+ status_code = http_response.status
671
+ response_content = http_response.body
672
+ unless status_code == 200
673
+ error_model = JSON.load(response_content)
674
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
675
+ end
676
+
677
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
678
+
679
+ result
680
+ end
681
+
682
+ promise.execute
683
+ end
684
+
685
+ #
686
+ # Get regional availability information for each size category configured under
687
+ # a lab account
688
+ #
689
+ # @param resource_group_name [String] The name of the resource group.
690
+ # @param lab_account_name [String] The name of the lab Account.
691
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
692
+ # will be added to the HTTP request.
693
+ #
694
+ # @return [GetRegionalAvailabilityResponse] operation results.
695
+ #
696
+ def get_regional_availability(resource_group_name, lab_account_name, custom_headers:nil)
697
+ response = get_regional_availability_async(resource_group_name, lab_account_name, custom_headers:custom_headers).value!
698
+ response.body unless response.nil?
699
+ end
700
+
701
+ #
702
+ # Get regional availability information for each size category configured under
703
+ # a lab account
704
+ #
705
+ # @param resource_group_name [String] The name of the resource group.
706
+ # @param lab_account_name [String] The name of the lab Account.
707
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
708
+ # will be added to the HTTP request.
709
+ #
710
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
711
+ #
712
+ def get_regional_availability_with_http_info(resource_group_name, lab_account_name, custom_headers:nil)
713
+ get_regional_availability_async(resource_group_name, lab_account_name, custom_headers:custom_headers).value!
714
+ end
715
+
716
+ #
717
+ # Get regional availability information for each size category configured under
718
+ # a lab account
719
+ #
720
+ # @param resource_group_name [String] The name of the resource group.
721
+ # @param lab_account_name [String] The name of the lab Account.
722
+ # @param [Hash{String => String}] A hash of custom headers that will be added
723
+ # to the HTTP request.
724
+ #
725
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
726
+ #
727
+ def get_regional_availability_async(resource_group_name, lab_account_name, custom_headers:nil)
728
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
729
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
730
+ fail ArgumentError, 'lab_account_name is nil' if lab_account_name.nil?
731
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
732
+
733
+
734
+ request_headers = {}
735
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
736
+
737
+ # Set Headers
738
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
739
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
740
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}/getRegionalAvailability'
741
+
742
+ request_url = @base_url || @client.base_url
743
+
744
+ options = {
745
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
746
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labAccountName' => lab_account_name},
747
+ query_params: {'api-version' => @client.api_version},
748
+ headers: request_headers.merge(custom_headers || {}),
749
+ base_url: request_url
750
+ }
751
+ promise = @client.make_request_async(:post, path_template, options)
752
+
753
+ promise = promise.then do |result|
754
+ http_response = result.response
755
+ status_code = http_response.status
756
+ response_content = http_response.body
757
+ unless status_code == 200
758
+ error_model = JSON.load(response_content)
759
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
760
+ end
761
+
762
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
763
+ # Deserialize Response
764
+ if status_code == 200
765
+ begin
766
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
767
+ result_mapper = Azure::Labservices::Mgmt::V2018_10_15::Models::GetRegionalAvailabilityResponse.mapper()
768
+ result.body = @client.deserialize(result_mapper, parsed_response)
769
+ rescue Exception => e
770
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
771
+ end
772
+ end
773
+
774
+ result
775
+ end
776
+
777
+ promise.execute
778
+ end
779
+
780
+ #
781
+ # Delete lab account. This operation can take a while to complete
782
+ #
783
+ # @param resource_group_name [String] The name of the resource group.
784
+ # @param lab_account_name [String] The name of the lab Account.
785
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
786
+ # will be added to the HTTP request.
787
+ #
788
+ #
789
+ def begin_delete(resource_group_name, lab_account_name, custom_headers:nil)
790
+ response = begin_delete_async(resource_group_name, lab_account_name, custom_headers:custom_headers).value!
791
+ nil
792
+ end
793
+
794
+ #
795
+ # Delete lab account. This operation can take a while to complete
796
+ #
797
+ # @param resource_group_name [String] The name of the resource group.
798
+ # @param lab_account_name [String] The name of the lab Account.
799
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
800
+ # will be added to the HTTP request.
801
+ #
802
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
803
+ #
804
+ def begin_delete_with_http_info(resource_group_name, lab_account_name, custom_headers:nil)
805
+ begin_delete_async(resource_group_name, lab_account_name, custom_headers:custom_headers).value!
806
+ end
807
+
808
+ #
809
+ # Delete lab account. This operation can take a while to complete
810
+ #
811
+ # @param resource_group_name [String] The name of the resource group.
812
+ # @param lab_account_name [String] The name of the lab Account.
813
+ # @param [Hash{String => String}] A hash of custom headers that will be added
814
+ # to the HTTP request.
815
+ #
816
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
817
+ #
818
+ def begin_delete_async(resource_group_name, lab_account_name, custom_headers:nil)
819
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
820
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
821
+ fail ArgumentError, 'lab_account_name is nil' if lab_account_name.nil?
822
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
823
+
824
+
825
+ request_headers = {}
826
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
827
+
828
+ # Set Headers
829
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
830
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
831
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labaccounts/{labAccountName}'
832
+
833
+ request_url = @base_url || @client.base_url
834
+
835
+ options = {
836
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
837
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labAccountName' => lab_account_name},
838
+ query_params: {'api-version' => @client.api_version},
839
+ headers: request_headers.merge(custom_headers || {}),
840
+ base_url: request_url
841
+ }
842
+ promise = @client.make_request_async(:delete, path_template, options)
843
+
844
+ promise = promise.then do |result|
845
+ http_response = result.response
846
+ status_code = http_response.status
847
+ response_content = http_response.body
848
+ unless status_code == 202 || status_code == 204
849
+ error_model = JSON.load(response_content)
850
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
851
+ end
852
+
853
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
854
+
855
+ result
856
+ end
857
+
858
+ promise.execute
859
+ end
860
+
861
+ #
862
+ # List lab accounts in a subscription.
863
+ #
864
+ # @param next_page_link [String] The NextLink from the previous successful call
865
+ # to List operation.
866
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
867
+ # will be added to the HTTP request.
868
+ #
869
+ # @return [ResponseWithContinuationLabAccount] operation results.
870
+ #
871
+ def list_by_subscription_next(next_page_link, custom_headers:nil)
872
+ response = list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
873
+ response.body unless response.nil?
874
+ end
875
+
876
+ #
877
+ # List lab accounts in a subscription.
878
+ #
879
+ # @param next_page_link [String] The NextLink from the previous successful call
880
+ # to List operation.
881
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
882
+ # will be added to the HTTP request.
883
+ #
884
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
885
+ #
886
+ def list_by_subscription_next_with_http_info(next_page_link, custom_headers:nil)
887
+ list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
888
+ end
889
+
890
+ #
891
+ # List lab accounts in a subscription.
892
+ #
893
+ # @param next_page_link [String] The NextLink from the previous successful call
894
+ # to List operation.
895
+ # @param [Hash{String => String}] A hash of custom headers that will be added
896
+ # to the HTTP request.
897
+ #
898
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
899
+ #
900
+ def list_by_subscription_next_async(next_page_link, custom_headers:nil)
901
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
902
+
903
+
904
+ request_headers = {}
905
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
906
+
907
+ # Set Headers
908
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
909
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
910
+ path_template = '{nextLink}'
911
+
912
+ request_url = @base_url || @client.base_url
913
+
914
+ options = {
915
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
916
+ skip_encoding_path_params: {'nextLink' => next_page_link},
917
+ headers: request_headers.merge(custom_headers || {}),
918
+ base_url: request_url
919
+ }
920
+ promise = @client.make_request_async(:get, path_template, options)
921
+
922
+ promise = promise.then do |result|
923
+ http_response = result.response
924
+ status_code = http_response.status
925
+ response_content = http_response.body
926
+ unless status_code == 200
927
+ error_model = JSON.load(response_content)
928
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
929
+ end
930
+
931
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
932
+ # Deserialize Response
933
+ if status_code == 200
934
+ begin
935
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
936
+ result_mapper = Azure::Labservices::Mgmt::V2018_10_15::Models::ResponseWithContinuationLabAccount.mapper()
937
+ result.body = @client.deserialize(result_mapper, parsed_response)
938
+ rescue Exception => e
939
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
940
+ end
941
+ end
942
+
943
+ result
944
+ end
945
+
946
+ promise.execute
947
+ end
948
+
949
+ #
950
+ # List lab accounts in a resource group.
951
+ #
952
+ # @param next_page_link [String] The NextLink from the previous successful call
953
+ # to List operation.
954
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
955
+ # will be added to the HTTP request.
956
+ #
957
+ # @return [ResponseWithContinuationLabAccount] operation results.
958
+ #
959
+ def list_by_resource_group_next(next_page_link, custom_headers:nil)
960
+ response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
961
+ response.body unless response.nil?
962
+ end
963
+
964
+ #
965
+ # List lab accounts in a resource group.
966
+ #
967
+ # @param next_page_link [String] The NextLink from the previous successful call
968
+ # to List operation.
969
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
970
+ # will be added to the HTTP request.
971
+ #
972
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
973
+ #
974
+ def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
975
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
976
+ end
977
+
978
+ #
979
+ # List lab accounts in a resource group.
980
+ #
981
+ # @param next_page_link [String] The NextLink from the previous successful call
982
+ # to List operation.
983
+ # @param [Hash{String => String}] A hash of custom headers that will be added
984
+ # to the HTTP request.
985
+ #
986
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
987
+ #
988
+ def list_by_resource_group_next_async(next_page_link, custom_headers:nil)
989
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
990
+
991
+
992
+ request_headers = {}
993
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
994
+
995
+ # Set Headers
996
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
997
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
998
+ path_template = '{nextLink}'
999
+
1000
+ request_url = @base_url || @client.base_url
1001
+
1002
+ options = {
1003
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1004
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1005
+ headers: request_headers.merge(custom_headers || {}),
1006
+ base_url: request_url
1007
+ }
1008
+ promise = @client.make_request_async(:get, path_template, options)
1009
+
1010
+ promise = promise.then do |result|
1011
+ http_response = result.response
1012
+ status_code = http_response.status
1013
+ response_content = http_response.body
1014
+ unless status_code == 200
1015
+ error_model = JSON.load(response_content)
1016
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1017
+ end
1018
+
1019
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1020
+ # Deserialize Response
1021
+ if status_code == 200
1022
+ begin
1023
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1024
+ result_mapper = Azure::Labservices::Mgmt::V2018_10_15::Models::ResponseWithContinuationLabAccount.mapper()
1025
+ result.body = @client.deserialize(result_mapper, parsed_response)
1026
+ rescue Exception => e
1027
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1028
+ end
1029
+ end
1030
+
1031
+ result
1032
+ end
1033
+
1034
+ promise.execute
1035
+ end
1036
+
1037
+ #
1038
+ # List lab accounts in a subscription.
1039
+ #
1040
+ # @param expand [String] Specify the $expand query. Example:
1041
+ # 'properties($expand=sizeConfiguration)'
1042
+ # @param filter [String] The filter to apply to the operation.
1043
+ # @param top [Integer] The maximum number of resources to return from the
1044
+ # operation.
1045
+ # @param orderby [String] The ordering expression for the results, using OData
1046
+ # notation.
1047
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1048
+ # will be added to the HTTP request.
1049
+ #
1050
+ # @return [ResponseWithContinuationLabAccount] which provide lazy access to
1051
+ # pages of the response.
1052
+ #
1053
+ def list_by_subscription_as_lazy(expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil)
1054
+ response = list_by_subscription_async(expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers).value!
1055
+ unless response.nil?
1056
+ page = response.body
1057
+ page.next_method = Proc.new do |next_page_link|
1058
+ list_by_subscription_next_async(next_page_link, custom_headers:custom_headers)
1059
+ end
1060
+ page
1061
+ end
1062
+ end
1063
+
1064
+ #
1065
+ # List lab accounts in a resource group.
1066
+ #
1067
+ # @param resource_group_name [String] The name of the resource group.
1068
+ # @param expand [String] Specify the $expand query. Example:
1069
+ # 'properties($expand=sizeConfiguration)'
1070
+ # @param filter [String] The filter to apply to the operation.
1071
+ # @param top [Integer] The maximum number of resources to return from the
1072
+ # operation.
1073
+ # @param orderby [String] The ordering expression for the results, using OData
1074
+ # notation.
1075
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1076
+ # will be added to the HTTP request.
1077
+ #
1078
+ # @return [ResponseWithContinuationLabAccount] which provide lazy access to
1079
+ # pages of the response.
1080
+ #
1081
+ def list_by_resource_group_as_lazy(resource_group_name, expand:nil, filter:nil, top:nil, orderby:nil, custom_headers:nil)
1082
+ response = list_by_resource_group_async(resource_group_name, expand:expand, filter:filter, top:top, orderby:orderby, custom_headers:custom_headers).value!
1083
+ unless response.nil?
1084
+ page = response.body
1085
+ page.next_method = Proc.new do |next_page_link|
1086
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
1087
+ end
1088
+ page
1089
+ end
1090
+ end
1091
+
1092
+ end
1093
+ end