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.
- checksums.yaml +4 -4
- data/lib/2018-03-01-preview/generated/azure_mgmt_signalr/signal_r.rb +11 -1
- data/lib/2018-03-01-preview/generated/azure_mgmt_signalr/signal_rmanagement_client.rb +1 -1
- data/lib/2018-10-01/generated/azure_mgmt_signalr.rb +13 -9
- data/lib/2018-10-01/generated/azure_mgmt_signalr/models/error_response.rb +48 -0
- data/lib/2018-10-01/generated/azure_mgmt_signalr/models/error_response_body.rb +93 -0
- data/lib/2018-10-01/generated/azure_mgmt_signalr/models/feature_flags.rb +16 -0
- data/lib/2018-10-01/generated/azure_mgmt_signalr/models/log_specification.rb +57 -0
- data/lib/2018-10-01/generated/azure_mgmt_signalr/models/service_specification.rb +21 -0
- data/lib/2018-10-01/generated/azure_mgmt_signalr/models/signal_rfeature.rb +12 -6
- data/lib/2018-10-01/generated/azure_mgmt_signalr/operations.rb +2 -2
- data/lib/2018-10-01/generated/azure_mgmt_signalr/signal_r.rb +23 -13
- data/lib/2018-10-01/generated/azure_mgmt_signalr/signal_rmanagement_client.rb +1 -1
- data/lib/2018-10-01/generated/azure_mgmt_signalr/usages.rb +2 -2
- data/lib/2020-05-01/generated/azure_mgmt_signalr.rb +76 -0
- data/lib/2020-05-01/generated/azure_mgmt_signalr/models/aclaction.rb +16 -0
- data/lib/2020-05-01/generated/azure_mgmt_signalr/models/dimension.rb +80 -0
- data/lib/2020-05-01/generated/azure_mgmt_signalr/models/error_response.rb +48 -0
- data/lib/2020-05-01/generated/azure_mgmt_signalr/models/error_response_body.rb +93 -0
- data/lib/2020-05-01/generated/azure_mgmt_signalr/models/feature_flags.rb +17 -0
- data/lib/2020-05-01/generated/azure_mgmt_signalr/models/key_type.rb +16 -0
- data/lib/2020-05-01/generated/azure_mgmt_signalr/models/log_specification.rb +57 -0
- data/lib/2020-05-01/generated/azure_mgmt_signalr/models/metric_specification.rb +139 -0
- data/lib/2020-05-01/generated/azure_mgmt_signalr/models/name_availability.rb +70 -0
- data/lib/2020-05-01/generated/azure_mgmt_signalr/models/name_availability_parameters.rb +59 -0
- data/lib/2020-05-01/generated/azure_mgmt_signalr/models/network_acl.rb +75 -0
- data/lib/2020-05-01/generated/azure_mgmt_signalr/models/operation.rb +96 -0
- data/lib/2020-05-01/generated/azure_mgmt_signalr/models/operation_display.rb +79 -0
- data/lib/2020-05-01/generated/azure_mgmt_signalr/models/operation_list.rb +102 -0
- data/lib/2020-05-01/generated/azure_mgmt_signalr/models/operation_properties.rb +47 -0
- data/lib/2020-05-01/generated/azure_mgmt_signalr/models/private_endpoint.rb +46 -0
- data/lib/2020-05-01/generated/azure_mgmt_signalr/models/private_endpoint_acl.rb +78 -0
- data/lib/2020-05-01/generated/azure_mgmt_signalr/models/private_endpoint_connection.rb +101 -0
- data/lib/2020-05-01/generated/azure_mgmt_signalr/models/private_link_resource.rb +111 -0
- data/lib/2020-05-01/generated/azure_mgmt_signalr/models/private_link_resource_list.rb +102 -0
- data/lib/2020-05-01/generated/azure_mgmt_signalr/models/private_link_service_connection_state.rb +72 -0
- data/lib/2020-05-01/generated/azure_mgmt_signalr/models/private_link_service_connection_status.rb +18 -0
- data/lib/2020-05-01/generated/azure_mgmt_signalr/models/provisioning_state.rb +23 -0
- data/lib/2020-05-01/generated/azure_mgmt_signalr/models/proxy_resource.rb +63 -0
- data/lib/2020-05-01/generated/azure_mgmt_signalr/models/regenerate_key_parameters.rb +48 -0
- data/lib/2020-05-01/generated/azure_mgmt_signalr/models/resource.rb +81 -0
- data/lib/2020-05-01/generated/azure_mgmt_signalr/models/resource_sku.rb +101 -0
- data/lib/2020-05-01/generated/azure_mgmt_signalr/models/serverless_upstream_settings.rb +58 -0
- data/lib/2020-05-01/generated/azure_mgmt_signalr/models/service_kind.rb +16 -0
- data/lib/2020-05-01/generated/azure_mgmt_signalr/models/service_specification.rb +77 -0
- data/lib/2020-05-01/generated/azure_mgmt_signalr/models/signal_rcors_settings.rb +57 -0
- data/lib/2020-05-01/generated/azure_mgmt_signalr/models/signal_rcreate_or_update_properties.rb +117 -0
- data/lib/2020-05-01/generated/azure_mgmt_signalr/models/signal_rfeature.rb +93 -0
- data/lib/2020-05-01/generated/azure_mgmt_signalr/models/signal_rkeys.rb +81 -0
- data/lib/2020-05-01/generated/azure_mgmt_signalr/models/signal_rnetwork_acls.rb +80 -0
- data/lib/2020-05-01/generated/azure_mgmt_signalr/models/signal_rrequest_type.rb +17 -0
- data/lib/2020-05-01/generated/azure_mgmt_signalr/models/signal_rresource.rb +294 -0
- data/lib/2020-05-01/generated/azure_mgmt_signalr/models/signal_rresource_list.rb +101 -0
- data/lib/2020-05-01/generated/azure_mgmt_signalr/models/signal_rsku_tier.rb +18 -0
- data/lib/2020-05-01/generated/azure_mgmt_signalr/models/signal_rusage.rb +95 -0
- data/lib/2020-05-01/generated/azure_mgmt_signalr/models/signal_rusage_list.rb +101 -0
- data/lib/2020-05-01/generated/azure_mgmt_signalr/models/signal_rusage_name.rb +57 -0
- data/lib/2020-05-01/generated/azure_mgmt_signalr/models/tracked_resource.rb +94 -0
- data/lib/2020-05-01/generated/azure_mgmt_signalr/models/upstream_template.rb +109 -0
- data/lib/2020-05-01/generated/azure_mgmt_signalr/module_definition.rb +9 -0
- data/lib/2020-05-01/generated/azure_mgmt_signalr/operations.rb +225 -0
- data/lib/2020-05-01/generated/azure_mgmt_signalr/signal_r.rb +1493 -0
- data/lib/2020-05-01/generated/azure_mgmt_signalr/signal_rmanagement_client.rb +150 -0
- data/lib/2020-05-01/generated/azure_mgmt_signalr/signal_rprivate_endpoint_connections.rb +404 -0
- data/lib/2020-05-01/generated/azure_mgmt_signalr/signal_rprivate_link_resources.rb +246 -0
- data/lib/2020-05-01/generated/azure_mgmt_signalr/usages.rb +226 -0
- data/lib/azure_mgmt_signalr.rb +1 -0
- data/lib/profiles/latest/modules/signalr_profile_module.rb +143 -71
- data/lib/version.rb +1 -1
- metadata +60 -4
@@ -0,0 +1,246 @@
|
|
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 SignalRPrivateLinkResources
|
11
|
+
include MsRestAzure
|
12
|
+
|
13
|
+
#
|
14
|
+
# Creates and initializes a new instance of the SignalRPrivateLinkResources 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
|
+
# Get the private link resources that need to be created for a SignalR
|
26
|
+
# resource.
|
27
|
+
#
|
28
|
+
# @param resource_group_name [String] The name of the resource group that
|
29
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
30
|
+
# Manager API or the portal.
|
31
|
+
# @param resource_name [String] The name of the SignalR resource.
|
32
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
33
|
+
# will be added to the HTTP request.
|
34
|
+
#
|
35
|
+
# @return [Array<PrivateLinkResource>] operation results.
|
36
|
+
#
|
37
|
+
def list(resource_group_name, resource_name, custom_headers:nil)
|
38
|
+
first_page = list_as_lazy(resource_group_name, resource_name, custom_headers:custom_headers)
|
39
|
+
first_page.get_all_items
|
40
|
+
end
|
41
|
+
|
42
|
+
#
|
43
|
+
# Get the private link resources that need to be created for a SignalR
|
44
|
+
# resource.
|
45
|
+
#
|
46
|
+
# @param resource_group_name [String] The name of the resource group that
|
47
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
48
|
+
# Manager API or the portal.
|
49
|
+
# @param resource_name [String] The name of the SignalR resource.
|
50
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
51
|
+
# will be added to the HTTP request.
|
52
|
+
#
|
53
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
54
|
+
#
|
55
|
+
def list_with_http_info(resource_group_name, resource_name, custom_headers:nil)
|
56
|
+
list_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
|
57
|
+
end
|
58
|
+
|
59
|
+
#
|
60
|
+
# Get the private link resources that need to be created for a SignalR
|
61
|
+
# resource.
|
62
|
+
#
|
63
|
+
# @param resource_group_name [String] The name of the resource group that
|
64
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
65
|
+
# Manager API or the portal.
|
66
|
+
# @param resource_name [String] The name of the SignalR resource.
|
67
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
68
|
+
# to the HTTP request.
|
69
|
+
#
|
70
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
71
|
+
#
|
72
|
+
def list_async(resource_group_name, resource_name, custom_headers:nil)
|
73
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
74
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
75
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
76
|
+
fail ArgumentError, 'resource_name is nil' if resource_name.nil?
|
77
|
+
|
78
|
+
|
79
|
+
request_headers = {}
|
80
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
81
|
+
|
82
|
+
# Set Headers
|
83
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
84
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
85
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/privateLinkResources'
|
86
|
+
|
87
|
+
request_url = @base_url || @client.base_url
|
88
|
+
|
89
|
+
options = {
|
90
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
91
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
|
92
|
+
query_params: {'api-version' => @client.api_version},
|
93
|
+
headers: request_headers.merge(custom_headers || {}),
|
94
|
+
base_url: request_url
|
95
|
+
}
|
96
|
+
promise = @client.make_request_async(:get, 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::PrivateLinkResourceList.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
|
+
# Get the private link resources that need to be created for a SignalR
|
129
|
+
# resource.
|
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 [PrivateLinkResourceList] operation results.
|
137
|
+
#
|
138
|
+
def list_next(next_page_link, custom_headers:nil)
|
139
|
+
response = list_next_async(next_page_link, custom_headers:custom_headers).value!
|
140
|
+
response.body unless response.nil?
|
141
|
+
end
|
142
|
+
|
143
|
+
#
|
144
|
+
# Get the private link resources that need to be created for a SignalR
|
145
|
+
# resource.
|
146
|
+
#
|
147
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
148
|
+
# to List operation.
|
149
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
150
|
+
# will be added to the HTTP request.
|
151
|
+
#
|
152
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
153
|
+
#
|
154
|
+
def list_next_with_http_info(next_page_link, custom_headers:nil)
|
155
|
+
list_next_async(next_page_link, custom_headers:custom_headers).value!
|
156
|
+
end
|
157
|
+
|
158
|
+
#
|
159
|
+
# Get the private link resources that need to be created for a SignalR
|
160
|
+
# resource.
|
161
|
+
#
|
162
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
163
|
+
# to List operation.
|
164
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
165
|
+
# to the HTTP request.
|
166
|
+
#
|
167
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
168
|
+
#
|
169
|
+
def list_next_async(next_page_link, custom_headers:nil)
|
170
|
+
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
171
|
+
|
172
|
+
|
173
|
+
request_headers = {}
|
174
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
175
|
+
|
176
|
+
# Set Headers
|
177
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
178
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
179
|
+
path_template = '{nextLink}'
|
180
|
+
|
181
|
+
request_url = @base_url || @client.base_url
|
182
|
+
|
183
|
+
options = {
|
184
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
185
|
+
skip_encoding_path_params: {'nextLink' => next_page_link},
|
186
|
+
headers: request_headers.merge(custom_headers || {}),
|
187
|
+
base_url: request_url
|
188
|
+
}
|
189
|
+
promise = @client.make_request_async(:get, path_template, options)
|
190
|
+
|
191
|
+
promise = promise.then do |result|
|
192
|
+
http_response = result.response
|
193
|
+
status_code = http_response.status
|
194
|
+
response_content = http_response.body
|
195
|
+
unless status_code == 200
|
196
|
+
error_model = JSON.load(response_content)
|
197
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
198
|
+
end
|
199
|
+
|
200
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
201
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
202
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
203
|
+
# Deserialize Response
|
204
|
+
if status_code == 200
|
205
|
+
begin
|
206
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
207
|
+
result_mapper = Azure::Signalr::Mgmt::V2020_05_01::Models::PrivateLinkResourceList.mapper()
|
208
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
209
|
+
rescue Exception => e
|
210
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
211
|
+
end
|
212
|
+
end
|
213
|
+
|
214
|
+
result
|
215
|
+
end
|
216
|
+
|
217
|
+
promise.execute
|
218
|
+
end
|
219
|
+
|
220
|
+
#
|
221
|
+
# Get the private link resources that need to be created for a SignalR
|
222
|
+
# resource.
|
223
|
+
#
|
224
|
+
# @param resource_group_name [String] The name of the resource group that
|
225
|
+
# contains the resource. You can obtain this value from the Azure Resource
|
226
|
+
# Manager API or the portal.
|
227
|
+
# @param resource_name [String] The name of the SignalR resource.
|
228
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
229
|
+
# will be added to the HTTP request.
|
230
|
+
#
|
231
|
+
# @return [PrivateLinkResourceList] which provide lazy access to pages of the
|
232
|
+
# response.
|
233
|
+
#
|
234
|
+
def list_as_lazy(resource_group_name, resource_name, custom_headers:nil)
|
235
|
+
response = list_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
|
236
|
+
unless response.nil?
|
237
|
+
page = response.body
|
238
|
+
page.next_method = Proc.new do |next_page_link|
|
239
|
+
list_next_async(next_page_link, custom_headers:custom_headers)
|
240
|
+
end
|
241
|
+
page
|
242
|
+
end
|
243
|
+
end
|
244
|
+
|
245
|
+
end
|
246
|
+
end
|
@@ -0,0 +1,226 @@
|
|
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 Usages
|
11
|
+
include MsRestAzure
|
12
|
+
|
13
|
+
#
|
14
|
+
# Creates and initializes a new instance of the Usages 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
|
+
# List usage quotas for Azure SignalR service by location.
|
26
|
+
#
|
27
|
+
# @param location [String] the location like "eastus"
|
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<SignalRUsage>] operation results.
|
32
|
+
#
|
33
|
+
def list(location, custom_headers:nil)
|
34
|
+
first_page = list_as_lazy(location, custom_headers:custom_headers)
|
35
|
+
first_page.get_all_items
|
36
|
+
end
|
37
|
+
|
38
|
+
#
|
39
|
+
# List usage quotas for Azure SignalR service by location.
|
40
|
+
#
|
41
|
+
# @param location [String] the location like "eastus"
|
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(location, custom_headers:nil)
|
48
|
+
list_async(location, custom_headers:custom_headers).value!
|
49
|
+
end
|
50
|
+
|
51
|
+
#
|
52
|
+
# List usage quotas for Azure SignalR service by location.
|
53
|
+
#
|
54
|
+
# @param location [String] the location like "eastus"
|
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(location, custom_headers:nil)
|
61
|
+
fail ArgumentError, 'location is nil' if location.nil?
|
62
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
63
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
64
|
+
|
65
|
+
|
66
|
+
request_headers = {}
|
67
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
68
|
+
|
69
|
+
# Set Headers
|
70
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
71
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
72
|
+
path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.SignalRService/locations/{location}/usages'
|
73
|
+
|
74
|
+
request_url = @base_url || @client.base_url
|
75
|
+
|
76
|
+
options = {
|
77
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
78
|
+
path_params: {'location' => location,'subscriptionId' => @client.subscription_id},
|
79
|
+
query_params: {'api-version' => @client.api_version},
|
80
|
+
headers: request_headers.merge(custom_headers || {}),
|
81
|
+
base_url: request_url
|
82
|
+
}
|
83
|
+
promise = @client.make_request_async(:get, path_template, options)
|
84
|
+
|
85
|
+
promise = promise.then do |result|
|
86
|
+
http_response = result.response
|
87
|
+
status_code = http_response.status
|
88
|
+
response_content = http_response.body
|
89
|
+
unless status_code == 200
|
90
|
+
error_model = JSON.load(response_content)
|
91
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
92
|
+
end
|
93
|
+
|
94
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
95
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
96
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
97
|
+
# Deserialize Response
|
98
|
+
if status_code == 200
|
99
|
+
begin
|
100
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
101
|
+
result_mapper = Azure::Signalr::Mgmt::V2020_05_01::Models::SignalRUsageList.mapper()
|
102
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
103
|
+
rescue Exception => e
|
104
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
result
|
109
|
+
end
|
110
|
+
|
111
|
+
promise.execute
|
112
|
+
end
|
113
|
+
|
114
|
+
#
|
115
|
+
# List usage quotas for Azure SignalR service by location.
|
116
|
+
#
|
117
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
118
|
+
# to List operation.
|
119
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
120
|
+
# will be added to the HTTP request.
|
121
|
+
#
|
122
|
+
# @return [SignalRUsageList] operation results.
|
123
|
+
#
|
124
|
+
def list_next(next_page_link, custom_headers:nil)
|
125
|
+
response = list_next_async(next_page_link, custom_headers:custom_headers).value!
|
126
|
+
response.body unless response.nil?
|
127
|
+
end
|
128
|
+
|
129
|
+
#
|
130
|
+
# List usage quotas for Azure SignalR service by location.
|
131
|
+
#
|
132
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
133
|
+
# to List operation.
|
134
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
135
|
+
# will be added to the HTTP request.
|
136
|
+
#
|
137
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
138
|
+
#
|
139
|
+
def list_next_with_http_info(next_page_link, custom_headers:nil)
|
140
|
+
list_next_async(next_page_link, custom_headers:custom_headers).value!
|
141
|
+
end
|
142
|
+
|
143
|
+
#
|
144
|
+
# List usage quotas for Azure SignalR service by location.
|
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 MsRest::HttpOperationError.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::V2020_05_01::Models::SignalRUsageList.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
|
+
# List usage quotas for Azure SignalR service by location.
|
206
|
+
#
|
207
|
+
# @param location [String] the location like "eastus"
|
208
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
209
|
+
# will be added to the HTTP request.
|
210
|
+
#
|
211
|
+
# @return [SignalRUsageList] which provide lazy access to pages of the
|
212
|
+
# response.
|
213
|
+
#
|
214
|
+
def list_as_lazy(location, custom_headers:nil)
|
215
|
+
response = list_async(location, custom_headers:custom_headers).value!
|
216
|
+
unless response.nil?
|
217
|
+
page = response.body
|
218
|
+
page.next_method = Proc.new do |next_page_link|
|
219
|
+
list_next_async(next_page_link, custom_headers:custom_headers)
|
220
|
+
end
|
221
|
+
page
|
222
|
+
end
|
223
|
+
end
|
224
|
+
|
225
|
+
end
|
226
|
+
end
|