azure_mgmt_advisor 0.17.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 (66) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/2016-07-12-preview/generated/azure_mgmt_advisor.rb +41 -0
  4. data/lib/2016-07-12-preview/generated/azure_mgmt_advisor/advisor_management_client.rb +140 -0
  5. data/lib/2016-07-12-preview/generated/azure_mgmt_advisor/models/category.rb +18 -0
  6. data/lib/2016-07-12-preview/generated/azure_mgmt_advisor/models/impact.rb +17 -0
  7. data/lib/2016-07-12-preview/generated/azure_mgmt_advisor/models/operation_display_info.rb +80 -0
  8. data/lib/2016-07-12-preview/generated/azure_mgmt_advisor/models/operation_entity.rb +58 -0
  9. data/lib/2016-07-12-preview/generated/azure_mgmt_advisor/models/operation_entity_list_result.rb +98 -0
  10. data/lib/2016-07-12-preview/generated/azure_mgmt_advisor/models/resource.rb +111 -0
  11. data/lib/2016-07-12-preview/generated/azure_mgmt_advisor/models/resource_recommendation_base.rb +201 -0
  12. data/lib/2016-07-12-preview/generated/azure_mgmt_advisor/models/resource_recommendation_base_list_result.rb +99 -0
  13. data/lib/2016-07-12-preview/generated/azure_mgmt_advisor/models/risk.rb +17 -0
  14. data/lib/2016-07-12-preview/generated/azure_mgmt_advisor/models/short_description.rb +59 -0
  15. data/lib/2016-07-12-preview/generated/azure_mgmt_advisor/models/suppression_contract.rb +109 -0
  16. data/lib/2016-07-12-preview/generated/azure_mgmt_advisor/module_definition.rb +9 -0
  17. data/lib/2016-07-12-preview/generated/azure_mgmt_advisor/operations.rb +215 -0
  18. data/lib/2016-07-12-preview/generated/azure_mgmt_advisor/recommendations.rb +503 -0
  19. data/lib/2016-07-12-preview/generated/azure_mgmt_advisor/suppressions.rb +437 -0
  20. data/lib/2017-03-31/generated/azure_mgmt_advisor.rb +41 -0
  21. data/lib/2017-03-31/generated/azure_mgmt_advisor/advisor_management_client.rb +140 -0
  22. data/lib/2017-03-31/generated/azure_mgmt_advisor/models/category.rb +18 -0
  23. data/lib/2017-03-31/generated/azure_mgmt_advisor/models/impact.rb +17 -0
  24. data/lib/2017-03-31/generated/azure_mgmt_advisor/models/operation_display_info.rb +80 -0
  25. data/lib/2017-03-31/generated/azure_mgmt_advisor/models/operation_entity.rb +58 -0
  26. data/lib/2017-03-31/generated/azure_mgmt_advisor/models/operation_entity_list_result.rb +98 -0
  27. data/lib/2017-03-31/generated/azure_mgmt_advisor/models/resource.rb +80 -0
  28. data/lib/2017-03-31/generated/azure_mgmt_advisor/models/resource_recommendation_base.rb +193 -0
  29. data/lib/2017-03-31/generated/azure_mgmt_advisor/models/resource_recommendation_base_list_result.rb +99 -0
  30. data/lib/2017-03-31/generated/azure_mgmt_advisor/models/risk.rb +17 -0
  31. data/lib/2017-03-31/generated/azure_mgmt_advisor/models/short_description.rb +59 -0
  32. data/lib/2017-03-31/generated/azure_mgmt_advisor/models/suppression_contract.rb +85 -0
  33. data/lib/2017-03-31/generated/azure_mgmt_advisor/module_definition.rb +9 -0
  34. data/lib/2017-03-31/generated/azure_mgmt_advisor/operations.rb +215 -0
  35. data/lib/2017-03-31/generated/azure_mgmt_advisor/recommendations.rb +503 -0
  36. data/lib/2017-03-31/generated/azure_mgmt_advisor/suppressions.rb +437 -0
  37. data/lib/2017-04-19/generated/azure_mgmt_advisor.rb +47 -0
  38. data/lib/2017-04-19/generated/azure_mgmt_advisor/advisor_management_client.rb +144 -0
  39. data/lib/2017-04-19/generated/azure_mgmt_advisor/configurations.rb +535 -0
  40. data/lib/2017-04-19/generated/azure_mgmt_advisor/models/armerror_response_body.rb +59 -0
  41. data/lib/2017-04-19/generated/azure_mgmt_advisor/models/category.rb +18 -0
  42. data/lib/2017-04-19/generated/azure_mgmt_advisor/models/config_data.rb +80 -0
  43. data/lib/2017-04-19/generated/azure_mgmt_advisor/models/config_data_properties.rb +79 -0
  44. data/lib/2017-04-19/generated/azure_mgmt_advisor/models/configuration_list_result.rb +98 -0
  45. data/lib/2017-04-19/generated/azure_mgmt_advisor/models/impact.rb +17 -0
  46. data/lib/2017-04-19/generated/azure_mgmt_advisor/models/operation_display_info.rb +80 -0
  47. data/lib/2017-04-19/generated/azure_mgmt_advisor/models/operation_entity.rb +58 -0
  48. data/lib/2017-04-19/generated/azure_mgmt_advisor/models/operation_entity_list_result.rb +98 -0
  49. data/lib/2017-04-19/generated/azure_mgmt_advisor/models/resource.rb +80 -0
  50. data/lib/2017-04-19/generated/azure_mgmt_advisor/models/resource_recommendation_base.rb +212 -0
  51. data/lib/2017-04-19/generated/azure_mgmt_advisor/models/resource_recommendation_base_list_result.rb +99 -0
  52. data/lib/2017-04-19/generated/azure_mgmt_advisor/models/risk.rb +17 -0
  53. data/lib/2017-04-19/generated/azure_mgmt_advisor/models/short_description.rb +59 -0
  54. data/lib/2017-04-19/generated/azure_mgmt_advisor/models/suppression_contract.rb +85 -0
  55. data/lib/2017-04-19/generated/azure_mgmt_advisor/models/suppression_contract_list_result.rb +98 -0
  56. data/lib/2017-04-19/generated/azure_mgmt_advisor/module_definition.rb +9 -0
  57. data/lib/2017-04-19/generated/azure_mgmt_advisor/operations.rb +215 -0
  58. data/lib/2017-04-19/generated/azure_mgmt_advisor/recommendations.rb +503 -0
  59. data/lib/2017-04-19/generated/azure_mgmt_advisor/suppressions.rb +553 -0
  60. data/lib/azure_mgmt_advisor.rb +8 -0
  61. data/lib/module_definition.rb +7 -0
  62. data/lib/profiles/latest/advisor_latest_profile_client.rb +40 -0
  63. data/lib/profiles/latest/advisor_module_definition.rb +8 -0
  64. data/lib/profiles/latest/modules/advisor_profile_module.rb +131 -0
  65. data/lib/version.rb +7 -0
  66. metadata +182 -0
@@ -0,0 +1,437 @@
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::Advisor::Mgmt::V2017_03_31
7
+ #
8
+ # REST APIs for Azure Advisor
9
+ #
10
+ class Suppressions
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Suppressions class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [AdvisorManagementClient] reference to the AdvisorManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Obtains the details of a suppression.
26
+ #
27
+ # @param resource_uri [String] The fully qualified Azure Resource Manager
28
+ # identifier of the resource to which the recommendation applies.
29
+ # @param recommendation_id [String] The recommendation ID.
30
+ # @param name [String] The name of the suppression.
31
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
32
+ # will be added to the HTTP request.
33
+ #
34
+ # @return [SuppressionContract] operation results.
35
+ #
36
+ def get(resource_uri, recommendation_id, name, custom_headers:nil)
37
+ response = get_async(resource_uri, recommendation_id, name, custom_headers:custom_headers).value!
38
+ response.body unless response.nil?
39
+ end
40
+
41
+ #
42
+ # Obtains the details of a suppression.
43
+ #
44
+ # @param resource_uri [String] The fully qualified Azure Resource Manager
45
+ # identifier of the resource to which the recommendation applies.
46
+ # @param recommendation_id [String] The recommendation ID.
47
+ # @param name [String] The name of the suppression.
48
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
49
+ # will be added to the HTTP request.
50
+ #
51
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
52
+ #
53
+ def get_with_http_info(resource_uri, recommendation_id, name, custom_headers:nil)
54
+ get_async(resource_uri, recommendation_id, name, custom_headers:custom_headers).value!
55
+ end
56
+
57
+ #
58
+ # Obtains the details of a suppression.
59
+ #
60
+ # @param resource_uri [String] The fully qualified Azure Resource Manager
61
+ # identifier of the resource to which the recommendation applies.
62
+ # @param recommendation_id [String] The recommendation ID.
63
+ # @param name [String] The name of the suppression.
64
+ # @param [Hash{String => String}] A hash of custom headers that will be added
65
+ # to the HTTP request.
66
+ #
67
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
68
+ #
69
+ def get_async(resource_uri, recommendation_id, name, custom_headers:nil)
70
+ fail ArgumentError, 'resource_uri is nil' if resource_uri.nil?
71
+ fail ArgumentError, 'recommendation_id is nil' if recommendation_id.nil?
72
+ fail ArgumentError, 'name is nil' if name.nil?
73
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
74
+
75
+
76
+ request_headers = {}
77
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
78
+
79
+ # Set Headers
80
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
81
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
82
+ path_template = '{resourceUri}/providers/Microsoft.Advisor/recommendations/{recommendationId}/suppressions/{name}'
83
+
84
+ request_url = @base_url || @client.base_url
85
+
86
+ options = {
87
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
88
+ path_params: {'resourceUri' => resource_uri,'recommendationId' => recommendation_id,'name' => name},
89
+ query_params: {'api-version' => @client.api_version},
90
+ headers: request_headers.merge(custom_headers || {}),
91
+ base_url: request_url
92
+ }
93
+ promise = @client.make_request_async(:get, path_template, options)
94
+
95
+ promise = promise.then do |result|
96
+ http_response = result.response
97
+ status_code = http_response.status
98
+ response_content = http_response.body
99
+ unless status_code == 200
100
+ error_model = JSON.load(response_content)
101
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
102
+ end
103
+
104
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
105
+ # Deserialize Response
106
+ if status_code == 200
107
+ begin
108
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
109
+ result_mapper = Azure::Advisor::Mgmt::V2017_03_31::Models::SuppressionContract.mapper()
110
+ result.body = @client.deserialize(result_mapper, parsed_response)
111
+ rescue Exception => e
112
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
113
+ end
114
+ end
115
+
116
+ result
117
+ end
118
+
119
+ promise.execute
120
+ end
121
+
122
+ #
123
+ # Enables the snoozed or dismissed attribute of a recommendation. The snoozed
124
+ # or dismissed attribute is referred to as a suppression. Use this API to
125
+ # create or update the snoozed or dismissed status of a recommendation.
126
+ #
127
+ # @param resource_uri [String] The fully qualified Azure Resource Manager
128
+ # identifier of the resource to which the recommendation applies.
129
+ # @param recommendation_id [String] The recommendation ID.
130
+ # @param name [String] The name of the suppression.
131
+ # @param suppression_contract [SuppressionContract] The snoozed or dismissed
132
+ # attribute; for example, the snooze duration.
133
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
134
+ # will be added to the HTTP request.
135
+ #
136
+ # @return [SuppressionContract] operation results.
137
+ #
138
+ def create(resource_uri, recommendation_id, name, suppression_contract, custom_headers:nil)
139
+ response = create_async(resource_uri, recommendation_id, name, suppression_contract, custom_headers:custom_headers).value!
140
+ response.body unless response.nil?
141
+ end
142
+
143
+ #
144
+ # Enables the snoozed or dismissed attribute of a recommendation. The snoozed
145
+ # or dismissed attribute is referred to as a suppression. Use this API to
146
+ # create or update the snoozed or dismissed status of a recommendation.
147
+ #
148
+ # @param resource_uri [String] The fully qualified Azure Resource Manager
149
+ # identifier of the resource to which the recommendation applies.
150
+ # @param recommendation_id [String] The recommendation ID.
151
+ # @param name [String] The name of the suppression.
152
+ # @param suppression_contract [SuppressionContract] The snoozed or dismissed
153
+ # attribute; for example, the snooze duration.
154
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
155
+ # will be added to the HTTP request.
156
+ #
157
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
158
+ #
159
+ def create_with_http_info(resource_uri, recommendation_id, name, suppression_contract, custom_headers:nil)
160
+ create_async(resource_uri, recommendation_id, name, suppression_contract, custom_headers:custom_headers).value!
161
+ end
162
+
163
+ #
164
+ # Enables the snoozed or dismissed attribute of a recommendation. The snoozed
165
+ # or dismissed attribute is referred to as a suppression. Use this API to
166
+ # create or update the snoozed or dismissed status of a recommendation.
167
+ #
168
+ # @param resource_uri [String] The fully qualified Azure Resource Manager
169
+ # identifier of the resource to which the recommendation applies.
170
+ # @param recommendation_id [String] The recommendation ID.
171
+ # @param name [String] The name of the suppression.
172
+ # @param suppression_contract [SuppressionContract] The snoozed or dismissed
173
+ # attribute; for example, the snooze duration.
174
+ # @param [Hash{String => String}] A hash of custom headers that will be added
175
+ # to the HTTP request.
176
+ #
177
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
178
+ #
179
+ def create_async(resource_uri, recommendation_id, name, suppression_contract, custom_headers:nil)
180
+ fail ArgumentError, 'resource_uri is nil' if resource_uri.nil?
181
+ fail ArgumentError, 'recommendation_id is nil' if recommendation_id.nil?
182
+ fail ArgumentError, 'name is nil' if name.nil?
183
+ fail ArgumentError, 'suppression_contract is nil' if suppression_contract.nil?
184
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
185
+
186
+
187
+ request_headers = {}
188
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
189
+
190
+ # Set Headers
191
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
192
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
193
+
194
+ # Serialize Request
195
+ request_mapper = Azure::Advisor::Mgmt::V2017_03_31::Models::SuppressionContract.mapper()
196
+ request_content = @client.serialize(request_mapper, suppression_contract)
197
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
198
+
199
+ path_template = '{resourceUri}/providers/Microsoft.Advisor/recommendations/{recommendationId}/suppressions/{name}'
200
+
201
+ request_url = @base_url || @client.base_url
202
+
203
+ options = {
204
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
205
+ path_params: {'resourceUri' => resource_uri,'recommendationId' => recommendation_id,'name' => name},
206
+ query_params: {'api-version' => @client.api_version},
207
+ body: request_content,
208
+ headers: request_headers.merge(custom_headers || {}),
209
+ base_url: request_url
210
+ }
211
+ promise = @client.make_request_async(:put, path_template, options)
212
+
213
+ promise = promise.then do |result|
214
+ http_response = result.response
215
+ status_code = http_response.status
216
+ response_content = http_response.body
217
+ unless status_code == 200
218
+ error_model = JSON.load(response_content)
219
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
220
+ end
221
+
222
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
223
+ # Deserialize Response
224
+ if status_code == 200
225
+ begin
226
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
227
+ result_mapper = Azure::Advisor::Mgmt::V2017_03_31::Models::SuppressionContract.mapper()
228
+ result.body = @client.deserialize(result_mapper, parsed_response)
229
+ rescue Exception => e
230
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
231
+ end
232
+ end
233
+
234
+ result
235
+ end
236
+
237
+ promise.execute
238
+ end
239
+
240
+ #
241
+ # Enables the activation of a snoozed or dismissed recommendation. The snoozed
242
+ # or dismissed attribute of a recommendation is referred to as a suppression.
243
+ #
244
+ # @param resource_uri [String] The fully qualified Azure Resource Manager
245
+ # identifier of the resource to which the recommendation applies.
246
+ # @param recommendation_id [String] The recommendation ID.
247
+ # @param name [String] The name of the suppression.
248
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
249
+ # will be added to the HTTP request.
250
+ #
251
+ #
252
+ def delete(resource_uri, recommendation_id, name, custom_headers:nil)
253
+ response = delete_async(resource_uri, recommendation_id, name, custom_headers:custom_headers).value!
254
+ nil
255
+ end
256
+
257
+ #
258
+ # Enables the activation of a snoozed or dismissed recommendation. The snoozed
259
+ # or dismissed attribute of a recommendation is referred to as a suppression.
260
+ #
261
+ # @param resource_uri [String] The fully qualified Azure Resource Manager
262
+ # identifier of the resource to which the recommendation applies.
263
+ # @param recommendation_id [String] The recommendation ID.
264
+ # @param name [String] The name of the suppression.
265
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
266
+ # will be added to the HTTP request.
267
+ #
268
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
269
+ #
270
+ def delete_with_http_info(resource_uri, recommendation_id, name, custom_headers:nil)
271
+ delete_async(resource_uri, recommendation_id, name, custom_headers:custom_headers).value!
272
+ end
273
+
274
+ #
275
+ # Enables the activation of a snoozed or dismissed recommendation. The snoozed
276
+ # or dismissed attribute of a recommendation is referred to as a suppression.
277
+ #
278
+ # @param resource_uri [String] The fully qualified Azure Resource Manager
279
+ # identifier of the resource to which the recommendation applies.
280
+ # @param recommendation_id [String] The recommendation ID.
281
+ # @param name [String] The name of the suppression.
282
+ # @param [Hash{String => String}] A hash of custom headers that will be added
283
+ # to the HTTP request.
284
+ #
285
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
286
+ #
287
+ def delete_async(resource_uri, recommendation_id, name, custom_headers:nil)
288
+ fail ArgumentError, 'resource_uri is nil' if resource_uri.nil?
289
+ fail ArgumentError, 'recommendation_id is nil' if recommendation_id.nil?
290
+ fail ArgumentError, 'name is nil' if name.nil?
291
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
292
+
293
+
294
+ request_headers = {}
295
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
296
+
297
+ # Set Headers
298
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
299
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
300
+ path_template = '{resourceUri}/providers/Microsoft.Advisor/recommendations/{recommendationId}/suppressions/{name}'
301
+
302
+ request_url = @base_url || @client.base_url
303
+
304
+ options = {
305
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
306
+ path_params: {'resourceUri' => resource_uri,'recommendationId' => recommendation_id,'name' => name},
307
+ query_params: {'api-version' => @client.api_version},
308
+ headers: request_headers.merge(custom_headers || {}),
309
+ base_url: request_url
310
+ }
311
+ promise = @client.make_request_async(:delete, path_template, options)
312
+
313
+ promise = promise.then do |result|
314
+ http_response = result.response
315
+ status_code = http_response.status
316
+ response_content = http_response.body
317
+ unless status_code == 204
318
+ error_model = JSON.load(response_content)
319
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
320
+ end
321
+
322
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
323
+
324
+ result
325
+ end
326
+
327
+ promise.execute
328
+ end
329
+
330
+ #
331
+ # Retrieves the list of snoozed or dismissed suppressions for a subscription.
332
+ # The snoozed or dismissed attribute of a recommendation is referred to as a
333
+ # suppression.
334
+ #
335
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
336
+ # will be added to the HTTP request.
337
+ #
338
+ # @return [Array] operation results.
339
+ #
340
+ def list(custom_headers:nil)
341
+ response = list_async(custom_headers:custom_headers).value!
342
+ response.body unless response.nil?
343
+ end
344
+
345
+ #
346
+ # Retrieves the list of snoozed or dismissed suppressions for a subscription.
347
+ # The snoozed or dismissed attribute of a recommendation is referred to as a
348
+ # suppression.
349
+ #
350
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
351
+ # will be added to the HTTP request.
352
+ #
353
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
354
+ #
355
+ def list_with_http_info(custom_headers:nil)
356
+ list_async(custom_headers:custom_headers).value!
357
+ end
358
+
359
+ #
360
+ # Retrieves the list of snoozed or dismissed suppressions for a subscription.
361
+ # The snoozed or dismissed attribute of a recommendation is referred to as a
362
+ # suppression.
363
+ #
364
+ # @param [Hash{String => String}] A hash of custom headers that will be added
365
+ # to the HTTP request.
366
+ #
367
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
368
+ #
369
+ def list_async(custom_headers:nil)
370
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
371
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
372
+
373
+
374
+ request_headers = {}
375
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
376
+
377
+ # Set Headers
378
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
379
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
380
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Advisor/suppressions'
381
+
382
+ request_url = @base_url || @client.base_url
383
+
384
+ options = {
385
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
386
+ path_params: {'subscriptionId' => @client.subscription_id},
387
+ query_params: {'api-version' => @client.api_version},
388
+ headers: request_headers.merge(custom_headers || {}),
389
+ base_url: request_url
390
+ }
391
+ promise = @client.make_request_async(:get, path_template, options)
392
+
393
+ promise = promise.then do |result|
394
+ http_response = result.response
395
+ status_code = http_response.status
396
+ response_content = http_response.body
397
+ unless status_code == 200
398
+ error_model = JSON.load(response_content)
399
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
400
+ end
401
+
402
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
403
+ # Deserialize Response
404
+ if status_code == 200
405
+ begin
406
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
407
+ result_mapper = {
408
+ client_side_validation: true,
409
+ required: false,
410
+ serialized_name: 'parsed_response',
411
+ type: {
412
+ name: 'Sequence',
413
+ element: {
414
+ client_side_validation: true,
415
+ required: false,
416
+ serialized_name: 'SuppressionContractElementType',
417
+ type: {
418
+ name: 'Composite',
419
+ class_name: 'SuppressionContract'
420
+ }
421
+ }
422
+ }
423
+ }
424
+ result.body = @client.deserialize(result_mapper, parsed_response)
425
+ rescue Exception => e
426
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
427
+ end
428
+ end
429
+
430
+ result
431
+ end
432
+
433
+ promise.execute
434
+ end
435
+
436
+ end
437
+ end
@@ -0,0 +1,47 @@
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-04-19/generated/azure_mgmt_advisor/module_definition'
20
+ require 'ms_rest_azure'
21
+
22
+ module Azure::Advisor::Mgmt::V2017_04_19
23
+ autoload :Configurations, '2017-04-19/generated/azure_mgmt_advisor/configurations.rb'
24
+ autoload :Recommendations, '2017-04-19/generated/azure_mgmt_advisor/recommendations.rb'
25
+ autoload :Operations, '2017-04-19/generated/azure_mgmt_advisor/operations.rb'
26
+ autoload :Suppressions, '2017-04-19/generated/azure_mgmt_advisor/suppressions.rb'
27
+ autoload :AdvisorManagementClient, '2017-04-19/generated/azure_mgmt_advisor/advisor_management_client.rb'
28
+
29
+ module Models
30
+ autoload :ResourceRecommendationBaseListResult, '2017-04-19/generated/azure_mgmt_advisor/models/resource_recommendation_base_list_result.rb'
31
+ autoload :Resource, '2017-04-19/generated/azure_mgmt_advisor/models/resource.rb'
32
+ autoload :ConfigData, '2017-04-19/generated/azure_mgmt_advisor/models/config_data.rb'
33
+ autoload :OperationDisplayInfo, '2017-04-19/generated/azure_mgmt_advisor/models/operation_display_info.rb'
34
+ autoload :ARMErrorResponseBody, '2017-04-19/generated/azure_mgmt_advisor/models/armerror_response_body.rb'
35
+ autoload :OperationEntity, '2017-04-19/generated/azure_mgmt_advisor/models/operation_entity.rb'
36
+ autoload :ShortDescription, '2017-04-19/generated/azure_mgmt_advisor/models/short_description.rb'
37
+ autoload :ConfigurationListResult, '2017-04-19/generated/azure_mgmt_advisor/models/configuration_list_result.rb'
38
+ autoload :OperationEntityListResult, '2017-04-19/generated/azure_mgmt_advisor/models/operation_entity_list_result.rb'
39
+ autoload :ConfigDataProperties, '2017-04-19/generated/azure_mgmt_advisor/models/config_data_properties.rb'
40
+ autoload :SuppressionContractListResult, '2017-04-19/generated/azure_mgmt_advisor/models/suppression_contract_list_result.rb'
41
+ autoload :ResourceRecommendationBase, '2017-04-19/generated/azure_mgmt_advisor/models/resource_recommendation_base.rb'
42
+ autoload :SuppressionContract, '2017-04-19/generated/azure_mgmt_advisor/models/suppression_contract.rb'
43
+ autoload :Category, '2017-04-19/generated/azure_mgmt_advisor/models/category.rb'
44
+ autoload :Impact, '2017-04-19/generated/azure_mgmt_advisor/models/impact.rb'
45
+ autoload :Risk, '2017-04-19/generated/azure_mgmt_advisor/models/risk.rb'
46
+ end
47
+ end