azure_mgmt_dev_spaces 0.16.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (31) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/2018-06-01-preview/generated/azure_mgmt_dev_spaces.rb +46 -0
  4. data/lib/2018-06-01-preview/generated/azure_mgmt_dev_spaces/controllers.rb +1107 -0
  5. data/lib/2018-06-01-preview/generated/azure_mgmt_dev_spaces/dev_spaces_management_client.rb +134 -0
  6. data/lib/2018-06-01-preview/generated/azure_mgmt_dev_spaces/models/controller.rb +160 -0
  7. data/lib/2018-06-01-preview/generated/azure_mgmt_dev_spaces/models/controller_connection_details.rb +86 -0
  8. data/lib/2018-06-01-preview/generated/azure_mgmt_dev_spaces/models/controller_connection_details_list.rb +57 -0
  9. data/lib/2018-06-01-preview/generated/azure_mgmt_dev_spaces/models/controller_list.rb +100 -0
  10. data/lib/2018-06-01-preview/generated/azure_mgmt_dev_spaces/models/controller_update_parameters.rb +55 -0
  11. data/lib/2018-06-01-preview/generated/azure_mgmt_dev_spaces/models/error_details.rb +72 -0
  12. data/lib/2018-06-01-preview/generated/azure_mgmt_dev_spaces/models/error_response.rb +48 -0
  13. data/lib/2018-06-01-preview/generated/azure_mgmt_dev_spaces/models/kubernetes_connection_details.rb +62 -0
  14. data/lib/2018-06-01-preview/generated/azure_mgmt_dev_spaces/models/orchestrator_specific_connection_details.rb +47 -0
  15. data/lib/2018-06-01-preview/generated/azure_mgmt_dev_spaces/models/provisioning_state.rb +20 -0
  16. data/lib/2018-06-01-preview/generated/azure_mgmt_dev_spaces/models/resource.rb +71 -0
  17. data/lib/2018-06-01-preview/generated/azure_mgmt_dev_spaces/models/resource_provider_operation_definition.rb +59 -0
  18. data/lib/2018-06-01-preview/generated/azure_mgmt_dev_spaces/models/resource_provider_operation_display.rb +80 -0
  19. data/lib/2018-06-01-preview/generated/azure_mgmt_dev_spaces/models/resource_provider_operation_list.rb +101 -0
  20. data/lib/2018-06-01-preview/generated/azure_mgmt_dev_spaces/models/sku.rb +61 -0
  21. data/lib/2018-06-01-preview/generated/azure_mgmt_dev_spaces/models/sku_tier.rb +15 -0
  22. data/lib/2018-06-01-preview/generated/azure_mgmt_dev_spaces/models/tracked_resource.rb +92 -0
  23. data/lib/2018-06-01-preview/generated/azure_mgmt_dev_spaces/module_definition.rb +9 -0
  24. data/lib/2018-06-01-preview/generated/azure_mgmt_dev_spaces/operations.rb +236 -0
  25. data/lib/azure_mgmt_dev_spaces.rb +6 -0
  26. data/lib/module_definition.rb +7 -0
  27. data/lib/profiles/latest/devspaces_latest_profile_client.rb +40 -0
  28. data/lib/profiles/latest/devspaces_module_definition.rb +8 -0
  29. data/lib/profiles/latest/modules/devspaces_profile_module.rb +131 -0
  30. data/lib/version.rb +7 -0
  31. metadata +147 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 42af08e4e5b6153c5d0a1c106297ddbf77a339d3
4
+ data.tar.gz: da30c592afe870f9030ddfe54109bacfdfe0509e
5
+ SHA512:
6
+ metadata.gz: bf5197db32905577574ab5ac41e4ddc084eea70995b5a4beb54c592d50410c8d1d1a039dede8871fd822e75a20e5693d951772199d4b083bd1894807ac5f8a36
7
+ data.tar.gz: f728222a291bbeb2f8f5d2a645df6e43bbec97ec173eef99cb5d039d30d633d3bd23dfee02f655cb74f8e2f8aad2f11dee79a74363c7a0f0078d6c49199aa7bd
@@ -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,46 @@
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 '2018-06-01-preview/generated/azure_mgmt_dev_spaces/module_definition'
20
+ require 'ms_rest_azure'
21
+
22
+ module Azure::DevSpaces::Mgmt::V2018_06_01_preview
23
+ autoload :Controllers, '2018-06-01-preview/generated/azure_mgmt_dev_spaces/controllers.rb'
24
+ autoload :Operations, '2018-06-01-preview/generated/azure_mgmt_dev_spaces/operations.rb'
25
+ autoload :DevSpacesManagementClient, '2018-06-01-preview/generated/azure_mgmt_dev_spaces/dev_spaces_management_client.rb'
26
+
27
+ module Models
28
+ autoload :ControllerConnectionDetailsList, '2018-06-01-preview/generated/azure_mgmt_dev_spaces/models/controller_connection_details_list.rb'
29
+ autoload :Sku, '2018-06-01-preview/generated/azure_mgmt_dev_spaces/models/sku.rb'
30
+ autoload :ErrorResponse, '2018-06-01-preview/generated/azure_mgmt_dev_spaces/models/error_response.rb'
31
+ autoload :ControllerUpdateParameters, '2018-06-01-preview/generated/azure_mgmt_dev_spaces/models/controller_update_parameters.rb'
32
+ autoload :ResourceProviderOperationDisplay, '2018-06-01-preview/generated/azure_mgmt_dev_spaces/models/resource_provider_operation_display.rb'
33
+ autoload :OrchestratorSpecificConnectionDetails, '2018-06-01-preview/generated/azure_mgmt_dev_spaces/models/orchestrator_specific_connection_details.rb'
34
+ autoload :ResourceProviderOperationDefinition, '2018-06-01-preview/generated/azure_mgmt_dev_spaces/models/resource_provider_operation_definition.rb'
35
+ autoload :ResourceProviderOperationList, '2018-06-01-preview/generated/azure_mgmt_dev_spaces/models/resource_provider_operation_list.rb'
36
+ autoload :ControllerConnectionDetails, '2018-06-01-preview/generated/azure_mgmt_dev_spaces/models/controller_connection_details.rb'
37
+ autoload :Resource, '2018-06-01-preview/generated/azure_mgmt_dev_spaces/models/resource.rb'
38
+ autoload :ControllerList, '2018-06-01-preview/generated/azure_mgmt_dev_spaces/models/controller_list.rb'
39
+ autoload :ErrorDetails, '2018-06-01-preview/generated/azure_mgmt_dev_spaces/models/error_details.rb'
40
+ autoload :TrackedResource, '2018-06-01-preview/generated/azure_mgmt_dev_spaces/models/tracked_resource.rb'
41
+ autoload :Controller, '2018-06-01-preview/generated/azure_mgmt_dev_spaces/models/controller.rb'
42
+ autoload :KubernetesConnectionDetails, '2018-06-01-preview/generated/azure_mgmt_dev_spaces/models/kubernetes_connection_details.rb'
43
+ autoload :ProvisioningState, '2018-06-01-preview/generated/azure_mgmt_dev_spaces/models/provisioning_state.rb'
44
+ autoload :SkuTier, '2018-06-01-preview/generated/azure_mgmt_dev_spaces/models/sku_tier.rb'
45
+ end
46
+ end
@@ -0,0 +1,1107 @@
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::DevSpaces::Mgmt::V2018_06_01_preview
7
+ #
8
+ # Dev Spaces Client
9
+ #
10
+ class Controllers
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Controllers class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [DevSpacesManagementClient] reference to the DevSpacesManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Gets an Azure Dev Spaces Controller.
26
+ #
27
+ # Gets the properties for an Azure Dev Spaces Controller.
28
+ #
29
+ # @param resource_group_name [String] Resource group to which the resource
30
+ # belongs.
31
+ # @param name [String] Name of the resource.
32
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
33
+ # will be added to the HTTP request.
34
+ #
35
+ # @return [Controller] operation results.
36
+ #
37
+ def get(resource_group_name, name, custom_headers:nil)
38
+ response = get_async(resource_group_name, name, custom_headers:custom_headers).value!
39
+ response.body unless response.nil?
40
+ end
41
+
42
+ #
43
+ # Gets an Azure Dev Spaces Controller.
44
+ #
45
+ # Gets the properties for an Azure Dev Spaces Controller.
46
+ #
47
+ # @param resource_group_name [String] Resource group to which the resource
48
+ # belongs.
49
+ # @param name [String] Name of the resource.
50
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
51
+ # will be added to the HTTP request.
52
+ #
53
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
54
+ #
55
+ def get_with_http_info(resource_group_name, name, custom_headers:nil)
56
+ get_async(resource_group_name, name, custom_headers:custom_headers).value!
57
+ end
58
+
59
+ #
60
+ # Gets an Azure Dev Spaces Controller.
61
+ #
62
+ # Gets the properties for an Azure Dev Spaces Controller.
63
+ #
64
+ # @param resource_group_name [String] Resource group to which the resource
65
+ # belongs.
66
+ # @param name [String] Name of the resource.
67
+ # @param [Hash{String => String}] A hash of custom headers that will be added
68
+ # to the HTTP request.
69
+ #
70
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
71
+ #
72
+ def get_async(resource_group_name, name, custom_headers:nil)
73
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
74
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
75
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
76
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
77
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
78
+ fail ArgumentError, 'name is nil' if name.nil?
79
+ fail ArgumentError, "'name' should satisfy the constraint - 'MaxLength': '31'" if !name.nil? && name.length > 31
80
+ fail ArgumentError, "'name' should satisfy the constraint - 'MinLength': '3'" if !name.nil? && name.length < 3
81
+ fail ArgumentError, "'name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9](-?[a-zA-Z0-9])*$'" if !name.nil? && name.match(Regexp.new('^^[a-zA-Z0-9](-?[a-zA-Z0-9])*$$')).nil?
82
+
83
+
84
+ request_headers = {}
85
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
86
+
87
+ # Set Headers
88
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
89
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
90
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}'
91
+
92
+ request_url = @base_url || @client.base_url
93
+
94
+ options = {
95
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
96
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'name' => name},
97
+ query_params: {'api-version' => @client.api_version},
98
+ headers: request_headers.merge(custom_headers || {}),
99
+ base_url: request_url
100
+ }
101
+ promise = @client.make_request_async(:get, path_template, options)
102
+
103
+ promise = promise.then do |result|
104
+ http_response = result.response
105
+ status_code = http_response.status
106
+ response_content = http_response.body
107
+ unless status_code == 200
108
+ error_model = JSON.load(response_content)
109
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
110
+ end
111
+
112
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
113
+ # Deserialize Response
114
+ if status_code == 200
115
+ begin
116
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
117
+ result_mapper = Azure::DevSpaces::Mgmt::V2018_06_01_preview::Models::Controller.mapper()
118
+ result.body = @client.deserialize(result_mapper, parsed_response)
119
+ rescue Exception => e
120
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
121
+ end
122
+ end
123
+
124
+ result
125
+ end
126
+
127
+ promise.execute
128
+ end
129
+
130
+ #
131
+ # Creates an Azure Dev Spaces Controller.
132
+ #
133
+ # Creates an Azure Dev Spaces Controller with the specified create parameters.
134
+ #
135
+ # @param resource_group_name [String] Resource group to which the resource
136
+ # belongs.
137
+ # @param name [String] Name of the resource.
138
+ # @param controller [Controller] Controller create parameters.
139
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
140
+ # will be added to the HTTP request.
141
+ #
142
+ # @return [Controller] operation results.
143
+ #
144
+ def create(resource_group_name, name, controller, custom_headers:nil)
145
+ response = create_async(resource_group_name, name, controller, custom_headers:custom_headers).value!
146
+ response.body unless response.nil?
147
+ end
148
+
149
+ #
150
+ # @param resource_group_name [String] Resource group to which the resource
151
+ # belongs.
152
+ # @param name [String] Name of the resource.
153
+ # @param controller [Controller] Controller create parameters.
154
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
155
+ # will be added to the HTTP request.
156
+ #
157
+ # @return [Concurrent::Promise] promise which provides async access to http
158
+ # response.
159
+ #
160
+ def create_async(resource_group_name, name, controller, custom_headers:nil)
161
+ # Send request
162
+ promise = begin_create_async(resource_group_name, name, controller, custom_headers:custom_headers)
163
+
164
+ promise = promise.then do |response|
165
+ # Defining deserialization method.
166
+ deserialize_method = lambda do |parsed_response|
167
+ result_mapper = Azure::DevSpaces::Mgmt::V2018_06_01_preview::Models::Controller.mapper()
168
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
169
+ end
170
+
171
+ # Waiting for response.
172
+ @client.get_long_running_operation_result(response, deserialize_method)
173
+ end
174
+
175
+ promise
176
+ end
177
+
178
+ #
179
+ # Deletes an Azure Dev Spaces Controller.
180
+ #
181
+ # Deletes an existing Azure Dev Spaces Controller.
182
+ #
183
+ # @param resource_group_name [String] Resource group to which the resource
184
+ # belongs.
185
+ # @param name [String] Name of the resource.
186
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
187
+ # will be added to the HTTP request.
188
+ #
189
+ def delete(resource_group_name, name, custom_headers:nil)
190
+ response = delete_async(resource_group_name, name, custom_headers:custom_headers).value!
191
+ nil
192
+ end
193
+
194
+ #
195
+ # @param resource_group_name [String] Resource group to which the resource
196
+ # belongs.
197
+ # @param name [String] Name of the resource.
198
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
199
+ # will be added to the HTTP request.
200
+ #
201
+ # @return [Concurrent::Promise] promise which provides async access to http
202
+ # response.
203
+ #
204
+ def delete_async(resource_group_name, name, custom_headers:nil)
205
+ # Send request
206
+ promise = begin_delete_async(resource_group_name, name, custom_headers:custom_headers)
207
+
208
+ promise = promise.then do |response|
209
+ # Defining deserialization method.
210
+ deserialize_method = lambda do |parsed_response|
211
+ end
212
+
213
+ # Waiting for response.
214
+ @client.get_long_running_operation_result(response, deserialize_method)
215
+ end
216
+
217
+ promise
218
+ end
219
+
220
+ #
221
+ # Updates an Azure Dev Spaces Controller.
222
+ #
223
+ # Updates the properties of an existing Azure Dev Spaces Controller with the
224
+ # specified update parameters.
225
+ #
226
+ # @param resource_group_name [String] Resource group to which the resource
227
+ # belongs.
228
+ # @param name [String] Name of the resource.
229
+ # @param controller_update_parameters [ControllerUpdateParameters]
230
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
231
+ # will be added to the HTTP request.
232
+ #
233
+ # @return [Controller] operation results.
234
+ #
235
+ def update(resource_group_name, name, controller_update_parameters, custom_headers:nil)
236
+ response = update_async(resource_group_name, name, controller_update_parameters, custom_headers:custom_headers).value!
237
+ response.body unless response.nil?
238
+ end
239
+
240
+ #
241
+ # Updates an Azure Dev Spaces Controller.
242
+ #
243
+ # Updates the properties of an existing Azure Dev Spaces Controller with the
244
+ # specified update parameters.
245
+ #
246
+ # @param resource_group_name [String] Resource group to which the resource
247
+ # belongs.
248
+ # @param name [String] Name of the resource.
249
+ # @param controller_update_parameters [ControllerUpdateParameters]
250
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
251
+ # will be added to the HTTP request.
252
+ #
253
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
254
+ #
255
+ def update_with_http_info(resource_group_name, name, controller_update_parameters, custom_headers:nil)
256
+ update_async(resource_group_name, name, controller_update_parameters, custom_headers:custom_headers).value!
257
+ end
258
+
259
+ #
260
+ # Updates an Azure Dev Spaces Controller.
261
+ #
262
+ # Updates the properties of an existing Azure Dev Spaces Controller with the
263
+ # specified update parameters.
264
+ #
265
+ # @param resource_group_name [String] Resource group to which the resource
266
+ # belongs.
267
+ # @param name [String] Name of the resource.
268
+ # @param controller_update_parameters [ControllerUpdateParameters]
269
+ # @param [Hash{String => String}] A hash of custom headers that will be added
270
+ # to the HTTP request.
271
+ #
272
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
273
+ #
274
+ def update_async(resource_group_name, name, controller_update_parameters, custom_headers:nil)
275
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
276
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
277
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
278
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
279
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
280
+ fail ArgumentError, 'name is nil' if name.nil?
281
+ fail ArgumentError, "'name' should satisfy the constraint - 'MaxLength': '31'" if !name.nil? && name.length > 31
282
+ fail ArgumentError, "'name' should satisfy the constraint - 'MinLength': '3'" if !name.nil? && name.length < 3
283
+ fail ArgumentError, "'name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9](-?[a-zA-Z0-9])*$'" if !name.nil? && name.match(Regexp.new('^^[a-zA-Z0-9](-?[a-zA-Z0-9])*$$')).nil?
284
+ fail ArgumentError, 'controller_update_parameters is nil' if controller_update_parameters.nil?
285
+
286
+
287
+ request_headers = {}
288
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
289
+
290
+ # Set Headers
291
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
292
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
293
+
294
+ # Serialize Request
295
+ request_mapper = Azure::DevSpaces::Mgmt::V2018_06_01_preview::Models::ControllerUpdateParameters.mapper()
296
+ request_content = @client.serialize(request_mapper, controller_update_parameters)
297
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
298
+
299
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}'
300
+
301
+ request_url = @base_url || @client.base_url
302
+
303
+ options = {
304
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
305
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'name' => name},
306
+ query_params: {'api-version' => @client.api_version},
307
+ body: request_content,
308
+ headers: request_headers.merge(custom_headers || {}),
309
+ base_url: request_url
310
+ }
311
+ promise = @client.make_request_async(:patch, path_template, options)
312
+
313
+ promise = promise.then do |result|
314
+ http_response = result.response
315
+ status_code = http_response.status
316
+ response_content = http_response.body
317
+ unless status_code == 200
318
+ error_model = JSON.load(response_content)
319
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
320
+ end
321
+
322
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
323
+ # Deserialize Response
324
+ if status_code == 200
325
+ begin
326
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
327
+ result_mapper = Azure::DevSpaces::Mgmt::V2018_06_01_preview::Models::Controller.mapper()
328
+ result.body = @client.deserialize(result_mapper, parsed_response)
329
+ rescue Exception => e
330
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
331
+ end
332
+ end
333
+
334
+ result
335
+ end
336
+
337
+ promise.execute
338
+ end
339
+
340
+ #
341
+ # Lists the Azure Dev Spaces Controllers in a resource group.
342
+ #
343
+ # Lists all the Azure Dev Spaces Controllers with their properties in the
344
+ # specified resource group and subscription.
345
+ #
346
+ # @param resource_group_name [String] Resource group to which the resource
347
+ # belongs.
348
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
349
+ # will be added to the HTTP request.
350
+ #
351
+ # @return [Array<Controller>] operation results.
352
+ #
353
+ def list_by_resource_group(resource_group_name, custom_headers:nil)
354
+ first_page = list_by_resource_group_as_lazy(resource_group_name, custom_headers:custom_headers)
355
+ first_page.get_all_items
356
+ end
357
+
358
+ #
359
+ # Lists the Azure Dev Spaces Controllers in a resource group.
360
+ #
361
+ # Lists all the Azure Dev Spaces Controllers with their properties in the
362
+ # specified resource group and subscription.
363
+ #
364
+ # @param resource_group_name [String] Resource group to which the resource
365
+ # belongs.
366
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
367
+ # will be added to the HTTP request.
368
+ #
369
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
370
+ #
371
+ def list_by_resource_group_with_http_info(resource_group_name, custom_headers:nil)
372
+ list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
373
+ end
374
+
375
+ #
376
+ # Lists the Azure Dev Spaces Controllers in a resource group.
377
+ #
378
+ # Lists all the Azure Dev Spaces Controllers with their properties in the
379
+ # specified resource group and subscription.
380
+ #
381
+ # @param resource_group_name [String] Resource group to which the resource
382
+ # belongs.
383
+ # @param [Hash{String => String}] A hash of custom headers that will be added
384
+ # to the HTTP request.
385
+ #
386
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
387
+ #
388
+ def list_by_resource_group_async(resource_group_name, custom_headers:nil)
389
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
390
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
391
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
392
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
393
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
394
+
395
+
396
+ request_headers = {}
397
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
398
+
399
+ # Set Headers
400
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
401
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
402
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers'
403
+
404
+ request_url = @base_url || @client.base_url
405
+
406
+ options = {
407
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
408
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
409
+ query_params: {'api-version' => @client.api_version},
410
+ headers: request_headers.merge(custom_headers || {}),
411
+ base_url: request_url
412
+ }
413
+ promise = @client.make_request_async(:get, path_template, options)
414
+
415
+ promise = promise.then do |result|
416
+ http_response = result.response
417
+ status_code = http_response.status
418
+ response_content = http_response.body
419
+ unless status_code == 200
420
+ error_model = JSON.load(response_content)
421
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
422
+ end
423
+
424
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
425
+ # Deserialize Response
426
+ if status_code == 200
427
+ begin
428
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
429
+ result_mapper = Azure::DevSpaces::Mgmt::V2018_06_01_preview::Models::ControllerList.mapper()
430
+ result.body = @client.deserialize(result_mapper, parsed_response)
431
+ rescue Exception => e
432
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
433
+ end
434
+ end
435
+
436
+ result
437
+ end
438
+
439
+ promise.execute
440
+ end
441
+
442
+ #
443
+ # Lists the Azure Dev Spaces Controllers in a subscription.
444
+ #
445
+ # Lists all the Azure Dev Spaces Controllers with their properties in the
446
+ # subscription.
447
+ #
448
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
449
+ # will be added to the HTTP request.
450
+ #
451
+ # @return [Array<Controller>] operation results.
452
+ #
453
+ def list(custom_headers:nil)
454
+ first_page = list_as_lazy(custom_headers:custom_headers)
455
+ first_page.get_all_items
456
+ end
457
+
458
+ #
459
+ # Lists the Azure Dev Spaces Controllers in a subscription.
460
+ #
461
+ # Lists all the Azure Dev Spaces Controllers with their properties in the
462
+ # subscription.
463
+ #
464
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
465
+ # will be added to the HTTP request.
466
+ #
467
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
468
+ #
469
+ def list_with_http_info(custom_headers:nil)
470
+ list_async(custom_headers:custom_headers).value!
471
+ end
472
+
473
+ #
474
+ # Lists the Azure Dev Spaces Controllers in a subscription.
475
+ #
476
+ # Lists all the Azure Dev Spaces Controllers with their properties in the
477
+ # subscription.
478
+ #
479
+ # @param [Hash{String => String}] A hash of custom headers that will be added
480
+ # to the HTTP request.
481
+ #
482
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
483
+ #
484
+ def list_async(custom_headers:nil)
485
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
486
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
487
+
488
+
489
+ request_headers = {}
490
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
491
+
492
+ # Set Headers
493
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
494
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
495
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.DevSpaces/controllers'
496
+
497
+ request_url = @base_url || @client.base_url
498
+
499
+ options = {
500
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
501
+ path_params: {'subscriptionId' => @client.subscription_id},
502
+ query_params: {'api-version' => @client.api_version},
503
+ headers: request_headers.merge(custom_headers || {}),
504
+ base_url: request_url
505
+ }
506
+ promise = @client.make_request_async(:get, path_template, options)
507
+
508
+ promise = promise.then do |result|
509
+ http_response = result.response
510
+ status_code = http_response.status
511
+ response_content = http_response.body
512
+ unless status_code == 200
513
+ error_model = JSON.load(response_content)
514
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
515
+ end
516
+
517
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
518
+ # Deserialize Response
519
+ if status_code == 200
520
+ begin
521
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
522
+ result_mapper = Azure::DevSpaces::Mgmt::V2018_06_01_preview::Models::ControllerList.mapper()
523
+ result.body = @client.deserialize(result_mapper, parsed_response)
524
+ rescue Exception => e
525
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
526
+ end
527
+ end
528
+
529
+ result
530
+ end
531
+
532
+ promise.execute
533
+ end
534
+
535
+ #
536
+ # Lists connection details for an Azure Dev Spaces Controller.
537
+ #
538
+ # Lists connection details for the underlying container resources of an Azure
539
+ # Dev Spaces Controller.
540
+ #
541
+ # @param resource_group_name [String] Resource group to which the resource
542
+ # belongs.
543
+ # @param name [String] Name of the resource.
544
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
545
+ # will be added to the HTTP request.
546
+ #
547
+ # @return [ControllerConnectionDetailsList] operation results.
548
+ #
549
+ def list_connection_details(resource_group_name, name, custom_headers:nil)
550
+ response = list_connection_details_async(resource_group_name, name, custom_headers:custom_headers).value!
551
+ response.body unless response.nil?
552
+ end
553
+
554
+ #
555
+ # Lists connection details for an Azure Dev Spaces Controller.
556
+ #
557
+ # Lists connection details for the underlying container resources of an Azure
558
+ # Dev Spaces Controller.
559
+ #
560
+ # @param resource_group_name [String] Resource group to which the resource
561
+ # belongs.
562
+ # @param name [String] Name of the resource.
563
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
564
+ # will be added to the HTTP request.
565
+ #
566
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
567
+ #
568
+ def list_connection_details_with_http_info(resource_group_name, name, custom_headers:nil)
569
+ list_connection_details_async(resource_group_name, name, custom_headers:custom_headers).value!
570
+ end
571
+
572
+ #
573
+ # Lists connection details for an Azure Dev Spaces Controller.
574
+ #
575
+ # Lists connection details for the underlying container resources of an Azure
576
+ # Dev Spaces Controller.
577
+ #
578
+ # @param resource_group_name [String] Resource group to which the resource
579
+ # belongs.
580
+ # @param name [String] Name of the resource.
581
+ # @param [Hash{String => String}] A hash of custom headers that will be added
582
+ # to the HTTP request.
583
+ #
584
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
585
+ #
586
+ def list_connection_details_async(resource_group_name, name, custom_headers:nil)
587
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
588
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
589
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
590
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
591
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
592
+ fail ArgumentError, 'name is nil' if name.nil?
593
+ fail ArgumentError, "'name' should satisfy the constraint - 'MaxLength': '31'" if !name.nil? && name.length > 31
594
+ fail ArgumentError, "'name' should satisfy the constraint - 'MinLength': '3'" if !name.nil? && name.length < 3
595
+ fail ArgumentError, "'name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9](-?[a-zA-Z0-9])*$'" if !name.nil? && name.match(Regexp.new('^^[a-zA-Z0-9](-?[a-zA-Z0-9])*$$')).nil?
596
+
597
+
598
+ request_headers = {}
599
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
600
+
601
+ # Set Headers
602
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
603
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
604
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}/listConnectionDetails'
605
+
606
+ request_url = @base_url || @client.base_url
607
+
608
+ options = {
609
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
610
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'name' => name},
611
+ query_params: {'api-version' => @client.api_version},
612
+ headers: request_headers.merge(custom_headers || {}),
613
+ base_url: request_url
614
+ }
615
+ promise = @client.make_request_async(:post, path_template, options)
616
+
617
+ promise = promise.then do |result|
618
+ http_response = result.response
619
+ status_code = http_response.status
620
+ response_content = http_response.body
621
+ unless status_code == 200
622
+ error_model = JSON.load(response_content)
623
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
624
+ end
625
+
626
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
627
+ # Deserialize Response
628
+ if status_code == 200
629
+ begin
630
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
631
+ result_mapper = Azure::DevSpaces::Mgmt::V2018_06_01_preview::Models::ControllerConnectionDetailsList.mapper()
632
+ result.body = @client.deserialize(result_mapper, parsed_response)
633
+ rescue Exception => e
634
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
635
+ end
636
+ end
637
+
638
+ result
639
+ end
640
+
641
+ promise.execute
642
+ end
643
+
644
+ #
645
+ # Creates an Azure Dev Spaces Controller.
646
+ #
647
+ # Creates an Azure Dev Spaces Controller with the specified create parameters.
648
+ #
649
+ # @param resource_group_name [String] Resource group to which the resource
650
+ # belongs.
651
+ # @param name [String] Name of the resource.
652
+ # @param controller [Controller] Controller create parameters.
653
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
654
+ # will be added to the HTTP request.
655
+ #
656
+ # @return [Controller] operation results.
657
+ #
658
+ def begin_create(resource_group_name, name, controller, custom_headers:nil)
659
+ response = begin_create_async(resource_group_name, name, controller, custom_headers:custom_headers).value!
660
+ response.body unless response.nil?
661
+ end
662
+
663
+ #
664
+ # Creates an Azure Dev Spaces Controller.
665
+ #
666
+ # Creates an Azure Dev Spaces Controller with the specified create parameters.
667
+ #
668
+ # @param resource_group_name [String] Resource group to which the resource
669
+ # belongs.
670
+ # @param name [String] Name of the resource.
671
+ # @param controller [Controller] Controller create parameters.
672
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
673
+ # will be added to the HTTP request.
674
+ #
675
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
676
+ #
677
+ def begin_create_with_http_info(resource_group_name, name, controller, custom_headers:nil)
678
+ begin_create_async(resource_group_name, name, controller, custom_headers:custom_headers).value!
679
+ end
680
+
681
+ #
682
+ # Creates an Azure Dev Spaces Controller.
683
+ #
684
+ # Creates an Azure Dev Spaces Controller with the specified create parameters.
685
+ #
686
+ # @param resource_group_name [String] Resource group to which the resource
687
+ # belongs.
688
+ # @param name [String] Name of the resource.
689
+ # @param controller [Controller] Controller create parameters.
690
+ # @param [Hash{String => String}] A hash of custom headers that will be added
691
+ # to the HTTP request.
692
+ #
693
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
694
+ #
695
+ def begin_create_async(resource_group_name, name, controller, custom_headers:nil)
696
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
697
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
698
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
699
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
700
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
701
+ fail ArgumentError, 'name is nil' if name.nil?
702
+ fail ArgumentError, "'name' should satisfy the constraint - 'MaxLength': '31'" if !name.nil? && name.length > 31
703
+ fail ArgumentError, "'name' should satisfy the constraint - 'MinLength': '3'" if !name.nil? && name.length < 3
704
+ fail ArgumentError, "'name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9](-?[a-zA-Z0-9])*$'" if !name.nil? && name.match(Regexp.new('^^[a-zA-Z0-9](-?[a-zA-Z0-9])*$$')).nil?
705
+ fail ArgumentError, 'controller is nil' if controller.nil?
706
+
707
+
708
+ request_headers = {}
709
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
710
+
711
+ # Set Headers
712
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
713
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
714
+
715
+ # Serialize Request
716
+ request_mapper = Azure::DevSpaces::Mgmt::V2018_06_01_preview::Models::Controller.mapper()
717
+ request_content = @client.serialize(request_mapper, controller)
718
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
719
+
720
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}'
721
+
722
+ request_url = @base_url || @client.base_url
723
+
724
+ options = {
725
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
726
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'name' => name},
727
+ query_params: {'api-version' => @client.api_version},
728
+ body: request_content,
729
+ headers: request_headers.merge(custom_headers || {}),
730
+ base_url: request_url
731
+ }
732
+ promise = @client.make_request_async(:put, path_template, options)
733
+
734
+ promise = promise.then do |result|
735
+ http_response = result.response
736
+ status_code = http_response.status
737
+ response_content = http_response.body
738
+ unless status_code == 200 || status_code == 201
739
+ error_model = JSON.load(response_content)
740
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
741
+ end
742
+
743
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
744
+ # Deserialize Response
745
+ if status_code == 200
746
+ begin
747
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
748
+ result_mapper = Azure::DevSpaces::Mgmt::V2018_06_01_preview::Models::Controller.mapper()
749
+ result.body = @client.deserialize(result_mapper, parsed_response)
750
+ rescue Exception => e
751
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
752
+ end
753
+ end
754
+ # Deserialize Response
755
+ if status_code == 201
756
+ begin
757
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
758
+ result_mapper = Azure::DevSpaces::Mgmt::V2018_06_01_preview::Models::Controller.mapper()
759
+ result.body = @client.deserialize(result_mapper, parsed_response)
760
+ rescue Exception => e
761
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
762
+ end
763
+ end
764
+
765
+ result
766
+ end
767
+
768
+ promise.execute
769
+ end
770
+
771
+ #
772
+ # Deletes an Azure Dev Spaces Controller.
773
+ #
774
+ # Deletes an existing Azure Dev Spaces Controller.
775
+ #
776
+ # @param resource_group_name [String] Resource group to which the resource
777
+ # belongs.
778
+ # @param name [String] Name of the resource.
779
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
780
+ # will be added to the HTTP request.
781
+ #
782
+ #
783
+ def begin_delete(resource_group_name, name, custom_headers:nil)
784
+ response = begin_delete_async(resource_group_name, name, custom_headers:custom_headers).value!
785
+ nil
786
+ end
787
+
788
+ #
789
+ # Deletes an Azure Dev Spaces Controller.
790
+ #
791
+ # Deletes an existing Azure Dev Spaces Controller.
792
+ #
793
+ # @param resource_group_name [String] Resource group to which the resource
794
+ # belongs.
795
+ # @param name [String] Name of the resource.
796
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
797
+ # will be added to the HTTP request.
798
+ #
799
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
800
+ #
801
+ def begin_delete_with_http_info(resource_group_name, name, custom_headers:nil)
802
+ begin_delete_async(resource_group_name, name, custom_headers:custom_headers).value!
803
+ end
804
+
805
+ #
806
+ # Deletes an Azure Dev Spaces Controller.
807
+ #
808
+ # Deletes an existing Azure Dev Spaces Controller.
809
+ #
810
+ # @param resource_group_name [String] Resource group to which the resource
811
+ # belongs.
812
+ # @param name [String] Name of the resource.
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, name, custom_headers:nil)
819
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
820
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
821
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
822
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
823
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
824
+ fail ArgumentError, 'name is nil' if name.nil?
825
+ fail ArgumentError, "'name' should satisfy the constraint - 'MaxLength': '31'" if !name.nil? && name.length > 31
826
+ fail ArgumentError, "'name' should satisfy the constraint - 'MinLength': '3'" if !name.nil? && name.length < 3
827
+ fail ArgumentError, "'name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9](-?[a-zA-Z0-9])*$'" if !name.nil? && name.match(Regexp.new('^^[a-zA-Z0-9](-?[a-zA-Z0-9])*$$')).nil?
828
+
829
+
830
+ request_headers = {}
831
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
832
+
833
+ # Set Headers
834
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
835
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
836
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevSpaces/controllers/{name}'
837
+
838
+ request_url = @base_url || @client.base_url
839
+
840
+ options = {
841
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
842
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'name' => name},
843
+ query_params: {'api-version' => @client.api_version},
844
+ headers: request_headers.merge(custom_headers || {}),
845
+ base_url: request_url
846
+ }
847
+ promise = @client.make_request_async(:delete, path_template, options)
848
+
849
+ promise = promise.then do |result|
850
+ http_response = result.response
851
+ status_code = http_response.status
852
+ response_content = http_response.body
853
+ unless status_code == 200 || status_code == 202 || status_code == 204
854
+ error_model = JSON.load(response_content)
855
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
856
+ end
857
+
858
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
859
+
860
+ result
861
+ end
862
+
863
+ promise.execute
864
+ end
865
+
866
+ #
867
+ # Lists the Azure Dev Spaces Controllers in a resource group.
868
+ #
869
+ # Lists all the Azure Dev Spaces Controllers with their properties in the
870
+ # specified resource group and subscription.
871
+ #
872
+ # @param next_page_link [String] The NextLink from the previous successful call
873
+ # to List operation.
874
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
875
+ # will be added to the HTTP request.
876
+ #
877
+ # @return [ControllerList] operation results.
878
+ #
879
+ def list_by_resource_group_next(next_page_link, custom_headers:nil)
880
+ response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
881
+ response.body unless response.nil?
882
+ end
883
+
884
+ #
885
+ # Lists the Azure Dev Spaces Controllers in a resource group.
886
+ #
887
+ # Lists all the Azure Dev Spaces Controllers with their properties in the
888
+ # specified resource group and subscription.
889
+ #
890
+ # @param next_page_link [String] The NextLink from the previous successful call
891
+ # to List operation.
892
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
893
+ # will be added to the HTTP request.
894
+ #
895
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
896
+ #
897
+ def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
898
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
899
+ end
900
+
901
+ #
902
+ # Lists the Azure Dev Spaces Controllers in a resource group.
903
+ #
904
+ # Lists all the Azure Dev Spaces Controllers with their properties in the
905
+ # specified resource group and subscription.
906
+ #
907
+ # @param next_page_link [String] The NextLink from the previous successful call
908
+ # to List operation.
909
+ # @param [Hash{String => String}] A hash of custom headers that will be added
910
+ # to the HTTP request.
911
+ #
912
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
913
+ #
914
+ def list_by_resource_group_next_async(next_page_link, custom_headers:nil)
915
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
916
+
917
+
918
+ request_headers = {}
919
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
920
+
921
+ # Set Headers
922
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
923
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
924
+ path_template = '{nextLink}'
925
+
926
+ request_url = @base_url || @client.base_url
927
+
928
+ options = {
929
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
930
+ skip_encoding_path_params: {'nextLink' => next_page_link},
931
+ headers: request_headers.merge(custom_headers || {}),
932
+ base_url: request_url
933
+ }
934
+ promise = @client.make_request_async(:get, path_template, options)
935
+
936
+ promise = promise.then do |result|
937
+ http_response = result.response
938
+ status_code = http_response.status
939
+ response_content = http_response.body
940
+ unless status_code == 200
941
+ error_model = JSON.load(response_content)
942
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
943
+ end
944
+
945
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
946
+ # Deserialize Response
947
+ if status_code == 200
948
+ begin
949
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
950
+ result_mapper = Azure::DevSpaces::Mgmt::V2018_06_01_preview::Models::ControllerList.mapper()
951
+ result.body = @client.deserialize(result_mapper, parsed_response)
952
+ rescue Exception => e
953
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
954
+ end
955
+ end
956
+
957
+ result
958
+ end
959
+
960
+ promise.execute
961
+ end
962
+
963
+ #
964
+ # Lists the Azure Dev Spaces Controllers in a subscription.
965
+ #
966
+ # Lists all the Azure Dev Spaces Controllers with their properties in the
967
+ # subscription.
968
+ #
969
+ # @param next_page_link [String] The NextLink from the previous successful call
970
+ # to List operation.
971
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
972
+ # will be added to the HTTP request.
973
+ #
974
+ # @return [ControllerList] operation results.
975
+ #
976
+ def list_next(next_page_link, custom_headers:nil)
977
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
978
+ response.body unless response.nil?
979
+ end
980
+
981
+ #
982
+ # Lists the Azure Dev Spaces Controllers in a subscription.
983
+ #
984
+ # Lists all the Azure Dev Spaces Controllers with their properties in the
985
+ # subscription.
986
+ #
987
+ # @param next_page_link [String] The NextLink from the previous successful call
988
+ # to List operation.
989
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
990
+ # will be added to the HTTP request.
991
+ #
992
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
993
+ #
994
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
995
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
996
+ end
997
+
998
+ #
999
+ # Lists the Azure Dev Spaces Controllers in a subscription.
1000
+ #
1001
+ # Lists all the Azure Dev Spaces Controllers with their properties in the
1002
+ # subscription.
1003
+ #
1004
+ # @param next_page_link [String] The NextLink from the previous successful call
1005
+ # to List operation.
1006
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1007
+ # to the HTTP request.
1008
+ #
1009
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1010
+ #
1011
+ def list_next_async(next_page_link, custom_headers:nil)
1012
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1013
+
1014
+
1015
+ request_headers = {}
1016
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1017
+
1018
+ # Set Headers
1019
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1020
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1021
+ path_template = '{nextLink}'
1022
+
1023
+ request_url = @base_url || @client.base_url
1024
+
1025
+ options = {
1026
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1027
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1028
+ headers: request_headers.merge(custom_headers || {}),
1029
+ base_url: request_url
1030
+ }
1031
+ promise = @client.make_request_async(:get, path_template, options)
1032
+
1033
+ promise = promise.then do |result|
1034
+ http_response = result.response
1035
+ status_code = http_response.status
1036
+ response_content = http_response.body
1037
+ unless status_code == 200
1038
+ error_model = JSON.load(response_content)
1039
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1040
+ end
1041
+
1042
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1043
+ # Deserialize Response
1044
+ if status_code == 200
1045
+ begin
1046
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1047
+ result_mapper = Azure::DevSpaces::Mgmt::V2018_06_01_preview::Models::ControllerList.mapper()
1048
+ result.body = @client.deserialize(result_mapper, parsed_response)
1049
+ rescue Exception => e
1050
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1051
+ end
1052
+ end
1053
+
1054
+ result
1055
+ end
1056
+
1057
+ promise.execute
1058
+ end
1059
+
1060
+ #
1061
+ # Lists the Azure Dev Spaces Controllers in a resource group.
1062
+ #
1063
+ # Lists all the Azure Dev Spaces Controllers with their properties in the
1064
+ # specified resource group and subscription.
1065
+ #
1066
+ # @param resource_group_name [String] Resource group to which the resource
1067
+ # belongs.
1068
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1069
+ # will be added to the HTTP request.
1070
+ #
1071
+ # @return [ControllerList] which provide lazy access to pages of the response.
1072
+ #
1073
+ def list_by_resource_group_as_lazy(resource_group_name, custom_headers:nil)
1074
+ response = list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
1075
+ unless response.nil?
1076
+ page = response.body
1077
+ page.next_method = Proc.new do |next_page_link|
1078
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
1079
+ end
1080
+ page
1081
+ end
1082
+ end
1083
+
1084
+ #
1085
+ # Lists the Azure Dev Spaces Controllers in a subscription.
1086
+ #
1087
+ # Lists all the Azure Dev Spaces Controllers with their properties in the
1088
+ # subscription.
1089
+ #
1090
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1091
+ # will be added to the HTTP request.
1092
+ #
1093
+ # @return [ControllerList] which provide lazy access to pages of the response.
1094
+ #
1095
+ def list_as_lazy(custom_headers:nil)
1096
+ response = list_async(custom_headers:custom_headers).value!
1097
+ unless response.nil?
1098
+ page = response.body
1099
+ page.next_method = Proc.new do |next_page_link|
1100
+ list_next_async(next_page_link, custom_headers:custom_headers)
1101
+ end
1102
+ page
1103
+ end
1104
+ end
1105
+
1106
+ end
1107
+ end