azure_mgmt_mixedreality 0.17.2 → 0.17.3

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