azure_mgmt_vmware_cloudsimple 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 (67) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple.rb +82 -0
  4. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/dedicated_cloud_nodes.rb +945 -0
  5. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/dedicated_cloud_services.rb +932 -0
  6. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/aggregation_type.rb +16 -0
  7. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/available_operation.rb +99 -0
  8. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/available_operation_display.rb +79 -0
  9. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/available_operation_display_property_service_specification_metrics_item.rb +94 -0
  10. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/available_operation_display_property_service_specification_metrics_list.rb +60 -0
  11. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/available_operations_list_response.rb +99 -0
  12. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/csrperror.rb +47 -0
  13. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/csrperror_body.rb +91 -0
  14. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/dedicated_cloud_node.rb +293 -0
  15. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/dedicated_cloud_node_list_response.rb +99 -0
  16. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/dedicated_cloud_service.rb +154 -0
  17. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/dedicated_cloud_service_list_response.rb +99 -0
  18. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/disk_independence_mode.rb +17 -0
  19. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/guest_ostype.rb +17 -0
  20. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/nictype.rb +20 -0
  21. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/node_status.rb +16 -0
  22. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/onboarding_status.rb +18 -0
  23. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/operation_error.rb +57 -0
  24. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/operation_origin.rb +17 -0
  25. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/operation_resource.rb +107 -0
  26. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/patch_payload.rb +54 -0
  27. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/private_cloud.rb +382 -0
  28. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/private_cloud_list.rb +98 -0
  29. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/private_cloud_resource_type.rb +15 -0
  30. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/resource_pool.rb +106 -0
  31. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/resource_pools_list_response.rb +98 -0
  32. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/sku.rb +93 -0
  33. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/sku_availability.rb +124 -0
  34. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/sku_availability_list_response.rb +99 -0
  35. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/stop_mode.rb +18 -0
  36. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/usage.rb +87 -0
  37. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/usage_count.rb +20 -0
  38. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/usage_list_response.rb +99 -0
  39. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/usage_name.rb +58 -0
  40. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/virtual_disk.rb +94 -0
  41. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/virtual_disk_controller.rb +84 -0
  42. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/virtual_machine.rb +388 -0
  43. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/virtual_machine_list_response.rb +98 -0
  44. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/virtual_machine_status.rb +20 -0
  45. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/virtual_machine_stop_mode.rb +49 -0
  46. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/virtual_machine_template.rb +283 -0
  47. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/virtual_machine_template_list_response.rb +98 -0
  48. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/virtual_network.rb +106 -0
  49. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/virtual_network_list_response.rb +98 -0
  50. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/models/virtual_nic.rb +124 -0
  51. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/module_definition.rb +9 -0
  52. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/operations.rb +335 -0
  53. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/private_clouds.rb +340 -0
  54. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/resource_pools.rb +349 -0
  55. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/skus_availability.rb +248 -0
  56. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/usages.rb +248 -0
  57. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/virtual_machine_templates.rb +361 -0
  58. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/virtual_machines.rb +1326 -0
  59. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/virtual_networks.rb +358 -0
  60. data/lib/2019-04-01/generated/azure_mgmt_vmware_cloudsimple/vmware_cloud_simple_client.rb +170 -0
  61. data/lib/azure_mgmt_vmware_cloudsimple.rb +6 -0
  62. data/lib/module_definition.rb +7 -0
  63. data/lib/profiles/latest/modules/vmwarecloudsimple_profile_module.rb +259 -0
  64. data/lib/profiles/latest/vmwarecloudsimple_latest_profile_client.rb +40 -0
  65. data/lib/profiles/latest/vmwarecloudsimple_module_definition.rb +8 -0
  66. data/lib/version.rb +7 -0
  67. metadata +182 -0
@@ -0,0 +1,932 @@
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::VMwareCloudSimple::Mgmt::V2019_04_01
7
+ #
8
+ # Description of the new service
9
+ #
10
+ class DedicatedCloudServices
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the DedicatedCloudServices class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [VMwareCloudSimpleClient] reference to the VMwareCloudSimpleClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Implements list of dedicatedCloudService objects within subscription method
26
+ #
27
+ # Returns list of dedicated cloud services within a subscription
28
+ #
29
+ # @param filter [String] The filter to apply on the list operation
30
+ # @param top [Integer] The maximum number of record sets to return
31
+ # @param skip_token [String] to be used by nextLink implementation
32
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
33
+ # will be added to the HTTP request.
34
+ #
35
+ # @return [Array<DedicatedCloudService>] operation results.
36
+ #
37
+ def list_by_subscription(filter:nil, top:nil, skip_token:nil, custom_headers:nil)
38
+ first_page = list_by_subscription_as_lazy(filter:filter, top:top, skip_token:skip_token, custom_headers:custom_headers)
39
+ first_page.get_all_items
40
+ end
41
+
42
+ #
43
+ # Implements list of dedicatedCloudService objects within subscription method
44
+ #
45
+ # Returns list of dedicated cloud services within a subscription
46
+ #
47
+ # @param filter [String] The filter to apply on the list operation
48
+ # @param top [Integer] The maximum number of record sets to return
49
+ # @param skip_token [String] to be used by nextLink implementation
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 list_by_subscription_with_http_info(filter:nil, top:nil, skip_token:nil, custom_headers:nil)
56
+ list_by_subscription_async(filter:filter, top:top, skip_token:skip_token, custom_headers:custom_headers).value!
57
+ end
58
+
59
+ #
60
+ # Implements list of dedicatedCloudService objects within subscription method
61
+ #
62
+ # Returns list of dedicated cloud services within a subscription
63
+ #
64
+ # @param filter [String] The filter to apply on the list operation
65
+ # @param top [Integer] The maximum number of record sets to return
66
+ # @param skip_token [String] to be used by nextLink implementation
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 list_by_subscription_async(filter:nil, top:nil, skip_token:nil, custom_headers:nil)
73
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
74
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
75
+
76
+
77
+ request_headers = {}
78
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
79
+
80
+ # Set Headers
81
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
82
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
83
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.VMwareCloudSimple/dedicatedCloudServices'
84
+
85
+ request_url = @base_url || @client.base_url
86
+
87
+ options = {
88
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
89
+ path_params: {'subscriptionId' => @client.subscription_id},
90
+ query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top,'$skipToken' => skip_token},
91
+ headers: request_headers.merge(custom_headers || {}),
92
+ base_url: request_url
93
+ }
94
+ promise = @client.make_request_async(:get, path_template, options)
95
+
96
+ promise = promise.then do |result|
97
+ http_response = result.response
98
+ status_code = http_response.status
99
+ response_content = http_response.body
100
+ unless status_code == 200
101
+ error_model = JSON.load(response_content)
102
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
103
+ end
104
+
105
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
106
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
107
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
108
+ # Deserialize Response
109
+ if status_code == 200
110
+ begin
111
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
112
+ result_mapper = Azure::VMwareCloudSimple::Mgmt::V2019_04_01::Models::DedicatedCloudServiceListResponse.mapper()
113
+ result.body = @client.deserialize(result_mapper, parsed_response)
114
+ rescue Exception => e
115
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
116
+ end
117
+ end
118
+
119
+ result
120
+ end
121
+
122
+ promise.execute
123
+ end
124
+
125
+ #
126
+ # Implements list of dedicatedCloudService objects within RG method
127
+ #
128
+ # Returns list of dedicated cloud services within a resource group
129
+ #
130
+ # @param resource_group_name [String] The name of the resource group
131
+ # @param filter [String] The filter to apply on the list operation
132
+ # @param top [Integer] The maximum number of record sets to return
133
+ # @param skip_token [String] to be used by nextLink implementation
134
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
135
+ # will be added to the HTTP request.
136
+ #
137
+ # @return [Array<DedicatedCloudService>] operation results.
138
+ #
139
+ def list_by_resource_group(resource_group_name, filter:nil, top:nil, skip_token:nil, custom_headers:nil)
140
+ first_page = list_by_resource_group_as_lazy(resource_group_name, filter:filter, top:top, skip_token:skip_token, custom_headers:custom_headers)
141
+ first_page.get_all_items
142
+ end
143
+
144
+ #
145
+ # Implements list of dedicatedCloudService objects within RG method
146
+ #
147
+ # Returns list of dedicated cloud services within a resource group
148
+ #
149
+ # @param resource_group_name [String] The name of the resource group
150
+ # @param filter [String] The filter to apply on the list operation
151
+ # @param top [Integer] The maximum number of record sets to return
152
+ # @param skip_token [String] to be used by nextLink implementation
153
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
154
+ # will be added to the HTTP request.
155
+ #
156
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
157
+ #
158
+ def list_by_resource_group_with_http_info(resource_group_name, filter:nil, top:nil, skip_token:nil, custom_headers:nil)
159
+ list_by_resource_group_async(resource_group_name, filter:filter, top:top, skip_token:skip_token, custom_headers:custom_headers).value!
160
+ end
161
+
162
+ #
163
+ # Implements list of dedicatedCloudService objects within RG method
164
+ #
165
+ # Returns list of dedicated cloud services within a resource group
166
+ #
167
+ # @param resource_group_name [String] The name of the resource group
168
+ # @param filter [String] The filter to apply on the list operation
169
+ # @param top [Integer] The maximum number of record sets to return
170
+ # @param skip_token [String] to be used by nextLink implementation
171
+ # @param [Hash{String => String}] A hash of custom headers that will be added
172
+ # to the HTTP request.
173
+ #
174
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
175
+ #
176
+ def list_by_resource_group_async(resource_group_name, filter:nil, top:nil, skip_token:nil, custom_headers:nil)
177
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
178
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
179
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
180
+
181
+
182
+ request_headers = {}
183
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
184
+
185
+ # Set Headers
186
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
187
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
188
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/dedicatedCloudServices'
189
+
190
+ request_url = @base_url || @client.base_url
191
+
192
+ options = {
193
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
194
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
195
+ query_params: {'api-version' => @client.api_version,'$filter' => filter,'$top' => top,'$skipToken' => skip_token},
196
+ headers: request_headers.merge(custom_headers || {}),
197
+ base_url: request_url
198
+ }
199
+ promise = @client.make_request_async(:get, path_template, options)
200
+
201
+ promise = promise.then do |result|
202
+ http_response = result.response
203
+ status_code = http_response.status
204
+ response_content = http_response.body
205
+ unless status_code == 200
206
+ error_model = JSON.load(response_content)
207
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
208
+ end
209
+
210
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
211
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
212
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
213
+ # Deserialize Response
214
+ if status_code == 200
215
+ begin
216
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
217
+ result_mapper = Azure::VMwareCloudSimple::Mgmt::V2019_04_01::Models::DedicatedCloudServiceListResponse.mapper()
218
+ result.body = @client.deserialize(result_mapper, parsed_response)
219
+ rescue Exception => e
220
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
221
+ end
222
+ end
223
+
224
+ result
225
+ end
226
+
227
+ promise.execute
228
+ end
229
+
230
+ #
231
+ # Implements dedicatedCloudService GET method
232
+ #
233
+ # Returns Dedicate Cloud Service
234
+ #
235
+ # @param resource_group_name [String] The name of the resource group
236
+ # @param dedicated_cloud_service_name [String] dedicated cloud Service name
237
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
238
+ # will be added to the HTTP request.
239
+ #
240
+ # @return [DedicatedCloudService] operation results.
241
+ #
242
+ def get(resource_group_name, dedicated_cloud_service_name, custom_headers:nil)
243
+ response = get_async(resource_group_name, dedicated_cloud_service_name, custom_headers:custom_headers).value!
244
+ response.body unless response.nil?
245
+ end
246
+
247
+ #
248
+ # Implements dedicatedCloudService GET method
249
+ #
250
+ # Returns Dedicate Cloud Service
251
+ #
252
+ # @param resource_group_name [String] The name of the resource group
253
+ # @param dedicated_cloud_service_name [String] dedicated cloud Service name
254
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
255
+ # will be added to the HTTP request.
256
+ #
257
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
258
+ #
259
+ def get_with_http_info(resource_group_name, dedicated_cloud_service_name, custom_headers:nil)
260
+ get_async(resource_group_name, dedicated_cloud_service_name, custom_headers:custom_headers).value!
261
+ end
262
+
263
+ #
264
+ # Implements dedicatedCloudService GET method
265
+ #
266
+ # Returns Dedicate Cloud Service
267
+ #
268
+ # @param resource_group_name [String] The name of the resource group
269
+ # @param dedicated_cloud_service_name [String] dedicated cloud Service name
270
+ # @param [Hash{String => String}] A hash of custom headers that will be added
271
+ # to the HTTP request.
272
+ #
273
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
274
+ #
275
+ def get_async(resource_group_name, dedicated_cloud_service_name, custom_headers: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, 'dedicated_cloud_service_name is nil' if dedicated_cloud_service_name.nil?
279
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
280
+
281
+
282
+ request_headers = {}
283
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
284
+
285
+ # Set Headers
286
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
287
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
288
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/dedicatedCloudServices/{dedicatedCloudServiceName}'
289
+
290
+ request_url = @base_url || @client.base_url
291
+
292
+ options = {
293
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
294
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'dedicatedCloudServiceName' => dedicated_cloud_service_name},
295
+ query_params: {'api-version' => @client.api_version},
296
+ headers: request_headers.merge(custom_headers || {}),
297
+ base_url: request_url
298
+ }
299
+ promise = @client.make_request_async(:get, path_template, options)
300
+
301
+ promise = promise.then do |result|
302
+ http_response = result.response
303
+ status_code = http_response.status
304
+ response_content = http_response.body
305
+ unless status_code == 200
306
+ error_model = JSON.load(response_content)
307
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
308
+ end
309
+
310
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
311
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
312
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
313
+ # Deserialize Response
314
+ if status_code == 200
315
+ begin
316
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
317
+ result_mapper = Azure::VMwareCloudSimple::Mgmt::V2019_04_01::Models::DedicatedCloudService.mapper()
318
+ result.body = @client.deserialize(result_mapper, parsed_response)
319
+ rescue Exception => e
320
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
321
+ end
322
+ end
323
+
324
+ result
325
+ end
326
+
327
+ promise.execute
328
+ end
329
+
330
+ #
331
+ # Implements dedicated cloud service PUT method
332
+ #
333
+ # Create dedicate cloud service
334
+ #
335
+ # @param resource_group_name [String] The name of the resource group
336
+ # @param dedicated_cloud_service_name [String] dedicated cloud Service name
337
+ # @param dedicated_cloud_service_request [DedicatedCloudService] Create
338
+ # Dedicated Cloud Service request
339
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
340
+ # will be added to the HTTP request.
341
+ #
342
+ # @return [DedicatedCloudService] operation results.
343
+ #
344
+ def create_or_update(resource_group_name, dedicated_cloud_service_name, dedicated_cloud_service_request, custom_headers:nil)
345
+ response = create_or_update_async(resource_group_name, dedicated_cloud_service_name, dedicated_cloud_service_request, custom_headers:custom_headers).value!
346
+ response.body unless response.nil?
347
+ end
348
+
349
+ #
350
+ # Implements dedicated cloud service PUT method
351
+ #
352
+ # Create dedicate cloud service
353
+ #
354
+ # @param resource_group_name [String] The name of the resource group
355
+ # @param dedicated_cloud_service_name [String] dedicated cloud Service name
356
+ # @param dedicated_cloud_service_request [DedicatedCloudService] Create
357
+ # Dedicated Cloud Service request
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, dedicated_cloud_service_name, dedicated_cloud_service_request, custom_headers:nil)
364
+ create_or_update_async(resource_group_name, dedicated_cloud_service_name, dedicated_cloud_service_request, custom_headers:custom_headers).value!
365
+ end
366
+
367
+ #
368
+ # Implements dedicated cloud service PUT method
369
+ #
370
+ # Create dedicate cloud service
371
+ #
372
+ # @param resource_group_name [String] The name of the resource group
373
+ # @param dedicated_cloud_service_name [String] dedicated cloud Service name
374
+ # @param dedicated_cloud_service_request [DedicatedCloudService] Create
375
+ # Dedicated Cloud Service request
376
+ # @param [Hash{String => String}] A hash of custom headers that will be added
377
+ # to the HTTP request.
378
+ #
379
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
380
+ #
381
+ def create_or_update_async(resource_group_name, dedicated_cloud_service_name, dedicated_cloud_service_request, custom_headers:nil)
382
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
383
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
384
+ fail ArgumentError, 'dedicated_cloud_service_name is nil' if dedicated_cloud_service_name.nil?
385
+ fail ArgumentError, "'dedicated_cloud_service_name' should satisfy the constraint - 'Pattern': '^[-a-zA-Z0-9]+$'" if !dedicated_cloud_service_name.nil? && dedicated_cloud_service_name.match(Regexp.new('^^[-a-zA-Z0-9]+$$')).nil?
386
+ fail ArgumentError, 'dedicated_cloud_service_request is nil' if dedicated_cloud_service_request.nil?
387
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
388
+
389
+
390
+ request_headers = {}
391
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
392
+
393
+ # Set Headers
394
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
395
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
396
+
397
+ # Serialize Request
398
+ request_mapper = Azure::VMwareCloudSimple::Mgmt::V2019_04_01::Models::DedicatedCloudService.mapper()
399
+ request_content = @client.serialize(request_mapper, dedicated_cloud_service_request)
400
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
401
+
402
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/dedicatedCloudServices/{dedicatedCloudServiceName}'
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,'dedicatedCloudServiceName' => dedicated_cloud_service_name},
409
+ query_params: {'api-version' => @client.api_version},
410
+ body: request_content,
411
+ headers: request_headers.merge(custom_headers || {}),
412
+ base_url: request_url
413
+ }
414
+ promise = @client.make_request_async(:put, path_template, options)
415
+
416
+ promise = promise.then do |result|
417
+ http_response = result.response
418
+ status_code = http_response.status
419
+ response_content = http_response.body
420
+ unless status_code == 200
421
+ error_model = JSON.load(response_content)
422
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
423
+ end
424
+
425
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
426
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
427
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
428
+ # Deserialize Response
429
+ if status_code == 200
430
+ begin
431
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
432
+ result_mapper = Azure::VMwareCloudSimple::Mgmt::V2019_04_01::Models::DedicatedCloudService.mapper()
433
+ result.body = @client.deserialize(result_mapper, parsed_response)
434
+ rescue Exception => e
435
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
436
+ end
437
+ end
438
+
439
+ result
440
+ end
441
+
442
+ promise.execute
443
+ end
444
+
445
+ #
446
+ # Implements dedicatedCloudService DELETE method
447
+ #
448
+ # Delete dedicate cloud service
449
+ #
450
+ # @param resource_group_name [String] The name of the resource group
451
+ # @param dedicated_cloud_service_name [String] dedicated cloud service name
452
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
453
+ # will be added to the HTTP request.
454
+ #
455
+ def delete(resource_group_name, dedicated_cloud_service_name, custom_headers:nil)
456
+ response = delete_async(resource_group_name, dedicated_cloud_service_name, custom_headers:custom_headers).value!
457
+ nil
458
+ end
459
+
460
+ #
461
+ # @param resource_group_name [String] The name of the resource group
462
+ # @param dedicated_cloud_service_name [String] dedicated cloud service name
463
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
464
+ # will be added to the HTTP request.
465
+ #
466
+ # @return [Concurrent::Promise] promise which provides async access to http
467
+ # response.
468
+ #
469
+ def delete_async(resource_group_name, dedicated_cloud_service_name, custom_headers:nil)
470
+ # Send request
471
+ promise = begin_delete_async(resource_group_name, dedicated_cloud_service_name, custom_headers:custom_headers)
472
+
473
+ promise = promise.then do |response|
474
+ # Defining deserialization method.
475
+ deserialize_method = lambda do |parsed_response|
476
+ end
477
+
478
+ # Waiting for response.
479
+ @client.get_long_running_operation_result(response, deserialize_method)
480
+ end
481
+
482
+ promise
483
+ end
484
+
485
+ #
486
+ # Implements dedicatedCloudService PATCH method
487
+ #
488
+ # Patch dedicated cloud service's properties
489
+ #
490
+ # @param resource_group_name [String] The name of the resource group
491
+ # @param dedicated_cloud_service_name [String] dedicated cloud service name
492
+ # @param dedicated_cloud_service_request [PatchPayload] Patch Dedicated Cloud
493
+ # Service request
494
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
495
+ # will be added to the HTTP request.
496
+ #
497
+ # @return [DedicatedCloudService] operation results.
498
+ #
499
+ def update(resource_group_name, dedicated_cloud_service_name, dedicated_cloud_service_request, custom_headers:nil)
500
+ response = update_async(resource_group_name, dedicated_cloud_service_name, dedicated_cloud_service_request, custom_headers:custom_headers).value!
501
+ response.body unless response.nil?
502
+ end
503
+
504
+ #
505
+ # Implements dedicatedCloudService PATCH method
506
+ #
507
+ # Patch dedicated cloud service's properties
508
+ #
509
+ # @param resource_group_name [String] The name of the resource group
510
+ # @param dedicated_cloud_service_name [String] dedicated cloud service name
511
+ # @param dedicated_cloud_service_request [PatchPayload] Patch Dedicated Cloud
512
+ # Service request
513
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
514
+ # will be added to the HTTP request.
515
+ #
516
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
517
+ #
518
+ def update_with_http_info(resource_group_name, dedicated_cloud_service_name, dedicated_cloud_service_request, custom_headers:nil)
519
+ update_async(resource_group_name, dedicated_cloud_service_name, dedicated_cloud_service_request, custom_headers:custom_headers).value!
520
+ end
521
+
522
+ #
523
+ # Implements dedicatedCloudService PATCH method
524
+ #
525
+ # Patch dedicated cloud service's properties
526
+ #
527
+ # @param resource_group_name [String] The name of the resource group
528
+ # @param dedicated_cloud_service_name [String] dedicated cloud service name
529
+ # @param dedicated_cloud_service_request [PatchPayload] Patch Dedicated Cloud
530
+ # Service request
531
+ # @param [Hash{String => String}] A hash of custom headers that will be added
532
+ # to the HTTP request.
533
+ #
534
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
535
+ #
536
+ def update_async(resource_group_name, dedicated_cloud_service_name, dedicated_cloud_service_request, custom_headers:nil)
537
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
538
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
539
+ fail ArgumentError, 'dedicated_cloud_service_name is nil' if dedicated_cloud_service_name.nil?
540
+ fail ArgumentError, 'dedicated_cloud_service_request is nil' if dedicated_cloud_service_request.nil?
541
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
542
+
543
+
544
+ request_headers = {}
545
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
546
+
547
+ # Set Headers
548
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
549
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
550
+
551
+ # Serialize Request
552
+ request_mapper = Azure::VMwareCloudSimple::Mgmt::V2019_04_01::Models::PatchPayload.mapper()
553
+ request_content = @client.serialize(request_mapper, dedicated_cloud_service_request)
554
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
555
+
556
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/dedicatedCloudServices/{dedicatedCloudServiceName}'
557
+
558
+ request_url = @base_url || @client.base_url
559
+
560
+ options = {
561
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
562
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'dedicatedCloudServiceName' => dedicated_cloud_service_name},
563
+ query_params: {'api-version' => @client.api_version},
564
+ body: request_content,
565
+ headers: request_headers.merge(custom_headers || {}),
566
+ base_url: request_url
567
+ }
568
+ promise = @client.make_request_async(:patch, path_template, options)
569
+
570
+ promise = promise.then do |result|
571
+ http_response = result.response
572
+ status_code = http_response.status
573
+ response_content = http_response.body
574
+ unless status_code == 200
575
+ error_model = JSON.load(response_content)
576
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
577
+ end
578
+
579
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
580
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
581
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
582
+ # Deserialize Response
583
+ if status_code == 200
584
+ begin
585
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
586
+ result_mapper = Azure::VMwareCloudSimple::Mgmt::V2019_04_01::Models::DedicatedCloudService.mapper()
587
+ result.body = @client.deserialize(result_mapper, parsed_response)
588
+ rescue Exception => e
589
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
590
+ end
591
+ end
592
+
593
+ result
594
+ end
595
+
596
+ promise.execute
597
+ end
598
+
599
+ #
600
+ # Implements dedicatedCloudService DELETE method
601
+ #
602
+ # Delete dedicate cloud service
603
+ #
604
+ # @param resource_group_name [String] The name of the resource group
605
+ # @param dedicated_cloud_service_name [String] dedicated cloud service name
606
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
607
+ # will be added to the HTTP request.
608
+ #
609
+ #
610
+ def begin_delete(resource_group_name, dedicated_cloud_service_name, custom_headers:nil)
611
+ response = begin_delete_async(resource_group_name, dedicated_cloud_service_name, custom_headers:custom_headers).value!
612
+ nil
613
+ end
614
+
615
+ #
616
+ # Implements dedicatedCloudService DELETE method
617
+ #
618
+ # Delete dedicate cloud service
619
+ #
620
+ # @param resource_group_name [String] The name of the resource group
621
+ # @param dedicated_cloud_service_name [String] dedicated cloud service name
622
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
623
+ # will be added to the HTTP request.
624
+ #
625
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
626
+ #
627
+ def begin_delete_with_http_info(resource_group_name, dedicated_cloud_service_name, custom_headers:nil)
628
+ begin_delete_async(resource_group_name, dedicated_cloud_service_name, custom_headers:custom_headers).value!
629
+ end
630
+
631
+ #
632
+ # Implements dedicatedCloudService DELETE method
633
+ #
634
+ # Delete dedicate cloud service
635
+ #
636
+ # @param resource_group_name [String] The name of the resource group
637
+ # @param dedicated_cloud_service_name [String] dedicated cloud service name
638
+ # @param [Hash{String => String}] A hash of custom headers that will be added
639
+ # to the HTTP request.
640
+ #
641
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
642
+ #
643
+ def begin_delete_async(resource_group_name, dedicated_cloud_service_name, custom_headers:nil)
644
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
645
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
646
+ fail ArgumentError, 'dedicated_cloud_service_name is nil' if dedicated_cloud_service_name.nil?
647
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
648
+
649
+
650
+ request_headers = {}
651
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
652
+
653
+ # Set Headers
654
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
655
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
656
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.VMwareCloudSimple/dedicatedCloudServices/{dedicatedCloudServiceName}'
657
+
658
+ request_url = @base_url || @client.base_url
659
+
660
+ options = {
661
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
662
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'dedicatedCloudServiceName' => dedicated_cloud_service_name},
663
+ query_params: {'api-version' => @client.api_version},
664
+ headers: request_headers.merge(custom_headers || {}),
665
+ base_url: request_url
666
+ }
667
+ promise = @client.make_request_async(:delete, path_template, options)
668
+
669
+ promise = promise.then do |result|
670
+ http_response = result.response
671
+ status_code = http_response.status
672
+ response_content = http_response.body
673
+ unless status_code == 204
674
+ error_model = JSON.load(response_content)
675
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
676
+ end
677
+
678
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
679
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
680
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
681
+
682
+ result
683
+ end
684
+
685
+ promise.execute
686
+ end
687
+
688
+ #
689
+ # Implements list of dedicatedCloudService objects within subscription method
690
+ #
691
+ # Returns list of dedicated cloud services within a subscription
692
+ #
693
+ # @param next_page_link [String] The NextLink from the previous successful call
694
+ # to List operation.
695
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
696
+ # will be added to the HTTP request.
697
+ #
698
+ # @return [DedicatedCloudServiceListResponse] operation results.
699
+ #
700
+ def list_by_subscription_next(next_page_link, custom_headers:nil)
701
+ response = list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
702
+ response.body unless response.nil?
703
+ end
704
+
705
+ #
706
+ # Implements list of dedicatedCloudService objects within subscription method
707
+ #
708
+ # Returns list of dedicated cloud services within a subscription
709
+ #
710
+ # @param next_page_link [String] The NextLink from the previous successful call
711
+ # to List operation.
712
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
713
+ # will be added to the HTTP request.
714
+ #
715
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
716
+ #
717
+ def list_by_subscription_next_with_http_info(next_page_link, custom_headers:nil)
718
+ list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
719
+ end
720
+
721
+ #
722
+ # Implements list of dedicatedCloudService objects within subscription method
723
+ #
724
+ # Returns list of dedicated cloud services within a subscription
725
+ #
726
+ # @param next_page_link [String] The NextLink from the previous successful call
727
+ # to List operation.
728
+ # @param [Hash{String => String}] A hash of custom headers that will be added
729
+ # to the HTTP request.
730
+ #
731
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
732
+ #
733
+ def list_by_subscription_next_async(next_page_link, custom_headers:nil)
734
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
735
+
736
+
737
+ request_headers = {}
738
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
739
+
740
+ # Set Headers
741
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
742
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
743
+ path_template = '{nextLink}'
744
+
745
+ request_url = @base_url || @client.base_url
746
+
747
+ options = {
748
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
749
+ skip_encoding_path_params: {'nextLink' => next_page_link},
750
+ headers: request_headers.merge(custom_headers || {}),
751
+ base_url: request_url
752
+ }
753
+ promise = @client.make_request_async(:get, path_template, options)
754
+
755
+ promise = promise.then do |result|
756
+ http_response = result.response
757
+ status_code = http_response.status
758
+ response_content = http_response.body
759
+ unless status_code == 200
760
+ error_model = JSON.load(response_content)
761
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
762
+ end
763
+
764
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
765
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
766
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
767
+ # Deserialize Response
768
+ if status_code == 200
769
+ begin
770
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
771
+ result_mapper = Azure::VMwareCloudSimple::Mgmt::V2019_04_01::Models::DedicatedCloudServiceListResponse.mapper()
772
+ result.body = @client.deserialize(result_mapper, parsed_response)
773
+ rescue Exception => e
774
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
775
+ end
776
+ end
777
+
778
+ result
779
+ end
780
+
781
+ promise.execute
782
+ end
783
+
784
+ #
785
+ # Implements list of dedicatedCloudService objects within RG method
786
+ #
787
+ # Returns list of dedicated cloud services within a resource group
788
+ #
789
+ # @param next_page_link [String] The NextLink from the previous successful call
790
+ # to List operation.
791
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
792
+ # will be added to the HTTP request.
793
+ #
794
+ # @return [DedicatedCloudServiceListResponse] operation results.
795
+ #
796
+ def list_by_resource_group_next(next_page_link, custom_headers:nil)
797
+ response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
798
+ response.body unless response.nil?
799
+ end
800
+
801
+ #
802
+ # Implements list of dedicatedCloudService objects within RG method
803
+ #
804
+ # Returns list of dedicated cloud services within a resource group
805
+ #
806
+ # @param next_page_link [String] The NextLink from the previous successful call
807
+ # to List operation.
808
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
809
+ # will be added to the HTTP request.
810
+ #
811
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
812
+ #
813
+ def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
814
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
815
+ end
816
+
817
+ #
818
+ # Implements list of dedicatedCloudService objects within RG method
819
+ #
820
+ # Returns list of dedicated cloud services within a resource group
821
+ #
822
+ # @param next_page_link [String] The NextLink from the previous successful call
823
+ # to List operation.
824
+ # @param [Hash{String => String}] A hash of custom headers that will be added
825
+ # to the HTTP request.
826
+ #
827
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
828
+ #
829
+ def list_by_resource_group_next_async(next_page_link, custom_headers:nil)
830
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
831
+
832
+
833
+ request_headers = {}
834
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
835
+
836
+ # Set Headers
837
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
838
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
839
+ path_template = '{nextLink}'
840
+
841
+ request_url = @base_url || @client.base_url
842
+
843
+ options = {
844
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
845
+ skip_encoding_path_params: {'nextLink' => next_page_link},
846
+ headers: request_headers.merge(custom_headers || {}),
847
+ base_url: request_url
848
+ }
849
+ promise = @client.make_request_async(:get, path_template, options)
850
+
851
+ promise = promise.then do |result|
852
+ http_response = result.response
853
+ status_code = http_response.status
854
+ response_content = http_response.body
855
+ unless status_code == 200
856
+ error_model = JSON.load(response_content)
857
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
858
+ end
859
+
860
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
861
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
862
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
863
+ # Deserialize Response
864
+ if status_code == 200
865
+ begin
866
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
867
+ result_mapper = Azure::VMwareCloudSimple::Mgmt::V2019_04_01::Models::DedicatedCloudServiceListResponse.mapper()
868
+ result.body = @client.deserialize(result_mapper, parsed_response)
869
+ rescue Exception => e
870
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
871
+ end
872
+ end
873
+
874
+ result
875
+ end
876
+
877
+ promise.execute
878
+ end
879
+
880
+ #
881
+ # Implements list of dedicatedCloudService objects within subscription method
882
+ #
883
+ # Returns list of dedicated cloud services within a subscription
884
+ #
885
+ # @param filter [String] The filter to apply on the list operation
886
+ # @param top [Integer] The maximum number of record sets to return
887
+ # @param skip_token [String] to be used by nextLink implementation
888
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
889
+ # will be added to the HTTP request.
890
+ #
891
+ # @return [DedicatedCloudServiceListResponse] which provide lazy access to
892
+ # pages of the response.
893
+ #
894
+ def list_by_subscription_as_lazy(filter:nil, top:nil, skip_token:nil, custom_headers:nil)
895
+ response = list_by_subscription_async(filter:filter, top:top, skip_token:skip_token, custom_headers:custom_headers).value!
896
+ unless response.nil?
897
+ page = response.body
898
+ page.next_method = Proc.new do |next_page_link|
899
+ list_by_subscription_next_async(next_page_link, custom_headers:custom_headers)
900
+ end
901
+ page
902
+ end
903
+ end
904
+
905
+ #
906
+ # Implements list of dedicatedCloudService objects within RG method
907
+ #
908
+ # Returns list of dedicated cloud services within a resource group
909
+ #
910
+ # @param resource_group_name [String] The name of the resource group
911
+ # @param filter [String] The filter to apply on the list operation
912
+ # @param top [Integer] The maximum number of record sets to return
913
+ # @param skip_token [String] to be used by nextLink implementation
914
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
915
+ # will be added to the HTTP request.
916
+ #
917
+ # @return [DedicatedCloudServiceListResponse] which provide lazy access to
918
+ # pages of the response.
919
+ #
920
+ def list_by_resource_group_as_lazy(resource_group_name, filter:nil, top:nil, skip_token:nil, custom_headers:nil)
921
+ response = list_by_resource_group_async(resource_group_name, filter:filter, top:top, skip_token:skip_token, custom_headers:custom_headers).value!
922
+ unless response.nil?
923
+ page = response.body
924
+ page.next_method = Proc.new do |next_page_link|
925
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
926
+ end
927
+ page
928
+ end
929
+ end
930
+
931
+ end
932
+ end