azure_mgmt_signalr 0.17.4 → 0.17.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2018-03-01-preview/generated/azure_mgmt_signalr/signal_r.rb +11 -1
  3. data/lib/2018-03-01-preview/generated/azure_mgmt_signalr/signal_rmanagement_client.rb +1 -1
  4. data/lib/2018-10-01/generated/azure_mgmt_signalr.rb +13 -9
  5. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/error_response.rb +48 -0
  6. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/error_response_body.rb +93 -0
  7. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/feature_flags.rb +16 -0
  8. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/log_specification.rb +57 -0
  9. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/service_specification.rb +21 -0
  10. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/signal_rfeature.rb +12 -6
  11. data/lib/2018-10-01/generated/azure_mgmt_signalr/operations.rb +2 -2
  12. data/lib/2018-10-01/generated/azure_mgmt_signalr/signal_r.rb +23 -13
  13. data/lib/2018-10-01/generated/azure_mgmt_signalr/signal_rmanagement_client.rb +1 -1
  14. data/lib/2018-10-01/generated/azure_mgmt_signalr/usages.rb +2 -2
  15. data/lib/2020-05-01/generated/azure_mgmt_signalr.rb +76 -0
  16. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/aclaction.rb +16 -0
  17. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/dimension.rb +80 -0
  18. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/error_response.rb +48 -0
  19. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/error_response_body.rb +93 -0
  20. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/feature_flags.rb +17 -0
  21. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/key_type.rb +16 -0
  22. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/log_specification.rb +57 -0
  23. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/metric_specification.rb +139 -0
  24. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/name_availability.rb +70 -0
  25. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/name_availability_parameters.rb +59 -0
  26. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/network_acl.rb +75 -0
  27. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/operation.rb +96 -0
  28. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/operation_display.rb +79 -0
  29. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/operation_list.rb +102 -0
  30. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/operation_properties.rb +47 -0
  31. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/private_endpoint.rb +46 -0
  32. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/private_endpoint_acl.rb +78 -0
  33. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/private_endpoint_connection.rb +101 -0
  34. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/private_link_resource.rb +111 -0
  35. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/private_link_resource_list.rb +102 -0
  36. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/private_link_service_connection_state.rb +72 -0
  37. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/private_link_service_connection_status.rb +18 -0
  38. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/provisioning_state.rb +23 -0
  39. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/proxy_resource.rb +63 -0
  40. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/regenerate_key_parameters.rb +48 -0
  41. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/resource.rb +81 -0
  42. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/resource_sku.rb +101 -0
  43. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/serverless_upstream_settings.rb +58 -0
  44. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/service_kind.rb +16 -0
  45. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/service_specification.rb +77 -0
  46. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/signal_rcors_settings.rb +57 -0
  47. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/signal_rcreate_or_update_properties.rb +117 -0
  48. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/signal_rfeature.rb +93 -0
  49. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/signal_rkeys.rb +81 -0
  50. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/signal_rnetwork_acls.rb +80 -0
  51. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/signal_rrequest_type.rb +17 -0
  52. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/signal_rresource.rb +294 -0
  53. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/signal_rresource_list.rb +101 -0
  54. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/signal_rsku_tier.rb +18 -0
  55. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/signal_rusage.rb +95 -0
  56. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/signal_rusage_list.rb +101 -0
  57. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/signal_rusage_name.rb +57 -0
  58. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/tracked_resource.rb +94 -0
  59. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/upstream_template.rb +109 -0
  60. data/lib/2020-05-01/generated/azure_mgmt_signalr/module_definition.rb +9 -0
  61. data/lib/2020-05-01/generated/azure_mgmt_signalr/operations.rb +225 -0
  62. data/lib/2020-05-01/generated/azure_mgmt_signalr/signal_r.rb +1493 -0
  63. data/lib/2020-05-01/generated/azure_mgmt_signalr/signal_rmanagement_client.rb +150 -0
  64. data/lib/2020-05-01/generated/azure_mgmt_signalr/signal_rprivate_endpoint_connections.rb +404 -0
  65. data/lib/2020-05-01/generated/azure_mgmt_signalr/signal_rprivate_link_resources.rb +246 -0
  66. data/lib/2020-05-01/generated/azure_mgmt_signalr/usages.rb +226 -0
  67. data/lib/azure_mgmt_signalr.rb +1 -0
  68. data/lib/profiles/latest/modules/signalr_profile_module.rb +143 -71
  69. data/lib/version.rb +1 -1
  70. metadata +60 -4
@@ -0,0 +1,1493 @@
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::Signalr::Mgmt::V2020_05_01
7
+ #
8
+ # REST API for Azure SignalR Service
9
+ #
10
+ class SignalR
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the SignalR class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [SignalRManagementClient] reference to the SignalRManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Checks that the SignalR name is valid and is not already in use.
26
+ #
27
+ # @param location [String] the region
28
+ # @param parameters [NameAvailabilityParameters] Parameters supplied to the
29
+ # operation.
30
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
31
+ # will be added to the HTTP request.
32
+ #
33
+ # @return [NameAvailability] operation results.
34
+ #
35
+ def check_name_availability(location, parameters:nil, custom_headers:nil)
36
+ response = check_name_availability_async(location, parameters:parameters, custom_headers:custom_headers).value!
37
+ response.body unless response.nil?
38
+ end
39
+
40
+ #
41
+ # Checks that the SignalR name is valid and is not already in use.
42
+ #
43
+ # @param location [String] the region
44
+ # @param parameters [NameAvailabilityParameters] Parameters supplied to the
45
+ # operation.
46
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
47
+ # will be added to the HTTP request.
48
+ #
49
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
50
+ #
51
+ def check_name_availability_with_http_info(location, parameters:nil, custom_headers:nil)
52
+ check_name_availability_async(location, parameters:parameters, custom_headers:custom_headers).value!
53
+ end
54
+
55
+ #
56
+ # Checks that the SignalR name is valid and is not already in use.
57
+ #
58
+ # @param location [String] the region
59
+ # @param parameters [NameAvailabilityParameters] Parameters supplied to the
60
+ # operation.
61
+ # @param [Hash{String => String}] A hash of custom headers that will be added
62
+ # to the HTTP request.
63
+ #
64
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
65
+ #
66
+ def check_name_availability_async(location, parameters:nil, custom_headers:nil)
67
+ fail ArgumentError, 'location is nil' if location.nil?
68
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
69
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
70
+
71
+
72
+ request_headers = {}
73
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
74
+
75
+ # Set Headers
76
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
77
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
78
+
79
+ # Serialize Request
80
+ request_mapper = Azure::Signalr::Mgmt::V2020_05_01::Models::NameAvailabilityParameters.mapper()
81
+ request_content = @client.serialize(request_mapper, parameters)
82
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
83
+
84
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.SignalRService/locations/{location}/checkNameAvailability'
85
+
86
+ request_url = @base_url || @client.base_url
87
+
88
+ options = {
89
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
90
+ path_params: {'location' => location,'subscriptionId' => @client.subscription_id},
91
+ query_params: {'api-version' => @client.api_version},
92
+ body: request_content,
93
+ headers: request_headers.merge(custom_headers || {}),
94
+ base_url: request_url
95
+ }
96
+ promise = @client.make_request_async(:post, path_template, options)
97
+
98
+ promise = promise.then do |result|
99
+ http_response = result.response
100
+ status_code = http_response.status
101
+ response_content = http_response.body
102
+ unless status_code == 200
103
+ error_model = JSON.load(response_content)
104
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
105
+ end
106
+
107
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
108
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
109
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
110
+ # Deserialize Response
111
+ if status_code == 200
112
+ begin
113
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
114
+ result_mapper = Azure::Signalr::Mgmt::V2020_05_01::Models::NameAvailability.mapper()
115
+ result.body = @client.deserialize(result_mapper, parsed_response)
116
+ rescue Exception => e
117
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
118
+ end
119
+ end
120
+
121
+ result
122
+ end
123
+
124
+ promise.execute
125
+ end
126
+
127
+ #
128
+ # Handles requests to list all resources in a subscription.
129
+ #
130
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
131
+ # will be added to the HTTP request.
132
+ #
133
+ # @return [Array<SignalRResource>] operation results.
134
+ #
135
+ def list_by_subscription(custom_headers:nil)
136
+ first_page = list_by_subscription_as_lazy(custom_headers:custom_headers)
137
+ first_page.get_all_items
138
+ end
139
+
140
+ #
141
+ # Handles requests to list all resources in a subscription.
142
+ #
143
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
144
+ # will be added to the HTTP request.
145
+ #
146
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
147
+ #
148
+ def list_by_subscription_with_http_info(custom_headers:nil)
149
+ list_by_subscription_async(custom_headers:custom_headers).value!
150
+ end
151
+
152
+ #
153
+ # Handles requests to list all resources in a subscription.
154
+ #
155
+ # @param [Hash{String => String}] A hash of custom headers that will be added
156
+ # to the HTTP request.
157
+ #
158
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
159
+ #
160
+ def list_by_subscription_async(custom_headers:nil)
161
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
162
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
163
+
164
+
165
+ request_headers = {}
166
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
167
+
168
+ # Set Headers
169
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
170
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
171
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.SignalRService/signalR'
172
+
173
+ request_url = @base_url || @client.base_url
174
+
175
+ options = {
176
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
177
+ path_params: {'subscriptionId' => @client.subscription_id},
178
+ query_params: {'api-version' => @client.api_version},
179
+ headers: request_headers.merge(custom_headers || {}),
180
+ base_url: request_url
181
+ }
182
+ promise = @client.make_request_async(:get, path_template, options)
183
+
184
+ promise = promise.then do |result|
185
+ http_response = result.response
186
+ status_code = http_response.status
187
+ response_content = http_response.body
188
+ unless status_code == 200
189
+ error_model = JSON.load(response_content)
190
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
191
+ end
192
+
193
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
194
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
195
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
196
+ # Deserialize Response
197
+ if status_code == 200
198
+ begin
199
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
200
+ result_mapper = Azure::Signalr::Mgmt::V2020_05_01::Models::SignalRResourceList.mapper()
201
+ result.body = @client.deserialize(result_mapper, parsed_response)
202
+ rescue Exception => e
203
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
204
+ end
205
+ end
206
+
207
+ result
208
+ end
209
+
210
+ promise.execute
211
+ end
212
+
213
+ #
214
+ # Handles requests to list all resources in a resource group.
215
+ #
216
+ # @param resource_group_name [String] The name of the resource group that
217
+ # contains the resource. You can obtain this value from the Azure Resource
218
+ # Manager API or the portal.
219
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
220
+ # will be added to the HTTP request.
221
+ #
222
+ # @return [Array<SignalRResource>] operation results.
223
+ #
224
+ def list_by_resource_group(resource_group_name, custom_headers:nil)
225
+ first_page = list_by_resource_group_as_lazy(resource_group_name, custom_headers:custom_headers)
226
+ first_page.get_all_items
227
+ end
228
+
229
+ #
230
+ # Handles requests to list all resources in a resource group.
231
+ #
232
+ # @param resource_group_name [String] The name of the resource group that
233
+ # contains the resource. You can obtain this value from the Azure Resource
234
+ # Manager API or the portal.
235
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
236
+ # will be added to the HTTP request.
237
+ #
238
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
239
+ #
240
+ def list_by_resource_group_with_http_info(resource_group_name, custom_headers:nil)
241
+ list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
242
+ end
243
+
244
+ #
245
+ # Handles requests to list all resources in a resource group.
246
+ #
247
+ # @param resource_group_name [String] The name of the resource group that
248
+ # contains the resource. You can obtain this value from the Azure Resource
249
+ # Manager API or the portal.
250
+ # @param [Hash{String => String}] A hash of custom headers that will be added
251
+ # to the HTTP request.
252
+ #
253
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
254
+ #
255
+ def list_by_resource_group_async(resource_group_name, custom_headers:nil)
256
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
257
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
258
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
259
+
260
+
261
+ request_headers = {}
262
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
263
+
264
+ # Set Headers
265
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
266
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
267
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR'
268
+
269
+ request_url = @base_url || @client.base_url
270
+
271
+ options = {
272
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
273
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
274
+ query_params: {'api-version' => @client.api_version},
275
+ headers: request_headers.merge(custom_headers || {}),
276
+ base_url: request_url
277
+ }
278
+ promise = @client.make_request_async(:get, path_template, options)
279
+
280
+ promise = promise.then do |result|
281
+ http_response = result.response
282
+ status_code = http_response.status
283
+ response_content = http_response.body
284
+ unless status_code == 200
285
+ error_model = JSON.load(response_content)
286
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
287
+ end
288
+
289
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
290
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
291
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
292
+ # Deserialize Response
293
+ if status_code == 200
294
+ begin
295
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
296
+ result_mapper = Azure::Signalr::Mgmt::V2020_05_01::Models::SignalRResourceList.mapper()
297
+ result.body = @client.deserialize(result_mapper, parsed_response)
298
+ rescue Exception => e
299
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
300
+ end
301
+ end
302
+
303
+ result
304
+ end
305
+
306
+ promise.execute
307
+ end
308
+
309
+ #
310
+ # Get the access keys of the SignalR resource.
311
+ #
312
+ # @param resource_group_name [String] The name of the resource group that
313
+ # contains the resource. You can obtain this value from the Azure Resource
314
+ # Manager API or the portal.
315
+ # @param resource_name [String] The name of the SignalR resource.
316
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
317
+ # will be added to the HTTP request.
318
+ #
319
+ # @return [SignalRKeys] operation results.
320
+ #
321
+ def list_keys(resource_group_name, resource_name, custom_headers:nil)
322
+ response = list_keys_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
323
+ response.body unless response.nil?
324
+ end
325
+
326
+ #
327
+ # Get the access keys of the SignalR resource.
328
+ #
329
+ # @param resource_group_name [String] The name of the resource group that
330
+ # contains the resource. You can obtain this value from the Azure Resource
331
+ # Manager API or the portal.
332
+ # @param resource_name [String] The name of the SignalR resource.
333
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
334
+ # will be added to the HTTP request.
335
+ #
336
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
337
+ #
338
+ def list_keys_with_http_info(resource_group_name, resource_name, custom_headers:nil)
339
+ list_keys_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
340
+ end
341
+
342
+ #
343
+ # Get the access keys of the SignalR resource.
344
+ #
345
+ # @param resource_group_name [String] The name of the resource group that
346
+ # contains the resource. You can obtain this value from the Azure Resource
347
+ # Manager API or the portal.
348
+ # @param resource_name [String] The name of the SignalR resource.
349
+ # @param [Hash{String => String}] A hash of custom headers that will be added
350
+ # to the HTTP request.
351
+ #
352
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
353
+ #
354
+ def list_keys_async(resource_group_name, resource_name, custom_headers:nil)
355
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
356
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
357
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
358
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
359
+
360
+
361
+ request_headers = {}
362
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
363
+
364
+ # Set Headers
365
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
366
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
367
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/listKeys'
368
+
369
+ request_url = @base_url || @client.base_url
370
+
371
+ options = {
372
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
373
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
374
+ query_params: {'api-version' => @client.api_version},
375
+ headers: request_headers.merge(custom_headers || {}),
376
+ base_url: request_url
377
+ }
378
+ promise = @client.make_request_async(:post, path_template, options)
379
+
380
+ promise = promise.then do |result|
381
+ http_response = result.response
382
+ status_code = http_response.status
383
+ response_content = http_response.body
384
+ unless status_code == 200
385
+ error_model = JSON.load(response_content)
386
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
387
+ end
388
+
389
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
390
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
391
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
392
+ # Deserialize Response
393
+ if status_code == 200
394
+ begin
395
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
396
+ result_mapper = Azure::Signalr::Mgmt::V2020_05_01::Models::SignalRKeys.mapper()
397
+ result.body = @client.deserialize(result_mapper, parsed_response)
398
+ rescue Exception => e
399
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
400
+ end
401
+ end
402
+
403
+ result
404
+ end
405
+
406
+ promise.execute
407
+ end
408
+
409
+ #
410
+ # Regenerate SignalR service access key. PrimaryKey and SecondaryKey cannot be
411
+ # regenerated at the same time.
412
+ #
413
+ # @param resource_group_name [String] The name of the resource group that
414
+ # contains the resource. You can obtain this value from the Azure Resource
415
+ # Manager API or the portal.
416
+ # @param resource_name [String] The name of the SignalR resource.
417
+ # @param parameters [RegenerateKeyParameters] Parameter that describes the
418
+ # Regenerate Key Operation.
419
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
420
+ # will be added to the HTTP request.
421
+ #
422
+ # @return [SignalRKeys] operation results.
423
+ #
424
+ def regenerate_key(resource_group_name, resource_name, parameters:nil, custom_headers:nil)
425
+ response = regenerate_key_async(resource_group_name, resource_name, parameters:parameters, custom_headers:custom_headers).value!
426
+ response.body unless response.nil?
427
+ end
428
+
429
+ #
430
+ # @param resource_group_name [String] The name of the resource group that
431
+ # contains the resource. You can obtain this value from the Azure Resource
432
+ # Manager API or the portal.
433
+ # @param resource_name [String] The name of the SignalR resource.
434
+ # @param parameters [RegenerateKeyParameters] Parameter that describes the
435
+ # Regenerate Key Operation.
436
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
437
+ # will be added to the HTTP request.
438
+ #
439
+ # @return [Concurrent::Promise] promise which provides async access to http
440
+ # response.
441
+ #
442
+ def regenerate_key_async(resource_group_name, resource_name, parameters:nil, custom_headers:nil)
443
+ # Send request
444
+ promise = begin_regenerate_key_async(resource_group_name, resource_name, parameters:parameters, custom_headers:custom_headers)
445
+
446
+ promise = promise.then do |response|
447
+ # Defining deserialization method.
448
+ deserialize_method = lambda do |parsed_response|
449
+ result_mapper = Azure::Signalr::Mgmt::V2020_05_01::Models::SignalRKeys.mapper()
450
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
451
+ end
452
+
453
+ # Waiting for response.
454
+ @client.get_long_running_operation_result(response, deserialize_method, FinalStateVia::AZURE_ASYNC_OPERATION)
455
+ end
456
+
457
+ promise
458
+ end
459
+
460
+ #
461
+ # Get the SignalR service and its properties.
462
+ #
463
+ # @param resource_group_name [String] The name of the resource group that
464
+ # contains the resource. You can obtain this value from the Azure Resource
465
+ # Manager API or the portal.
466
+ # @param resource_name [String] The name of the SignalR resource.
467
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
468
+ # will be added to the HTTP request.
469
+ #
470
+ # @return [SignalRResource] operation results.
471
+ #
472
+ def get(resource_group_name, resource_name, custom_headers:nil)
473
+ response = get_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
474
+ response.body unless response.nil?
475
+ end
476
+
477
+ #
478
+ # Get the SignalR service and its properties.
479
+ #
480
+ # @param resource_group_name [String] The name of the resource group that
481
+ # contains the resource. You can obtain this value from the Azure Resource
482
+ # Manager API or the portal.
483
+ # @param resource_name [String] The name of the SignalR resource.
484
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
485
+ # will be added to the HTTP request.
486
+ #
487
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
488
+ #
489
+ def get_with_http_info(resource_group_name, resource_name, custom_headers:nil)
490
+ get_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
491
+ end
492
+
493
+ #
494
+ # Get the SignalR service and its properties.
495
+ #
496
+ # @param resource_group_name [String] The name of the resource group that
497
+ # contains the resource. You can obtain this value from the Azure Resource
498
+ # Manager API or the portal.
499
+ # @param resource_name [String] The name of the SignalR resource.
500
+ # @param [Hash{String => String}] A hash of custom headers that will be added
501
+ # to the HTTP request.
502
+ #
503
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
504
+ #
505
+ def get_async(resource_group_name, resource_name, custom_headers:nil)
506
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
507
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
508
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
509
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
510
+
511
+
512
+ request_headers = {}
513
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
514
+
515
+ # Set Headers
516
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
517
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
518
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}'
519
+
520
+ request_url = @base_url || @client.base_url
521
+
522
+ options = {
523
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
524
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
525
+ query_params: {'api-version' => @client.api_version},
526
+ headers: request_headers.merge(custom_headers || {}),
527
+ base_url: request_url
528
+ }
529
+ promise = @client.make_request_async(:get, path_template, options)
530
+
531
+ promise = promise.then do |result|
532
+ http_response = result.response
533
+ status_code = http_response.status
534
+ response_content = http_response.body
535
+ unless status_code == 200
536
+ error_model = JSON.load(response_content)
537
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
538
+ end
539
+
540
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
541
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
542
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
543
+ # Deserialize Response
544
+ if status_code == 200
545
+ begin
546
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
547
+ result_mapper = Azure::Signalr::Mgmt::V2020_05_01::Models::SignalRResource.mapper()
548
+ result.body = @client.deserialize(result_mapper, parsed_response)
549
+ rescue Exception => e
550
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
551
+ end
552
+ end
553
+
554
+ result
555
+ end
556
+
557
+ promise.execute
558
+ end
559
+
560
+ #
561
+ # Create a new SignalR service and update an exiting SignalR service.
562
+ #
563
+ # @param resource_group_name [String] The name of the resource group that
564
+ # contains the resource. You can obtain this value from the Azure Resource
565
+ # Manager API or the portal.
566
+ # @param resource_name [String] The name of the SignalR resource.
567
+ # @param parameters [SignalRResource] Parameters for the create or update
568
+ # operation
569
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
570
+ # will be added to the HTTP request.
571
+ #
572
+ # @return [SignalRResource] operation results.
573
+ #
574
+ def create_or_update(resource_group_name, resource_name, parameters:nil, custom_headers:nil)
575
+ response = create_or_update_async(resource_group_name, resource_name, parameters:parameters, custom_headers:custom_headers).value!
576
+ response.body unless response.nil?
577
+ end
578
+
579
+ #
580
+ # @param resource_group_name [String] The name of the resource group that
581
+ # contains the resource. You can obtain this value from the Azure Resource
582
+ # Manager API or the portal.
583
+ # @param resource_name [String] The name of the SignalR resource.
584
+ # @param parameters [SignalRResource] Parameters for the create or update
585
+ # operation
586
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
587
+ # will be added to the HTTP request.
588
+ #
589
+ # @return [Concurrent::Promise] promise which provides async access to http
590
+ # response.
591
+ #
592
+ def create_or_update_async(resource_group_name, resource_name, parameters:nil, custom_headers:nil)
593
+ # Send request
594
+ promise = begin_create_or_update_async(resource_group_name, resource_name, parameters:parameters, custom_headers:custom_headers)
595
+
596
+ promise = promise.then do |response|
597
+ # Defining deserialization method.
598
+ deserialize_method = lambda do |parsed_response|
599
+ result_mapper = Azure::Signalr::Mgmt::V2020_05_01::Models::SignalRResource.mapper()
600
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
601
+ end
602
+
603
+ # Waiting for response.
604
+ @client.get_long_running_operation_result(response, deserialize_method)
605
+ end
606
+
607
+ promise
608
+ end
609
+
610
+ #
611
+ # Operation to delete a SignalR service.
612
+ #
613
+ # @param resource_group_name [String] The name of the resource group that
614
+ # contains the resource. You can obtain this value from the Azure Resource
615
+ # Manager API or the portal.
616
+ # @param resource_name [String] The name of the SignalR resource.
617
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
618
+ # will be added to the HTTP request.
619
+ #
620
+ def delete(resource_group_name, resource_name, custom_headers:nil)
621
+ response = delete_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
622
+ nil
623
+ end
624
+
625
+ #
626
+ # @param resource_group_name [String] The name of the resource group that
627
+ # contains the resource. You can obtain this value from the Azure Resource
628
+ # Manager API or the portal.
629
+ # @param resource_name [String] The name of the SignalR resource.
630
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
631
+ # will be added to the HTTP request.
632
+ #
633
+ # @return [Concurrent::Promise] promise which provides async access to http
634
+ # response.
635
+ #
636
+ def delete_async(resource_group_name, resource_name, custom_headers:nil)
637
+ # Send request
638
+ promise = begin_delete_async(resource_group_name, resource_name, custom_headers:custom_headers)
639
+
640
+ promise = promise.then do |response|
641
+ # Defining deserialization method.
642
+ deserialize_method = lambda do |parsed_response|
643
+ end
644
+
645
+ # Waiting for response.
646
+ @client.get_long_running_operation_result(response, deserialize_method)
647
+ end
648
+
649
+ promise
650
+ end
651
+
652
+ #
653
+ # Operation to update an exiting SignalR service.
654
+ #
655
+ # @param resource_group_name [String] The name of the resource group that
656
+ # contains the resource. You can obtain this value from the Azure Resource
657
+ # Manager API or the portal.
658
+ # @param resource_name [String] The name of the SignalR resource.
659
+ # @param parameters [SignalRResource] Parameters for the update operation
660
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
661
+ # will be added to the HTTP request.
662
+ #
663
+ # @return [SignalRResource] operation results.
664
+ #
665
+ def update(resource_group_name, resource_name, parameters:nil, custom_headers:nil)
666
+ response = update_async(resource_group_name, resource_name, parameters:parameters, custom_headers:custom_headers).value!
667
+ response.body unless response.nil?
668
+ end
669
+
670
+ #
671
+ # @param resource_group_name [String] The name of the resource group that
672
+ # contains the resource. You can obtain this value from the Azure Resource
673
+ # Manager API or the portal.
674
+ # @param resource_name [String] The name of the SignalR resource.
675
+ # @param parameters [SignalRResource] Parameters for the update operation
676
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
677
+ # will be added to the HTTP request.
678
+ #
679
+ # @return [Concurrent::Promise] promise which provides async access to http
680
+ # response.
681
+ #
682
+ def update_async(resource_group_name, resource_name, parameters:nil, custom_headers:nil)
683
+ # Send request
684
+ promise = begin_update_async(resource_group_name, resource_name, parameters:parameters, custom_headers:custom_headers)
685
+
686
+ promise = promise.then do |response|
687
+ # Defining deserialization method.
688
+ deserialize_method = lambda do |parsed_response|
689
+ result_mapper = Azure::Signalr::Mgmt::V2020_05_01::Models::SignalRResource.mapper()
690
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
691
+ end
692
+
693
+ # Waiting for response.
694
+ @client.get_long_running_operation_result(response, deserialize_method)
695
+ end
696
+
697
+ promise
698
+ end
699
+
700
+ #
701
+ # Operation to restart a SignalR service.
702
+ #
703
+ # @param resource_group_name [String] The name of the resource group that
704
+ # contains the resource. You can obtain this value from the Azure Resource
705
+ # Manager API or the portal.
706
+ # @param resource_name [String] The name of the SignalR resource.
707
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
708
+ # will be added to the HTTP request.
709
+ #
710
+ def restart(resource_group_name, resource_name, custom_headers:nil)
711
+ response = restart_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
712
+ nil
713
+ end
714
+
715
+ #
716
+ # @param resource_group_name [String] The name of the resource group that
717
+ # contains the resource. You can obtain this value from the Azure Resource
718
+ # Manager API or the portal.
719
+ # @param resource_name [String] The name of the SignalR resource.
720
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
721
+ # will be added to the HTTP request.
722
+ #
723
+ # @return [Concurrent::Promise] promise which provides async access to http
724
+ # response.
725
+ #
726
+ def restart_async(resource_group_name, resource_name, custom_headers:nil)
727
+ # Send request
728
+ promise = begin_restart_async(resource_group_name, resource_name, custom_headers:custom_headers)
729
+
730
+ promise = promise.then do |response|
731
+ # Defining deserialization method.
732
+ deserialize_method = lambda do |parsed_response|
733
+ end
734
+
735
+ # Waiting for response.
736
+ @client.get_long_running_operation_result(response, deserialize_method, FinalStateVia::AZURE_ASYNC_OPERATION)
737
+ end
738
+
739
+ promise
740
+ end
741
+
742
+ #
743
+ # Regenerate SignalR service access key. PrimaryKey and SecondaryKey cannot be
744
+ # regenerated at the same time.
745
+ #
746
+ # @param resource_group_name [String] The name of the resource group that
747
+ # contains the resource. You can obtain this value from the Azure Resource
748
+ # Manager API or the portal.
749
+ # @param resource_name [String] The name of the SignalR resource.
750
+ # @param parameters [RegenerateKeyParameters] Parameter that describes the
751
+ # Regenerate Key Operation.
752
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
753
+ # will be added to the HTTP request.
754
+ #
755
+ # @return [SignalRKeys] operation results.
756
+ #
757
+ def begin_regenerate_key(resource_group_name, resource_name, parameters:nil, custom_headers:nil)
758
+ response = begin_regenerate_key_async(resource_group_name, resource_name, parameters:parameters, custom_headers:custom_headers).value!
759
+ response.body unless response.nil?
760
+ end
761
+
762
+ #
763
+ # Regenerate SignalR service access key. PrimaryKey and SecondaryKey cannot be
764
+ # regenerated at the same time.
765
+ #
766
+ # @param resource_group_name [String] The name of the resource group that
767
+ # contains the resource. You can obtain this value from the Azure Resource
768
+ # Manager API or the portal.
769
+ # @param resource_name [String] The name of the SignalR resource.
770
+ # @param parameters [RegenerateKeyParameters] Parameter that describes the
771
+ # Regenerate Key Operation.
772
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
773
+ # will be added to the HTTP request.
774
+ #
775
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
776
+ #
777
+ def begin_regenerate_key_with_http_info(resource_group_name, resource_name, parameters:nil, custom_headers:nil)
778
+ begin_regenerate_key_async(resource_group_name, resource_name, parameters:parameters, custom_headers:custom_headers).value!
779
+ end
780
+
781
+ #
782
+ # Regenerate SignalR service access key. PrimaryKey and SecondaryKey cannot be
783
+ # regenerated at the same time.
784
+ #
785
+ # @param resource_group_name [String] The name of the resource group that
786
+ # contains the resource. You can obtain this value from the Azure Resource
787
+ # Manager API or the portal.
788
+ # @param resource_name [String] The name of the SignalR resource.
789
+ # @param parameters [RegenerateKeyParameters] Parameter that describes the
790
+ # Regenerate Key Operation.
791
+ # @param [Hash{String => String}] A hash of custom headers that will be added
792
+ # to the HTTP request.
793
+ #
794
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
795
+ #
796
+ def begin_regenerate_key_async(resource_group_name, resource_name, parameters:nil, custom_headers:nil)
797
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
798
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
799
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
800
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
801
+
802
+
803
+ request_headers = {}
804
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
805
+
806
+ # Set Headers
807
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
808
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
809
+
810
+ # Serialize Request
811
+ request_mapper = Azure::Signalr::Mgmt::V2020_05_01::Models::RegenerateKeyParameters.mapper()
812
+ request_content = @client.serialize(request_mapper, parameters)
813
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
814
+
815
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/regenerateKey'
816
+
817
+ request_url = @base_url || @client.base_url
818
+
819
+ options = {
820
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
821
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
822
+ query_params: {'api-version' => @client.api_version},
823
+ body: request_content,
824
+ headers: request_headers.merge(custom_headers || {}),
825
+ base_url: request_url
826
+ }
827
+ promise = @client.make_request_async(:post, path_template, options)
828
+
829
+ promise = promise.then do |result|
830
+ http_response = result.response
831
+ status_code = http_response.status
832
+ response_content = http_response.body
833
+ unless status_code == 201
834
+ error_model = JSON.load(response_content)
835
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
836
+ end
837
+
838
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
839
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
840
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
841
+ # Deserialize Response
842
+ if status_code == 201
843
+ begin
844
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
845
+ result_mapper = Azure::Signalr::Mgmt::V2020_05_01::Models::SignalRKeys.mapper()
846
+ result.body = @client.deserialize(result_mapper, parsed_response)
847
+ rescue Exception => e
848
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
849
+ end
850
+ end
851
+
852
+ result
853
+ end
854
+
855
+ promise.execute
856
+ end
857
+
858
+ #
859
+ # Create a new SignalR service and update an exiting SignalR service.
860
+ #
861
+ # @param resource_group_name [String] The name of the resource group that
862
+ # contains the resource. You can obtain this value from the Azure Resource
863
+ # Manager API or the portal.
864
+ # @param resource_name [String] The name of the SignalR resource.
865
+ # @param parameters [SignalRResource] Parameters for the create or update
866
+ # operation
867
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
868
+ # will be added to the HTTP request.
869
+ #
870
+ # @return [SignalRResource] operation results.
871
+ #
872
+ def begin_create_or_update(resource_group_name, resource_name, parameters:nil, custom_headers:nil)
873
+ response = begin_create_or_update_async(resource_group_name, resource_name, parameters:parameters, custom_headers:custom_headers).value!
874
+ response.body unless response.nil?
875
+ end
876
+
877
+ #
878
+ # Create a new SignalR service and update an exiting SignalR service.
879
+ #
880
+ # @param resource_group_name [String] The name of the resource group that
881
+ # contains the resource. You can obtain this value from the Azure Resource
882
+ # Manager API or the portal.
883
+ # @param resource_name [String] The name of the SignalR resource.
884
+ # @param parameters [SignalRResource] Parameters for the create or update
885
+ # operation
886
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
887
+ # will be added to the HTTP request.
888
+ #
889
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
890
+ #
891
+ def begin_create_or_update_with_http_info(resource_group_name, resource_name, parameters:nil, custom_headers:nil)
892
+ begin_create_or_update_async(resource_group_name, resource_name, parameters:parameters, custom_headers:custom_headers).value!
893
+ end
894
+
895
+ #
896
+ # Create a new SignalR service and update an exiting SignalR service.
897
+ #
898
+ # @param resource_group_name [String] The name of the resource group that
899
+ # contains the resource. You can obtain this value from the Azure Resource
900
+ # Manager API or the portal.
901
+ # @param resource_name [String] The name of the SignalR resource.
902
+ # @param parameters [SignalRResource] Parameters for the create or update
903
+ # operation
904
+ # @param [Hash{String => String}] A hash of custom headers that will be added
905
+ # to the HTTP request.
906
+ #
907
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
908
+ #
909
+ def begin_create_or_update_async(resource_group_name, resource_name, parameters:nil, custom_headers:nil)
910
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
911
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
912
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
913
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
914
+
915
+
916
+ request_headers = {}
917
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
918
+
919
+ # Set Headers
920
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
921
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
922
+
923
+ # Serialize Request
924
+ request_mapper = Azure::Signalr::Mgmt::V2020_05_01::Models::SignalRResource.mapper()
925
+ request_content = @client.serialize(request_mapper, parameters)
926
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
927
+
928
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}'
929
+
930
+ request_url = @base_url || @client.base_url
931
+
932
+ options = {
933
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
934
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
935
+ query_params: {'api-version' => @client.api_version},
936
+ body: request_content,
937
+ headers: request_headers.merge(custom_headers || {}),
938
+ base_url: request_url
939
+ }
940
+ promise = @client.make_request_async(:put, path_template, options)
941
+
942
+ promise = promise.then do |result|
943
+ http_response = result.response
944
+ status_code = http_response.status
945
+ response_content = http_response.body
946
+ unless status_code == 200 || status_code == 201 || status_code == 202
947
+ error_model = JSON.load(response_content)
948
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
949
+ end
950
+
951
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
952
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
953
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
954
+ # Deserialize Response
955
+ if status_code == 200
956
+ begin
957
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
958
+ result_mapper = Azure::Signalr::Mgmt::V2020_05_01::Models::SignalRResource.mapper()
959
+ result.body = @client.deserialize(result_mapper, parsed_response)
960
+ rescue Exception => e
961
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
962
+ end
963
+ end
964
+ # Deserialize Response
965
+ if status_code == 201
966
+ begin
967
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
968
+ result_mapper = Azure::Signalr::Mgmt::V2020_05_01::Models::SignalRResource.mapper()
969
+ result.body = @client.deserialize(result_mapper, parsed_response)
970
+ rescue Exception => e
971
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
972
+ end
973
+ end
974
+
975
+ result
976
+ end
977
+
978
+ promise.execute
979
+ end
980
+
981
+ #
982
+ # Operation to delete a SignalR service.
983
+ #
984
+ # @param resource_group_name [String] The name of the resource group that
985
+ # contains the resource. You can obtain this value from the Azure Resource
986
+ # Manager API or the portal.
987
+ # @param resource_name [String] The name of the SignalR resource.
988
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
989
+ # will be added to the HTTP request.
990
+ #
991
+ #
992
+ def begin_delete(resource_group_name, resource_name, custom_headers:nil)
993
+ response = begin_delete_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
994
+ nil
995
+ end
996
+
997
+ #
998
+ # Operation to delete a SignalR service.
999
+ #
1000
+ # @param resource_group_name [String] The name of the resource group that
1001
+ # contains the resource. You can obtain this value from the Azure Resource
1002
+ # Manager API or the portal.
1003
+ # @param resource_name [String] The name of the SignalR resource.
1004
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1005
+ # will be added to the HTTP request.
1006
+ #
1007
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1008
+ #
1009
+ def begin_delete_with_http_info(resource_group_name, resource_name, custom_headers:nil)
1010
+ begin_delete_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
1011
+ end
1012
+
1013
+ #
1014
+ # Operation to delete a SignalR service.
1015
+ #
1016
+ # @param resource_group_name [String] The name of the resource group that
1017
+ # contains the resource. You can obtain this value from the Azure Resource
1018
+ # Manager API or the portal.
1019
+ # @param resource_name [String] The name of the SignalR resource.
1020
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1021
+ # to the HTTP request.
1022
+ #
1023
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1024
+ #
1025
+ def begin_delete_async(resource_group_name, resource_name, custom_headers:nil)
1026
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1027
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1028
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1029
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
1030
+
1031
+
1032
+ request_headers = {}
1033
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1034
+
1035
+ # Set Headers
1036
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1037
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1038
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}'
1039
+
1040
+ request_url = @base_url || @client.base_url
1041
+
1042
+ options = {
1043
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1044
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
1045
+ query_params: {'api-version' => @client.api_version},
1046
+ headers: request_headers.merge(custom_headers || {}),
1047
+ base_url: request_url
1048
+ }
1049
+ promise = @client.make_request_async(:delete, path_template, options)
1050
+
1051
+ promise = promise.then do |result|
1052
+ http_response = result.response
1053
+ status_code = http_response.status
1054
+ response_content = http_response.body
1055
+ unless status_code == 202 || status_code == 204
1056
+ error_model = JSON.load(response_content)
1057
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1058
+ end
1059
+
1060
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1061
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1062
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1063
+
1064
+ result
1065
+ end
1066
+
1067
+ promise.execute
1068
+ end
1069
+
1070
+ #
1071
+ # Operation to update an exiting SignalR service.
1072
+ #
1073
+ # @param resource_group_name [String] The name of the resource group that
1074
+ # contains the resource. You can obtain this value from the Azure Resource
1075
+ # Manager API or the portal.
1076
+ # @param resource_name [String] The name of the SignalR resource.
1077
+ # @param parameters [SignalRResource] Parameters for the update operation
1078
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1079
+ # will be added to the HTTP request.
1080
+ #
1081
+ # @return [SignalRResource] operation results.
1082
+ #
1083
+ def begin_update(resource_group_name, resource_name, parameters:nil, custom_headers:nil)
1084
+ response = begin_update_async(resource_group_name, resource_name, parameters:parameters, custom_headers:custom_headers).value!
1085
+ response.body unless response.nil?
1086
+ end
1087
+
1088
+ #
1089
+ # Operation to update an exiting SignalR service.
1090
+ #
1091
+ # @param resource_group_name [String] The name of the resource group that
1092
+ # contains the resource. You can obtain this value from the Azure Resource
1093
+ # Manager API or the portal.
1094
+ # @param resource_name [String] The name of the SignalR resource.
1095
+ # @param parameters [SignalRResource] Parameters for the update operation
1096
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1097
+ # will be added to the HTTP request.
1098
+ #
1099
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1100
+ #
1101
+ def begin_update_with_http_info(resource_group_name, resource_name, parameters:nil, custom_headers:nil)
1102
+ begin_update_async(resource_group_name, resource_name, parameters:parameters, custom_headers:custom_headers).value!
1103
+ end
1104
+
1105
+ #
1106
+ # Operation to update an exiting SignalR service.
1107
+ #
1108
+ # @param resource_group_name [String] The name of the resource group that
1109
+ # contains the resource. You can obtain this value from the Azure Resource
1110
+ # Manager API or the portal.
1111
+ # @param resource_name [String] The name of the SignalR resource.
1112
+ # @param parameters [SignalRResource] Parameters for the update operation
1113
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1114
+ # to the HTTP request.
1115
+ #
1116
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1117
+ #
1118
+ def begin_update_async(resource_group_name, resource_name, parameters:nil, custom_headers:nil)
1119
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1120
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1121
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1122
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
1123
+
1124
+
1125
+ request_headers = {}
1126
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1127
+
1128
+ # Set Headers
1129
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1130
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1131
+
1132
+ # Serialize Request
1133
+ request_mapper = Azure::Signalr::Mgmt::V2020_05_01::Models::SignalRResource.mapper()
1134
+ request_content = @client.serialize(request_mapper, parameters)
1135
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1136
+
1137
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}'
1138
+
1139
+ request_url = @base_url || @client.base_url
1140
+
1141
+ options = {
1142
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1143
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
1144
+ query_params: {'api-version' => @client.api_version},
1145
+ body: request_content,
1146
+ headers: request_headers.merge(custom_headers || {}),
1147
+ base_url: request_url
1148
+ }
1149
+ promise = @client.make_request_async(:patch, path_template, options)
1150
+
1151
+ promise = promise.then do |result|
1152
+ http_response = result.response
1153
+ status_code = http_response.status
1154
+ response_content = http_response.body
1155
+ unless status_code == 200 || status_code == 202
1156
+ error_model = JSON.load(response_content)
1157
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1158
+ end
1159
+
1160
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1161
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1162
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1163
+ # Deserialize Response
1164
+ if status_code == 200
1165
+ begin
1166
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1167
+ result_mapper = Azure::Signalr::Mgmt::V2020_05_01::Models::SignalRResource.mapper()
1168
+ result.body = @client.deserialize(result_mapper, parsed_response)
1169
+ rescue Exception => e
1170
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1171
+ end
1172
+ end
1173
+
1174
+ result
1175
+ end
1176
+
1177
+ promise.execute
1178
+ end
1179
+
1180
+ #
1181
+ # Operation to restart a SignalR service.
1182
+ #
1183
+ # @param resource_group_name [String] The name of the resource group that
1184
+ # contains the resource. You can obtain this value from the Azure Resource
1185
+ # Manager API or the portal.
1186
+ # @param resource_name [String] The name of the SignalR resource.
1187
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1188
+ # will be added to the HTTP request.
1189
+ #
1190
+ #
1191
+ def begin_restart(resource_group_name, resource_name, custom_headers:nil)
1192
+ response = begin_restart_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
1193
+ nil
1194
+ end
1195
+
1196
+ #
1197
+ # Operation to restart a SignalR service.
1198
+ #
1199
+ # @param resource_group_name [String] The name of the resource group that
1200
+ # contains the resource. You can obtain this value from the Azure Resource
1201
+ # Manager API or the portal.
1202
+ # @param resource_name [String] The name of the SignalR resource.
1203
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1204
+ # will be added to the HTTP request.
1205
+ #
1206
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1207
+ #
1208
+ def begin_restart_with_http_info(resource_group_name, resource_name, custom_headers:nil)
1209
+ begin_restart_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
1210
+ end
1211
+
1212
+ #
1213
+ # Operation to restart a SignalR service.
1214
+ #
1215
+ # @param resource_group_name [String] The name of the resource group that
1216
+ # contains the resource. You can obtain this value from the Azure Resource
1217
+ # Manager API or the portal.
1218
+ # @param resource_name [String] The name of the SignalR resource.
1219
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1220
+ # to the HTTP request.
1221
+ #
1222
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1223
+ #
1224
+ def begin_restart_async(resource_group_name, resource_name, custom_headers:nil)
1225
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1226
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1227
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1228
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
1229
+
1230
+
1231
+ request_headers = {}
1232
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1233
+
1234
+ # Set Headers
1235
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1236
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1237
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/restart'
1238
+
1239
+ request_url = @base_url || @client.base_url
1240
+
1241
+ options = {
1242
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1243
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
1244
+ query_params: {'api-version' => @client.api_version},
1245
+ headers: request_headers.merge(custom_headers || {}),
1246
+ base_url: request_url
1247
+ }
1248
+ promise = @client.make_request_async(:post, path_template, options)
1249
+
1250
+ promise = promise.then do |result|
1251
+ http_response = result.response
1252
+ status_code = http_response.status
1253
+ response_content = http_response.body
1254
+ unless status_code == 202 || status_code == 204
1255
+ error_model = JSON.load(response_content)
1256
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1257
+ end
1258
+
1259
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1260
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1261
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1262
+
1263
+ result
1264
+ end
1265
+
1266
+ promise.execute
1267
+ end
1268
+
1269
+ #
1270
+ # Handles requests to list all resources in a subscription.
1271
+ #
1272
+ # @param next_page_link [String] The NextLink from the previous successful call
1273
+ # to List operation.
1274
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1275
+ # will be added to the HTTP request.
1276
+ #
1277
+ # @return [SignalRResourceList] operation results.
1278
+ #
1279
+ def list_by_subscription_next(next_page_link, custom_headers:nil)
1280
+ response = list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
1281
+ response.body unless response.nil?
1282
+ end
1283
+
1284
+ #
1285
+ # Handles requests to list all resources in a subscription.
1286
+ #
1287
+ # @param next_page_link [String] The NextLink from the previous successful call
1288
+ # to List operation.
1289
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1290
+ # will be added to the HTTP request.
1291
+ #
1292
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1293
+ #
1294
+ def list_by_subscription_next_with_http_info(next_page_link, custom_headers:nil)
1295
+ list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
1296
+ end
1297
+
1298
+ #
1299
+ # Handles requests to list all resources in a subscription.
1300
+ #
1301
+ # @param next_page_link [String] The NextLink from the previous successful call
1302
+ # to List operation.
1303
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1304
+ # to the HTTP request.
1305
+ #
1306
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1307
+ #
1308
+ def list_by_subscription_next_async(next_page_link, custom_headers:nil)
1309
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1310
+
1311
+
1312
+ request_headers = {}
1313
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1314
+
1315
+ # Set Headers
1316
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1317
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1318
+ path_template = '{nextLink}'
1319
+
1320
+ request_url = @base_url || @client.base_url
1321
+
1322
+ options = {
1323
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1324
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1325
+ headers: request_headers.merge(custom_headers || {}),
1326
+ base_url: request_url
1327
+ }
1328
+ promise = @client.make_request_async(:get, path_template, options)
1329
+
1330
+ promise = promise.then do |result|
1331
+ http_response = result.response
1332
+ status_code = http_response.status
1333
+ response_content = http_response.body
1334
+ unless status_code == 200
1335
+ error_model = JSON.load(response_content)
1336
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1337
+ end
1338
+
1339
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1340
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1341
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1342
+ # Deserialize Response
1343
+ if status_code == 200
1344
+ begin
1345
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1346
+ result_mapper = Azure::Signalr::Mgmt::V2020_05_01::Models::SignalRResourceList.mapper()
1347
+ result.body = @client.deserialize(result_mapper, parsed_response)
1348
+ rescue Exception => e
1349
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1350
+ end
1351
+ end
1352
+
1353
+ result
1354
+ end
1355
+
1356
+ promise.execute
1357
+ end
1358
+
1359
+ #
1360
+ # Handles requests to list all resources in a resource group.
1361
+ #
1362
+ # @param next_page_link [String] The NextLink from the previous successful call
1363
+ # to List operation.
1364
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1365
+ # will be added to the HTTP request.
1366
+ #
1367
+ # @return [SignalRResourceList] operation results.
1368
+ #
1369
+ def list_by_resource_group_next(next_page_link, custom_headers:nil)
1370
+ response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
1371
+ response.body unless response.nil?
1372
+ end
1373
+
1374
+ #
1375
+ # Handles requests to list all resources in a resource group.
1376
+ #
1377
+ # @param next_page_link [String] The NextLink from the previous successful call
1378
+ # to List operation.
1379
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1380
+ # will be added to the HTTP request.
1381
+ #
1382
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1383
+ #
1384
+ def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
1385
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
1386
+ end
1387
+
1388
+ #
1389
+ # Handles requests to list all resources in a resource group.
1390
+ #
1391
+ # @param next_page_link [String] The NextLink from the previous successful call
1392
+ # to List operation.
1393
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1394
+ # to the HTTP request.
1395
+ #
1396
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1397
+ #
1398
+ def list_by_resource_group_next_async(next_page_link, custom_headers:nil)
1399
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1400
+
1401
+
1402
+ request_headers = {}
1403
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1404
+
1405
+ # Set Headers
1406
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1407
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1408
+ path_template = '{nextLink}'
1409
+
1410
+ request_url = @base_url || @client.base_url
1411
+
1412
+ options = {
1413
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1414
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1415
+ headers: request_headers.merge(custom_headers || {}),
1416
+ base_url: request_url
1417
+ }
1418
+ promise = @client.make_request_async(:get, path_template, options)
1419
+
1420
+ promise = promise.then do |result|
1421
+ http_response = result.response
1422
+ status_code = http_response.status
1423
+ response_content = http_response.body
1424
+ unless status_code == 200
1425
+ error_model = JSON.load(response_content)
1426
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1427
+ end
1428
+
1429
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1430
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1431
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1432
+ # Deserialize Response
1433
+ if status_code == 200
1434
+ begin
1435
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1436
+ result_mapper = Azure::Signalr::Mgmt::V2020_05_01::Models::SignalRResourceList.mapper()
1437
+ result.body = @client.deserialize(result_mapper, parsed_response)
1438
+ rescue Exception => e
1439
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1440
+ end
1441
+ end
1442
+
1443
+ result
1444
+ end
1445
+
1446
+ promise.execute
1447
+ end
1448
+
1449
+ #
1450
+ # Handles requests to list all resources in a subscription.
1451
+ #
1452
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1453
+ # will be added to the HTTP request.
1454
+ #
1455
+ # @return [SignalRResourceList] which provide lazy access to pages of the
1456
+ # response.
1457
+ #
1458
+ def list_by_subscription_as_lazy(custom_headers:nil)
1459
+ response = list_by_subscription_async(custom_headers:custom_headers).value!
1460
+ unless response.nil?
1461
+ page = response.body
1462
+ page.next_method = Proc.new do |next_page_link|
1463
+ list_by_subscription_next_async(next_page_link, custom_headers:custom_headers)
1464
+ end
1465
+ page
1466
+ end
1467
+ end
1468
+
1469
+ #
1470
+ # Handles requests to list all resources in a resource group.
1471
+ #
1472
+ # @param resource_group_name [String] The name of the resource group that
1473
+ # contains the resource. You can obtain this value from the Azure Resource
1474
+ # Manager API or the portal.
1475
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1476
+ # will be added to the HTTP request.
1477
+ #
1478
+ # @return [SignalRResourceList] which provide lazy access to pages of the
1479
+ # response.
1480
+ #
1481
+ def list_by_resource_group_as_lazy(resource_group_name, custom_headers:nil)
1482
+ response = list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
1483
+ unless response.nil?
1484
+ page = response.body
1485
+ page.next_method = Proc.new do |next_page_link|
1486
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
1487
+ end
1488
+ page
1489
+ end
1490
+ end
1491
+
1492
+ end
1493
+ end