azure_mgmt_signalr 0.17.0 → 0.17.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (109) hide show
  1. checksums.yaml +5 -5
  2. data/lib/2018-03-01-preview/generated/azure_mgmt_signalr.rb +13 -8
  3. data/lib/2018-03-01-preview/generated/azure_mgmt_signalr/models/dimension.rb +80 -0
  4. data/lib/2018-03-01-preview/generated/azure_mgmt_signalr/models/metric_specification.rb +20 -0
  5. data/lib/2018-03-01-preview/generated/azure_mgmt_signalr/models/operation_list.rb +1 -1
  6. data/lib/2018-03-01-preview/generated/azure_mgmt_signalr/models/resource.rb +10 -1
  7. data/lib/2018-03-01-preview/generated/azure_mgmt_signalr/models/signal_rkeys.rb +24 -0
  8. data/lib/2018-03-01-preview/generated/azure_mgmt_signalr/models/signal_rresource.rb +12 -0
  9. data/lib/2018-03-01-preview/generated/azure_mgmt_signalr/models/signal_rresource_list.rb +1 -1
  10. data/lib/2018-03-01-preview/generated/azure_mgmt_signalr/models/signal_rusage.rb +95 -0
  11. data/lib/2018-03-01-preview/generated/azure_mgmt_signalr/models/signal_rusage_list.rb +101 -0
  12. data/lib/2018-03-01-preview/generated/azure_mgmt_signalr/models/signal_rusage_name.rb +57 -0
  13. data/lib/2018-03-01-preview/generated/azure_mgmt_signalr/operations.rb +4 -0
  14. data/lib/2018-03-01-preview/generated/azure_mgmt_signalr/signal_r.rb +33 -1
  15. data/lib/2018-03-01-preview/generated/azure_mgmt_signalr/signal_rmanagement_client.rb +5 -1
  16. data/lib/2018-03-01-preview/generated/azure_mgmt_signalr/usages.rb +226 -0
  17. data/lib/2018-10-01/generated/azure_mgmt_signalr.rb +61 -0
  18. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/dimension.rb +80 -0
  19. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/error_response.rb +48 -0
  20. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/error_response_body.rb +93 -0
  21. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/feature_flags.rb +16 -0
  22. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/key_type.rb +16 -0
  23. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/log_specification.rb +57 -0
  24. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/metric_specification.rb +139 -0
  25. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/name_availability.rb +70 -0
  26. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/name_availability_parameters.rb +59 -0
  27. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/operation.rb +84 -0
  28. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/operation_display.rb +79 -0
  29. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/operation_list.rb +102 -0
  30. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/operation_properties.rb +47 -0
  31. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/provisioning_state.rb +23 -0
  32. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/regenerate_key_parameters.rb +48 -0
  33. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/resource.rb +81 -0
  34. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/resource_sku.rb +101 -0
  35. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/service_specification.rb +77 -0
  36. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/signal_rcors_settings.rb +57 -0
  37. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/signal_rcreate_or_update_properties.rb +92 -0
  38. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/signal_rcreate_parameters.rb +85 -0
  39. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/signal_rfeature.rb +93 -0
  40. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/signal_rkeys.rb +81 -0
  41. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/signal_rresource.rb +232 -0
  42. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/signal_rresource_list.rb +101 -0
  43. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/signal_rsku_tier.rb +18 -0
  44. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/signal_rupdate_parameters.rb +81 -0
  45. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/signal_rusage.rb +95 -0
  46. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/signal_rusage_list.rb +101 -0
  47. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/signal_rusage_name.rb +57 -0
  48. data/lib/2018-10-01/generated/azure_mgmt_signalr/models/tracked_resource.rb +94 -0
  49. data/lib/2018-10-01/generated/azure_mgmt_signalr/module_definition.rb +9 -0
  50. data/lib/2018-10-01/generated/azure_mgmt_signalr/operations.rb +225 -0
  51. data/lib/2018-10-01/generated/azure_mgmt_signalr/signal_r.rb +1498 -0
  52. data/lib/2018-10-01/generated/azure_mgmt_signalr/signal_rmanagement_client.rb +141 -0
  53. data/lib/2018-10-01/generated/azure_mgmt_signalr/usages.rb +226 -0
  54. data/lib/2020-05-01/generated/azure_mgmt_signalr.rb +76 -0
  55. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/aclaction.rb +16 -0
  56. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/dimension.rb +80 -0
  57. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/error_response.rb +48 -0
  58. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/error_response_body.rb +93 -0
  59. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/feature_flags.rb +17 -0
  60. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/key_type.rb +16 -0
  61. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/log_specification.rb +57 -0
  62. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/metric_specification.rb +139 -0
  63. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/name_availability.rb +70 -0
  64. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/name_availability_parameters.rb +59 -0
  65. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/network_acl.rb +75 -0
  66. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/operation.rb +96 -0
  67. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/operation_display.rb +79 -0
  68. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/operation_list.rb +102 -0
  69. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/operation_properties.rb +47 -0
  70. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/private_endpoint.rb +46 -0
  71. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/private_endpoint_acl.rb +78 -0
  72. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/private_endpoint_connection.rb +101 -0
  73. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/private_link_resource.rb +111 -0
  74. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/private_link_resource_list.rb +102 -0
  75. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/private_link_service_connection_state.rb +72 -0
  76. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/private_link_service_connection_status.rb +18 -0
  77. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/provisioning_state.rb +23 -0
  78. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/proxy_resource.rb +63 -0
  79. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/regenerate_key_parameters.rb +48 -0
  80. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/resource.rb +81 -0
  81. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/resource_sku.rb +101 -0
  82. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/serverless_upstream_settings.rb +58 -0
  83. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/service_kind.rb +16 -0
  84. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/service_specification.rb +77 -0
  85. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/signal_rcors_settings.rb +57 -0
  86. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/signal_rcreate_or_update_properties.rb +117 -0
  87. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/signal_rfeature.rb +93 -0
  88. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/signal_rkeys.rb +81 -0
  89. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/signal_rnetwork_acls.rb +80 -0
  90. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/signal_rrequest_type.rb +17 -0
  91. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/signal_rresource.rb +294 -0
  92. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/signal_rresource_list.rb +101 -0
  93. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/signal_rsku_tier.rb +18 -0
  94. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/signal_rusage.rb +95 -0
  95. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/signal_rusage_list.rb +101 -0
  96. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/signal_rusage_name.rb +57 -0
  97. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/tracked_resource.rb +94 -0
  98. data/lib/2020-05-01/generated/azure_mgmt_signalr/models/upstream_template.rb +109 -0
  99. data/lib/2020-05-01/generated/azure_mgmt_signalr/module_definition.rb +9 -0
  100. data/lib/2020-05-01/generated/azure_mgmt_signalr/operations.rb +225 -0
  101. data/lib/2020-05-01/generated/azure_mgmt_signalr/signal_r.rb +1493 -0
  102. data/lib/2020-05-01/generated/azure_mgmt_signalr/signal_rmanagement_client.rb +150 -0
  103. data/lib/2020-05-01/generated/azure_mgmt_signalr/signal_rprivate_endpoint_connections.rb +404 -0
  104. data/lib/2020-05-01/generated/azure_mgmt_signalr/signal_rprivate_link_resources.rb +246 -0
  105. data/lib/2020-05-01/generated/azure_mgmt_signalr/usages.rb +226 -0
  106. data/lib/azure_mgmt_signalr.rb +2 -0
  107. data/lib/profiles/latest/modules/signalr_profile_module.rb +153 -55
  108. data/lib/version.rb +1 -1
  109. metadata +99 -5
@@ -0,0 +1,94 @@
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
+ module Models
8
+ #
9
+ # The resource model definition for a ARM tracked top level resource.
10
+ #
11
+ class TrackedResource < Resource
12
+
13
+ include MsRestAzure
14
+
15
+ # @return [String] The GEO location of the SignalR service. e.g. West US
16
+ # | East US | North Central US | South Central US.
17
+ attr_accessor :location
18
+
19
+ # @return [Hash{String => String}] Tags of the service which is a list of
20
+ # key value pairs that describe the resource.
21
+ attr_accessor :tags
22
+
23
+
24
+ #
25
+ # Mapper for TrackedResource class as Ruby Hash.
26
+ # This will be used for serialization/deserialization.
27
+ #
28
+ def self.mapper()
29
+ {
30
+ client_side_validation: true,
31
+ required: false,
32
+ serialized_name: 'TrackedResource',
33
+ type: {
34
+ name: 'Composite',
35
+ class_name: 'TrackedResource',
36
+ model_properties: {
37
+ id: {
38
+ client_side_validation: true,
39
+ required: false,
40
+ read_only: true,
41
+ serialized_name: 'id',
42
+ type: {
43
+ name: 'String'
44
+ }
45
+ },
46
+ name: {
47
+ client_side_validation: true,
48
+ required: false,
49
+ read_only: true,
50
+ serialized_name: 'name',
51
+ type: {
52
+ name: 'String'
53
+ }
54
+ },
55
+ type: {
56
+ client_side_validation: true,
57
+ required: false,
58
+ read_only: true,
59
+ serialized_name: 'type',
60
+ type: {
61
+ name: 'String'
62
+ }
63
+ },
64
+ location: {
65
+ client_side_validation: true,
66
+ required: false,
67
+ serialized_name: 'location',
68
+ type: {
69
+ name: 'String'
70
+ }
71
+ },
72
+ tags: {
73
+ client_side_validation: true,
74
+ required: false,
75
+ serialized_name: 'tags',
76
+ type: {
77
+ name: 'Dictionary',
78
+ value: {
79
+ client_side_validation: true,
80
+ required: false,
81
+ serialized_name: 'StringElementType',
82
+ type: {
83
+ name: 'String'
84
+ }
85
+ }
86
+ }
87
+ }
88
+ }
89
+ }
90
+ }
91
+ end
92
+ end
93
+ end
94
+ end
@@ -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 MsRest::HttpOperationError.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 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::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,1498 @@
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 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::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 MsRest::HttpOperationError.new(result.request, http_response, error_model)
191
+ end
192
+
193
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
194
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
195
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
196
+ # Deserialize Response
197
+ if status_code == 200
198
+ begin
199
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
200
+ result_mapper = Azure::Signalr::Mgmt::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 MsRest::HttpOperationError.new(result.request, http_response, error_model)
287
+ end
288
+
289
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
290
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
291
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
292
+ # Deserialize Response
293
+ if status_code == 200
294
+ begin
295
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
296
+ result_mapper = Azure::Signalr::Mgmt::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 MsRest::HttpOperationError.new(result.request, http_response, error_model)
387
+ end
388
+
389
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
390
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
391
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
392
+ # Deserialize Response
393
+ if status_code == 200
394
+ begin
395
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
396
+ result_mapper = Azure::Signalr::Mgmt::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 MsRest::HttpOperationError.new(result.request, http_response, error_model)
538
+ end
539
+
540
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
541
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
542
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
543
+ # Deserialize Response
544
+ if status_code == 200
545
+ begin
546
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
547
+ result_mapper = Azure::Signalr::Mgmt::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 MsRest::HttpOperationError.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 == 200 || status_code == 201 || status_code == 202
949
+ error_model = JSON.load(response_content)
950
+ fail MsRest::HttpOperationError.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 == 200
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
+ # Deserialize Response
967
+ if status_code == 201
968
+ begin
969
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
970
+ result_mapper = Azure::Signalr::Mgmt::V2018_10_01::Models::SignalRResource.mapper()
971
+ result.body = @client.deserialize(result_mapper, parsed_response)
972
+ rescue Exception => e
973
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
974
+ end
975
+ end
976
+
977
+ result
978
+ end
979
+
980
+ promise.execute
981
+ end
982
+
983
+ #
984
+ # Operation to delete a SignalR service.
985
+ #
986
+ # @param resource_group_name [String] The name of the resource group that
987
+ # contains the resource. You can obtain this value from the Azure Resource
988
+ # Manager API or the portal.
989
+ # @param resource_name [String] The name of the SignalR resource.
990
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
991
+ # will be added to the HTTP request.
992
+ #
993
+ #
994
+ def begin_delete(resource_group_name, resource_name, custom_headers:nil)
995
+ response = begin_delete_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
996
+ nil
997
+ end
998
+
999
+ #
1000
+ # Operation to delete a SignalR service.
1001
+ #
1002
+ # @param resource_group_name [String] The name of the resource group that
1003
+ # contains the resource. You can obtain this value from the Azure Resource
1004
+ # Manager API or the portal.
1005
+ # @param resource_name [String] The name of the SignalR resource.
1006
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1007
+ # will be added to the HTTP request.
1008
+ #
1009
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1010
+ #
1011
+ def begin_delete_with_http_info(resource_group_name, resource_name, custom_headers:nil)
1012
+ begin_delete_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
1013
+ end
1014
+
1015
+ #
1016
+ # Operation to delete a SignalR service.
1017
+ #
1018
+ # @param resource_group_name [String] The name of the resource group that
1019
+ # contains the resource. You can obtain this value from the Azure Resource
1020
+ # Manager API or the portal.
1021
+ # @param resource_name [String] The name of the SignalR resource.
1022
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1023
+ # to the HTTP request.
1024
+ #
1025
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1026
+ #
1027
+ def begin_delete_async(resource_group_name, resource_name, custom_headers:nil)
1028
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1029
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1030
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1031
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
1032
+
1033
+
1034
+ request_headers = {}
1035
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1036
+
1037
+ # Set Headers
1038
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1039
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1040
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}'
1041
+
1042
+ request_url = @base_url || @client.base_url
1043
+
1044
+ options = {
1045
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1046
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
1047
+ query_params: {'api-version' => @client.api_version},
1048
+ headers: request_headers.merge(custom_headers || {}),
1049
+ base_url: request_url
1050
+ }
1051
+ promise = @client.make_request_async(:delete, path_template, options)
1052
+
1053
+ promise = promise.then do |result|
1054
+ http_response = result.response
1055
+ status_code = http_response.status
1056
+ response_content = http_response.body
1057
+ unless status_code == 202 || status_code == 204
1058
+ error_model = JSON.load(response_content)
1059
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1060
+ end
1061
+
1062
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1063
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1064
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1065
+
1066
+ result
1067
+ end
1068
+
1069
+ promise.execute
1070
+ end
1071
+
1072
+ #
1073
+ # Operation to update an exiting SignalR service.
1074
+ #
1075
+ # @param resource_group_name [String] The name of the resource group that
1076
+ # contains the resource. You can obtain this value from the Azure Resource
1077
+ # Manager API or the portal.
1078
+ # @param resource_name [String] The name of the SignalR resource.
1079
+ # @param parameters [SignalRUpdateParameters] Parameters for the update
1080
+ # operation
1081
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1082
+ # will be added to the HTTP request.
1083
+ #
1084
+ # @return [SignalRResource] operation results.
1085
+ #
1086
+ def begin_update(resource_group_name, resource_name, parameters:nil, custom_headers:nil)
1087
+ response = begin_update_async(resource_group_name, resource_name, parameters:parameters, custom_headers:custom_headers).value!
1088
+ response.body unless response.nil?
1089
+ end
1090
+
1091
+ #
1092
+ # Operation to update an exiting SignalR service.
1093
+ #
1094
+ # @param resource_group_name [String] The name of the resource group that
1095
+ # contains the resource. You can obtain this value from the Azure Resource
1096
+ # Manager API or the portal.
1097
+ # @param resource_name [String] The name of the SignalR resource.
1098
+ # @param parameters [SignalRUpdateParameters] Parameters for the update
1099
+ # operation
1100
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1101
+ # will be added to the HTTP request.
1102
+ #
1103
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1104
+ #
1105
+ def begin_update_with_http_info(resource_group_name, resource_name, parameters:nil, custom_headers:nil)
1106
+ begin_update_async(resource_group_name, resource_name, parameters:parameters, custom_headers:custom_headers).value!
1107
+ end
1108
+
1109
+ #
1110
+ # Operation to update an exiting SignalR service.
1111
+ #
1112
+ # @param resource_group_name [String] The name of the resource group that
1113
+ # contains the resource. You can obtain this value from the Azure Resource
1114
+ # Manager API or the portal.
1115
+ # @param resource_name [String] The name of the SignalR resource.
1116
+ # @param parameters [SignalRUpdateParameters] Parameters for the update
1117
+ # operation
1118
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1119
+ # to the HTTP request.
1120
+ #
1121
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1122
+ #
1123
+ def begin_update_async(resource_group_name, resource_name, parameters:nil, custom_headers:nil)
1124
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1125
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1126
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1127
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
1128
+
1129
+
1130
+ request_headers = {}
1131
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1132
+
1133
+ # Set Headers
1134
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1135
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1136
+
1137
+ # Serialize Request
1138
+ request_mapper = Azure::Signalr::Mgmt::V2018_10_01::Models::SignalRUpdateParameters.mapper()
1139
+ request_content = @client.serialize(request_mapper, parameters)
1140
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1141
+
1142
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}'
1143
+
1144
+ request_url = @base_url || @client.base_url
1145
+
1146
+ options = {
1147
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1148
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
1149
+ query_params: {'api-version' => @client.api_version},
1150
+ body: request_content,
1151
+ headers: request_headers.merge(custom_headers || {}),
1152
+ base_url: request_url
1153
+ }
1154
+ promise = @client.make_request_async(:patch, path_template, options)
1155
+
1156
+ promise = promise.then do |result|
1157
+ http_response = result.response
1158
+ status_code = http_response.status
1159
+ response_content = http_response.body
1160
+ unless status_code == 200 || status_code == 202
1161
+ error_model = JSON.load(response_content)
1162
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1163
+ end
1164
+
1165
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1166
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1167
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1168
+ # Deserialize Response
1169
+ if status_code == 200
1170
+ begin
1171
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1172
+ result_mapper = Azure::Signalr::Mgmt::V2018_10_01::Models::SignalRResource.mapper()
1173
+ result.body = @client.deserialize(result_mapper, parsed_response)
1174
+ rescue Exception => e
1175
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1176
+ end
1177
+ end
1178
+
1179
+ result
1180
+ end
1181
+
1182
+ promise.execute
1183
+ end
1184
+
1185
+ #
1186
+ # Operation to restart a SignalR service.
1187
+ #
1188
+ # @param resource_group_name [String] The name of the resource group that
1189
+ # contains the resource. You can obtain this value from the Azure Resource
1190
+ # Manager API or the portal.
1191
+ # @param resource_name [String] The name of the SignalR resource.
1192
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1193
+ # will be added to the HTTP request.
1194
+ #
1195
+ #
1196
+ def begin_restart(resource_group_name, resource_name, custom_headers:nil)
1197
+ response = begin_restart_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
1198
+ nil
1199
+ end
1200
+
1201
+ #
1202
+ # Operation to restart a SignalR service.
1203
+ #
1204
+ # @param resource_group_name [String] The name of the resource group that
1205
+ # contains the resource. You can obtain this value from the Azure Resource
1206
+ # Manager API or the portal.
1207
+ # @param resource_name [String] The name of the SignalR resource.
1208
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1209
+ # will be added to the HTTP request.
1210
+ #
1211
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1212
+ #
1213
+ def begin_restart_with_http_info(resource_group_name, resource_name, custom_headers:nil)
1214
+ begin_restart_async(resource_group_name, resource_name, custom_headers:custom_headers).value!
1215
+ end
1216
+
1217
+ #
1218
+ # Operation to restart a SignalR service.
1219
+ #
1220
+ # @param resource_group_name [String] The name of the resource group that
1221
+ # contains the resource. You can obtain this value from the Azure Resource
1222
+ # Manager API or the portal.
1223
+ # @param resource_name [String] The name of the SignalR resource.
1224
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1225
+ # to the HTTP request.
1226
+ #
1227
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1228
+ #
1229
+ def begin_restart_async(resource_group_name, resource_name, custom_headers:nil)
1230
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1231
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1232
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1233
+ fail ArgumentError, 'resource_name is nil' if resource_name.nil?
1234
+
1235
+
1236
+ request_headers = {}
1237
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1238
+
1239
+ # Set Headers
1240
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1241
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1242
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/restart'
1243
+
1244
+ request_url = @base_url || @client.base_url
1245
+
1246
+ options = {
1247
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1248
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'resourceName' => resource_name},
1249
+ query_params: {'api-version' => @client.api_version},
1250
+ headers: request_headers.merge(custom_headers || {}),
1251
+ base_url: request_url
1252
+ }
1253
+ promise = @client.make_request_async(:post, path_template, options)
1254
+
1255
+ promise = promise.then do |result|
1256
+ http_response = result.response
1257
+ status_code = http_response.status
1258
+ response_content = http_response.body
1259
+ unless status_code == 202 || status_code == 204
1260
+ error_model = JSON.load(response_content)
1261
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1262
+ end
1263
+
1264
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1265
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1266
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1267
+
1268
+ result
1269
+ end
1270
+
1271
+ promise.execute
1272
+ end
1273
+
1274
+ #
1275
+ # Handles requests to list all resources in a subscription.
1276
+ #
1277
+ # @param next_page_link [String] The NextLink from the previous successful call
1278
+ # to List operation.
1279
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1280
+ # will be added to the HTTP request.
1281
+ #
1282
+ # @return [SignalRResourceList] operation results.
1283
+ #
1284
+ def list_by_subscription_next(next_page_link, custom_headers:nil)
1285
+ response = list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
1286
+ response.body unless response.nil?
1287
+ end
1288
+
1289
+ #
1290
+ # Handles requests to list all resources in a subscription.
1291
+ #
1292
+ # @param next_page_link [String] The NextLink from the previous successful call
1293
+ # to List operation.
1294
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1295
+ # will be added to the HTTP request.
1296
+ #
1297
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1298
+ #
1299
+ def list_by_subscription_next_with_http_info(next_page_link, custom_headers:nil)
1300
+ list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
1301
+ end
1302
+
1303
+ #
1304
+ # Handles requests to list all resources in a subscription.
1305
+ #
1306
+ # @param next_page_link [String] The NextLink from the previous successful call
1307
+ # to List operation.
1308
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1309
+ # to the HTTP request.
1310
+ #
1311
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1312
+ #
1313
+ def list_by_subscription_next_async(next_page_link, custom_headers:nil)
1314
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1315
+
1316
+
1317
+ request_headers = {}
1318
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1319
+
1320
+ # Set Headers
1321
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1322
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1323
+ path_template = '{nextLink}'
1324
+
1325
+ request_url = @base_url || @client.base_url
1326
+
1327
+ options = {
1328
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1329
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1330
+ headers: request_headers.merge(custom_headers || {}),
1331
+ base_url: request_url
1332
+ }
1333
+ promise = @client.make_request_async(:get, path_template, options)
1334
+
1335
+ promise = promise.then do |result|
1336
+ http_response = result.response
1337
+ status_code = http_response.status
1338
+ response_content = http_response.body
1339
+ unless status_code == 200
1340
+ error_model = JSON.load(response_content)
1341
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1342
+ end
1343
+
1344
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1345
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1346
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1347
+ # Deserialize Response
1348
+ if status_code == 200
1349
+ begin
1350
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1351
+ result_mapper = Azure::Signalr::Mgmt::V2018_10_01::Models::SignalRResourceList.mapper()
1352
+ result.body = @client.deserialize(result_mapper, parsed_response)
1353
+ rescue Exception => e
1354
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1355
+ end
1356
+ end
1357
+
1358
+ result
1359
+ end
1360
+
1361
+ promise.execute
1362
+ end
1363
+
1364
+ #
1365
+ # Handles requests to list all resources in a resource group.
1366
+ #
1367
+ # @param next_page_link [String] The NextLink from the previous successful call
1368
+ # to List operation.
1369
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1370
+ # will be added to the HTTP request.
1371
+ #
1372
+ # @return [SignalRResourceList] operation results.
1373
+ #
1374
+ def list_by_resource_group_next(next_page_link, custom_headers:nil)
1375
+ response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
1376
+ response.body unless response.nil?
1377
+ end
1378
+
1379
+ #
1380
+ # Handles requests to list all resources in a resource group.
1381
+ #
1382
+ # @param next_page_link [String] The NextLink from the previous successful call
1383
+ # to List operation.
1384
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1385
+ # will be added to the HTTP request.
1386
+ #
1387
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1388
+ #
1389
+ def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
1390
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
1391
+ end
1392
+
1393
+ #
1394
+ # Handles requests to list all resources in a resource group.
1395
+ #
1396
+ # @param next_page_link [String] The NextLink from the previous successful call
1397
+ # to List operation.
1398
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1399
+ # to the HTTP request.
1400
+ #
1401
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1402
+ #
1403
+ def list_by_resource_group_next_async(next_page_link, custom_headers:nil)
1404
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1405
+
1406
+
1407
+ request_headers = {}
1408
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1409
+
1410
+ # Set Headers
1411
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1412
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1413
+ path_template = '{nextLink}'
1414
+
1415
+ request_url = @base_url || @client.base_url
1416
+
1417
+ options = {
1418
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1419
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1420
+ headers: request_headers.merge(custom_headers || {}),
1421
+ base_url: request_url
1422
+ }
1423
+ promise = @client.make_request_async(:get, path_template, options)
1424
+
1425
+ promise = promise.then do |result|
1426
+ http_response = result.response
1427
+ status_code = http_response.status
1428
+ response_content = http_response.body
1429
+ unless status_code == 200
1430
+ error_model = JSON.load(response_content)
1431
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1432
+ end
1433
+
1434
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1435
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1436
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1437
+ # Deserialize Response
1438
+ if status_code == 200
1439
+ begin
1440
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1441
+ result_mapper = Azure::Signalr::Mgmt::V2018_10_01::Models::SignalRResourceList.mapper()
1442
+ result.body = @client.deserialize(result_mapper, parsed_response)
1443
+ rescue Exception => e
1444
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1445
+ end
1446
+ end
1447
+
1448
+ result
1449
+ end
1450
+
1451
+ promise.execute
1452
+ end
1453
+
1454
+ #
1455
+ # Handles requests to list all resources in a subscription.
1456
+ #
1457
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1458
+ # will be added to the HTTP request.
1459
+ #
1460
+ # @return [SignalRResourceList] which provide lazy access to pages of the
1461
+ # response.
1462
+ #
1463
+ def list_by_subscription_as_lazy(custom_headers:nil)
1464
+ response = list_by_subscription_async(custom_headers:custom_headers).value!
1465
+ unless response.nil?
1466
+ page = response.body
1467
+ page.next_method = Proc.new do |next_page_link|
1468
+ list_by_subscription_next_async(next_page_link, custom_headers:custom_headers)
1469
+ end
1470
+ page
1471
+ end
1472
+ end
1473
+
1474
+ #
1475
+ # Handles requests to list all resources in a resource group.
1476
+ #
1477
+ # @param resource_group_name [String] The name of the resource group that
1478
+ # contains the resource. You can obtain this value from the Azure Resource
1479
+ # Manager API or the portal.
1480
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1481
+ # will be added to the HTTP request.
1482
+ #
1483
+ # @return [SignalRResourceList] which provide lazy access to pages of the
1484
+ # response.
1485
+ #
1486
+ def list_by_resource_group_as_lazy(resource_group_name, custom_headers:nil)
1487
+ response = list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
1488
+ unless response.nil?
1489
+ page = response.body
1490
+ page.next_method = Proc.new do |next_page_link|
1491
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
1492
+ end
1493
+ page
1494
+ end
1495
+ end
1496
+
1497
+ end
1498
+ end