azure_mgmt_security 0.16.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/2017-08-01-preview/generated/azure_mgmt_security.rb +48 -0
  4. data/lib/2017-08-01-preview/generated/azure_mgmt_security/auto_provisioning_settings.rb +407 -0
  5. data/lib/2017-08-01-preview/generated/azure_mgmt_security/compliances.rb +325 -0
  6. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/alert_notifications.rb +16 -0
  7. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/alerts_to_admins.rb +16 -0
  8. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/auto_provisioning_setting.rb +75 -0
  9. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/auto_provisioning_setting_list.rb +100 -0
  10. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/compliance.rb +111 -0
  11. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/compliance_list.rb +99 -0
  12. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/compliance_segment.rb +60 -0
  13. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/pricing.rb +74 -0
  14. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/pricing_list.rb +99 -0
  15. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/pricing_tier.rb +16 -0
  16. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/provisioning_setting.rb +16 -0
  17. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/resource.rb +71 -0
  18. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/security_contact.rb +109 -0
  19. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/security_contact_list.rb +100 -0
  20. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/workspace_setting.rb +86 -0
  21. data/lib/2017-08-01-preview/generated/azure_mgmt_security/models/workspace_setting_list.rb +99 -0
  22. data/lib/2017-08-01-preview/generated/azure_mgmt_security/module_definition.rb +9 -0
  23. data/lib/2017-08-01-preview/generated/azure_mgmt_security/pricings.rb +822 -0
  24. data/lib/2017-08-01-preview/generated/azure_mgmt_security/security_contacts.rb +585 -0
  25. data/lib/2017-08-01-preview/generated/azure_mgmt_security/security_management_client.rb +146 -0
  26. data/lib/2017-08-01-preview/generated/azure_mgmt_security/workspace_settings.rb +588 -0
  27. data/lib/azure_mgmt_security.rb +6 -0
  28. data/lib/module_definition.rb +7 -0
  29. data/lib/profiles/latest/modules/security_profile_module.rb +133 -0
  30. data/lib/profiles/latest/security_latest_profile_client.rb +40 -0
  31. data/lib/profiles/latest/security_module_definition.rb +8 -0
  32. data/lib/version.rb +7 -0
  33. metadata +150 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 80b5e28c6d3647341eb4f00e28cf64479861ea5e
4
+ data.tar.gz: 86290f5389b37fa059bbd4caa82403d25bb17eae
5
+ SHA512:
6
+ metadata.gz: c4c57bb48808332e6509d3ff335a247e929bac429d9523e5d62d7561969b38d3988cdb008700751b57ae616c2f360b89d662238107c9a18fee6fe65d45c5c524
7
+ data.tar.gz: 96f6d8b3d53c14d3dd278a1b23f2edc5c59fdbde6b9533bb04cb8753156737acbfde0aa051c4ab916eb111adb32cf8aceba21cf5ccaf0163541ca838fd255bbf
data/LICENSE.txt ADDED
@@ -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,48 @@
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
+ 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 '2017-08-01-preview/generated/azure_mgmt_security/module_definition'
20
+ require 'ms_rest_azure'
21
+
22
+ module Azure::Security::Mgmt::V2017_08_01_preview
23
+ autoload :Pricings, '2017-08-01-preview/generated/azure_mgmt_security/pricings.rb'
24
+ autoload :SecurityContacts, '2017-08-01-preview/generated/azure_mgmt_security/security_contacts.rb'
25
+ autoload :WorkspaceSettings, '2017-08-01-preview/generated/azure_mgmt_security/workspace_settings.rb'
26
+ autoload :AutoProvisioningSettings, '2017-08-01-preview/generated/azure_mgmt_security/auto_provisioning_settings.rb'
27
+ autoload :Compliances, '2017-08-01-preview/generated/azure_mgmt_security/compliances.rb'
28
+ autoload :SecurityManagementClient, '2017-08-01-preview/generated/azure_mgmt_security/security_management_client.rb'
29
+
30
+ module Models
31
+ autoload :AutoProvisioningSettingList, '2017-08-01-preview/generated/azure_mgmt_security/models/auto_provisioning_setting_list.rb'
32
+ autoload :PricingList, '2017-08-01-preview/generated/azure_mgmt_security/models/pricing_list.rb'
33
+ autoload :ComplianceSegment, '2017-08-01-preview/generated/azure_mgmt_security/models/compliance_segment.rb'
34
+ autoload :SecurityContactList, '2017-08-01-preview/generated/azure_mgmt_security/models/security_contact_list.rb'
35
+ autoload :ComplianceList, '2017-08-01-preview/generated/azure_mgmt_security/models/compliance_list.rb'
36
+ autoload :Resource, '2017-08-01-preview/generated/azure_mgmt_security/models/resource.rb'
37
+ autoload :WorkspaceSettingList, '2017-08-01-preview/generated/azure_mgmt_security/models/workspace_setting_list.rb'
38
+ autoload :SecurityContact, '2017-08-01-preview/generated/azure_mgmt_security/models/security_contact.rb'
39
+ autoload :Pricing, '2017-08-01-preview/generated/azure_mgmt_security/models/pricing.rb'
40
+ autoload :WorkspaceSetting, '2017-08-01-preview/generated/azure_mgmt_security/models/workspace_setting.rb'
41
+ autoload :AutoProvisioningSetting, '2017-08-01-preview/generated/azure_mgmt_security/models/auto_provisioning_setting.rb'
42
+ autoload :Compliance, '2017-08-01-preview/generated/azure_mgmt_security/models/compliance.rb'
43
+ autoload :AlertNotifications, '2017-08-01-preview/generated/azure_mgmt_security/models/alert_notifications.rb'
44
+ autoload :AlertsToAdmins, '2017-08-01-preview/generated/azure_mgmt_security/models/alerts_to_admins.rb'
45
+ autoload :PricingTier, '2017-08-01-preview/generated/azure_mgmt_security/models/pricing_tier.rb'
46
+ autoload :ProvisioningSetting, '2017-08-01-preview/generated/azure_mgmt_security/models/provisioning_setting.rb'
47
+ end
48
+ end
@@ -0,0 +1,407 @@
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::Security::Mgmt::V2017_08_01_preview
7
+ #
8
+ # API spec for Microsoft.Security (Azure Security Center) resource provider
9
+ #
10
+ class AutoProvisioningSettings
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the AutoProvisioningSettings class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [SecurityManagementClient] reference to the SecurityManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Exposes the auto provisioning settings of the subscriptions
26
+ #
27
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
28
+ # will be added to the HTTP request.
29
+ #
30
+ # @return [Array<AutoProvisioningSetting>] operation results.
31
+ #
32
+ def list(custom_headers:nil)
33
+ first_page = list_as_lazy(custom_headers:custom_headers)
34
+ first_page.get_all_items
35
+ end
36
+
37
+ #
38
+ # Exposes the auto provisioning settings of the subscriptions
39
+ #
40
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
41
+ # will be added to the HTTP request.
42
+ #
43
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
44
+ #
45
+ def list_with_http_info(custom_headers:nil)
46
+ list_async(custom_headers:custom_headers).value!
47
+ end
48
+
49
+ #
50
+ # Exposes the auto provisioning settings of the subscriptions
51
+ #
52
+ # @param [Hash{String => String}] A hash of custom headers that will be added
53
+ # to the HTTP request.
54
+ #
55
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
56
+ #
57
+ def list_async(custom_headers:nil)
58
+ @client.api_version = '2017-08-01-preview'
59
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
60
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil?
61
+
62
+
63
+ request_headers = {}
64
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
65
+
66
+ # Set Headers
67
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
68
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
69
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Security/autoProvisioningSettings'
70
+
71
+ request_url = @base_url || @client.base_url
72
+
73
+ options = {
74
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
75
+ path_params: {'subscriptionId' => @client.subscription_id},
76
+ query_params: {'api-version' => @client.api_version},
77
+ headers: request_headers.merge(custom_headers || {}),
78
+ base_url: request_url
79
+ }
80
+ promise = @client.make_request_async(:get, path_template, options)
81
+
82
+ promise = promise.then do |result|
83
+ http_response = result.response
84
+ status_code = http_response.status
85
+ response_content = http_response.body
86
+ unless status_code == 200
87
+ error_model = JSON.load(response_content)
88
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
89
+ end
90
+
91
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
92
+ # Deserialize Response
93
+ if status_code == 200
94
+ begin
95
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
96
+ result_mapper = Azure::Security::Mgmt::V2017_08_01_preview::Models::AutoProvisioningSettingList.mapper()
97
+ result.body = @client.deserialize(result_mapper, parsed_response)
98
+ rescue Exception => e
99
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
100
+ end
101
+ end
102
+
103
+ result
104
+ end
105
+
106
+ promise.execute
107
+ end
108
+
109
+ #
110
+ # Details of a specific setting
111
+ #
112
+ # @param setting_name [String] Auto provisioning setting key
113
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
114
+ # will be added to the HTTP request.
115
+ #
116
+ # @return [AutoProvisioningSetting] operation results.
117
+ #
118
+ def get(setting_name, custom_headers:nil)
119
+ response = get_async(setting_name, custom_headers:custom_headers).value!
120
+ response.body unless response.nil?
121
+ end
122
+
123
+ #
124
+ # Details of a specific setting
125
+ #
126
+ # @param setting_name [String] Auto provisioning setting key
127
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
128
+ # will be added to the HTTP request.
129
+ #
130
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
131
+ #
132
+ def get_with_http_info(setting_name, custom_headers:nil)
133
+ get_async(setting_name, custom_headers:custom_headers).value!
134
+ end
135
+
136
+ #
137
+ # Details of a specific setting
138
+ #
139
+ # @param setting_name [String] Auto provisioning setting key
140
+ # @param [Hash{String => String}] A hash of custom headers that will be added
141
+ # to the HTTP request.
142
+ #
143
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
144
+ #
145
+ def get_async(setting_name, custom_headers:nil)
146
+ @client.api_version = '2017-08-01-preview'
147
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
148
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil?
149
+ fail ArgumentError, 'setting_name is nil' if setting_name.nil?
150
+
151
+
152
+ request_headers = {}
153
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
154
+
155
+ # Set Headers
156
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
157
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
158
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Security/autoProvisioningSettings/{settingName}'
159
+
160
+ request_url = @base_url || @client.base_url
161
+
162
+ options = {
163
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
164
+ path_params: {'subscriptionId' => @client.subscription_id,'settingName' => setting_name},
165
+ query_params: {'api-version' => @client.api_version},
166
+ headers: request_headers.merge(custom_headers || {}),
167
+ base_url: request_url
168
+ }
169
+ promise = @client.make_request_async(:get, path_template, options)
170
+
171
+ promise = promise.then do |result|
172
+ http_response = result.response
173
+ status_code = http_response.status
174
+ response_content = http_response.body
175
+ unless status_code == 200
176
+ error_model = JSON.load(response_content)
177
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
178
+ end
179
+
180
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
181
+ # Deserialize Response
182
+ if status_code == 200
183
+ begin
184
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
185
+ result_mapper = Azure::Security::Mgmt::V2017_08_01_preview::Models::AutoProvisioningSetting.mapper()
186
+ result.body = @client.deserialize(result_mapper, parsed_response)
187
+ rescue Exception => e
188
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
189
+ end
190
+ end
191
+
192
+ result
193
+ end
194
+
195
+ promise.execute
196
+ end
197
+
198
+ #
199
+ # Details of a specific setting
200
+ #
201
+ # @param setting_name [String] Auto provisioning setting key
202
+ # @param setting [AutoProvisioningSetting] Auto provisioning setting key
203
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
204
+ # will be added to the HTTP request.
205
+ #
206
+ # @return [AutoProvisioningSetting] operation results.
207
+ #
208
+ def create(setting_name, setting, custom_headers:nil)
209
+ response = create_async(setting_name, setting, custom_headers:custom_headers).value!
210
+ response.body unless response.nil?
211
+ end
212
+
213
+ #
214
+ # Details of a specific setting
215
+ #
216
+ # @param setting_name [String] Auto provisioning setting key
217
+ # @param setting [AutoProvisioningSetting] Auto provisioning setting key
218
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
219
+ # will be added to the HTTP request.
220
+ #
221
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
222
+ #
223
+ def create_with_http_info(setting_name, setting, custom_headers:nil)
224
+ create_async(setting_name, setting, custom_headers:custom_headers).value!
225
+ end
226
+
227
+ #
228
+ # Details of a specific setting
229
+ #
230
+ # @param setting_name [String] Auto provisioning setting key
231
+ # @param setting [AutoProvisioningSetting] Auto provisioning setting key
232
+ # @param [Hash{String => String}] A hash of custom headers that will be added
233
+ # to the HTTP request.
234
+ #
235
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
236
+ #
237
+ def create_async(setting_name, setting, custom_headers:nil)
238
+ @client.api_version = '2017-08-01-preview'
239
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
240
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'Pattern': '^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$'" if !@client.subscription_id.nil? && @client.subscription_id.match(Regexp.new('^^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$$')).nil?
241
+ fail ArgumentError, 'setting_name is nil' if setting_name.nil?
242
+ fail ArgumentError, 'setting is nil' if setting.nil?
243
+
244
+
245
+ request_headers = {}
246
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
247
+
248
+ # Set Headers
249
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
250
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
251
+
252
+ # Serialize Request
253
+ request_mapper = Azure::Security::Mgmt::V2017_08_01_preview::Models::AutoProvisioningSetting.mapper()
254
+ request_content = @client.serialize(request_mapper, setting)
255
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
256
+
257
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Security/autoProvisioningSettings/{settingName}'
258
+
259
+ request_url = @base_url || @client.base_url
260
+
261
+ options = {
262
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
263
+ path_params: {'subscriptionId' => @client.subscription_id,'settingName' => setting_name},
264
+ query_params: {'api-version' => @client.api_version},
265
+ body: request_content,
266
+ headers: request_headers.merge(custom_headers || {}),
267
+ base_url: request_url
268
+ }
269
+ promise = @client.make_request_async(:put, path_template, options)
270
+
271
+ promise = promise.then do |result|
272
+ http_response = result.response
273
+ status_code = http_response.status
274
+ response_content = http_response.body
275
+ unless status_code == 200
276
+ error_model = JSON.load(response_content)
277
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
278
+ end
279
+
280
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
281
+ # Deserialize Response
282
+ if status_code == 200
283
+ begin
284
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
285
+ result_mapper = Azure::Security::Mgmt::V2017_08_01_preview::Models::AutoProvisioningSetting.mapper()
286
+ result.body = @client.deserialize(result_mapper, parsed_response)
287
+ rescue Exception => e
288
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
289
+ end
290
+ end
291
+
292
+ result
293
+ end
294
+
295
+ promise.execute
296
+ end
297
+
298
+ #
299
+ # Exposes the auto provisioning settings of the subscriptions
300
+ #
301
+ # @param next_page_link [String] The NextLink from the previous successful call
302
+ # to List operation.
303
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
304
+ # will be added to the HTTP request.
305
+ #
306
+ # @return [AutoProvisioningSettingList] operation results.
307
+ #
308
+ def list_next(next_page_link, custom_headers:nil)
309
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
310
+ response.body unless response.nil?
311
+ end
312
+
313
+ #
314
+ # Exposes the auto provisioning settings of the subscriptions
315
+ #
316
+ # @param next_page_link [String] The NextLink from the previous successful call
317
+ # to List operation.
318
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
319
+ # will be added to the HTTP request.
320
+ #
321
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
322
+ #
323
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
324
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
325
+ end
326
+
327
+ #
328
+ # Exposes the auto provisioning settings of the subscriptions
329
+ #
330
+ # @param next_page_link [String] The NextLink from the previous successful call
331
+ # to List operation.
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 list_next_async(next_page_link, custom_headers:nil)
338
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
339
+
340
+
341
+ request_headers = {}
342
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
343
+
344
+ # Set Headers
345
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
346
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
347
+ path_template = '{nextLink}'
348
+
349
+ request_url = @base_url || @client.base_url
350
+
351
+ options = {
352
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
353
+ skip_encoding_path_params: {'nextLink' => next_page_link},
354
+ headers: request_headers.merge(custom_headers || {}),
355
+ base_url: request_url
356
+ }
357
+ promise = @client.make_request_async(:get, path_template, options)
358
+
359
+ promise = promise.then do |result|
360
+ http_response = result.response
361
+ status_code = http_response.status
362
+ response_content = http_response.body
363
+ unless status_code == 200
364
+ error_model = JSON.load(response_content)
365
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
366
+ end
367
+
368
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
369
+ # Deserialize Response
370
+ if status_code == 200
371
+ begin
372
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
373
+ result_mapper = Azure::Security::Mgmt::V2017_08_01_preview::Models::AutoProvisioningSettingList.mapper()
374
+ result.body = @client.deserialize(result_mapper, parsed_response)
375
+ rescue Exception => e
376
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
377
+ end
378
+ end
379
+
380
+ result
381
+ end
382
+
383
+ promise.execute
384
+ end
385
+
386
+ #
387
+ # Exposes the auto provisioning settings of the subscriptions
388
+ #
389
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
390
+ # will be added to the HTTP request.
391
+ #
392
+ # @return [AutoProvisioningSettingList] which provide lazy access to pages of
393
+ # the response.
394
+ #
395
+ def list_as_lazy(custom_headers:nil)
396
+ response = list_async(custom_headers:custom_headers).value!
397
+ unless response.nil?
398
+ page = response.body
399
+ page.next_method = Proc.new do |next_page_link|
400
+ list_next_async(next_page_link, custom_headers:custom_headers)
401
+ end
402
+ page
403
+ end
404
+ end
405
+
406
+ end
407
+ end