azure_mgmt_powerbi_dedicated 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 (32) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/2017-10-01/generated/azure_mgmt_powerbi_dedicated.rb +47 -0
  4. data/lib/2017-10-01/generated/azure_mgmt_powerbi_dedicated/capacities.rb +1423 -0
  5. data/lib/2017-10-01/generated/azure_mgmt_powerbi_dedicated/models/check_capacity_name_availability_parameters.rb +64 -0
  6. data/lib/2017-10-01/generated/azure_mgmt_powerbi_dedicated/models/check_capacity_name_availability_result.rb +68 -0
  7. data/lib/2017-10-01/generated/azure_mgmt_powerbi_dedicated/models/dedicated_capacities.rb +56 -0
  8. data/lib/2017-10-01/generated/azure_mgmt_powerbi_dedicated/models/dedicated_capacity.rb +140 -0
  9. data/lib/2017-10-01/generated/azure_mgmt_powerbi_dedicated/models/dedicated_capacity_administrators.rb +54 -0
  10. data/lib/2017-10-01/generated/azure_mgmt_powerbi_dedicated/models/dedicated_capacity_update_parameters.rb +80 -0
  11. data/lib/2017-10-01/generated/azure_mgmt_powerbi_dedicated/models/error_response.rb +57 -0
  12. data/lib/2017-10-01/generated/azure_mgmt_powerbi_dedicated/models/operation.rb +59 -0
  13. data/lib/2017-10-01/generated/azure_mgmt_powerbi_dedicated/models/operation_display.rb +72 -0
  14. data/lib/2017-10-01/generated/azure_mgmt_powerbi_dedicated/models/operation_list_result.rb +103 -0
  15. data/lib/2017-10-01/generated/azure_mgmt_powerbi_dedicated/models/provisioning_state.rb +26 -0
  16. data/lib/2017-10-01/generated/azure_mgmt_powerbi_dedicated/models/resource.rb +124 -0
  17. data/lib/2017-10-01/generated/azure_mgmt_powerbi_dedicated/models/resource_sku.rb +59 -0
  18. data/lib/2017-10-01/generated/azure_mgmt_powerbi_dedicated/models/sku_details_for_existing_resource.rb +47 -0
  19. data/lib/2017-10-01/generated/azure_mgmt_powerbi_dedicated/models/sku_enumeration_for_existing_resource_result.rb +56 -0
  20. data/lib/2017-10-01/generated/azure_mgmt_powerbi_dedicated/models/sku_enumeration_for_new_resource_result.rb +56 -0
  21. data/lib/2017-10-01/generated/azure_mgmt_powerbi_dedicated/models/sku_tier.rb +15 -0
  22. data/lib/2017-10-01/generated/azure_mgmt_powerbi_dedicated/models/state.rb +26 -0
  23. data/lib/2017-10-01/generated/azure_mgmt_powerbi_dedicated/module_definition.rb +9 -0
  24. data/lib/2017-10-01/generated/azure_mgmt_powerbi_dedicated/operations.rb +221 -0
  25. data/lib/2017-10-01/generated/azure_mgmt_powerbi_dedicated/power_bidedicated_management_client.rb +136 -0
  26. data/lib/azure_mgmt_powerbi_dedicated.rb +6 -0
  27. data/lib/module_definition.rb +7 -0
  28. data/lib/profiles/latest/modules/powerbidedicated_profile_module.rb +135 -0
  29. data/lib/profiles/latest/powerbidedicated_latest_profile_client.rb +40 -0
  30. data/lib/profiles/latest/powerbidedicated_module_definition.rb +8 -0
  31. data/lib/version.rb +7 -0
  32. metadata +147 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 550beb4f2bc8fbd17f1175ad947db167bf91be0be95a648b76cbcd1b43965510
4
+ data.tar.gz: b91c57ed87fd6278856145c1b0eca49d0e62e02146df9c0e9add38c515edabc0
5
+ SHA512:
6
+ metadata.gz: d1d76e51598234d403100cd62c14326813a2bc5f234b585d2b46b82c294c792e4b2af210f9bc01a435f1fea4fc5feccbaf1ad0cab4d27b998dd5292fdec02256
7
+ data.tar.gz: b98b82f71f6a19eec594eedf01afd0295e4c9279e51af804da76b1301a9dded03b17dc20b4fb15c92e7e5f6e14cbf9b5bddca4692a8d9cdfb7bd4ee436b1cb30
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Microsoft Corporation
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,47 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ require 'uri'
7
+ require 'cgi'
8
+ require 'date'
9
+ require 'json'
10
+ require 'base64'
11
+ require 'erb'
12
+ require 'securerandom'
13
+ require 'time'
14
+ require 'timeliness'
15
+ require 'faraday'
16
+ require 'faraday-cookie_jar'
17
+ require 'concurrent'
18
+ require 'ms_rest'
19
+ require '2017-10-01/generated/azure_mgmt_powerbi_dedicated/module_definition'
20
+ require 'ms_rest_azure'
21
+
22
+ module Azure::PowerBiDedicated::Mgmt::V2017_10_01
23
+ autoload :Capacities, '2017-10-01/generated/azure_mgmt_powerbi_dedicated/capacities.rb'
24
+ autoload :Operations, '2017-10-01/generated/azure_mgmt_powerbi_dedicated/operations.rb'
25
+ autoload :PowerBIDedicatedManagementClient, '2017-10-01/generated/azure_mgmt_powerbi_dedicated/power_bidedicated_management_client.rb'
26
+
27
+ module Models
28
+ autoload :DedicatedCapacityAdministrators, '2017-10-01/generated/azure_mgmt_powerbi_dedicated/models/dedicated_capacity_administrators.rb'
29
+ autoload :DedicatedCapacityUpdateParameters, '2017-10-01/generated/azure_mgmt_powerbi_dedicated/models/dedicated_capacity_update_parameters.rb'
30
+ autoload :Operation, '2017-10-01/generated/azure_mgmt_powerbi_dedicated/models/operation.rb'
31
+ autoload :SkuEnumerationForNewResourceResult, '2017-10-01/generated/azure_mgmt_powerbi_dedicated/models/sku_enumeration_for_new_resource_result.rb'
32
+ autoload :ResourceSku, '2017-10-01/generated/azure_mgmt_powerbi_dedicated/models/resource_sku.rb'
33
+ autoload :SkuDetailsForExistingResource, '2017-10-01/generated/azure_mgmt_powerbi_dedicated/models/sku_details_for_existing_resource.rb'
34
+ autoload :DedicatedCapacities, '2017-10-01/generated/azure_mgmt_powerbi_dedicated/models/dedicated_capacities.rb'
35
+ autoload :SkuEnumerationForExistingResourceResult, '2017-10-01/generated/azure_mgmt_powerbi_dedicated/models/sku_enumeration_for_existing_resource_result.rb'
36
+ autoload :OperationListResult, '2017-10-01/generated/azure_mgmt_powerbi_dedicated/models/operation_list_result.rb'
37
+ autoload :ErrorResponse, '2017-10-01/generated/azure_mgmt_powerbi_dedicated/models/error_response.rb'
38
+ autoload :OperationDisplay, '2017-10-01/generated/azure_mgmt_powerbi_dedicated/models/operation_display.rb'
39
+ autoload :CheckCapacityNameAvailabilityParameters, '2017-10-01/generated/azure_mgmt_powerbi_dedicated/models/check_capacity_name_availability_parameters.rb'
40
+ autoload :Resource, '2017-10-01/generated/azure_mgmt_powerbi_dedicated/models/resource.rb'
41
+ autoload :CheckCapacityNameAvailabilityResult, '2017-10-01/generated/azure_mgmt_powerbi_dedicated/models/check_capacity_name_availability_result.rb'
42
+ autoload :DedicatedCapacity, '2017-10-01/generated/azure_mgmt_powerbi_dedicated/models/dedicated_capacity.rb'
43
+ autoload :SkuTier, '2017-10-01/generated/azure_mgmt_powerbi_dedicated/models/sku_tier.rb'
44
+ autoload :State, '2017-10-01/generated/azure_mgmt_powerbi_dedicated/models/state.rb'
45
+ autoload :ProvisioningState, '2017-10-01/generated/azure_mgmt_powerbi_dedicated/models/provisioning_state.rb'
46
+ end
47
+ end
@@ -0,0 +1,1423 @@
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::PowerBiDedicated::Mgmt::V2017_10_01
7
+ #
8
+ # PowerBI Dedicated Web API provides a RESTful set of web services that
9
+ # enables users to create, retrieve, update, and delete Power BI dedicated
10
+ # capacities
11
+ #
12
+ class Capacities
13
+ include MsRestAzure
14
+
15
+ #
16
+ # Creates and initializes a new instance of the Capacities class.
17
+ # @param client service class for accessing basic functionality.
18
+ #
19
+ def initialize(client)
20
+ @client = client
21
+ end
22
+
23
+ # @return [PowerBIDedicatedManagementClient] reference to the PowerBIDedicatedManagementClient
24
+ attr_reader :client
25
+
26
+ #
27
+ # Gets details about the specified dedicated capacity.
28
+ #
29
+ # @param resource_group_name [String] The name of the Azure Resource group of
30
+ # which a given PowerBIDedicated capacity is part. This name must be at least 1
31
+ # character in length, and no more than 90.
32
+ # @param dedicated_capacity_name [String] The name of the dedicated capacity.
33
+ # It must be a minimum of 3 characters, and a maximum of 63.
34
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
35
+ # will be added to the HTTP request.
36
+ #
37
+ # @return [DedicatedCapacity] operation results.
38
+ #
39
+ def get_details(resource_group_name, dedicated_capacity_name, custom_headers:nil)
40
+ response = get_details_async(resource_group_name, dedicated_capacity_name, custom_headers:custom_headers).value!
41
+ response.body unless response.nil?
42
+ end
43
+
44
+ #
45
+ # Gets details about the specified dedicated capacity.
46
+ #
47
+ # @param resource_group_name [String] The name of the Azure Resource group of
48
+ # which a given PowerBIDedicated capacity is part. This name must be at least 1
49
+ # character in length, and no more than 90.
50
+ # @param dedicated_capacity_name [String] The name of the dedicated capacity.
51
+ # It must be a minimum of 3 characters, and a maximum of 63.
52
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
53
+ # will be added to the HTTP request.
54
+ #
55
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
56
+ #
57
+ def get_details_with_http_info(resource_group_name, dedicated_capacity_name, custom_headers:nil)
58
+ get_details_async(resource_group_name, dedicated_capacity_name, custom_headers:custom_headers).value!
59
+ end
60
+
61
+ #
62
+ # Gets details about the specified dedicated capacity.
63
+ #
64
+ # @param resource_group_name [String] The name of the Azure Resource group of
65
+ # which a given PowerBIDedicated capacity is part. This name must be at least 1
66
+ # character in length, and no more than 90.
67
+ # @param dedicated_capacity_name [String] The name of the dedicated capacity.
68
+ # It must be a minimum of 3 characters, and a maximum of 63.
69
+ # @param [Hash{String => String}] A hash of custom headers that will be added
70
+ # to the HTTP request.
71
+ #
72
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
73
+ #
74
+ def get_details_async(resource_group_name, dedicated_capacity_name, custom_headers: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, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
79
+ fail ArgumentError, 'dedicated_capacity_name is nil' if dedicated_capacity_name.nil?
80
+ fail ArgumentError, "'dedicated_capacity_name' should satisfy the constraint - 'MaxLength': '63'" if !dedicated_capacity_name.nil? && dedicated_capacity_name.length > 63
81
+ fail ArgumentError, "'dedicated_capacity_name' should satisfy the constraint - 'MinLength': '3'" if !dedicated_capacity_name.nil? && dedicated_capacity_name.length < 3
82
+ fail ArgumentError, "'dedicated_capacity_name' should satisfy the constraint - 'Pattern': '^[a-z][a-z0-9]*$'" if !dedicated_capacity_name.nil? && dedicated_capacity_name.match(Regexp.new('^^[a-z][a-z0-9]*$$')).nil?
83
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
84
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
85
+
86
+
87
+ request_headers = {}
88
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
89
+
90
+ # Set Headers
91
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
92
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
93
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/capacities/{dedicatedCapacityName}'
94
+
95
+ request_url = @base_url || @client.base_url
96
+
97
+ options = {
98
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
99
+ path_params: {'resourceGroupName' => resource_group_name,'dedicatedCapacityName' => dedicated_capacity_name,'subscriptionId' => @client.subscription_id},
100
+ query_params: {'api-version' => @client.api_version},
101
+ headers: request_headers.merge(custom_headers || {}),
102
+ base_url: request_url
103
+ }
104
+ promise = @client.make_request_async(:get, path_template, options)
105
+
106
+ promise = promise.then do |result|
107
+ http_response = result.response
108
+ status_code = http_response.status
109
+ response_content = http_response.body
110
+ unless status_code == 200
111
+ error_model = JSON.load(response_content)
112
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
113
+ end
114
+
115
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
116
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
117
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
118
+ # Deserialize Response
119
+ if status_code == 200
120
+ begin
121
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
122
+ result_mapper = Azure::PowerBiDedicated::Mgmt::V2017_10_01::Models::DedicatedCapacity.mapper()
123
+ result.body = @client.deserialize(result_mapper, parsed_response)
124
+ rescue Exception => e
125
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
126
+ end
127
+ end
128
+
129
+ result
130
+ end
131
+
132
+ promise.execute
133
+ end
134
+
135
+ #
136
+ # Provisions the specified Dedicated capacity based on the configuration
137
+ # specified in the request.
138
+ #
139
+ # @param resource_group_name [String] The name of the Azure Resource group of
140
+ # which a given PowerBIDedicated capacity is part. This name must be at least 1
141
+ # character in length, and no more than 90.
142
+ # @param dedicated_capacity_name [String] The name of the Dedicated capacity.
143
+ # It must be a minimum of 3 characters, and a maximum of 63.
144
+ # @param capacity_parameters [DedicatedCapacity] Contains the information used
145
+ # to provision the Dedicated capacity.
146
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
147
+ # will be added to the HTTP request.
148
+ #
149
+ # @return [DedicatedCapacity] operation results.
150
+ #
151
+ def create(resource_group_name, dedicated_capacity_name, capacity_parameters, custom_headers:nil)
152
+ response = create_async(resource_group_name, dedicated_capacity_name, capacity_parameters, custom_headers:custom_headers).value!
153
+ response.body unless response.nil?
154
+ end
155
+
156
+ #
157
+ # @param resource_group_name [String] The name of the Azure Resource group of
158
+ # which a given PowerBIDedicated capacity is part. This name must be at least 1
159
+ # character in length, and no more than 90.
160
+ # @param dedicated_capacity_name [String] The name of the Dedicated capacity.
161
+ # It must be a minimum of 3 characters, and a maximum of 63.
162
+ # @param capacity_parameters [DedicatedCapacity] Contains the information used
163
+ # to provision the Dedicated capacity.
164
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
165
+ # will be added to the HTTP request.
166
+ #
167
+ # @return [Concurrent::Promise] promise which provides async access to http
168
+ # response.
169
+ #
170
+ def create_async(resource_group_name, dedicated_capacity_name, capacity_parameters, custom_headers:nil)
171
+ # Send request
172
+ promise = begin_create_async(resource_group_name, dedicated_capacity_name, capacity_parameters, custom_headers:custom_headers)
173
+
174
+ promise = promise.then do |response|
175
+ # Defining deserialization method.
176
+ deserialize_method = lambda do |parsed_response|
177
+ result_mapper = Azure::PowerBiDedicated::Mgmt::V2017_10_01::Models::DedicatedCapacity.mapper()
178
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
179
+ end
180
+
181
+ # Waiting for response.
182
+ @client.get_long_running_operation_result(response, deserialize_method)
183
+ end
184
+
185
+ promise
186
+ end
187
+
188
+ #
189
+ # Deletes the specified Dedicated capacity.
190
+ #
191
+ # @param resource_group_name [String] The name of the Azure Resource group of
192
+ # which a given PowerBIDedicated capacity is part. This name must be at least 1
193
+ # character in length, and no more than 90.
194
+ # @param dedicated_capacity_name [String] The name of the Dedicated capacity.
195
+ # It must be at least 3 characters in length, and no more than 63.
196
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
197
+ # will be added to the HTTP request.
198
+ #
199
+ def delete(resource_group_name, dedicated_capacity_name, custom_headers:nil)
200
+ response = delete_async(resource_group_name, dedicated_capacity_name, custom_headers:custom_headers).value!
201
+ nil
202
+ end
203
+
204
+ #
205
+ # @param resource_group_name [String] The name of the Azure Resource group of
206
+ # which a given PowerBIDedicated capacity is part. This name must be at least 1
207
+ # character in length, and no more than 90.
208
+ # @param dedicated_capacity_name [String] The name of the Dedicated capacity.
209
+ # It must be at least 3 characters in length, and no more than 63.
210
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
211
+ # will be added to the HTTP request.
212
+ #
213
+ # @return [Concurrent::Promise] promise which provides async access to http
214
+ # response.
215
+ #
216
+ def delete_async(resource_group_name, dedicated_capacity_name, custom_headers:nil)
217
+ # Send request
218
+ promise = begin_delete_async(resource_group_name, dedicated_capacity_name, custom_headers:custom_headers)
219
+
220
+ promise = promise.then do |response|
221
+ # Defining deserialization method.
222
+ deserialize_method = lambda do |parsed_response|
223
+ end
224
+
225
+ # Waiting for response.
226
+ @client.get_long_running_operation_result(response, deserialize_method)
227
+ end
228
+
229
+ promise
230
+ end
231
+
232
+ #
233
+ # Updates the current state of the specified Dedicated capacity.
234
+ #
235
+ # @param resource_group_name [String] The name of the Azure Resource group of
236
+ # which a given PowerBIDedicated capacity is part. This name must be at least 1
237
+ # character in length, and no more than 90.
238
+ # @param dedicated_capacity_name [String] The name of the Dedicated capacity.
239
+ # It must be at least 3 characters in length, and no more than 63.
240
+ # @param capacity_update_parameters [DedicatedCapacityUpdateParameters] Request
241
+ # object that contains the updated information for the capacity.
242
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
243
+ # will be added to the HTTP request.
244
+ #
245
+ # @return [DedicatedCapacity] operation results.
246
+ #
247
+ def update(resource_group_name, dedicated_capacity_name, capacity_update_parameters, custom_headers:nil)
248
+ response = update_async(resource_group_name, dedicated_capacity_name, capacity_update_parameters, custom_headers:custom_headers).value!
249
+ response.body unless response.nil?
250
+ end
251
+
252
+ #
253
+ # @param resource_group_name [String] The name of the Azure Resource group of
254
+ # which a given PowerBIDedicated capacity is part. This name must be at least 1
255
+ # character in length, and no more than 90.
256
+ # @param dedicated_capacity_name [String] The name of the Dedicated capacity.
257
+ # It must be at least 3 characters in length, and no more than 63.
258
+ # @param capacity_update_parameters [DedicatedCapacityUpdateParameters] Request
259
+ # object that contains the updated information for the capacity.
260
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
261
+ # will be added to the HTTP request.
262
+ #
263
+ # @return [Concurrent::Promise] promise which provides async access to http
264
+ # response.
265
+ #
266
+ def update_async(resource_group_name, dedicated_capacity_name, capacity_update_parameters, custom_headers:nil)
267
+ # Send request
268
+ promise = begin_update_async(resource_group_name, dedicated_capacity_name, capacity_update_parameters, custom_headers:custom_headers)
269
+
270
+ promise = promise.then do |response|
271
+ # Defining deserialization method.
272
+ deserialize_method = lambda do |parsed_response|
273
+ result_mapper = Azure::PowerBiDedicated::Mgmt::V2017_10_01::Models::DedicatedCapacity.mapper()
274
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
275
+ end
276
+
277
+ # Waiting for response.
278
+ @client.get_long_running_operation_result(response, deserialize_method)
279
+ end
280
+
281
+ promise
282
+ end
283
+
284
+ #
285
+ # Suspends operation of the specified dedicated capacity instance.
286
+ #
287
+ # @param resource_group_name [String] The name of the Azure Resource group of
288
+ # which a given PowerBIDedicated capacity is part. This name must be at least 1
289
+ # character in length, and no more than 90.
290
+ # @param dedicated_capacity_name [String] The name of the Dedicated capacity.
291
+ # It must be at least 3 characters in length, and no more than 63.
292
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
293
+ # will be added to the HTTP request.
294
+ #
295
+ def suspend(resource_group_name, dedicated_capacity_name, custom_headers:nil)
296
+ response = suspend_async(resource_group_name, dedicated_capacity_name, custom_headers:custom_headers).value!
297
+ nil
298
+ end
299
+
300
+ #
301
+ # @param resource_group_name [String] The name of the Azure Resource group of
302
+ # which a given PowerBIDedicated capacity is part. This name must be at least 1
303
+ # character in length, and no more than 90.
304
+ # @param dedicated_capacity_name [String] The name of the Dedicated capacity.
305
+ # It must be at least 3 characters in length, and no more than 63.
306
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
307
+ # will be added to the HTTP request.
308
+ #
309
+ # @return [Concurrent::Promise] promise which provides async access to http
310
+ # response.
311
+ #
312
+ def suspend_async(resource_group_name, dedicated_capacity_name, custom_headers:nil)
313
+ # Send request
314
+ promise = begin_suspend_async(resource_group_name, dedicated_capacity_name, custom_headers:custom_headers)
315
+
316
+ promise = promise.then do |response|
317
+ # Defining deserialization method.
318
+ deserialize_method = lambda do |parsed_response|
319
+ end
320
+
321
+ # Waiting for response.
322
+ @client.get_long_running_operation_result(response, deserialize_method)
323
+ end
324
+
325
+ promise
326
+ end
327
+
328
+ #
329
+ # Resumes operation of the specified Dedicated capacity instance.
330
+ #
331
+ # @param resource_group_name [String] The name of the Azure Resource group of
332
+ # which a given PowerBIDedicated capacity is part. This name must be at least 1
333
+ # character in length, and no more than 90.
334
+ # @param dedicated_capacity_name [String] The name of the Dedicated capacity.
335
+ # It must be at least 3 characters in length, and no more than 63.
336
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
337
+ # will be added to the HTTP request.
338
+ #
339
+ def resume(resource_group_name, dedicated_capacity_name, custom_headers:nil)
340
+ response = resume_async(resource_group_name, dedicated_capacity_name, custom_headers:custom_headers).value!
341
+ nil
342
+ end
343
+
344
+ #
345
+ # @param resource_group_name [String] The name of the Azure Resource group of
346
+ # which a given PowerBIDedicated capacity is part. This name must be at least 1
347
+ # character in length, and no more than 90.
348
+ # @param dedicated_capacity_name [String] The name of the Dedicated capacity.
349
+ # It must be at least 3 characters in length, and no more than 63.
350
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
351
+ # will be added to the HTTP request.
352
+ #
353
+ # @return [Concurrent::Promise] promise which provides async access to http
354
+ # response.
355
+ #
356
+ def resume_async(resource_group_name, dedicated_capacity_name, custom_headers:nil)
357
+ # Send request
358
+ promise = begin_resume_async(resource_group_name, dedicated_capacity_name, custom_headers:custom_headers)
359
+
360
+ promise = promise.then do |response|
361
+ # Defining deserialization method.
362
+ deserialize_method = lambda do |parsed_response|
363
+ end
364
+
365
+ # Waiting for response.
366
+ @client.get_long_running_operation_result(response, deserialize_method)
367
+ end
368
+
369
+ promise
370
+ end
371
+
372
+ #
373
+ # Gets all the Dedicated capacities for the given resource group.
374
+ #
375
+ # @param resource_group_name [String] The name of the Azure Resource group of
376
+ # which a given PowerBIDedicated capacity is part. This name must be at least 1
377
+ # character in length, and no more than 90.
378
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
379
+ # will be added to the HTTP request.
380
+ #
381
+ # @return [DedicatedCapacities] operation results.
382
+ #
383
+ def list_by_resource_group(resource_group_name, custom_headers:nil)
384
+ response = list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
385
+ response.body unless response.nil?
386
+ end
387
+
388
+ #
389
+ # Gets all the Dedicated capacities for the given resource group.
390
+ #
391
+ # @param resource_group_name [String] The name of the Azure Resource group of
392
+ # which a given PowerBIDedicated capacity is part. This name must be at least 1
393
+ # character in length, and no more than 90.
394
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
395
+ # will be added to the HTTP request.
396
+ #
397
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
398
+ #
399
+ def list_by_resource_group_with_http_info(resource_group_name, custom_headers:nil)
400
+ list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
401
+ end
402
+
403
+ #
404
+ # Gets all the Dedicated capacities for the given resource group.
405
+ #
406
+ # @param resource_group_name [String] The name of the Azure Resource group of
407
+ # which a given PowerBIDedicated capacity is part. This name must be at least 1
408
+ # character in length, and no more than 90.
409
+ # @param [Hash{String => String}] A hash of custom headers that will be added
410
+ # to the HTTP request.
411
+ #
412
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
413
+ #
414
+ def list_by_resource_group_async(resource_group_name, custom_headers:nil)
415
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
416
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
417
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
418
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
419
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
420
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
421
+
422
+
423
+ request_headers = {}
424
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
425
+
426
+ # Set Headers
427
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
428
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
429
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/capacities'
430
+
431
+ request_url = @base_url || @client.base_url
432
+
433
+ options = {
434
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
435
+ path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
436
+ query_params: {'api-version' => @client.api_version},
437
+ headers: request_headers.merge(custom_headers || {}),
438
+ base_url: request_url
439
+ }
440
+ promise = @client.make_request_async(:get, path_template, options)
441
+
442
+ promise = promise.then do |result|
443
+ http_response = result.response
444
+ status_code = http_response.status
445
+ response_content = http_response.body
446
+ unless status_code == 200
447
+ error_model = JSON.load(response_content)
448
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
449
+ end
450
+
451
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
452
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
453
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
454
+ # Deserialize Response
455
+ if status_code == 200
456
+ begin
457
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
458
+ result_mapper = Azure::PowerBiDedicated::Mgmt::V2017_10_01::Models::DedicatedCapacities.mapper()
459
+ result.body = @client.deserialize(result_mapper, parsed_response)
460
+ rescue Exception => e
461
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
462
+ end
463
+ end
464
+
465
+ result
466
+ end
467
+
468
+ promise.execute
469
+ end
470
+
471
+ #
472
+ # Lists all the Dedicated capacities for the given subscription.
473
+ #
474
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
475
+ # will be added to the HTTP request.
476
+ #
477
+ # @return [DedicatedCapacities] operation results.
478
+ #
479
+ def list(custom_headers:nil)
480
+ response = list_async(custom_headers:custom_headers).value!
481
+ response.body unless response.nil?
482
+ end
483
+
484
+ #
485
+ # Lists all the Dedicated capacities for the given subscription.
486
+ #
487
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
488
+ # will be added to the HTTP request.
489
+ #
490
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
491
+ #
492
+ def list_with_http_info(custom_headers:nil)
493
+ list_async(custom_headers:custom_headers).value!
494
+ end
495
+
496
+ #
497
+ # Lists all the Dedicated capacities for the given subscription.
498
+ #
499
+ # @param [Hash{String => String}] A hash of custom headers that will be added
500
+ # to the HTTP request.
501
+ #
502
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
503
+ #
504
+ def list_async(custom_headers:nil)
505
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
506
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
507
+
508
+
509
+ request_headers = {}
510
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
511
+
512
+ # Set Headers
513
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
514
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
515
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.PowerBIDedicated/capacities'
516
+
517
+ request_url = @base_url || @client.base_url
518
+
519
+ options = {
520
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
521
+ path_params: {'subscriptionId' => @client.subscription_id},
522
+ query_params: {'api-version' => @client.api_version},
523
+ headers: request_headers.merge(custom_headers || {}),
524
+ base_url: request_url
525
+ }
526
+ promise = @client.make_request_async(:get, path_template, options)
527
+
528
+ promise = promise.then do |result|
529
+ http_response = result.response
530
+ status_code = http_response.status
531
+ response_content = http_response.body
532
+ unless status_code == 200
533
+ error_model = JSON.load(response_content)
534
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
535
+ end
536
+
537
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
538
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
539
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
540
+ # Deserialize Response
541
+ if status_code == 200
542
+ begin
543
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
544
+ result_mapper = Azure::PowerBiDedicated::Mgmt::V2017_10_01::Models::DedicatedCapacities.mapper()
545
+ result.body = @client.deserialize(result_mapper, parsed_response)
546
+ rescue Exception => e
547
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
548
+ end
549
+ end
550
+
551
+ result
552
+ end
553
+
554
+ promise.execute
555
+ end
556
+
557
+ #
558
+ # Lists eligible SKUs for PowerBI Dedicated resource provider.
559
+ #
560
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
561
+ # will be added to the HTTP request.
562
+ #
563
+ # @return [SkuEnumerationForNewResourceResult] operation results.
564
+ #
565
+ def list_skus(custom_headers:nil)
566
+ response = list_skus_async(custom_headers:custom_headers).value!
567
+ response.body unless response.nil?
568
+ end
569
+
570
+ #
571
+ # Lists eligible SKUs for PowerBI Dedicated resource provider.
572
+ #
573
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
574
+ # will be added to the HTTP request.
575
+ #
576
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
577
+ #
578
+ def list_skus_with_http_info(custom_headers:nil)
579
+ list_skus_async(custom_headers:custom_headers).value!
580
+ end
581
+
582
+ #
583
+ # Lists eligible SKUs for PowerBI Dedicated resource provider.
584
+ #
585
+ # @param [Hash{String => String}] A hash of custom headers that will be added
586
+ # to the HTTP request.
587
+ #
588
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
589
+ #
590
+ def list_skus_async(custom_headers:nil)
591
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
592
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
593
+
594
+
595
+ request_headers = {}
596
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
597
+
598
+ # Set Headers
599
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
600
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
601
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.PowerBIDedicated/skus'
602
+
603
+ request_url = @base_url || @client.base_url
604
+
605
+ options = {
606
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
607
+ path_params: {'subscriptionId' => @client.subscription_id},
608
+ query_params: {'api-version' => @client.api_version},
609
+ headers: request_headers.merge(custom_headers || {}),
610
+ base_url: request_url
611
+ }
612
+ promise = @client.make_request_async(:get, path_template, options)
613
+
614
+ promise = promise.then do |result|
615
+ http_response = result.response
616
+ status_code = http_response.status
617
+ response_content = http_response.body
618
+ unless status_code == 200
619
+ error_model = JSON.load(response_content)
620
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
621
+ end
622
+
623
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
624
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
625
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
626
+ # Deserialize Response
627
+ if status_code == 200
628
+ begin
629
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
630
+ result_mapper = Azure::PowerBiDedicated::Mgmt::V2017_10_01::Models::SkuEnumerationForNewResourceResult.mapper()
631
+ result.body = @client.deserialize(result_mapper, parsed_response)
632
+ rescue Exception => e
633
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
634
+ end
635
+ end
636
+
637
+ result
638
+ end
639
+
640
+ promise.execute
641
+ end
642
+
643
+ #
644
+ # Lists eligible SKUs for a PowerBI Dedicated resource.
645
+ #
646
+ # @param resource_group_name [String] The name of the Azure Resource group of
647
+ # which a given PowerBIDedicated capacity is part. This name must be at least 1
648
+ # character in length, and no more than 90.
649
+ # @param dedicated_capacity_name [String] The name of the Dedicated capacity.
650
+ # It must be at least 3 characters in length, and no more than 63.
651
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
652
+ # will be added to the HTTP request.
653
+ #
654
+ # @return [SkuEnumerationForExistingResourceResult] operation results.
655
+ #
656
+ def list_skus_for_capacity(resource_group_name, dedicated_capacity_name, custom_headers:nil)
657
+ response = list_skus_for_capacity_async(resource_group_name, dedicated_capacity_name, custom_headers:custom_headers).value!
658
+ response.body unless response.nil?
659
+ end
660
+
661
+ #
662
+ # Lists eligible SKUs for a PowerBI Dedicated resource.
663
+ #
664
+ # @param resource_group_name [String] The name of the Azure Resource group of
665
+ # which a given PowerBIDedicated capacity is part. This name must be at least 1
666
+ # character in length, and no more than 90.
667
+ # @param dedicated_capacity_name [String] The name of the Dedicated capacity.
668
+ # It must be at least 3 characters in length, and no more than 63.
669
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
670
+ # will be added to the HTTP request.
671
+ #
672
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
673
+ #
674
+ def list_skus_for_capacity_with_http_info(resource_group_name, dedicated_capacity_name, custom_headers:nil)
675
+ list_skus_for_capacity_async(resource_group_name, dedicated_capacity_name, custom_headers:custom_headers).value!
676
+ end
677
+
678
+ #
679
+ # Lists eligible SKUs for a PowerBI Dedicated resource.
680
+ #
681
+ # @param resource_group_name [String] The name of the Azure Resource group of
682
+ # which a given PowerBIDedicated capacity is part. This name must be at least 1
683
+ # character in length, and no more than 90.
684
+ # @param dedicated_capacity_name [String] The name of the Dedicated capacity.
685
+ # It must be at least 3 characters in length, and no more than 63.
686
+ # @param [Hash{String => String}] A hash of custom headers that will be added
687
+ # to the HTTP request.
688
+ #
689
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
690
+ #
691
+ def list_skus_for_capacity_async(resource_group_name, dedicated_capacity_name, custom_headers:nil)
692
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
693
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
694
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
695
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
696
+ fail ArgumentError, 'dedicated_capacity_name is nil' if dedicated_capacity_name.nil?
697
+ fail ArgumentError, "'dedicated_capacity_name' should satisfy the constraint - 'MaxLength': '63'" if !dedicated_capacity_name.nil? && dedicated_capacity_name.length > 63
698
+ fail ArgumentError, "'dedicated_capacity_name' should satisfy the constraint - 'MinLength': '3'" if !dedicated_capacity_name.nil? && dedicated_capacity_name.length < 3
699
+ fail ArgumentError, "'dedicated_capacity_name' should satisfy the constraint - 'Pattern': '^[a-z][a-z0-9]*$'" if !dedicated_capacity_name.nil? && dedicated_capacity_name.match(Regexp.new('^^[a-z][a-z0-9]*$$')).nil?
700
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
701
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
702
+
703
+
704
+ request_headers = {}
705
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
706
+
707
+ # Set Headers
708
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
709
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
710
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/capacities/{dedicatedCapacityName}/skus'
711
+
712
+ request_url = @base_url || @client.base_url
713
+
714
+ options = {
715
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
716
+ path_params: {'resourceGroupName' => resource_group_name,'dedicatedCapacityName' => dedicated_capacity_name,'subscriptionId' => @client.subscription_id},
717
+ query_params: {'api-version' => @client.api_version},
718
+ headers: request_headers.merge(custom_headers || {}),
719
+ base_url: request_url
720
+ }
721
+ promise = @client.make_request_async(:get, path_template, options)
722
+
723
+ promise = promise.then do |result|
724
+ http_response = result.response
725
+ status_code = http_response.status
726
+ response_content = http_response.body
727
+ unless status_code == 200
728
+ error_model = JSON.load(response_content)
729
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
730
+ end
731
+
732
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
733
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
734
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
735
+ # Deserialize Response
736
+ if status_code == 200
737
+ begin
738
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
739
+ result_mapper = Azure::PowerBiDedicated::Mgmt::V2017_10_01::Models::SkuEnumerationForExistingResourceResult.mapper()
740
+ result.body = @client.deserialize(result_mapper, parsed_response)
741
+ rescue Exception => e
742
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
743
+ end
744
+ end
745
+
746
+ result
747
+ end
748
+
749
+ promise.execute
750
+ end
751
+
752
+ #
753
+ # Check the name availability in the target location.
754
+ #
755
+ # @param location [String] The region name which the operation will lookup
756
+ # into.
757
+ # @param capacity_parameters [CheckCapacityNameAvailabilityParameters] The name
758
+ # of the capacity.
759
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
760
+ # will be added to the HTTP request.
761
+ #
762
+ # @return [CheckCapacityNameAvailabilityResult] operation results.
763
+ #
764
+ def check_name_availability(location, capacity_parameters, custom_headers:nil)
765
+ response = check_name_availability_async(location, capacity_parameters, custom_headers:custom_headers).value!
766
+ response.body unless response.nil?
767
+ end
768
+
769
+ #
770
+ # Check the name availability in the target location.
771
+ #
772
+ # @param location [String] The region name which the operation will lookup
773
+ # into.
774
+ # @param capacity_parameters [CheckCapacityNameAvailabilityParameters] The name
775
+ # of the capacity.
776
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
777
+ # will be added to the HTTP request.
778
+ #
779
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
780
+ #
781
+ def check_name_availability_with_http_info(location, capacity_parameters, custom_headers:nil)
782
+ check_name_availability_async(location, capacity_parameters, custom_headers:custom_headers).value!
783
+ end
784
+
785
+ #
786
+ # Check the name availability in the target location.
787
+ #
788
+ # @param location [String] The region name which the operation will lookup
789
+ # into.
790
+ # @param capacity_parameters [CheckCapacityNameAvailabilityParameters] The name
791
+ # of the capacity.
792
+ # @param [Hash{String => String}] A hash of custom headers that will be added
793
+ # to the HTTP request.
794
+ #
795
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
796
+ #
797
+ def check_name_availability_async(location, capacity_parameters, custom_headers:nil)
798
+ fail ArgumentError, 'location is nil' if location.nil?
799
+ fail ArgumentError, 'capacity_parameters is nil' if capacity_parameters.nil?
800
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
801
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
802
+
803
+
804
+ request_headers = {}
805
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
806
+
807
+ # Set Headers
808
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
809
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
810
+
811
+ # Serialize Request
812
+ request_mapper = Azure::PowerBiDedicated::Mgmt::V2017_10_01::Models::CheckCapacityNameAvailabilityParameters.mapper()
813
+ request_content = @client.serialize(request_mapper, capacity_parameters)
814
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
815
+
816
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.PowerBIDedicated/locations/{location}/checkNameAvailability'
817
+
818
+ request_url = @base_url || @client.base_url
819
+
820
+ options = {
821
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
822
+ path_params: {'location' => location,'subscriptionId' => @client.subscription_id},
823
+ query_params: {'api-version' => @client.api_version},
824
+ body: request_content,
825
+ headers: request_headers.merge(custom_headers || {}),
826
+ base_url: request_url
827
+ }
828
+ promise = @client.make_request_async(:post, path_template, options)
829
+
830
+ promise = promise.then do |result|
831
+ http_response = result.response
832
+ status_code = http_response.status
833
+ response_content = http_response.body
834
+ unless status_code == 200
835
+ error_model = JSON.load(response_content)
836
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
837
+ end
838
+
839
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
840
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
841
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
842
+ # Deserialize Response
843
+ if status_code == 200
844
+ begin
845
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
846
+ result_mapper = Azure::PowerBiDedicated::Mgmt::V2017_10_01::Models::CheckCapacityNameAvailabilityResult.mapper()
847
+ result.body = @client.deserialize(result_mapper, parsed_response)
848
+ rescue Exception => e
849
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
850
+ end
851
+ end
852
+
853
+ result
854
+ end
855
+
856
+ promise.execute
857
+ end
858
+
859
+ #
860
+ # Provisions the specified Dedicated capacity based on the configuration
861
+ # specified in the request.
862
+ #
863
+ # @param resource_group_name [String] The name of the Azure Resource group of
864
+ # which a given PowerBIDedicated capacity is part. This name must be at least 1
865
+ # character in length, and no more than 90.
866
+ # @param dedicated_capacity_name [String] The name of the Dedicated capacity.
867
+ # It must be a minimum of 3 characters, and a maximum of 63.
868
+ # @param capacity_parameters [DedicatedCapacity] Contains the information used
869
+ # to provision the Dedicated capacity.
870
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
871
+ # will be added to the HTTP request.
872
+ #
873
+ # @return [DedicatedCapacity] operation results.
874
+ #
875
+ def begin_create(resource_group_name, dedicated_capacity_name, capacity_parameters, custom_headers:nil)
876
+ response = begin_create_async(resource_group_name, dedicated_capacity_name, capacity_parameters, custom_headers:custom_headers).value!
877
+ response.body unless response.nil?
878
+ end
879
+
880
+ #
881
+ # Provisions the specified Dedicated capacity based on the configuration
882
+ # specified in the request.
883
+ #
884
+ # @param resource_group_name [String] The name of the Azure Resource group of
885
+ # which a given PowerBIDedicated capacity is part. This name must be at least 1
886
+ # character in length, and no more than 90.
887
+ # @param dedicated_capacity_name [String] The name of the Dedicated capacity.
888
+ # It must be a minimum of 3 characters, and a maximum of 63.
889
+ # @param capacity_parameters [DedicatedCapacity] Contains the information used
890
+ # to provision the Dedicated capacity.
891
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
892
+ # will be added to the HTTP request.
893
+ #
894
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
895
+ #
896
+ def begin_create_with_http_info(resource_group_name, dedicated_capacity_name, capacity_parameters, custom_headers:nil)
897
+ begin_create_async(resource_group_name, dedicated_capacity_name, capacity_parameters, custom_headers:custom_headers).value!
898
+ end
899
+
900
+ #
901
+ # Provisions the specified Dedicated capacity based on the configuration
902
+ # specified in the request.
903
+ #
904
+ # @param resource_group_name [String] The name of the Azure Resource group of
905
+ # which a given PowerBIDedicated capacity is part. This name must be at least 1
906
+ # character in length, and no more than 90.
907
+ # @param dedicated_capacity_name [String] The name of the Dedicated capacity.
908
+ # It must be a minimum of 3 characters, and a maximum of 63.
909
+ # @param capacity_parameters [DedicatedCapacity] Contains the information used
910
+ # to provision the Dedicated capacity.
911
+ # @param [Hash{String => String}] A hash of custom headers that will be added
912
+ # to the HTTP request.
913
+ #
914
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
915
+ #
916
+ def begin_create_async(resource_group_name, dedicated_capacity_name, capacity_parameters, custom_headers:nil)
917
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
918
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
919
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
920
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
921
+ fail ArgumentError, 'dedicated_capacity_name is nil' if dedicated_capacity_name.nil?
922
+ fail ArgumentError, "'dedicated_capacity_name' should satisfy the constraint - 'MaxLength': '63'" if !dedicated_capacity_name.nil? && dedicated_capacity_name.length > 63
923
+ fail ArgumentError, "'dedicated_capacity_name' should satisfy the constraint - 'MinLength': '3'" if !dedicated_capacity_name.nil? && dedicated_capacity_name.length < 3
924
+ fail ArgumentError, "'dedicated_capacity_name' should satisfy the constraint - 'Pattern': '^[a-z][a-z0-9]*$'" if !dedicated_capacity_name.nil? && dedicated_capacity_name.match(Regexp.new('^^[a-z][a-z0-9]*$$')).nil?
925
+ fail ArgumentError, 'capacity_parameters is nil' if capacity_parameters.nil?
926
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
927
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
928
+
929
+
930
+ request_headers = {}
931
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
932
+
933
+ # Set Headers
934
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
935
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
936
+
937
+ # Serialize Request
938
+ request_mapper = Azure::PowerBiDedicated::Mgmt::V2017_10_01::Models::DedicatedCapacity.mapper()
939
+ request_content = @client.serialize(request_mapper, capacity_parameters)
940
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
941
+
942
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/capacities/{dedicatedCapacityName}'
943
+
944
+ request_url = @base_url || @client.base_url
945
+
946
+ options = {
947
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
948
+ path_params: {'resourceGroupName' => resource_group_name,'dedicatedCapacityName' => dedicated_capacity_name,'subscriptionId' => @client.subscription_id},
949
+ query_params: {'api-version' => @client.api_version},
950
+ body: request_content,
951
+ headers: request_headers.merge(custom_headers || {}),
952
+ base_url: request_url
953
+ }
954
+ promise = @client.make_request_async(:put, path_template, options)
955
+
956
+ promise = promise.then do |result|
957
+ http_response = result.response
958
+ status_code = http_response.status
959
+ response_content = http_response.body
960
+ unless status_code == 200 || status_code == 201
961
+ error_model = JSON.load(response_content)
962
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
963
+ end
964
+
965
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
966
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
967
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
968
+ # Deserialize Response
969
+ if status_code == 200
970
+ begin
971
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
972
+ result_mapper = Azure::PowerBiDedicated::Mgmt::V2017_10_01::Models::DedicatedCapacity.mapper()
973
+ result.body = @client.deserialize(result_mapper, parsed_response)
974
+ rescue Exception => e
975
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
976
+ end
977
+ end
978
+ # Deserialize Response
979
+ if status_code == 201
980
+ begin
981
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
982
+ result_mapper = Azure::PowerBiDedicated::Mgmt::V2017_10_01::Models::DedicatedCapacity.mapper()
983
+ result.body = @client.deserialize(result_mapper, parsed_response)
984
+ rescue Exception => e
985
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
986
+ end
987
+ end
988
+
989
+ result
990
+ end
991
+
992
+ promise.execute
993
+ end
994
+
995
+ #
996
+ # Deletes the specified Dedicated capacity.
997
+ #
998
+ # @param resource_group_name [String] The name of the Azure Resource group of
999
+ # which a given PowerBIDedicated capacity is part. This name must be at least 1
1000
+ # character in length, and no more than 90.
1001
+ # @param dedicated_capacity_name [String] The name of the Dedicated capacity.
1002
+ # It must be at least 3 characters in length, and no more than 63.
1003
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1004
+ # will be added to the HTTP request.
1005
+ #
1006
+ #
1007
+ def begin_delete(resource_group_name, dedicated_capacity_name, custom_headers:nil)
1008
+ response = begin_delete_async(resource_group_name, dedicated_capacity_name, custom_headers:custom_headers).value!
1009
+ nil
1010
+ end
1011
+
1012
+ #
1013
+ # Deletes the specified Dedicated capacity.
1014
+ #
1015
+ # @param resource_group_name [String] The name of the Azure Resource group of
1016
+ # which a given PowerBIDedicated capacity is part. This name must be at least 1
1017
+ # character in length, and no more than 90.
1018
+ # @param dedicated_capacity_name [String] The name of the Dedicated capacity.
1019
+ # It must be at least 3 characters in length, and no more than 63.
1020
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1021
+ # will be added to the HTTP request.
1022
+ #
1023
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1024
+ #
1025
+ def begin_delete_with_http_info(resource_group_name, dedicated_capacity_name, custom_headers:nil)
1026
+ begin_delete_async(resource_group_name, dedicated_capacity_name, custom_headers:custom_headers).value!
1027
+ end
1028
+
1029
+ #
1030
+ # Deletes the specified Dedicated capacity.
1031
+ #
1032
+ # @param resource_group_name [String] The name of the Azure Resource group of
1033
+ # which a given PowerBIDedicated capacity is part. This name must be at least 1
1034
+ # character in length, and no more than 90.
1035
+ # @param dedicated_capacity_name [String] The name of the Dedicated capacity.
1036
+ # It must be at least 3 characters in length, and no more than 63.
1037
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1038
+ # to the HTTP request.
1039
+ #
1040
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1041
+ #
1042
+ def begin_delete_async(resource_group_name, dedicated_capacity_name, custom_headers:nil)
1043
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1044
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1045
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1046
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1047
+ fail ArgumentError, 'dedicated_capacity_name is nil' if dedicated_capacity_name.nil?
1048
+ fail ArgumentError, "'dedicated_capacity_name' should satisfy the constraint - 'MaxLength': '63'" if !dedicated_capacity_name.nil? && dedicated_capacity_name.length > 63
1049
+ fail ArgumentError, "'dedicated_capacity_name' should satisfy the constraint - 'MinLength': '3'" if !dedicated_capacity_name.nil? && dedicated_capacity_name.length < 3
1050
+ fail ArgumentError, "'dedicated_capacity_name' should satisfy the constraint - 'Pattern': '^[a-z][a-z0-9]*$'" if !dedicated_capacity_name.nil? && dedicated_capacity_name.match(Regexp.new('^^[a-z][a-z0-9]*$$')).nil?
1051
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1052
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1053
+
1054
+
1055
+ request_headers = {}
1056
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1057
+
1058
+ # Set Headers
1059
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1060
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1061
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/capacities/{dedicatedCapacityName}'
1062
+
1063
+ request_url = @base_url || @client.base_url
1064
+
1065
+ options = {
1066
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1067
+ path_params: {'resourceGroupName' => resource_group_name,'dedicatedCapacityName' => dedicated_capacity_name,'subscriptionId' => @client.subscription_id},
1068
+ query_params: {'api-version' => @client.api_version},
1069
+ headers: request_headers.merge(custom_headers || {}),
1070
+ base_url: request_url
1071
+ }
1072
+ promise = @client.make_request_async(:delete, path_template, options)
1073
+
1074
+ promise = promise.then do |result|
1075
+ http_response = result.response
1076
+ status_code = http_response.status
1077
+ response_content = http_response.body
1078
+ unless status_code == 200 || status_code == 204 || status_code == 202
1079
+ error_model = JSON.load(response_content)
1080
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1081
+ end
1082
+
1083
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1084
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1085
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1086
+
1087
+ result
1088
+ end
1089
+
1090
+ promise.execute
1091
+ end
1092
+
1093
+ #
1094
+ # Updates the current state of the specified Dedicated capacity.
1095
+ #
1096
+ # @param resource_group_name [String] The name of the Azure Resource group of
1097
+ # which a given PowerBIDedicated capacity is part. This name must be at least 1
1098
+ # character in length, and no more than 90.
1099
+ # @param dedicated_capacity_name [String] The name of the Dedicated capacity.
1100
+ # It must be at least 3 characters in length, and no more than 63.
1101
+ # @param capacity_update_parameters [DedicatedCapacityUpdateParameters] Request
1102
+ # object that contains the updated information for the capacity.
1103
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1104
+ # will be added to the HTTP request.
1105
+ #
1106
+ # @return [DedicatedCapacity] operation results.
1107
+ #
1108
+ def begin_update(resource_group_name, dedicated_capacity_name, capacity_update_parameters, custom_headers:nil)
1109
+ response = begin_update_async(resource_group_name, dedicated_capacity_name, capacity_update_parameters, custom_headers:custom_headers).value!
1110
+ response.body unless response.nil?
1111
+ end
1112
+
1113
+ #
1114
+ # Updates the current state of the specified Dedicated capacity.
1115
+ #
1116
+ # @param resource_group_name [String] The name of the Azure Resource group of
1117
+ # which a given PowerBIDedicated capacity is part. This name must be at least 1
1118
+ # character in length, and no more than 90.
1119
+ # @param dedicated_capacity_name [String] The name of the Dedicated capacity.
1120
+ # It must be at least 3 characters in length, and no more than 63.
1121
+ # @param capacity_update_parameters [DedicatedCapacityUpdateParameters] Request
1122
+ # object that contains the updated information for the capacity.
1123
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1124
+ # will be added to the HTTP request.
1125
+ #
1126
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1127
+ #
1128
+ def begin_update_with_http_info(resource_group_name, dedicated_capacity_name, capacity_update_parameters, custom_headers:nil)
1129
+ begin_update_async(resource_group_name, dedicated_capacity_name, capacity_update_parameters, custom_headers:custom_headers).value!
1130
+ end
1131
+
1132
+ #
1133
+ # Updates the current state of the specified Dedicated capacity.
1134
+ #
1135
+ # @param resource_group_name [String] The name of the Azure Resource group of
1136
+ # which a given PowerBIDedicated capacity is part. This name must be at least 1
1137
+ # character in length, and no more than 90.
1138
+ # @param dedicated_capacity_name [String] The name of the Dedicated capacity.
1139
+ # It must be at least 3 characters in length, and no more than 63.
1140
+ # @param capacity_update_parameters [DedicatedCapacityUpdateParameters] Request
1141
+ # object that contains the updated information for the capacity.
1142
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1143
+ # to the HTTP request.
1144
+ #
1145
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1146
+ #
1147
+ def begin_update_async(resource_group_name, dedicated_capacity_name, capacity_update_parameters, custom_headers:nil)
1148
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1149
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1150
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1151
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1152
+ fail ArgumentError, 'dedicated_capacity_name is nil' if dedicated_capacity_name.nil?
1153
+ fail ArgumentError, "'dedicated_capacity_name' should satisfy the constraint - 'MaxLength': '63'" if !dedicated_capacity_name.nil? && dedicated_capacity_name.length > 63
1154
+ fail ArgumentError, "'dedicated_capacity_name' should satisfy the constraint - 'MinLength': '3'" if !dedicated_capacity_name.nil? && dedicated_capacity_name.length < 3
1155
+ fail ArgumentError, "'dedicated_capacity_name' should satisfy the constraint - 'Pattern': '^[a-z][a-z0-9]*$'" if !dedicated_capacity_name.nil? && dedicated_capacity_name.match(Regexp.new('^^[a-z][a-z0-9]*$$')).nil?
1156
+ fail ArgumentError, 'capacity_update_parameters is nil' if capacity_update_parameters.nil?
1157
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1158
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1159
+
1160
+
1161
+ request_headers = {}
1162
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1163
+
1164
+ # Set Headers
1165
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1166
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1167
+
1168
+ # Serialize Request
1169
+ request_mapper = Azure::PowerBiDedicated::Mgmt::V2017_10_01::Models::DedicatedCapacityUpdateParameters.mapper()
1170
+ request_content = @client.serialize(request_mapper, capacity_update_parameters)
1171
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1172
+
1173
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/capacities/{dedicatedCapacityName}'
1174
+
1175
+ request_url = @base_url || @client.base_url
1176
+
1177
+ options = {
1178
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1179
+ path_params: {'resourceGroupName' => resource_group_name,'dedicatedCapacityName' => dedicated_capacity_name,'subscriptionId' => @client.subscription_id},
1180
+ query_params: {'api-version' => @client.api_version},
1181
+ body: request_content,
1182
+ headers: request_headers.merge(custom_headers || {}),
1183
+ base_url: request_url
1184
+ }
1185
+ promise = @client.make_request_async(:patch, path_template, options)
1186
+
1187
+ promise = promise.then do |result|
1188
+ http_response = result.response
1189
+ status_code = http_response.status
1190
+ response_content = http_response.body
1191
+ unless status_code == 200 || status_code == 202
1192
+ error_model = JSON.load(response_content)
1193
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1194
+ end
1195
+
1196
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1197
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1198
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1199
+ # Deserialize Response
1200
+ if status_code == 200
1201
+ begin
1202
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1203
+ result_mapper = Azure::PowerBiDedicated::Mgmt::V2017_10_01::Models::DedicatedCapacity.mapper()
1204
+ result.body = @client.deserialize(result_mapper, parsed_response)
1205
+ rescue Exception => e
1206
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1207
+ end
1208
+ end
1209
+ # Deserialize Response
1210
+ if status_code == 202
1211
+ begin
1212
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1213
+ result_mapper = Azure::PowerBiDedicated::Mgmt::V2017_10_01::Models::DedicatedCapacity.mapper()
1214
+ result.body = @client.deserialize(result_mapper, parsed_response)
1215
+ rescue Exception => e
1216
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1217
+ end
1218
+ end
1219
+
1220
+ result
1221
+ end
1222
+
1223
+ promise.execute
1224
+ end
1225
+
1226
+ #
1227
+ # Suspends operation of the specified dedicated capacity instance.
1228
+ #
1229
+ # @param resource_group_name [String] The name of the Azure Resource group of
1230
+ # which a given PowerBIDedicated capacity is part. This name must be at least 1
1231
+ # character in length, and no more than 90.
1232
+ # @param dedicated_capacity_name [String] The name of the Dedicated capacity.
1233
+ # It must be at least 3 characters in length, and no more than 63.
1234
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1235
+ # will be added to the HTTP request.
1236
+ #
1237
+ #
1238
+ def begin_suspend(resource_group_name, dedicated_capacity_name, custom_headers:nil)
1239
+ response = begin_suspend_async(resource_group_name, dedicated_capacity_name, custom_headers:custom_headers).value!
1240
+ nil
1241
+ end
1242
+
1243
+ #
1244
+ # Suspends operation of the specified dedicated capacity instance.
1245
+ #
1246
+ # @param resource_group_name [String] The name of the Azure Resource group of
1247
+ # which a given PowerBIDedicated capacity is part. This name must be at least 1
1248
+ # character in length, and no more than 90.
1249
+ # @param dedicated_capacity_name [String] The name of the Dedicated capacity.
1250
+ # It must be at least 3 characters in length, and no more than 63.
1251
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1252
+ # will be added to the HTTP request.
1253
+ #
1254
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1255
+ #
1256
+ def begin_suspend_with_http_info(resource_group_name, dedicated_capacity_name, custom_headers:nil)
1257
+ begin_suspend_async(resource_group_name, dedicated_capacity_name, custom_headers:custom_headers).value!
1258
+ end
1259
+
1260
+ #
1261
+ # Suspends operation of the specified dedicated capacity instance.
1262
+ #
1263
+ # @param resource_group_name [String] The name of the Azure Resource group of
1264
+ # which a given PowerBIDedicated capacity is part. This name must be at least 1
1265
+ # character in length, and no more than 90.
1266
+ # @param dedicated_capacity_name [String] The name of the Dedicated capacity.
1267
+ # It must be at least 3 characters in length, and no more than 63.
1268
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1269
+ # to the HTTP request.
1270
+ #
1271
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1272
+ #
1273
+ def begin_suspend_async(resource_group_name, dedicated_capacity_name, custom_headers:nil)
1274
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1275
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1276
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1277
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1278
+ fail ArgumentError, 'dedicated_capacity_name is nil' if dedicated_capacity_name.nil?
1279
+ fail ArgumentError, "'dedicated_capacity_name' should satisfy the constraint - 'MaxLength': '63'" if !dedicated_capacity_name.nil? && dedicated_capacity_name.length > 63
1280
+ fail ArgumentError, "'dedicated_capacity_name' should satisfy the constraint - 'MinLength': '3'" if !dedicated_capacity_name.nil? && dedicated_capacity_name.length < 3
1281
+ fail ArgumentError, "'dedicated_capacity_name' should satisfy the constraint - 'Pattern': '^[a-z][a-z0-9]*$'" if !dedicated_capacity_name.nil? && dedicated_capacity_name.match(Regexp.new('^^[a-z][a-z0-9]*$$')).nil?
1282
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1283
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1284
+
1285
+
1286
+ request_headers = {}
1287
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1288
+
1289
+ # Set Headers
1290
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1291
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1292
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/capacities/{dedicatedCapacityName}/suspend'
1293
+
1294
+ request_url = @base_url || @client.base_url
1295
+
1296
+ options = {
1297
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1298
+ path_params: {'resourceGroupName' => resource_group_name,'dedicatedCapacityName' => dedicated_capacity_name,'subscriptionId' => @client.subscription_id},
1299
+ query_params: {'api-version' => @client.api_version},
1300
+ headers: request_headers.merge(custom_headers || {}),
1301
+ base_url: request_url
1302
+ }
1303
+ promise = @client.make_request_async(:post, path_template, options)
1304
+
1305
+ promise = promise.then do |result|
1306
+ http_response = result.response
1307
+ status_code = http_response.status
1308
+ response_content = http_response.body
1309
+ unless status_code == 200 || status_code == 202
1310
+ error_model = JSON.load(response_content)
1311
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1312
+ end
1313
+
1314
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1315
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1316
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1317
+
1318
+ result
1319
+ end
1320
+
1321
+ promise.execute
1322
+ end
1323
+
1324
+ #
1325
+ # Resumes operation of the specified Dedicated capacity instance.
1326
+ #
1327
+ # @param resource_group_name [String] The name of the Azure Resource group of
1328
+ # which a given PowerBIDedicated capacity is part. This name must be at least 1
1329
+ # character in length, and no more than 90.
1330
+ # @param dedicated_capacity_name [String] The name of the Dedicated capacity.
1331
+ # It must be at least 3 characters in length, and no more than 63.
1332
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1333
+ # will be added to the HTTP request.
1334
+ #
1335
+ #
1336
+ def begin_resume(resource_group_name, dedicated_capacity_name, custom_headers:nil)
1337
+ response = begin_resume_async(resource_group_name, dedicated_capacity_name, custom_headers:custom_headers).value!
1338
+ nil
1339
+ end
1340
+
1341
+ #
1342
+ # Resumes operation of the specified Dedicated capacity instance.
1343
+ #
1344
+ # @param resource_group_name [String] The name of the Azure Resource group of
1345
+ # which a given PowerBIDedicated capacity is part. This name must be at least 1
1346
+ # character in length, and no more than 90.
1347
+ # @param dedicated_capacity_name [String] The name of the Dedicated capacity.
1348
+ # It must be at least 3 characters in length, and no more than 63.
1349
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1350
+ # will be added to the HTTP request.
1351
+ #
1352
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1353
+ #
1354
+ def begin_resume_with_http_info(resource_group_name, dedicated_capacity_name, custom_headers:nil)
1355
+ begin_resume_async(resource_group_name, dedicated_capacity_name, custom_headers:custom_headers).value!
1356
+ end
1357
+
1358
+ #
1359
+ # Resumes operation of the specified Dedicated capacity instance.
1360
+ #
1361
+ # @param resource_group_name [String] The name of the Azure Resource group of
1362
+ # which a given PowerBIDedicated capacity is part. This name must be at least 1
1363
+ # character in length, and no more than 90.
1364
+ # @param dedicated_capacity_name [String] The name of the Dedicated capacity.
1365
+ # It must be at least 3 characters in length, and no more than 63.
1366
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1367
+ # to the HTTP request.
1368
+ #
1369
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1370
+ #
1371
+ def begin_resume_async(resource_group_name, dedicated_capacity_name, custom_headers:nil)
1372
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1373
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1374
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1375
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
1376
+ fail ArgumentError, 'dedicated_capacity_name is nil' if dedicated_capacity_name.nil?
1377
+ fail ArgumentError, "'dedicated_capacity_name' should satisfy the constraint - 'MaxLength': '63'" if !dedicated_capacity_name.nil? && dedicated_capacity_name.length > 63
1378
+ fail ArgumentError, "'dedicated_capacity_name' should satisfy the constraint - 'MinLength': '3'" if !dedicated_capacity_name.nil? && dedicated_capacity_name.length < 3
1379
+ fail ArgumentError, "'dedicated_capacity_name' should satisfy the constraint - 'Pattern': '^[a-z][a-z0-9]*$'" if !dedicated_capacity_name.nil? && dedicated_capacity_name.match(Regexp.new('^^[a-z][a-z0-9]*$$')).nil?
1380
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1381
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1382
+
1383
+
1384
+ request_headers = {}
1385
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1386
+
1387
+ # Set Headers
1388
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1389
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1390
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBIDedicated/capacities/{dedicatedCapacityName}/resume'
1391
+
1392
+ request_url = @base_url || @client.base_url
1393
+
1394
+ options = {
1395
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1396
+ path_params: {'resourceGroupName' => resource_group_name,'dedicatedCapacityName' => dedicated_capacity_name,'subscriptionId' => @client.subscription_id},
1397
+ query_params: {'api-version' => @client.api_version},
1398
+ headers: request_headers.merge(custom_headers || {}),
1399
+ base_url: request_url
1400
+ }
1401
+ promise = @client.make_request_async(:post, path_template, options)
1402
+
1403
+ promise = promise.then do |result|
1404
+ http_response = result.response
1405
+ status_code = http_response.status
1406
+ response_content = http_response.body
1407
+ unless status_code == 200 || status_code == 202
1408
+ error_model = JSON.load(response_content)
1409
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1410
+ end
1411
+
1412
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1413
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1414
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1415
+
1416
+ result
1417
+ end
1418
+
1419
+ promise.execute
1420
+ end
1421
+
1422
+ end
1423
+ end