azure_mgmt_signalr 0.17.3 → 0.17.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2018-03-01-preview/generated/azure_mgmt_signalr/models/resource.rb +1 -1
  3. data/lib/2018-03-01-preview/generated/azure_mgmt_signalr/models/signal_rusage_name.rb +1 -1
  4. data/lib/2018-03-01-preview/generated/azure_mgmt_signalr/operations.rb +4 -0
  5. data/lib/2018-03-01-preview/generated/azure_mgmt_signalr/signal_r.rb +22 -0
  6. data/lib/2018-03-01-preview/generated/azure_mgmt_signalr/signal_rmanagement_client.rb +1 -1
  7. data/lib/2018-03-01-preview/generated/azure_mgmt_signalr/usages.rb +4 -0
  8. data/lib/2018-10-01/generated/azure_mgmt_signalr.rb +57 -0
  9. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/dimension.rb +80 -0
  10. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/key_type.rb +16 -0
  11. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/metric_specification.rb +139 -0
  12. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/name_availability.rb +70 -0
  13. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/name_availability_parameters.rb +59 -0
  14. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/operation.rb +84 -0
  15. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/operation_display.rb +79 -0
  16. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/operation_list.rb +102 -0
  17. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/operation_properties.rb +47 -0
  18. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/provisioning_state.rb +23 -0
  19. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/regenerate_key_parameters.rb +48 -0
  20. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/resource.rb +81 -0
  21. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/resource_sku.rb +101 -0
  22. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/service_specification.rb +56 -0
  23. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/signal_rcors_settings.rb +57 -0
  24. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/signal_rcreate_or_update_properties.rb +92 -0
  25. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/signal_rcreate_parameters.rb +85 -0
  26. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/signal_rfeature.rb +87 -0
  27. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/signal_rkeys.rb +81 -0
  28. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/signal_rresource.rb +232 -0
  29. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/signal_rresource_list.rb +101 -0
  30. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/signal_rsku_tier.rb +18 -0
  31. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/signal_rupdate_parameters.rb +81 -0
  32. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/signal_rusage.rb +95 -0
  33. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/signal_rusage_list.rb +101 -0
  34. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/signal_rusage_name.rb +57 -0
  35. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/tracked_resource.rb +94 -0
  36. data/lib/2018-10-01/generated/azure_mgmt_signalr/module_definition.rb +9 -0
  37. data/lib/2018-10-01/generated/azure_mgmt_signalr/operations.rb +225 -0
  38. data/lib/2018-10-01/generated/azure_mgmt_signalr/signal_r.rb +1488 -0
  39. data/lib/2018-10-01/generated/azure_mgmt_signalr/signal_rmanagement_client.rb +141 -0
  40. data/lib/2018-10-01/generated/azure_mgmt_signalr/usages.rb +226 -0
  41. data/lib/azure_mgmt_signalr.rb +1 -0
  42. data/lib/profiles/latest/modules/signalr_profile_module.rb +71 -63
  43. data/lib/version.rb +1 -1
  44. metadata +38 -5
@@ -0,0 +1,9 @@
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 end
7
+ module Azure::Signalr end
8
+ module Azure::Signalr::Mgmt end
9
+ module Azure::Signalr::Mgmt::V2018_10_01 end
@@ -0,0 +1,225 @@
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::V2018_10_01
7
+ #
8
+ # REST API for Azure SignalR Service
9
+ #
10
+ class Operations
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Operations 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
+ # Lists all of the available REST API operations of the
26
+ # Microsoft.SignalRService provider.
27
+ #
28
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
29
+ # will be added to the HTTP request.
30
+ #
31
+ # @return [Array<Operation>] operation results.
32
+ #
33
+ def list(custom_headers:nil)
34
+ first_page = list_as_lazy(custom_headers:custom_headers)
35
+ first_page.get_all_items
36
+ end
37
+
38
+ #
39
+ # Lists all of the available REST API operations of the
40
+ # Microsoft.SignalRService provider.
41
+ #
42
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
43
+ # will be added to the HTTP request.
44
+ #
45
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
46
+ #
47
+ def list_with_http_info(custom_headers:nil)
48
+ list_async(custom_headers:custom_headers).value!
49
+ end
50
+
51
+ #
52
+ # Lists all of the available REST API operations of the
53
+ # Microsoft.SignalRService provider.
54
+ #
55
+ # @param [Hash{String => String}] A hash of custom headers that will be added
56
+ # to the HTTP request.
57
+ #
58
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
59
+ #
60
+ def list_async(custom_headers:nil)
61
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
62
+
63
+
64
+ request_headers = {}
65
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
66
+
67
+ # Set Headers
68
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
69
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
70
+ path_template = 'providers/Microsoft.SignalRService/operations'
71
+
72
+ request_url = @base_url || @client.base_url
73
+
74
+ options = {
75
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
76
+ query_params: {'api-version' => @client.api_version},
77
+ headers: request_headers.merge(custom_headers || {}),
78
+ base_url: request_url
79
+ }
80
+ promise = @client.make_request_async(:get, path_template, options)
81
+
82
+ promise = promise.then do |result|
83
+ http_response = result.response
84
+ status_code = http_response.status
85
+ response_content = http_response.body
86
+ unless status_code == 200
87
+ error_model = JSON.load(response_content)
88
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
89
+ end
90
+
91
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
92
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
93
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
94
+ # Deserialize Response
95
+ if status_code == 200
96
+ begin
97
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
98
+ result_mapper = Azure::Signalr::Mgmt::V2018_10_01::Models::OperationList.mapper()
99
+ result.body = @client.deserialize(result_mapper, parsed_response)
100
+ rescue Exception => e
101
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
102
+ end
103
+ end
104
+
105
+ result
106
+ end
107
+
108
+ promise.execute
109
+ end
110
+
111
+ #
112
+ # Lists all of the available REST API operations of the
113
+ # Microsoft.SignalRService provider.
114
+ #
115
+ # @param next_page_link [String] The NextLink from the previous successful call
116
+ # to List operation.
117
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
118
+ # will be added to the HTTP request.
119
+ #
120
+ # @return [OperationList] operation results.
121
+ #
122
+ def list_next(next_page_link, custom_headers:nil)
123
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
124
+ response.body unless response.nil?
125
+ end
126
+
127
+ #
128
+ # Lists all of the available REST API operations of the
129
+ # Microsoft.SignalRService provider.
130
+ #
131
+ # @param next_page_link [String] The NextLink from the previous successful call
132
+ # to List operation.
133
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
134
+ # will be added to the HTTP request.
135
+ #
136
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
137
+ #
138
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
139
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
140
+ end
141
+
142
+ #
143
+ # Lists all of the available REST API operations of the
144
+ # Microsoft.SignalRService provider.
145
+ #
146
+ # @param next_page_link [String] The NextLink from the previous successful call
147
+ # to List operation.
148
+ # @param [Hash{String => String}] A hash of custom headers that will be added
149
+ # to the HTTP request.
150
+ #
151
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
152
+ #
153
+ def list_next_async(next_page_link, custom_headers:nil)
154
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
155
+
156
+
157
+ request_headers = {}
158
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
159
+
160
+ # Set Headers
161
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
162
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
163
+ path_template = '{nextLink}'
164
+
165
+ request_url = @base_url || @client.base_url
166
+
167
+ options = {
168
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
169
+ skip_encoding_path_params: {'nextLink' => next_page_link},
170
+ headers: request_headers.merge(custom_headers || {}),
171
+ base_url: request_url
172
+ }
173
+ promise = @client.make_request_async(:get, path_template, options)
174
+
175
+ promise = promise.then do |result|
176
+ http_response = result.response
177
+ status_code = http_response.status
178
+ response_content = http_response.body
179
+ unless status_code == 200
180
+ error_model = JSON.load(response_content)
181
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
182
+ end
183
+
184
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
185
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
186
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
187
+ # Deserialize Response
188
+ if status_code == 200
189
+ begin
190
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
191
+ result_mapper = Azure::Signalr::Mgmt::V2018_10_01::Models::OperationList.mapper()
192
+ result.body = @client.deserialize(result_mapper, parsed_response)
193
+ rescue Exception => e
194
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
195
+ end
196
+ end
197
+
198
+ result
199
+ end
200
+
201
+ promise.execute
202
+ end
203
+
204
+ #
205
+ # Lists all of the available REST API operations of the
206
+ # Microsoft.SignalRService provider.
207
+ #
208
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
209
+ # will be added to the HTTP request.
210
+ #
211
+ # @return [OperationList] which provide lazy access to pages of the response.
212
+ #
213
+ def list_as_lazy(custom_headers:nil)
214
+ response = list_async(custom_headers:custom_headers).value!
215
+ unless response.nil?
216
+ page = response.body
217
+ page.next_method = Proc.new do |next_page_link|
218
+ list_next_async(next_page_link, custom_headers:custom_headers)
219
+ end
220
+ page
221
+ end
222
+ end
223
+
224
+ end
225
+ end
@@ -0,0 +1,1488 @@
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::V2018_10_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::V2018_10_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 MsRestAzure::AzureOperationError.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::V2018_10_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 MsRestAzure::AzureOperationError.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::V2018_10_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 MsRestAzure::AzureOperationError.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::V2018_10_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 MsRestAzure::AzureOperationError.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::V2018_10_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::V2018_10_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 MsRestAzure::AzureOperationError.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::V2018_10_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 [SignalRCreateParameters] Parameters for the create or
568
+ # update 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 [SignalRCreateParameters] Parameters for the create or
585
+ # update 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::V2018_10_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 [SignalRUpdateParameters] Parameters for the update
660
+ # operation
661
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
662
+ # will be added to the HTTP request.
663
+ #
664
+ # @return [SignalRResource] operation results.
665
+ #
666
+ def update(resource_group_name, resource_name, parameters:nil, custom_headers:nil)
667
+ response = update_async(resource_group_name, resource_name, parameters:parameters, custom_headers:custom_headers).value!
668
+ response.body unless response.nil?
669
+ end
670
+
671
+ #
672
+ # @param resource_group_name [String] The name of the resource group that
673
+ # contains the resource. You can obtain this value from the Azure Resource
674
+ # Manager API or the portal.
675
+ # @param resource_name [String] The name of the SignalR resource.
676
+ # @param parameters [SignalRUpdateParameters] Parameters for the update
677
+ # operation
678
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
679
+ # will be added to the HTTP request.
680
+ #
681
+ # @return [Concurrent::Promise] promise which provides async access to http
682
+ # response.
683
+ #
684
+ def update_async(resource_group_name, resource_name, parameters:nil, custom_headers:nil)
685
+ # Send request
686
+ promise = begin_update_async(resource_group_name, resource_name, parameters:parameters, custom_headers:custom_headers)
687
+
688
+ promise = promise.then do |response|
689
+ # Defining deserialization method.
690
+ deserialize_method = lambda do |parsed_response|
691
+ result_mapper = Azure::Signalr::Mgmt::V2018_10_01::Models::SignalRResource.mapper()
692
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
693
+ end
694
+
695
+ # Waiting for response.
696
+ @client.get_long_running_operation_result(response, deserialize_method)
697
+ end
698
+
699
+ promise
700
+ end
701
+
702
+ #
703
+ # Operation to restart a SignalR service.
704
+ #
705
+ # @param resource_group_name [String] The name of the resource group that
706
+ # contains the resource. You can obtain this value from the Azure Resource
707
+ # Manager API or the portal.
708
+ # @param resource_name [String] The name of the SignalR resource.
709
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
710
+ # will be added to the HTTP request.
711
+ #
712
+ def restart(resource_group_name, resource_name, custom_headers:nil)
713
+ response = restart_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
714
+ nil
715
+ end
716
+
717
+ #
718
+ # @param resource_group_name [String] The name of the resource group that
719
+ # contains the resource. You can obtain this value from the Azure Resource
720
+ # Manager API or the portal.
721
+ # @param resource_name [String] The name of the SignalR resource.
722
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
723
+ # will be added to the HTTP request.
724
+ #
725
+ # @return [Concurrent::Promise] promise which provides async access to http
726
+ # response.
727
+ #
728
+ def restart_async(resource_group_name, resource_name, custom_headers:nil)
729
+ # Send request
730
+ promise = begin_restart_async(resource_group_name, resource_name, custom_headers:custom_headers)
731
+
732
+ promise = promise.then do |response|
733
+ # Defining deserialization method.
734
+ deserialize_method = lambda do |parsed_response|
735
+ end
736
+
737
+ # Waiting for response.
738
+ @client.get_long_running_operation_result(response, deserialize_method, FinalStateVia::AZURE_ASYNC_OPERATION)
739
+ end
740
+
741
+ promise
742
+ end
743
+
744
+ #
745
+ # Regenerate SignalR service access key. PrimaryKey and SecondaryKey cannot be
746
+ # regenerated at the same time.
747
+ #
748
+ # @param resource_group_name [String] The name of the resource group that
749
+ # contains the resource. You can obtain this value from the Azure Resource
750
+ # Manager API or the portal.
751
+ # @param resource_name [String] The name of the SignalR resource.
752
+ # @param parameters [RegenerateKeyParameters] Parameter that describes the
753
+ # Regenerate Key Operation.
754
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
755
+ # will be added to the HTTP request.
756
+ #
757
+ # @return [SignalRKeys] operation results.
758
+ #
759
+ def begin_regenerate_key(resource_group_name, resource_name, parameters:nil, custom_headers:nil)
760
+ response = begin_regenerate_key_async(resource_group_name, resource_name, parameters:parameters, custom_headers:custom_headers).value!
761
+ response.body unless response.nil?
762
+ end
763
+
764
+ #
765
+ # Regenerate SignalR service access key. PrimaryKey and SecondaryKey cannot be
766
+ # regenerated at the same time.
767
+ #
768
+ # @param resource_group_name [String] The name of the resource group that
769
+ # contains the resource. You can obtain this value from the Azure Resource
770
+ # Manager API or the portal.
771
+ # @param resource_name [String] The name of the SignalR resource.
772
+ # @param parameters [RegenerateKeyParameters] Parameter that describes the
773
+ # Regenerate Key Operation.
774
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
775
+ # will be added to the HTTP request.
776
+ #
777
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
778
+ #
779
+ def begin_regenerate_key_with_http_info(resource_group_name, resource_name, parameters:nil, custom_headers:nil)
780
+ begin_regenerate_key_async(resource_group_name, resource_name, parameters:parameters, custom_headers:custom_headers).value!
781
+ end
782
+
783
+ #
784
+ # Regenerate SignalR service access key. PrimaryKey and SecondaryKey cannot be
785
+ # regenerated at the same time.
786
+ #
787
+ # @param resource_group_name [String] The name of the resource group that
788
+ # contains the resource. You can obtain this value from the Azure Resource
789
+ # Manager API or the portal.
790
+ # @param resource_name [String] The name of the SignalR resource.
791
+ # @param parameters [RegenerateKeyParameters] Parameter that describes the
792
+ # Regenerate Key Operation.
793
+ # @param [Hash{String => String}] A hash of custom headers that will be added
794
+ # to the HTTP request.
795
+ #
796
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
797
+ #
798
+ def begin_regenerate_key_async(resource_group_name, resource_name, parameters:nil, custom_headers:nil)
799
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
800
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
801
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
802
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
803
+
804
+
805
+ request_headers = {}
806
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
807
+
808
+ # Set Headers
809
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
810
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
811
+
812
+ # Serialize Request
813
+ request_mapper = Azure::Signalr::Mgmt::V2018_10_01::Models::RegenerateKeyParameters.mapper()
814
+ request_content = @client.serialize(request_mapper, parameters)
815
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
816
+
817
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/SignalR/{resourceName}/regenerateKey'
818
+
819
+ request_url = @base_url || @client.base_url
820
+
821
+ options = {
822
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
823
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
824
+ query_params: {'api-version' => @client.api_version},
825
+ body: request_content,
826
+ headers: request_headers.merge(custom_headers || {}),
827
+ base_url: request_url
828
+ }
829
+ promise = @client.make_request_async(:post, path_template, options)
830
+
831
+ promise = promise.then do |result|
832
+ http_response = result.response
833
+ status_code = http_response.status
834
+ response_content = http_response.body
835
+ unless status_code == 201
836
+ error_model = JSON.load(response_content)
837
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
838
+ end
839
+
840
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
841
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
842
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
843
+ # Deserialize Response
844
+ if status_code == 201
845
+ begin
846
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
847
+ result_mapper = Azure::Signalr::Mgmt::V2018_10_01::Models::SignalRKeys.mapper()
848
+ result.body = @client.deserialize(result_mapper, parsed_response)
849
+ rescue Exception => e
850
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
851
+ end
852
+ end
853
+
854
+ result
855
+ end
856
+
857
+ promise.execute
858
+ end
859
+
860
+ #
861
+ # Create a new SignalR service and update an exiting SignalR service.
862
+ #
863
+ # @param resource_group_name [String] The name of the resource group that
864
+ # contains the resource. You can obtain this value from the Azure Resource
865
+ # Manager API or the portal.
866
+ # @param resource_name [String] The name of the SignalR resource.
867
+ # @param parameters [SignalRCreateParameters] Parameters for the create or
868
+ # update operation
869
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
870
+ # will be added to the HTTP request.
871
+ #
872
+ # @return [SignalRResource] operation results.
873
+ #
874
+ def begin_create_or_update(resource_group_name, resource_name, parameters:nil, custom_headers:nil)
875
+ response = begin_create_or_update_async(resource_group_name, resource_name, parameters:parameters, custom_headers:custom_headers).value!
876
+ response.body unless response.nil?
877
+ end
878
+
879
+ #
880
+ # Create a new SignalR service and update an exiting SignalR service.
881
+ #
882
+ # @param resource_group_name [String] The name of the resource group that
883
+ # contains the resource. You can obtain this value from the Azure Resource
884
+ # Manager API or the portal.
885
+ # @param resource_name [String] The name of the SignalR resource.
886
+ # @param parameters [SignalRCreateParameters] Parameters for the create or
887
+ # update operation
888
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
889
+ # will be added to the HTTP request.
890
+ #
891
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
892
+ #
893
+ def begin_create_or_update_with_http_info(resource_group_name, resource_name, parameters:nil, custom_headers:nil)
894
+ begin_create_or_update_async(resource_group_name, resource_name, parameters:parameters, custom_headers:custom_headers).value!
895
+ end
896
+
897
+ #
898
+ # Create a new SignalR service and update an exiting SignalR service.
899
+ #
900
+ # @param resource_group_name [String] The name of the resource group that
901
+ # contains the resource. You can obtain this value from the Azure Resource
902
+ # Manager API or the portal.
903
+ # @param resource_name [String] The name of the SignalR resource.
904
+ # @param parameters [SignalRCreateParameters] Parameters for the create or
905
+ # update operation
906
+ # @param [Hash{String => String}] A hash of custom headers that will be added
907
+ # to the HTTP request.
908
+ #
909
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
910
+ #
911
+ def begin_create_or_update_async(resource_group_name, resource_name, parameters:nil, custom_headers:nil)
912
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
913
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
914
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
915
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
916
+
917
+
918
+ request_headers = {}
919
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
920
+
921
+ # Set Headers
922
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
923
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
924
+
925
+ # Serialize Request
926
+ request_mapper = Azure::Signalr::Mgmt::V2018_10_01::Models::SignalRCreateParameters.mapper()
927
+ request_content = @client.serialize(request_mapper, parameters)
928
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
929
+
930
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}'
931
+
932
+ request_url = @base_url || @client.base_url
933
+
934
+ options = {
935
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
936
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
937
+ query_params: {'api-version' => @client.api_version},
938
+ body: request_content,
939
+ headers: request_headers.merge(custom_headers || {}),
940
+ base_url: request_url
941
+ }
942
+ promise = @client.make_request_async(:put, path_template, options)
943
+
944
+ promise = promise.then do |result|
945
+ http_response = result.response
946
+ status_code = http_response.status
947
+ response_content = http_response.body
948
+ unless status_code == 201 || status_code == 202
949
+ error_model = JSON.load(response_content)
950
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
951
+ end
952
+
953
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
954
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
955
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
956
+ # Deserialize Response
957
+ if status_code == 201
958
+ begin
959
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
960
+ result_mapper = Azure::Signalr::Mgmt::V2018_10_01::Models::SignalRResource.mapper()
961
+ result.body = @client.deserialize(result_mapper, parsed_response)
962
+ rescue Exception => e
963
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
964
+ end
965
+ end
966
+
967
+ result
968
+ end
969
+
970
+ promise.execute
971
+ end
972
+
973
+ #
974
+ # Operation to delete a SignalR service.
975
+ #
976
+ # @param resource_group_name [String] The name of the resource group that
977
+ # contains the resource. You can obtain this value from the Azure Resource
978
+ # Manager API or the portal.
979
+ # @param resource_name [String] The name of the SignalR resource.
980
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
981
+ # will be added to the HTTP request.
982
+ #
983
+ #
984
+ def begin_delete(resource_group_name, resource_name, custom_headers:nil)
985
+ response = begin_delete_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
986
+ nil
987
+ end
988
+
989
+ #
990
+ # Operation to delete a SignalR service.
991
+ #
992
+ # @param resource_group_name [String] The name of the resource group that
993
+ # contains the resource. You can obtain this value from the Azure Resource
994
+ # Manager API or the portal.
995
+ # @param resource_name [String] The name of the SignalR resource.
996
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
997
+ # will be added to the HTTP request.
998
+ #
999
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1000
+ #
1001
+ def begin_delete_with_http_info(resource_group_name, resource_name, custom_headers:nil)
1002
+ begin_delete_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
1003
+ end
1004
+
1005
+ #
1006
+ # Operation to delete a SignalR service.
1007
+ #
1008
+ # @param resource_group_name [String] The name of the resource group that
1009
+ # contains the resource. You can obtain this value from the Azure Resource
1010
+ # Manager API or the portal.
1011
+ # @param resource_name [String] The name of the SignalR resource.
1012
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1013
+ # to the HTTP request.
1014
+ #
1015
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1016
+ #
1017
+ def begin_delete_async(resource_group_name, resource_name, custom_headers:nil)
1018
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1019
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1020
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1021
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
1022
+
1023
+
1024
+ request_headers = {}
1025
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1026
+
1027
+ # Set Headers
1028
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1029
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1030
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}'
1031
+
1032
+ request_url = @base_url || @client.base_url
1033
+
1034
+ options = {
1035
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1036
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
1037
+ query_params: {'api-version' => @client.api_version},
1038
+ headers: request_headers.merge(custom_headers || {}),
1039
+ base_url: request_url
1040
+ }
1041
+ promise = @client.make_request_async(:delete, path_template, options)
1042
+
1043
+ promise = promise.then do |result|
1044
+ http_response = result.response
1045
+ status_code = http_response.status
1046
+ response_content = http_response.body
1047
+ unless status_code == 202 || status_code == 204
1048
+ error_model = JSON.load(response_content)
1049
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1050
+ end
1051
+
1052
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1053
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1054
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1055
+
1056
+ result
1057
+ end
1058
+
1059
+ promise.execute
1060
+ end
1061
+
1062
+ #
1063
+ # Operation to update an exiting SignalR service.
1064
+ #
1065
+ # @param resource_group_name [String] The name of the resource group that
1066
+ # contains the resource. You can obtain this value from the Azure Resource
1067
+ # Manager API or the portal.
1068
+ # @param resource_name [String] The name of the SignalR resource.
1069
+ # @param parameters [SignalRUpdateParameters] Parameters for the update
1070
+ # operation
1071
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1072
+ # will be added to the HTTP request.
1073
+ #
1074
+ # @return [SignalRResource] operation results.
1075
+ #
1076
+ def begin_update(resource_group_name, resource_name, parameters:nil, custom_headers:nil)
1077
+ response = begin_update_async(resource_group_name, resource_name, parameters:parameters, custom_headers:custom_headers).value!
1078
+ response.body unless response.nil?
1079
+ end
1080
+
1081
+ #
1082
+ # Operation to update an exiting SignalR service.
1083
+ #
1084
+ # @param resource_group_name [String] The name of the resource group that
1085
+ # contains the resource. You can obtain this value from the Azure Resource
1086
+ # Manager API or the portal.
1087
+ # @param resource_name [String] The name of the SignalR resource.
1088
+ # @param parameters [SignalRUpdateParameters] Parameters for the update
1089
+ # operation
1090
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1091
+ # will be added to the HTTP request.
1092
+ #
1093
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1094
+ #
1095
+ def begin_update_with_http_info(resource_group_name, resource_name, parameters:nil, custom_headers:nil)
1096
+ begin_update_async(resource_group_name, resource_name, parameters:parameters, custom_headers:custom_headers).value!
1097
+ end
1098
+
1099
+ #
1100
+ # Operation to update an exiting SignalR service.
1101
+ #
1102
+ # @param resource_group_name [String] The name of the resource group that
1103
+ # contains the resource. You can obtain this value from the Azure Resource
1104
+ # Manager API or the portal.
1105
+ # @param resource_name [String] The name of the SignalR resource.
1106
+ # @param parameters [SignalRUpdateParameters] Parameters for the update
1107
+ # operation
1108
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1109
+ # to the HTTP request.
1110
+ #
1111
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1112
+ #
1113
+ def begin_update_async(resource_group_name, resource_name, parameters:nil, custom_headers:nil)
1114
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1115
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1116
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1117
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
1118
+
1119
+
1120
+ request_headers = {}
1121
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1122
+
1123
+ # Set Headers
1124
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1125
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1126
+
1127
+ # Serialize Request
1128
+ request_mapper = Azure::Signalr::Mgmt::V2018_10_01::Models::SignalRUpdateParameters.mapper()
1129
+ request_content = @client.serialize(request_mapper, parameters)
1130
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1131
+
1132
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}'
1133
+
1134
+ request_url = @base_url || @client.base_url
1135
+
1136
+ options = {
1137
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1138
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
1139
+ query_params: {'api-version' => @client.api_version},
1140
+ body: request_content,
1141
+ headers: request_headers.merge(custom_headers || {}),
1142
+ base_url: request_url
1143
+ }
1144
+ promise = @client.make_request_async(:patch, path_template, options)
1145
+
1146
+ promise = promise.then do |result|
1147
+ http_response = result.response
1148
+ status_code = http_response.status
1149
+ response_content = http_response.body
1150
+ unless status_code == 200 || status_code == 202
1151
+ error_model = JSON.load(response_content)
1152
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1153
+ end
1154
+
1155
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1156
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1157
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1158
+ # Deserialize Response
1159
+ if status_code == 200
1160
+ begin
1161
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1162
+ result_mapper = Azure::Signalr::Mgmt::V2018_10_01::Models::SignalRResource.mapper()
1163
+ result.body = @client.deserialize(result_mapper, parsed_response)
1164
+ rescue Exception => e
1165
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1166
+ end
1167
+ end
1168
+
1169
+ result
1170
+ end
1171
+
1172
+ promise.execute
1173
+ end
1174
+
1175
+ #
1176
+ # Operation to restart a SignalR service.
1177
+ #
1178
+ # @param resource_group_name [String] The name of the resource group that
1179
+ # contains the resource. You can obtain this value from the Azure Resource
1180
+ # Manager API or the portal.
1181
+ # @param resource_name [String] The name of the SignalR resource.
1182
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1183
+ # will be added to the HTTP request.
1184
+ #
1185
+ #
1186
+ def begin_restart(resource_group_name, resource_name, custom_headers:nil)
1187
+ response = begin_restart_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
1188
+ nil
1189
+ end
1190
+
1191
+ #
1192
+ # Operation to restart a SignalR service.
1193
+ #
1194
+ # @param resource_group_name [String] The name of the resource group that
1195
+ # contains the resource. You can obtain this value from the Azure Resource
1196
+ # Manager API or the portal.
1197
+ # @param resource_name [String] The name of the SignalR resource.
1198
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1199
+ # will be added to the HTTP request.
1200
+ #
1201
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1202
+ #
1203
+ def begin_restart_with_http_info(resource_group_name, resource_name, custom_headers:nil)
1204
+ begin_restart_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
1205
+ end
1206
+
1207
+ #
1208
+ # Operation to restart a SignalR service.
1209
+ #
1210
+ # @param resource_group_name [String] The name of the resource group that
1211
+ # contains the resource. You can obtain this value from the Azure Resource
1212
+ # Manager API or the portal.
1213
+ # @param resource_name [String] The name of the SignalR resource.
1214
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1215
+ # to the HTTP request.
1216
+ #
1217
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1218
+ #
1219
+ def begin_restart_async(resource_group_name, resource_name, custom_headers:nil)
1220
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1221
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1222
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1223
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
1224
+
1225
+
1226
+ request_headers = {}
1227
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1228
+
1229
+ # Set Headers
1230
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1231
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1232
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/restart'
1233
+
1234
+ request_url = @base_url || @client.base_url
1235
+
1236
+ options = {
1237
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1238
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
1239
+ query_params: {'api-version' => @client.api_version},
1240
+ headers: request_headers.merge(custom_headers || {}),
1241
+ base_url: request_url
1242
+ }
1243
+ promise = @client.make_request_async(:post, path_template, options)
1244
+
1245
+ promise = promise.then do |result|
1246
+ http_response = result.response
1247
+ status_code = http_response.status
1248
+ response_content = http_response.body
1249
+ unless status_code == 202 || status_code == 204
1250
+ error_model = JSON.load(response_content)
1251
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1252
+ end
1253
+
1254
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1255
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1256
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1257
+
1258
+ result
1259
+ end
1260
+
1261
+ promise.execute
1262
+ end
1263
+
1264
+ #
1265
+ # Handles requests to list all resources in a subscription.
1266
+ #
1267
+ # @param next_page_link [String] The NextLink from the previous successful call
1268
+ # to List operation.
1269
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1270
+ # will be added to the HTTP request.
1271
+ #
1272
+ # @return [SignalRResourceList] operation results.
1273
+ #
1274
+ def list_by_subscription_next(next_page_link, custom_headers:nil)
1275
+ response = list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
1276
+ response.body unless response.nil?
1277
+ end
1278
+
1279
+ #
1280
+ # Handles requests to list all resources in a subscription.
1281
+ #
1282
+ # @param next_page_link [String] The NextLink from the previous successful call
1283
+ # to List operation.
1284
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1285
+ # will be added to the HTTP request.
1286
+ #
1287
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1288
+ #
1289
+ def list_by_subscription_next_with_http_info(next_page_link, custom_headers:nil)
1290
+ list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
1291
+ end
1292
+
1293
+ #
1294
+ # Handles requests to list all resources in a subscription.
1295
+ #
1296
+ # @param next_page_link [String] The NextLink from the previous successful call
1297
+ # to List operation.
1298
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1299
+ # to the HTTP request.
1300
+ #
1301
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1302
+ #
1303
+ def list_by_subscription_next_async(next_page_link, custom_headers:nil)
1304
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1305
+
1306
+
1307
+ request_headers = {}
1308
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1309
+
1310
+ # Set Headers
1311
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1312
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1313
+ path_template = '{nextLink}'
1314
+
1315
+ request_url = @base_url || @client.base_url
1316
+
1317
+ options = {
1318
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1319
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1320
+ headers: request_headers.merge(custom_headers || {}),
1321
+ base_url: request_url
1322
+ }
1323
+ promise = @client.make_request_async(:get, path_template, options)
1324
+
1325
+ promise = promise.then do |result|
1326
+ http_response = result.response
1327
+ status_code = http_response.status
1328
+ response_content = http_response.body
1329
+ unless status_code == 200
1330
+ error_model = JSON.load(response_content)
1331
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1332
+ end
1333
+
1334
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1335
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1336
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1337
+ # Deserialize Response
1338
+ if status_code == 200
1339
+ begin
1340
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1341
+ result_mapper = Azure::Signalr::Mgmt::V2018_10_01::Models::SignalRResourceList.mapper()
1342
+ result.body = @client.deserialize(result_mapper, parsed_response)
1343
+ rescue Exception => e
1344
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1345
+ end
1346
+ end
1347
+
1348
+ result
1349
+ end
1350
+
1351
+ promise.execute
1352
+ end
1353
+
1354
+ #
1355
+ # Handles requests to list all resources in a resource group.
1356
+ #
1357
+ # @param next_page_link [String] The NextLink from the previous successful call
1358
+ # to List operation.
1359
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1360
+ # will be added to the HTTP request.
1361
+ #
1362
+ # @return [SignalRResourceList] operation results.
1363
+ #
1364
+ def list_by_resource_group_next(next_page_link, custom_headers:nil)
1365
+ response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
1366
+ response.body unless response.nil?
1367
+ end
1368
+
1369
+ #
1370
+ # Handles requests to list all resources in a resource group.
1371
+ #
1372
+ # @param next_page_link [String] The NextLink from the previous successful call
1373
+ # to List operation.
1374
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1375
+ # will be added to the HTTP request.
1376
+ #
1377
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1378
+ #
1379
+ def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
1380
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
1381
+ end
1382
+
1383
+ #
1384
+ # Handles requests to list all resources in a resource group.
1385
+ #
1386
+ # @param next_page_link [String] The NextLink from the previous successful call
1387
+ # to List operation.
1388
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1389
+ # to the HTTP request.
1390
+ #
1391
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1392
+ #
1393
+ def list_by_resource_group_next_async(next_page_link, custom_headers:nil)
1394
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1395
+
1396
+
1397
+ request_headers = {}
1398
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1399
+
1400
+ # Set Headers
1401
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1402
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1403
+ path_template = '{nextLink}'
1404
+
1405
+ request_url = @base_url || @client.base_url
1406
+
1407
+ options = {
1408
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1409
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1410
+ headers: request_headers.merge(custom_headers || {}),
1411
+ base_url: request_url
1412
+ }
1413
+ promise = @client.make_request_async(:get, path_template, options)
1414
+
1415
+ promise = promise.then do |result|
1416
+ http_response = result.response
1417
+ status_code = http_response.status
1418
+ response_content = http_response.body
1419
+ unless status_code == 200
1420
+ error_model = JSON.load(response_content)
1421
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1422
+ end
1423
+
1424
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1425
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1426
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1427
+ # Deserialize Response
1428
+ if status_code == 200
1429
+ begin
1430
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1431
+ result_mapper = Azure::Signalr::Mgmt::V2018_10_01::Models::SignalRResourceList.mapper()
1432
+ result.body = @client.deserialize(result_mapper, parsed_response)
1433
+ rescue Exception => e
1434
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1435
+ end
1436
+ end
1437
+
1438
+ result
1439
+ end
1440
+
1441
+ promise.execute
1442
+ end
1443
+
1444
+ #
1445
+ # Handles requests to list all resources in a subscription.
1446
+ #
1447
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1448
+ # will be added to the HTTP request.
1449
+ #
1450
+ # @return [SignalRResourceList] which provide lazy access to pages of the
1451
+ # response.
1452
+ #
1453
+ def list_by_subscription_as_lazy(custom_headers:nil)
1454
+ response = list_by_subscription_async(custom_headers:custom_headers).value!
1455
+ unless response.nil?
1456
+ page = response.body
1457
+ page.next_method = Proc.new do |next_page_link|
1458
+ list_by_subscription_next_async(next_page_link, custom_headers:custom_headers)
1459
+ end
1460
+ page
1461
+ end
1462
+ end
1463
+
1464
+ #
1465
+ # Handles requests to list all resources in a resource group.
1466
+ #
1467
+ # @param resource_group_name [String] The name of the resource group that
1468
+ # contains the resource. You can obtain this value from the Azure Resource
1469
+ # Manager API or the portal.
1470
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1471
+ # will be added to the HTTP request.
1472
+ #
1473
+ # @return [SignalRResourceList] which provide lazy access to pages of the
1474
+ # response.
1475
+ #
1476
+ def list_by_resource_group_as_lazy(resource_group_name, custom_headers:nil)
1477
+ response = list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
1478
+ unless response.nil?
1479
+ page = response.body
1480
+ page.next_method = Proc.new do |next_page_link|
1481
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
1482
+ end
1483
+ page
1484
+ end
1485
+ end
1486
+
1487
+ end
1488
+ end