azure_mgmt_server_management 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. checksums.yaml +7 -0
  2. data/.rspec +3 -0
  3. data/LICENSE.txt +21 -0
  4. data/Rakefile +5 -0
  5. data/azure_mgmt_server_management.gemspec +34 -0
  6. data/lib/azure_mgmt_server_management.rb +5 -0
  7. data/lib/generated/azure_mgmt_server_management.rb +57 -0
  8. data/lib/generated/azure_mgmt_server_management/gateway.rb +1394 -0
  9. data/lib/generated/azure_mgmt_server_management/models/auto_upgrade.rb +16 -0
  10. data/lib/generated/azure_mgmt_server_management/models/error.rb +64 -0
  11. data/lib/generated/azure_mgmt_server_management/models/gateway_expand_option.rb +15 -0
  12. data/lib/generated/azure_mgmt_server_management/models/gateway_parameters.rb +67 -0
  13. data/lib/generated/azure_mgmt_server_management/models/gateway_profile.rb +136 -0
  14. data/lib/generated/azure_mgmt_server_management/models/gateway_resource.rb +178 -0
  15. data/lib/generated/azure_mgmt_server_management/models/gateway_resources.rb +93 -0
  16. data/lib/generated/azure_mgmt_server_management/models/gateway_status.rb +153 -0
  17. data/lib/generated/azure_mgmt_server_management/models/node_parameters.rb +94 -0
  18. data/lib/generated/azure_mgmt_server_management/models/node_resource.rb +128 -0
  19. data/lib/generated/azure_mgmt_server_management/models/node_resources.rb +93 -0
  20. data/lib/generated/azure_mgmt_server_management/models/power_shell_command_parameters.rb +44 -0
  21. data/lib/generated/azure_mgmt_server_management/models/power_shell_command_result.rb +146 -0
  22. data/lib/generated/azure_mgmt_server_management/models/power_shell_command_results.rb +82 -0
  23. data/lib/generated/azure_mgmt_server_management/models/power_shell_command_status.rb +135 -0
  24. data/lib/generated/azure_mgmt_server_management/models/power_shell_expand_option.rb +15 -0
  25. data/lib/generated/azure_mgmt_server_management/models/power_shell_session_resource.rb +160 -0
  26. data/lib/generated/azure_mgmt_server_management/models/power_shell_session_resources.rb +63 -0
  27. data/lib/generated/azure_mgmt_server_management/models/power_shell_tab_completion_parameters.rb +44 -0
  28. data/lib/generated/azure_mgmt_server_management/models/power_shell_tab_completion_results.rb +52 -0
  29. data/lib/generated/azure_mgmt_server_management/models/prompt_field_description.rb +87 -0
  30. data/lib/generated/azure_mgmt_server_management/models/prompt_field_type.rb +17 -0
  31. data/lib/generated/azure_mgmt_server_management/models/prompt_message_response.rb +51 -0
  32. data/lib/generated/azure_mgmt_server_management/models/session_parameters.rb +54 -0
  33. data/lib/generated/azure_mgmt_server_management/models/session_resource.rb +118 -0
  34. data/lib/generated/azure_mgmt_server_management/models/version.rb +94 -0
  35. data/lib/generated/azure_mgmt_server_management/module_definition.rb +8 -0
  36. data/lib/generated/azure_mgmt_server_management/node.rb +996 -0
  37. data/lib/generated/azure_mgmt_server_management/power_shell.rb +989 -0
  38. data/lib/generated/azure_mgmt_server_management/server_management.rb +80 -0
  39. data/lib/generated/azure_mgmt_server_management/session.rb +398 -0
  40. data/lib/generated/azure_mgmt_server_management/version.rb +8 -0
  41. metadata +153 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: d1c21b7b16f25a11d39c78185d078069464bd9c7
4
+ data.tar.gz: 97430701810bbad5e1b1f580b7fe490d6ea562a3
5
+ SHA512:
6
+ metadata.gz: c2090044e273740365df3ecc00d44393854e6a11f6cdd0aa334ed7d2c8f804a3686807dfa48030701c94ec0750d201d9daa0ed90a7573e3c4e269f0500b3f583
7
+ data.tar.gz: 9a846614041e3d828ea7751164e5ced8cf57471b14a60a93b3f5b74952b51eebe065f1e31be0d79ca6a6956eec072a07dad4e429d18594e60bfc1c41b7f0a706
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --require spec_helper
2
+ --color
3
+ --format documentation
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Microsoft Corporation
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,5 @@
1
+ # encoding: utf-8
2
+ # Copyright (c) Microsoft Corporation. All rights reserved.
3
+ # Licensed under the MIT License. See License.txt in the project root for license information.
4
+
5
+ require "bundler/gem_tasks"
@@ -0,0 +1,34 @@
1
+ # encoding: utf-8
2
+ # Copyright (c) Microsoft Corporation. All rights reserved.
3
+ # Licensed under the MIT License. See License.txt in the project root for license information.
4
+
5
+ lib = File.expand_path('../lib', __FILE__)
6
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
7
+
8
+ require 'generated/azure_mgmt_server_management/module_definition'
9
+ require 'generated/azure_mgmt_server_management/version'
10
+
11
+ Gem::Specification.new do |spec|
12
+ spec.name = 'azure_mgmt_server_management'
13
+ spec.version = Azure::ARM::ServerManagement::VERSION
14
+ spec.authors = 'Microsoft Corporation'
15
+ spec.email = 'azrubyteam@microsoft.com'
16
+ spec.description = 'Microsoft Azure Server Management Client Library for Ruby'
17
+ spec.summary = 'Official Ruby client library to consume Microsoft Azure Server Management services.'
18
+ spec.homepage = 'https://aka.ms/azure-sdk-for-ruby'
19
+ spec.license = 'MIT'
20
+
21
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
22
+ spec.bindir = 'bin'
23
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
24
+ spec.require_paths = ['lib']
25
+
26
+ spec.required_ruby_version = '>= 1.9.3'
27
+
28
+ spec.add_development_dependency 'bundler', '~> 1.9'
29
+ spec.add_development_dependency 'rake', '~> 10'
30
+ spec.add_development_dependency 'rspec', '~> 3'
31
+ spec.add_development_dependency 'dotenv', '~> 2'
32
+
33
+ spec.add_runtime_dependency 'ms_rest_azure', '~> 0.3.0'
34
+ end
@@ -0,0 +1,5 @@
1
+ # encoding: utf-8
2
+ # Copyright (c) Microsoft Corporation. All rights reserved.
3
+ # Licensed under the MIT License. See License.txt in the project root for license information.
4
+
5
+ require 'generated/azure_mgmt_server_management'
@@ -0,0 +1,57 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ require 'uri'
7
+ require 'cgi'
8
+ require 'date'
9
+ require 'json'
10
+ require 'base64'
11
+ require 'erb'
12
+ require 'securerandom'
13
+ require 'time'
14
+ require 'timeliness'
15
+ require 'faraday'
16
+ require 'faraday-cookie_jar'
17
+ require 'concurrent'
18
+ require 'ms_rest'
19
+ require 'generated/azure_mgmt_server_management/module_definition'
20
+ require 'ms_rest_azure'
21
+
22
+ module Azure::ARM::ServerManagement
23
+ autoload :Gateway, 'generated/azure_mgmt_server_management/gateway.rb'
24
+ autoload :Node, 'generated/azure_mgmt_server_management/node.rb'
25
+ autoload :Session, 'generated/azure_mgmt_server_management/session.rb'
26
+ autoload :PowerShell, 'generated/azure_mgmt_server_management/power_shell.rb'
27
+ autoload :ServerManagement, 'generated/azure_mgmt_server_management/server_management.rb'
28
+
29
+ module Models
30
+ autoload :GatewayStatus, 'generated/azure_mgmt_server_management/models/gateway_status.rb'
31
+ autoload :GatewayResources, 'generated/azure_mgmt_server_management/models/gateway_resources.rb'
32
+ autoload :GatewayProfile, 'generated/azure_mgmt_server_management/models/gateway_profile.rb'
33
+ autoload :GatewayParameters, 'generated/azure_mgmt_server_management/models/gateway_parameters.rb'
34
+ autoload :NodeResources, 'generated/azure_mgmt_server_management/models/node_resources.rb'
35
+ autoload :NodeParameters, 'generated/azure_mgmt_server_management/models/node_parameters.rb'
36
+ autoload :SessionParameters, 'generated/azure_mgmt_server_management/models/session_parameters.rb'
37
+ autoload :Version, 'generated/azure_mgmt_server_management/models/version.rb'
38
+ autoload :PowerShellCommandResults, 'generated/azure_mgmt_server_management/models/power_shell_command_results.rb'
39
+ autoload :PowerShellCommandResult, 'generated/azure_mgmt_server_management/models/power_shell_command_result.rb'
40
+ autoload :PromptFieldDescription, 'generated/azure_mgmt_server_management/models/prompt_field_description.rb'
41
+ autoload :PowerShellSessionResources, 'generated/azure_mgmt_server_management/models/power_shell_session_resources.rb'
42
+ autoload :PowerShellCommandParameters, 'generated/azure_mgmt_server_management/models/power_shell_command_parameters.rb'
43
+ autoload :PromptMessageResponse, 'generated/azure_mgmt_server_management/models/prompt_message_response.rb'
44
+ autoload :PowerShellTabCompletionParameters, 'generated/azure_mgmt_server_management/models/power_shell_tab_completion_parameters.rb'
45
+ autoload :PowerShellTabCompletionResults, 'generated/azure_mgmt_server_management/models/power_shell_tab_completion_results.rb'
46
+ autoload :Error, 'generated/azure_mgmt_server_management/models/error.rb'
47
+ autoload :GatewayResource, 'generated/azure_mgmt_server_management/models/gateway_resource.rb'
48
+ autoload :NodeResource, 'generated/azure_mgmt_server_management/models/node_resource.rb'
49
+ autoload :SessionResource, 'generated/azure_mgmt_server_management/models/session_resource.rb'
50
+ autoload :PowerShellSessionResource, 'generated/azure_mgmt_server_management/models/power_shell_session_resource.rb'
51
+ autoload :PowerShellCommandStatus, 'generated/azure_mgmt_server_management/models/power_shell_command_status.rb'
52
+ autoload :AutoUpgrade, 'generated/azure_mgmt_server_management/models/auto_upgrade.rb'
53
+ autoload :PromptFieldType, 'generated/azure_mgmt_server_management/models/prompt_field_type.rb'
54
+ autoload :GatewayExpandOption, 'generated/azure_mgmt_server_management/models/gateway_expand_option.rb'
55
+ autoload :PowerShellExpandOption, 'generated/azure_mgmt_server_management/models/power_shell_expand_option.rb'
56
+ end
57
+ end
@@ -0,0 +1,1394 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::ARM::ServerManagement
7
+ #
8
+ # REST API for Azure Server Management Service
9
+ #
10
+ class Gateway
11
+ include Azure::ARM::ServerManagement::Models
12
+ include MsRestAzure
13
+
14
+ #
15
+ # Creates and initializes a new instance of the Gateway class.
16
+ # @param client service class for accessing basic functionality.
17
+ #
18
+ def initialize(client)
19
+ @client = client
20
+ end
21
+
22
+ # @return reference to the ServerManagement
23
+ attr_reader :client
24
+
25
+ #
26
+ # Creates or updates a ManagementService gateway.
27
+ #
28
+ # @param resource_group_name [String] The resource group name uniquely
29
+ # identifies the resource group within the user subscriptionId.
30
+ # @param gateway_name [String] The gateway name (256 characters maximum).
31
+ # @param location [String] location of the resource
32
+ # @param tags resource tags
33
+ # @param auto_upgrade [AutoUpgrade] The autoUpgrade property gives the
34
+ # flexibility to gateway to auto upgrade itself. If properties value not
35
+ # specified, then we assume autoUpgrade = Off. Possible values include: 'On',
36
+ # 'Off'
37
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
38
+ # will be added to the HTTP request.
39
+ #
40
+ # @return [GatewayResource] operation results.
41
+ #
42
+ def create(resource_group_name, gateway_name, location = nil, tags = nil, auto_upgrade = nil, custom_headers = nil)
43
+ response = create_async(resource_group_name, gateway_name, location, tags, auto_upgrade, custom_headers).value!
44
+ response.body unless response.nil?
45
+ end
46
+
47
+ #
48
+ # @param resource_group_name [String] The resource group name uniquely
49
+ # identifies the resource group within the user subscriptionId.
50
+ # @param gateway_name [String] The gateway name (256 characters maximum).
51
+ # @param location [String] location of the resource
52
+ # @param tags resource tags
53
+ # @param auto_upgrade [AutoUpgrade] The autoUpgrade property gives the
54
+ # flexibility to gateway to auto upgrade itself. If properties value not
55
+ # specified, then we assume autoUpgrade = Off. Possible values include: 'On',
56
+ # 'Off'
57
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
58
+ # will be added to the HTTP request.
59
+ #
60
+ # @return [Concurrent::Promise] promise which provides async access to http
61
+ # response.
62
+ #
63
+ def create_async(resource_group_name, gateway_name, location = nil, tags = nil, auto_upgrade = nil, custom_headers = nil)
64
+ # Send request
65
+ promise = begin_create_async(resource_group_name, gateway_name, location, tags, auto_upgrade, custom_headers)
66
+
67
+ promise = promise.then do |response|
68
+ # Defining deserialization method.
69
+ deserialize_method = lambda do |parsed_response|
70
+ result_mapper = GatewayResource.mapper()
71
+ parsed_response = @client.deserialize(result_mapper, parsed_response, 'parsed_response')
72
+ end
73
+
74
+ # Waiting for response.
75
+ @client.get_long_running_operation_result(response, deserialize_method)
76
+ end
77
+
78
+ promise
79
+ end
80
+
81
+ #
82
+ # Creates or updates a ManagementService gateway.
83
+ #
84
+ # @param resource_group_name [String] The resource group name uniquely
85
+ # identifies the resource group within the user subscriptionId.
86
+ # @param gateway_name [String] The gateway name (256 characters maximum).
87
+ # @param location [String] location of the resource
88
+ # @param tags resource tags
89
+ # @param auto_upgrade [AutoUpgrade] The autoUpgrade property gives the
90
+ # flexibility to gateway to auto upgrade itself. If properties value not
91
+ # specified, then we assume autoUpgrade = Off. Possible values include: 'On',
92
+ # 'Off'
93
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
94
+ # will be added to the HTTP request.
95
+ #
96
+ # @return [GatewayResource] operation results.
97
+ #
98
+ def begin_create(resource_group_name, gateway_name, location = nil, tags = nil, auto_upgrade = nil, custom_headers = nil)
99
+ response = begin_create_async(resource_group_name, gateway_name, location, tags, auto_upgrade, custom_headers).value!
100
+ response.body unless response.nil?
101
+ end
102
+
103
+ #
104
+ # Creates or updates a ManagementService gateway.
105
+ #
106
+ # @param resource_group_name [String] The resource group name uniquely
107
+ # identifies the resource group within the user subscriptionId.
108
+ # @param gateway_name [String] The gateway name (256 characters maximum).
109
+ # @param location [String] location of the resource
110
+ # @param tags resource tags
111
+ # @param auto_upgrade [AutoUpgrade] The autoUpgrade property gives the
112
+ # flexibility to gateway to auto upgrade itself. If properties value not
113
+ # specified, then we assume autoUpgrade = Off. Possible values include: 'On',
114
+ # 'Off'
115
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
116
+ # will be added to the HTTP request.
117
+ #
118
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
119
+ #
120
+ def begin_create_with_http_info(resource_group_name, gateway_name, location = nil, tags = nil, auto_upgrade = nil, custom_headers = nil)
121
+ begin_create_async(resource_group_name, gateway_name, location, tags, auto_upgrade, custom_headers).value!
122
+ end
123
+
124
+ #
125
+ # Creates or updates a ManagementService gateway.
126
+ #
127
+ # @param resource_group_name [String] The resource group name uniquely
128
+ # identifies the resource group within the user subscriptionId.
129
+ # @param gateway_name [String] The gateway name (256 characters maximum).
130
+ # @param location [String] location of the resource
131
+ # @param tags resource tags
132
+ # @param auto_upgrade [AutoUpgrade] The autoUpgrade property gives the
133
+ # flexibility to gateway to auto upgrade itself. If properties value not
134
+ # specified, then we assume autoUpgrade = Off. Possible values include: 'On',
135
+ # 'Off'
136
+ # @param [Hash{String => String}] A hash of custom headers that will be added
137
+ # to the HTTP request.
138
+ #
139
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
140
+ #
141
+ def begin_create_async(resource_group_name, gateway_name, location = nil, tags = nil, auto_upgrade = nil, custom_headers = nil)
142
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
143
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
144
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
145
+ fail ArgumentError, 'gateway_name is nil' if gateway_name.nil?
146
+
147
+ gateway_parameters = GatewayParameters.new
148
+ unless location.nil? && tags.nil? && auto_upgrade.nil?
149
+ gateway_parameters.location = location
150
+ gateway_parameters.tags = tags
151
+ gateway_parameters.auto_upgrade = auto_upgrade
152
+ end
153
+
154
+ request_headers = {}
155
+
156
+ # Set Headers
157
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
158
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
159
+
160
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
161
+
162
+ # Serialize Request
163
+ request_mapper = GatewayParameters.mapper()
164
+ request_content = @client.serialize(request_mapper, gateway_parameters, 'gateway_parameters')
165
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
166
+
167
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServerManagement/gateways/{gatewayName}'
168
+ options = {
169
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
170
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'gatewayName' => gateway_name},
171
+ query_params: {'api-version' => @client.api_version},
172
+ body: request_content,
173
+ headers: request_headers.merge(custom_headers || {})
174
+ }
175
+
176
+ request_url = @base_url || @client.base_url
177
+
178
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :put, options)
179
+ promise = request.run_promise do |req|
180
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
181
+ end
182
+
183
+ promise = promise.then do |http_response|
184
+ status_code = http_response.status
185
+ response_content = http_response.body
186
+ unless status_code == 200 || status_code == 201
187
+ error_model = JSON.load(response_content)
188
+ fail MsRest::HttpOperationError.new(request, http_response, error_model)
189
+ end
190
+
191
+ # Create Result
192
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
193
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
194
+ # Deserialize Response
195
+ if status_code == 200
196
+ begin
197
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
198
+ result_mapper = GatewayResource.mapper()
199
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
200
+ rescue Exception => e
201
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
202
+ end
203
+ end
204
+ # Deserialize Response
205
+ if status_code == 201
206
+ begin
207
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
208
+ result_mapper = GatewayResource.mapper()
209
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
210
+ rescue Exception => e
211
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
212
+ end
213
+ end
214
+
215
+ result
216
+ end
217
+
218
+ promise.execute
219
+ end
220
+
221
+ #
222
+ # Updates a gateway belonging to a resource group.
223
+ #
224
+ # @param resource_group_name [String] The resource group name uniquely
225
+ # identifies the resource group within the user subscriptionId.
226
+ # @param gateway_name [String] The gateway name (256 characters maximum).
227
+ # @param location [String] location of the resource
228
+ # @param tags resource tags
229
+ # @param auto_upgrade [AutoUpgrade] The autoUpgrade property gives the
230
+ # flexibility to gateway to auto upgrade itself. If properties value not
231
+ # specified, then we assume autoUpgrade = Off. Possible values include: 'On',
232
+ # 'Off'
233
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
234
+ # will be added to the HTTP request.
235
+ #
236
+ # @return [GatewayResource] operation results.
237
+ #
238
+ def update(resource_group_name, gateway_name, location = nil, tags = nil, auto_upgrade = nil, custom_headers = nil)
239
+ response = update_async(resource_group_name, gateway_name, location, tags, auto_upgrade, custom_headers).value!
240
+ response.body unless response.nil?
241
+ end
242
+
243
+ #
244
+ # @param resource_group_name [String] The resource group name uniquely
245
+ # identifies the resource group within the user subscriptionId.
246
+ # @param gateway_name [String] The gateway name (256 characters maximum).
247
+ # @param location [String] location of the resource
248
+ # @param tags resource tags
249
+ # @param auto_upgrade [AutoUpgrade] The autoUpgrade property gives the
250
+ # flexibility to gateway to auto upgrade itself. If properties value not
251
+ # specified, then we assume autoUpgrade = Off. Possible values include: 'On',
252
+ # 'Off'
253
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
254
+ # will be added to the HTTP request.
255
+ #
256
+ # @return [Concurrent::Promise] promise which provides async access to http
257
+ # response.
258
+ #
259
+ def update_async(resource_group_name, gateway_name, location = nil, tags = nil, auto_upgrade = nil, custom_headers = nil)
260
+ # Send request
261
+ promise = begin_update_async(resource_group_name, gateway_name, location, tags, auto_upgrade, custom_headers)
262
+
263
+ promise = promise.then do |response|
264
+ # Defining deserialization method.
265
+ deserialize_method = lambda do |parsed_response|
266
+ result_mapper = GatewayResource.mapper()
267
+ parsed_response = @client.deserialize(result_mapper, parsed_response, 'parsed_response')
268
+ end
269
+
270
+ # Waiting for response.
271
+ @client.get_long_running_operation_result(response, deserialize_method)
272
+ end
273
+
274
+ promise
275
+ end
276
+
277
+ #
278
+ # Updates a gateway belonging to a resource group.
279
+ #
280
+ # @param resource_group_name [String] The resource group name uniquely
281
+ # identifies the resource group within the user subscriptionId.
282
+ # @param gateway_name [String] The gateway name (256 characters maximum).
283
+ # @param location [String] location of the resource
284
+ # @param tags resource tags
285
+ # @param auto_upgrade [AutoUpgrade] The autoUpgrade property gives the
286
+ # flexibility to gateway to auto upgrade itself. If properties value not
287
+ # specified, then we assume autoUpgrade = Off. Possible values include: 'On',
288
+ # 'Off'
289
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
290
+ # will be added to the HTTP request.
291
+ #
292
+ # @return [GatewayResource] operation results.
293
+ #
294
+ def begin_update(resource_group_name, gateway_name, location = nil, tags = nil, auto_upgrade = nil, custom_headers = nil)
295
+ response = begin_update_async(resource_group_name, gateway_name, location, tags, auto_upgrade, custom_headers).value!
296
+ response.body unless response.nil?
297
+ end
298
+
299
+ #
300
+ # Updates a gateway belonging to a resource group.
301
+ #
302
+ # @param resource_group_name [String] The resource group name uniquely
303
+ # identifies the resource group within the user subscriptionId.
304
+ # @param gateway_name [String] The gateway name (256 characters maximum).
305
+ # @param location [String] location of the resource
306
+ # @param tags resource tags
307
+ # @param auto_upgrade [AutoUpgrade] The autoUpgrade property gives the
308
+ # flexibility to gateway to auto upgrade itself. If properties value not
309
+ # specified, then we assume autoUpgrade = Off. Possible values include: 'On',
310
+ # 'Off'
311
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
312
+ # will be added to the HTTP request.
313
+ #
314
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
315
+ #
316
+ def begin_update_with_http_info(resource_group_name, gateway_name, location = nil, tags = nil, auto_upgrade = nil, custom_headers = nil)
317
+ begin_update_async(resource_group_name, gateway_name, location, tags, auto_upgrade, custom_headers).value!
318
+ end
319
+
320
+ #
321
+ # Updates a gateway belonging to a resource group.
322
+ #
323
+ # @param resource_group_name [String] The resource group name uniquely
324
+ # identifies the resource group within the user subscriptionId.
325
+ # @param gateway_name [String] The gateway name (256 characters maximum).
326
+ # @param location [String] location of the resource
327
+ # @param tags resource tags
328
+ # @param auto_upgrade [AutoUpgrade] The autoUpgrade property gives the
329
+ # flexibility to gateway to auto upgrade itself. If properties value not
330
+ # specified, then we assume autoUpgrade = Off. Possible values include: 'On',
331
+ # 'Off'
332
+ # @param [Hash{String => String}] A hash of custom headers that will be added
333
+ # to the HTTP request.
334
+ #
335
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
336
+ #
337
+ def begin_update_async(resource_group_name, gateway_name, location = nil, tags = nil, auto_upgrade = nil, custom_headers = nil)
338
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
339
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
340
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
341
+ fail ArgumentError, 'gateway_name is nil' if gateway_name.nil?
342
+
343
+ gateway_parameters = GatewayParameters.new
344
+ unless location.nil? && tags.nil? && auto_upgrade.nil?
345
+ gateway_parameters.location = location
346
+ gateway_parameters.tags = tags
347
+ gateway_parameters.auto_upgrade = auto_upgrade
348
+ end
349
+
350
+ request_headers = {}
351
+
352
+ # Set Headers
353
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
354
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
355
+
356
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
357
+
358
+ # Serialize Request
359
+ request_mapper = GatewayParameters.mapper()
360
+ request_content = @client.serialize(request_mapper, gateway_parameters, 'gateway_parameters')
361
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
362
+
363
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServerManagement/gateways/{gatewayName}'
364
+ options = {
365
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
366
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'gatewayName' => gateway_name},
367
+ query_params: {'api-version' => @client.api_version},
368
+ body: request_content,
369
+ headers: request_headers.merge(custom_headers || {})
370
+ }
371
+
372
+ request_url = @base_url || @client.base_url
373
+
374
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :patch, options)
375
+ promise = request.run_promise do |req|
376
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
377
+ end
378
+
379
+ promise = promise.then do |http_response|
380
+ status_code = http_response.status
381
+ response_content = http_response.body
382
+ unless status_code == 200 || status_code == 202
383
+ error_model = JSON.load(response_content)
384
+ fail MsRest::HttpOperationError.new(request, http_response, error_model)
385
+ end
386
+
387
+ # Create Result
388
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
389
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
390
+ # Deserialize Response
391
+ if status_code == 200
392
+ begin
393
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
394
+ result_mapper = GatewayResource.mapper()
395
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
396
+ rescue Exception => e
397
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
398
+ end
399
+ end
400
+
401
+ result
402
+ end
403
+
404
+ promise.execute
405
+ end
406
+
407
+ #
408
+ # Deletes a gateway from a resource group.
409
+ #
410
+ # @param resource_group_name [String] The resource group name uniquely
411
+ # identifies the resource group within the user subscriptionId.
412
+ # @param gateway_name [String] The gateway name (256 characters maximum).
413
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
414
+ # will be added to the HTTP request.
415
+ #
416
+ #
417
+ def delete(resource_group_name, gateway_name, custom_headers = nil)
418
+ response = delete_async(resource_group_name, gateway_name, custom_headers).value!
419
+ nil
420
+ end
421
+
422
+ #
423
+ # Deletes a gateway from a resource group.
424
+ #
425
+ # @param resource_group_name [String] The resource group name uniquely
426
+ # identifies the resource group within the user subscriptionId.
427
+ # @param gateway_name [String] The gateway name (256 characters maximum).
428
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
429
+ # will be added to the HTTP request.
430
+ #
431
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
432
+ #
433
+ def delete_with_http_info(resource_group_name, gateway_name, custom_headers = nil)
434
+ delete_async(resource_group_name, gateway_name, custom_headers).value!
435
+ end
436
+
437
+ #
438
+ # Deletes a gateway from a resource group.
439
+ #
440
+ # @param resource_group_name [String] The resource group name uniquely
441
+ # identifies the resource group within the user subscriptionId.
442
+ # @param gateway_name [String] The gateway name (256 characters maximum).
443
+ # @param [Hash{String => String}] A hash of custom headers that will be added
444
+ # to the HTTP request.
445
+ #
446
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
447
+ #
448
+ def delete_async(resource_group_name, gateway_name, custom_headers = nil)
449
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
450
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
451
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
452
+ fail ArgumentError, 'gateway_name is nil' if gateway_name.nil?
453
+
454
+
455
+ request_headers = {}
456
+
457
+ # Set Headers
458
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
459
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
460
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServerManagement/gateways/{gatewayName}'
461
+ options = {
462
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
463
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'gatewayName' => gateway_name},
464
+ query_params: {'api-version' => @client.api_version},
465
+ headers: request_headers.merge(custom_headers || {})
466
+ }
467
+
468
+ request_url = @base_url || @client.base_url
469
+
470
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :delete, options)
471
+ promise = request.run_promise do |req|
472
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
473
+ end
474
+
475
+ promise = promise.then do |http_response|
476
+ status_code = http_response.status
477
+ response_content = http_response.body
478
+ unless status_code == 200 || status_code == 204
479
+ error_model = JSON.load(response_content)
480
+ fail MsRest::HttpOperationError.new(request, http_response, error_model)
481
+ end
482
+
483
+ # Create Result
484
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
485
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
486
+
487
+ result
488
+ end
489
+
490
+ promise.execute
491
+ end
492
+
493
+ #
494
+ # Returns a gateway
495
+ #
496
+ # @param resource_group_name [String] The resource group name uniquely
497
+ # identifies the resource group within the user subscriptionId.
498
+ # @param gateway_name [String] The gateway name (256 characters maximum)
499
+ # @param expand [GatewayExpandOption] Gets subscription credentials which
500
+ # uniquely identify Microsoft Azure subscription. The subscription ID forms
501
+ # part of the URI for every service call. Possible values include: 'status'
502
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
503
+ # will be added to the HTTP request.
504
+ #
505
+ # @return [GatewayResource] operation results.
506
+ #
507
+ def get(resource_group_name, gateway_name, expand = nil, custom_headers = nil)
508
+ response = get_async(resource_group_name, gateway_name, expand, custom_headers).value!
509
+ response.body unless response.nil?
510
+ end
511
+
512
+ #
513
+ # Returns a gateway
514
+ #
515
+ # @param resource_group_name [String] The resource group name uniquely
516
+ # identifies the resource group within the user subscriptionId.
517
+ # @param gateway_name [String] The gateway name (256 characters maximum)
518
+ # @param expand [GatewayExpandOption] Gets subscription credentials which
519
+ # uniquely identify Microsoft Azure subscription. The subscription ID forms
520
+ # part of the URI for every service call. Possible values include: 'status'
521
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
522
+ # will be added to the HTTP request.
523
+ #
524
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
525
+ #
526
+ def get_with_http_info(resource_group_name, gateway_name, expand = nil, custom_headers = nil)
527
+ get_async(resource_group_name, gateway_name, expand, custom_headers).value!
528
+ end
529
+
530
+ #
531
+ # Returns a gateway
532
+ #
533
+ # @param resource_group_name [String] The resource group name uniquely
534
+ # identifies the resource group within the user subscriptionId.
535
+ # @param gateway_name [String] The gateway name (256 characters maximum)
536
+ # @param expand [GatewayExpandOption] Gets subscription credentials which
537
+ # uniquely identify Microsoft Azure subscription. The subscription ID forms
538
+ # part of the URI for every service call. Possible values include: 'status'
539
+ # @param [Hash{String => String}] A hash of custom headers that will be added
540
+ # to the HTTP request.
541
+ #
542
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
543
+ #
544
+ def get_async(resource_group_name, gateway_name, expand = nil, custom_headers = nil)
545
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
546
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
547
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
548
+ fail ArgumentError, 'gateway_name is nil' if gateway_name.nil?
549
+
550
+
551
+ request_headers = {}
552
+
553
+ # Set Headers
554
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
555
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
556
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServerManagement/gateways/{gatewayName}'
557
+ options = {
558
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
559
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'gatewayName' => gateway_name},
560
+ query_params: {'api-version' => @client.api_version,'$expand' => expand},
561
+ headers: request_headers.merge(custom_headers || {})
562
+ }
563
+
564
+ request_url = @base_url || @client.base_url
565
+
566
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
567
+ promise = request.run_promise do |req|
568
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
569
+ end
570
+
571
+ promise = promise.then do |http_response|
572
+ status_code = http_response.status
573
+ response_content = http_response.body
574
+ unless status_code == 200
575
+ error_model = JSON.load(response_content)
576
+ fail MsRest::HttpOperationError.new(request, http_response, error_model)
577
+ end
578
+
579
+ # Create Result
580
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
581
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
582
+ # Deserialize Response
583
+ if status_code == 200
584
+ begin
585
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
586
+ result_mapper = GatewayResource.mapper()
587
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
588
+ rescue Exception => e
589
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
590
+ end
591
+ end
592
+
593
+ result
594
+ end
595
+
596
+ promise.execute
597
+ end
598
+
599
+ #
600
+ # Returns gateways in a subscription
601
+ #
602
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
603
+ # will be added to the HTTP request.
604
+ #
605
+ # @return [GatewayResources] which provide lazy access to pages of the
606
+ # response.
607
+ #
608
+ def list_as_lazy(custom_headers = nil)
609
+ response = list_async(custom_headers).value!
610
+ unless response.nil?
611
+ page = response.body
612
+ page.next_method = Proc.new do |next_link|
613
+ list_next_async(next_link, custom_headers)
614
+ end
615
+ page
616
+ end
617
+ end
618
+
619
+ #
620
+ # Returns gateways in a subscription
621
+ #
622
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
623
+ # will be added to the HTTP request.
624
+ #
625
+ # @return [Array<GatewayResource>] operation results.
626
+ #
627
+ def list(custom_headers = nil)
628
+ first_page = list_as_lazy(custom_headers)
629
+ first_page.get_all_items
630
+ end
631
+
632
+ #
633
+ # Returns gateways in a subscription
634
+ #
635
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
636
+ # will be added to the HTTP request.
637
+ #
638
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
639
+ #
640
+ def list_with_http_info(custom_headers = nil)
641
+ list_async(custom_headers).value!
642
+ end
643
+
644
+ #
645
+ # Returns gateways in a subscription
646
+ #
647
+ # @param [Hash{String => String}] A hash of custom headers that will be added
648
+ # to the HTTP request.
649
+ #
650
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
651
+ #
652
+ def list_async(custom_headers = nil)
653
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
654
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
655
+
656
+
657
+ request_headers = {}
658
+
659
+ # Set Headers
660
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
661
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
662
+ path_template = '/subscriptions/{subscriptionId}/providers/Microsoft.ServerManagement/gateways'
663
+ options = {
664
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
665
+ path_params: {'subscriptionId' => @client.subscription_id},
666
+ query_params: {'api-version' => @client.api_version},
667
+ headers: request_headers.merge(custom_headers || {})
668
+ }
669
+
670
+ request_url = @base_url || @client.base_url
671
+
672
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
673
+ promise = request.run_promise do |req|
674
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
675
+ end
676
+
677
+ promise = promise.then do |http_response|
678
+ status_code = http_response.status
679
+ response_content = http_response.body
680
+ unless status_code == 200
681
+ error_model = JSON.load(response_content)
682
+ fail MsRest::HttpOperationError.new(request, http_response, error_model)
683
+ end
684
+
685
+ # Create Result
686
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
687
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
688
+ # Deserialize Response
689
+ if status_code == 200
690
+ begin
691
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
692
+ result_mapper = GatewayResources.mapper()
693
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
694
+ rescue Exception => e
695
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
696
+ end
697
+ end
698
+
699
+ result
700
+ end
701
+
702
+ promise.execute
703
+ end
704
+
705
+ #
706
+ # Returns gateways in a resource group
707
+ #
708
+ # @param resource_group_name [String] The resource group name uniquely
709
+ # identifies the resource group within the user subscriptionId.
710
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
711
+ # will be added to the HTTP request.
712
+ #
713
+ # @return [GatewayResources] which provide lazy access to pages of the
714
+ # response.
715
+ #
716
+ def list_for_resource_group_as_lazy(resource_group_name, custom_headers = nil)
717
+ response = list_for_resource_group_async(resource_group_name, custom_headers).value!
718
+ unless response.nil?
719
+ page = response.body
720
+ page.next_method = Proc.new do |next_link|
721
+ list_for_resource_group_next_async(next_link, custom_headers)
722
+ end
723
+ page
724
+ end
725
+ end
726
+
727
+ #
728
+ # Returns gateways in a resource group
729
+ #
730
+ # @param resource_group_name [String] The resource group name uniquely
731
+ # identifies the resource group within the user subscriptionId.
732
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
733
+ # will be added to the HTTP request.
734
+ #
735
+ # @return [Array<GatewayResource>] operation results.
736
+ #
737
+ def list_for_resource_group(resource_group_name, custom_headers = nil)
738
+ first_page = list_for_resource_group_as_lazy(resource_group_name, custom_headers)
739
+ first_page.get_all_items
740
+ end
741
+
742
+ #
743
+ # Returns gateways in a resource group
744
+ #
745
+ # @param resource_group_name [String] The resource group name uniquely
746
+ # identifies the resource group within the user subscriptionId.
747
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
748
+ # will be added to the HTTP request.
749
+ #
750
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
751
+ #
752
+ def list_for_resource_group_with_http_info(resource_group_name, custom_headers = nil)
753
+ list_for_resource_group_async(resource_group_name, custom_headers).value!
754
+ end
755
+
756
+ #
757
+ # Returns gateways in a resource group
758
+ #
759
+ # @param resource_group_name [String] The resource group name uniquely
760
+ # identifies the resource group within the user subscriptionId.
761
+ # @param [Hash{String => String}] A hash of custom headers that will be added
762
+ # to the HTTP request.
763
+ #
764
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
765
+ #
766
+ def list_for_resource_group_async(resource_group_name, custom_headers = nil)
767
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
768
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
769
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
770
+
771
+
772
+ request_headers = {}
773
+
774
+ # Set Headers
775
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
776
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
777
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServerManagement/gateways'
778
+ options = {
779
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
780
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
781
+ query_params: {'api-version' => @client.api_version},
782
+ headers: request_headers.merge(custom_headers || {})
783
+ }
784
+
785
+ request_url = @base_url || @client.base_url
786
+
787
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
788
+ promise = request.run_promise do |req|
789
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
790
+ end
791
+
792
+ promise = promise.then do |http_response|
793
+ status_code = http_response.status
794
+ response_content = http_response.body
795
+ unless status_code == 200
796
+ error_model = JSON.load(response_content)
797
+ fail MsRest::HttpOperationError.new(request, http_response, error_model)
798
+ end
799
+
800
+ # Create Result
801
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
802
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
803
+ # Deserialize Response
804
+ if status_code == 200
805
+ begin
806
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
807
+ result_mapper = GatewayResources.mapper()
808
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
809
+ rescue Exception => e
810
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
811
+ end
812
+ end
813
+
814
+ result
815
+ end
816
+
817
+ promise.execute
818
+ end
819
+
820
+ #
821
+ # Upgrade a gateway
822
+ #
823
+ # @param resource_group_name [String] The resource group name uniquely
824
+ # identifies the resource group within the user subscriptionId.
825
+ # @param gateway_name [String] The gateway name (256 characters maximum).
826
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
827
+ # will be added to the HTTP request.
828
+ #
829
+ def upgrade(resource_group_name, gateway_name, custom_headers = nil)
830
+ response = upgrade_async(resource_group_name, gateway_name, custom_headers).value!
831
+ nil
832
+ end
833
+
834
+ #
835
+ # @param resource_group_name [String] The resource group name uniquely
836
+ # identifies the resource group within the user subscriptionId.
837
+ # @param gateway_name [String] The gateway name (256 characters maximum).
838
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
839
+ # will be added to the HTTP request.
840
+ #
841
+ # @return [Concurrent::Promise] promise which provides async access to http
842
+ # response.
843
+ #
844
+ def upgrade_async(resource_group_name, gateway_name, custom_headers = nil)
845
+ # Send request
846
+ promise = begin_upgrade_async(resource_group_name, gateway_name, custom_headers)
847
+
848
+ promise = promise.then do |response|
849
+ # Defining deserialization method.
850
+ deserialize_method = lambda do |parsed_response|
851
+ end
852
+
853
+ # Waiting for response.
854
+ @client.get_long_running_operation_result(response, deserialize_method)
855
+ end
856
+
857
+ promise
858
+ end
859
+
860
+ #
861
+ # Upgrade a gateway
862
+ #
863
+ # @param resource_group_name [String] The resource group name uniquely
864
+ # identifies the resource group within the user subscriptionId.
865
+ # @param gateway_name [String] The gateway name (256 characters maximum).
866
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
867
+ # will be added to the HTTP request.
868
+ #
869
+ #
870
+ def begin_upgrade(resource_group_name, gateway_name, custom_headers = nil)
871
+ response = begin_upgrade_async(resource_group_name, gateway_name, custom_headers).value!
872
+ nil
873
+ end
874
+
875
+ #
876
+ # Upgrade a gateway
877
+ #
878
+ # @param resource_group_name [String] The resource group name uniquely
879
+ # identifies the resource group within the user subscriptionId.
880
+ # @param gateway_name [String] The gateway name (256 characters maximum).
881
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
882
+ # will be added to the HTTP request.
883
+ #
884
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
885
+ #
886
+ def begin_upgrade_with_http_info(resource_group_name, gateway_name, custom_headers = nil)
887
+ begin_upgrade_async(resource_group_name, gateway_name, custom_headers).value!
888
+ end
889
+
890
+ #
891
+ # Upgrade a gateway
892
+ #
893
+ # @param resource_group_name [String] The resource group name uniquely
894
+ # identifies the resource group within the user subscriptionId.
895
+ # @param gateway_name [String] The gateway name (256 characters maximum).
896
+ # @param [Hash{String => String}] A hash of custom headers that will be added
897
+ # to the HTTP request.
898
+ #
899
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
900
+ #
901
+ def begin_upgrade_async(resource_group_name, gateway_name, custom_headers = nil)
902
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
903
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
904
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
905
+ fail ArgumentError, 'gateway_name is nil' if gateway_name.nil?
906
+
907
+
908
+ request_headers = {}
909
+
910
+ # Set Headers
911
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
912
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
913
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServerManagement/gateways/{gatewayName}/upgradetolatest'
914
+ options = {
915
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
916
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'gatewayName' => gateway_name},
917
+ query_params: {'api-version' => @client.api_version},
918
+ headers: request_headers.merge(custom_headers || {})
919
+ }
920
+
921
+ request_url = @base_url || @client.base_url
922
+
923
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options)
924
+ promise = request.run_promise do |req|
925
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
926
+ end
927
+
928
+ promise = promise.then do |http_response|
929
+ status_code = http_response.status
930
+ response_content = http_response.body
931
+ unless status_code == 200 || status_code == 202
932
+ error_model = JSON.load(response_content)
933
+ fail MsRest::HttpOperationError.new(request, http_response, error_model)
934
+ end
935
+
936
+ # Create Result
937
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
938
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
939
+
940
+ result
941
+ end
942
+
943
+ promise.execute
944
+ end
945
+
946
+ #
947
+ # Regenerate a gateway's profile
948
+ #
949
+ # @param resource_group_name [String] The resource group name uniquely
950
+ # identifies the resource group within the user subscriptionId.
951
+ # @param gateway_name [String] The gateway name (256 characters maximum).
952
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
953
+ # will be added to the HTTP request.
954
+ #
955
+ def regenerate_profile(resource_group_name, gateway_name, custom_headers = nil)
956
+ response = regenerate_profile_async(resource_group_name, gateway_name, custom_headers).value!
957
+ nil
958
+ end
959
+
960
+ #
961
+ # @param resource_group_name [String] The resource group name uniquely
962
+ # identifies the resource group within the user subscriptionId.
963
+ # @param gateway_name [String] The gateway name (256 characters maximum).
964
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
965
+ # will be added to the HTTP request.
966
+ #
967
+ # @return [Concurrent::Promise] promise which provides async access to http
968
+ # response.
969
+ #
970
+ def regenerate_profile_async(resource_group_name, gateway_name, custom_headers = nil)
971
+ # Send request
972
+ promise = begin_regenerate_profile_async(resource_group_name, gateway_name, custom_headers)
973
+
974
+ promise = promise.then do |response|
975
+ # Defining deserialization method.
976
+ deserialize_method = lambda do |parsed_response|
977
+ end
978
+
979
+ # Waiting for response.
980
+ @client.get_long_running_operation_result(response, deserialize_method)
981
+ end
982
+
983
+ promise
984
+ end
985
+
986
+ #
987
+ # Regenerate a gateway's profile
988
+ #
989
+ # @param resource_group_name [String] The resource group name uniquely
990
+ # identifies the resource group within the user subscriptionId.
991
+ # @param gateway_name [String] The gateway name (256 characters maximum).
992
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
993
+ # will be added to the HTTP request.
994
+ #
995
+ #
996
+ def begin_regenerate_profile(resource_group_name, gateway_name, custom_headers = nil)
997
+ response = begin_regenerate_profile_async(resource_group_name, gateway_name, custom_headers).value!
998
+ nil
999
+ end
1000
+
1001
+ #
1002
+ # Regenerate a gateway's profile
1003
+ #
1004
+ # @param resource_group_name [String] The resource group name uniquely
1005
+ # identifies the resource group within the user subscriptionId.
1006
+ # @param gateway_name [String] The gateway name (256 characters maximum).
1007
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1008
+ # will be added to the HTTP request.
1009
+ #
1010
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1011
+ #
1012
+ def begin_regenerate_profile_with_http_info(resource_group_name, gateway_name, custom_headers = nil)
1013
+ begin_regenerate_profile_async(resource_group_name, gateway_name, custom_headers).value!
1014
+ end
1015
+
1016
+ #
1017
+ # Regenerate a gateway's profile
1018
+ #
1019
+ # @param resource_group_name [String] The resource group name uniquely
1020
+ # identifies the resource group within the user subscriptionId.
1021
+ # @param gateway_name [String] The gateway name (256 characters maximum).
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_regenerate_profile_async(resource_group_name, gateway_name, custom_headers = nil)
1028
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1029
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1030
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1031
+ fail ArgumentError, 'gateway_name is nil' if gateway_name.nil?
1032
+
1033
+
1034
+ request_headers = {}
1035
+
1036
+ # Set Headers
1037
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1038
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1039
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServerManagement/gateways/{gatewayName}/regenerateprofile'
1040
+ options = {
1041
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1042
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'gatewayName' => gateway_name},
1043
+ query_params: {'api-version' => @client.api_version},
1044
+ headers: request_headers.merge(custom_headers || {})
1045
+ }
1046
+
1047
+ request_url = @base_url || @client.base_url
1048
+
1049
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options)
1050
+ promise = request.run_promise do |req|
1051
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
1052
+ end
1053
+
1054
+ promise = promise.then do |http_response|
1055
+ status_code = http_response.status
1056
+ response_content = http_response.body
1057
+ unless status_code == 200 || status_code == 202
1058
+ error_model = JSON.load(response_content)
1059
+ fail MsRest::HttpOperationError.new(request, http_response, error_model)
1060
+ end
1061
+
1062
+ # Create Result
1063
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
1064
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1065
+
1066
+ result
1067
+ end
1068
+
1069
+ promise.execute
1070
+ end
1071
+
1072
+ #
1073
+ # Gets a gateway profile
1074
+ #
1075
+ # @param resource_group_name [String] The resource group name uniquely
1076
+ # identifies the resource group within the user subscriptionId.
1077
+ # @param gateway_name [String] The gateway name (256 characters maximum).
1078
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1079
+ # will be added to the HTTP request.
1080
+ #
1081
+ # @return [GatewayProfile] operation results.
1082
+ #
1083
+ def get_profile(resource_group_name, gateway_name, custom_headers = nil)
1084
+ response = get_profile_async(resource_group_name, gateway_name, custom_headers).value!
1085
+ response.body unless response.nil?
1086
+ end
1087
+
1088
+ #
1089
+ # @param resource_group_name [String] The resource group name uniquely
1090
+ # identifies the resource group within the user subscriptionId.
1091
+ # @param gateway_name [String] The gateway name (256 characters maximum).
1092
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1093
+ # will be added to the HTTP request.
1094
+ #
1095
+ # @return [Concurrent::Promise] promise which provides async access to http
1096
+ # response.
1097
+ #
1098
+ def get_profile_async(resource_group_name, gateway_name, custom_headers = nil)
1099
+ # Send request
1100
+ promise = begin_get_profile_async(resource_group_name, gateway_name, custom_headers)
1101
+
1102
+ promise = promise.then do |response|
1103
+ # Defining deserialization method.
1104
+ deserialize_method = lambda do |parsed_response|
1105
+ result_mapper = GatewayProfile.mapper()
1106
+ parsed_response = @client.deserialize(result_mapper, parsed_response, 'parsed_response')
1107
+ end
1108
+
1109
+ # Waiting for response.
1110
+ @client.get_long_running_operation_result(response, deserialize_method)
1111
+ end
1112
+
1113
+ promise
1114
+ end
1115
+
1116
+ #
1117
+ # Gets a gateway profile
1118
+ #
1119
+ # @param resource_group_name [String] The resource group name uniquely
1120
+ # identifies the resource group within the user subscriptionId.
1121
+ # @param gateway_name [String] The gateway name (256 characters maximum).
1122
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1123
+ # will be added to the HTTP request.
1124
+ #
1125
+ # @return [GatewayProfile] operation results.
1126
+ #
1127
+ def begin_get_profile(resource_group_name, gateway_name, custom_headers = nil)
1128
+ response = begin_get_profile_async(resource_group_name, gateway_name, custom_headers).value!
1129
+ response.body unless response.nil?
1130
+ end
1131
+
1132
+ #
1133
+ # Gets a gateway profile
1134
+ #
1135
+ # @param resource_group_name [String] The resource group name uniquely
1136
+ # identifies the resource group within the user subscriptionId.
1137
+ # @param gateway_name [String] The gateway name (256 characters maximum).
1138
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1139
+ # will be added to the HTTP request.
1140
+ #
1141
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1142
+ #
1143
+ def begin_get_profile_with_http_info(resource_group_name, gateway_name, custom_headers = nil)
1144
+ begin_get_profile_async(resource_group_name, gateway_name, custom_headers).value!
1145
+ end
1146
+
1147
+ #
1148
+ # Gets a gateway profile
1149
+ #
1150
+ # @param resource_group_name [String] The resource group name uniquely
1151
+ # identifies the resource group within the user subscriptionId.
1152
+ # @param gateway_name [String] The gateway name (256 characters maximum).
1153
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1154
+ # to the HTTP request.
1155
+ #
1156
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1157
+ #
1158
+ def begin_get_profile_async(resource_group_name, gateway_name, custom_headers = nil)
1159
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1160
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1161
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1162
+ fail ArgumentError, 'gateway_name is nil' if gateway_name.nil?
1163
+
1164
+
1165
+ request_headers = {}
1166
+
1167
+ # Set Headers
1168
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1169
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1170
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServerManagement/gateways/{gatewayName}/profile'
1171
+ options = {
1172
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1173
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'gatewayName' => gateway_name},
1174
+ query_params: {'api-version' => @client.api_version},
1175
+ headers: request_headers.merge(custom_headers || {})
1176
+ }
1177
+
1178
+ request_url = @base_url || @client.base_url
1179
+
1180
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options)
1181
+ promise = request.run_promise do |req|
1182
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
1183
+ end
1184
+
1185
+ promise = promise.then do |http_response|
1186
+ status_code = http_response.status
1187
+ response_content = http_response.body
1188
+ unless status_code == 200 || status_code == 202
1189
+ error_model = JSON.load(response_content)
1190
+ fail MsRest::HttpOperationError.new(request, http_response, error_model)
1191
+ end
1192
+
1193
+ # Create Result
1194
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
1195
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1196
+ # Deserialize Response
1197
+ if status_code == 200
1198
+ begin
1199
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1200
+ result_mapper = GatewayProfile.mapper()
1201
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
1202
+ rescue Exception => e
1203
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1204
+ end
1205
+ end
1206
+
1207
+ result
1208
+ end
1209
+
1210
+ promise.execute
1211
+ end
1212
+
1213
+ #
1214
+ # Returns gateways in a subscription
1215
+ #
1216
+ # @param next_page_link [String] The NextLink from the previous successful
1217
+ # call to List operation.
1218
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1219
+ # will be added to the HTTP request.
1220
+ #
1221
+ # @return [GatewayResources] operation results.
1222
+ #
1223
+ def list_next(next_page_link, custom_headers = nil)
1224
+ response = list_next_async(next_page_link, custom_headers).value!
1225
+ response.body unless response.nil?
1226
+ end
1227
+
1228
+ #
1229
+ # Returns gateways in a subscription
1230
+ #
1231
+ # @param next_page_link [String] The NextLink from the previous successful
1232
+ # call to List operation.
1233
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1234
+ # will be added to the HTTP request.
1235
+ #
1236
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1237
+ #
1238
+ def list_next_with_http_info(next_page_link, custom_headers = nil)
1239
+ list_next_async(next_page_link, custom_headers).value!
1240
+ end
1241
+
1242
+ #
1243
+ # Returns gateways in a subscription
1244
+ #
1245
+ # @param next_page_link [String] The NextLink from the previous successful
1246
+ # call to List operation.
1247
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1248
+ # to the HTTP request.
1249
+ #
1250
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1251
+ #
1252
+ def list_next_async(next_page_link, custom_headers = nil)
1253
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1254
+
1255
+
1256
+ request_headers = {}
1257
+
1258
+ # Set Headers
1259
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1260
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1261
+ path_template = '{nextLink}'
1262
+ options = {
1263
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1264
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1265
+ headers: request_headers.merge(custom_headers || {})
1266
+ }
1267
+
1268
+ request_url = @base_url || @client.base_url
1269
+
1270
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
1271
+ promise = request.run_promise do |req|
1272
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
1273
+ end
1274
+
1275
+ promise = promise.then do |http_response|
1276
+ status_code = http_response.status
1277
+ response_content = http_response.body
1278
+ unless status_code == 200
1279
+ error_model = JSON.load(response_content)
1280
+ fail MsRest::HttpOperationError.new(request, http_response, error_model)
1281
+ end
1282
+
1283
+ # Create Result
1284
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
1285
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1286
+ # Deserialize Response
1287
+ if status_code == 200
1288
+ begin
1289
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1290
+ result_mapper = GatewayResources.mapper()
1291
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
1292
+ rescue Exception => e
1293
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1294
+ end
1295
+ end
1296
+
1297
+ result
1298
+ end
1299
+
1300
+ promise.execute
1301
+ end
1302
+
1303
+ #
1304
+ # Returns gateways in a resource group
1305
+ #
1306
+ # @param next_page_link [String] The NextLink from the previous successful
1307
+ # call to List operation.
1308
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1309
+ # will be added to the HTTP request.
1310
+ #
1311
+ # @return [GatewayResources] operation results.
1312
+ #
1313
+ def list_for_resource_group_next(next_page_link, custom_headers = nil)
1314
+ response = list_for_resource_group_next_async(next_page_link, custom_headers).value!
1315
+ response.body unless response.nil?
1316
+ end
1317
+
1318
+ #
1319
+ # Returns gateways in a resource group
1320
+ #
1321
+ # @param next_page_link [String] The NextLink from the previous successful
1322
+ # call to List operation.
1323
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1324
+ # will be added to the HTTP request.
1325
+ #
1326
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1327
+ #
1328
+ def list_for_resource_group_next_with_http_info(next_page_link, custom_headers = nil)
1329
+ list_for_resource_group_next_async(next_page_link, custom_headers).value!
1330
+ end
1331
+
1332
+ #
1333
+ # Returns gateways in a resource group
1334
+ #
1335
+ # @param next_page_link [String] The NextLink from the previous successful
1336
+ # call to List operation.
1337
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1338
+ # to the HTTP request.
1339
+ #
1340
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1341
+ #
1342
+ def list_for_resource_group_next_async(next_page_link, custom_headers = nil)
1343
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
1344
+
1345
+
1346
+ request_headers = {}
1347
+
1348
+ # Set Headers
1349
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1350
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1351
+ path_template = '{nextLink}'
1352
+ options = {
1353
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1354
+ skip_encoding_path_params: {'nextLink' => next_page_link},
1355
+ headers: request_headers.merge(custom_headers || {})
1356
+ }
1357
+
1358
+ request_url = @base_url || @client.base_url
1359
+
1360
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
1361
+ promise = request.run_promise do |req|
1362
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
1363
+ end
1364
+
1365
+ promise = promise.then do |http_response|
1366
+ status_code = http_response.status
1367
+ response_content = http_response.body
1368
+ unless status_code == 200
1369
+ error_model = JSON.load(response_content)
1370
+ fail MsRest::HttpOperationError.new(request, http_response, error_model)
1371
+ end
1372
+
1373
+ # Create Result
1374
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
1375
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1376
+ # Deserialize Response
1377
+ if status_code == 200
1378
+ begin
1379
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1380
+ result_mapper = GatewayResources.mapper()
1381
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
1382
+ rescue Exception => e
1383
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1384
+ end
1385
+ end
1386
+
1387
+ result
1388
+ end
1389
+
1390
+ promise.execute
1391
+ end
1392
+
1393
+ end
1394
+ end