azure_mgmt_automanage 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/2020-06-30-preview/generated/azure_mgmt_automanage.rb +63 -0
  4. data/lib/2020-06-30-preview/generated/azure_mgmt_automanage/accounts.rb +646 -0
  5. data/lib/2020-06-30-preview/generated/azure_mgmt_automanage/automanage_client.rb +145 -0
  6. data/lib/2020-06-30-preview/generated/azure_mgmt_automanage/configuration_profile_assignments.rb +603 -0
  7. data/lib/2020-06-30-preview/generated/azure_mgmt_automanage/configuration_profile_preferences.rb +661 -0
  8. data/lib/2020-06-30-preview/generated/azure_mgmt_automanage/models/account.rb +98 -0
  9. data/lib/2020-06-30-preview/generated/azure_mgmt_automanage/models/account_identity.rb +74 -0
  10. data/lib/2020-06-30-preview/generated/azure_mgmt_automanage/models/account_list.rb +55 -0
  11. data/lib/2020-06-30-preview/generated/azure_mgmt_automanage/models/account_update.rb +63 -0
  12. data/lib/2020-06-30-preview/generated/azure_mgmt_automanage/models/azure_entity_resource.rb +75 -0
  13. data/lib/2020-06-30-preview/generated/azure_mgmt_automanage/models/configuration_profile.rb +16 -0
  14. data/lib/2020-06-30-preview/generated/azure_mgmt_automanage/models/configuration_profile_assignment.rb +76 -0
  15. data/lib/2020-06-30-preview/generated/azure_mgmt_automanage/models/configuration_profile_assignment_compliance.rb +48 -0
  16. data/lib/2020-06-30-preview/generated/azure_mgmt_automanage/models/configuration_profile_assignment_list.rb +56 -0
  17. data/lib/2020-06-30-preview/generated/azure_mgmt_automanage/models/configuration_profile_assignment_properties.rb +109 -0
  18. data/lib/2020-06-30-preview/generated/azure_mgmt_automanage/models/configuration_profile_preference.rb +99 -0
  19. data/lib/2020-06-30-preview/generated/azure_mgmt_automanage/models/configuration_profile_preference_anti_malware.rb +105 -0
  20. data/lib/2020-06-30-preview/generated/azure_mgmt_automanage/models/configuration_profile_preference_list.rb +56 -0
  21. data/lib/2020-06-30-preview/generated/azure_mgmt_automanage/models/configuration_profile_preference_properties.rb +61 -0
  22. data/lib/2020-06-30-preview/generated/azure_mgmt_automanage/models/configuration_profile_preference_update.rb +64 -0
  23. data/lib/2020-06-30-preview/generated/azure_mgmt_automanage/models/configuration_profile_preference_vm_backup.rb +81 -0
  24. data/lib/2020-06-30-preview/generated/azure_mgmt_automanage/models/enable_real_time_protection.rb +16 -0
  25. data/lib/2020-06-30-preview/generated/azure_mgmt_automanage/models/error_additional_info.rb +59 -0
  26. data/lib/2020-06-30-preview/generated/azure_mgmt_automanage/models/error_response.rb +47 -0
  27. data/lib/2020-06-30-preview/generated/azure_mgmt_automanage/models/error_response_error.rb +113 -0
  28. data/lib/2020-06-30-preview/generated/azure_mgmt_automanage/models/operation.rb +83 -0
  29. data/lib/2020-06-30-preview/generated/azure_mgmt_automanage/models/operation_display.rb +79 -0
  30. data/lib/2020-06-30-preview/generated/azure_mgmt_automanage/models/operation_list.rb +56 -0
  31. data/lib/2020-06-30-preview/generated/azure_mgmt_automanage/models/provisioning_state.rb +17 -0
  32. data/lib/2020-06-30-preview/generated/azure_mgmt_automanage/models/proxy_resource.rb +63 -0
  33. data/lib/2020-06-30-preview/generated/azure_mgmt_automanage/models/resource.rb +83 -0
  34. data/lib/2020-06-30-preview/generated/azure_mgmt_automanage/models/resource_identity_type.rb +16 -0
  35. data/lib/2020-06-30-preview/generated/azure_mgmt_automanage/models/run_scheduled_scan.rb +16 -0
  36. data/lib/2020-06-30-preview/generated/azure_mgmt_automanage/models/scan_type.rb +16 -0
  37. data/lib/2020-06-30-preview/generated/azure_mgmt_automanage/models/tracked_resource.rb +92 -0
  38. data/lib/2020-06-30-preview/generated/azure_mgmt_automanage/models/update_resource.rb +54 -0
  39. data/lib/2020-06-30-preview/generated/azure_mgmt_automanage/models/update_status.rb +17 -0
  40. data/lib/2020-06-30-preview/generated/azure_mgmt_automanage/module_definition.rb +9 -0
  41. data/lib/2020-06-30-preview/generated/azure_mgmt_automanage/operations.rb +110 -0
  42. data/lib/azure_mgmt_automanage.rb +6 -0
  43. data/lib/module_definition.rb +7 -0
  44. data/lib/profiles/latest/automanage_latest_profile_client.rb +40 -0
  45. data/lib/profiles/latest/automanage_module_definition.rb +8 -0
  46. data/lib/profiles/latest/modules/automanage_profile_module.rb +195 -0
  47. data/lib/version.rb +7 -0
  48. metadata +163 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: b19e0a4949db61707f946bb46b3318e0b587f20b6ead983c0b3843c8297a2fd1
4
+ data.tar.gz: b0fe7166e29c639971666e4530d77982868ccf1fad04a994ff9a32c0cbe17aff
5
+ SHA512:
6
+ metadata.gz: f1f026bfeadf24bfbff89bdc4030fa3588c4b67ab0f3793944058a3df5210f822334f1a0c3296216bebae923b75245e3616608e8a87ea7ad4f6abab183b40652
7
+ data.tar.gz: 202732c67e658f819bc6b948aa7e330c0497aebe7add887346457425a63e1e34e467758d7388d14cc24083b778baff8f0306e5813285f8e77187f30b3540a030
@@ -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,63 @@
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 '2020-06-30-preview/generated/azure_mgmt_automanage/module_definition'
20
+ require 'ms_rest_azure'
21
+
22
+ module Azure::Automanage::Mgmt::V2020_06_30_preview
23
+ autoload :Accounts, '2020-06-30-preview/generated/azure_mgmt_automanage/accounts.rb'
24
+ autoload :ConfigurationProfileAssignments, '2020-06-30-preview/generated/azure_mgmt_automanage/configuration_profile_assignments.rb'
25
+ autoload :ConfigurationProfilePreferences, '2020-06-30-preview/generated/azure_mgmt_automanage/configuration_profile_preferences.rb'
26
+ autoload :Operations, '2020-06-30-preview/generated/azure_mgmt_automanage/operations.rb'
27
+ autoload :AutomanageClient, '2020-06-30-preview/generated/azure_mgmt_automanage/automanage_client.rb'
28
+
29
+ module Models
30
+ autoload :ConfigurationProfilePreferenceProperties, '2020-06-30-preview/generated/azure_mgmt_automanage/models/configuration_profile_preference_properties.rb'
31
+ autoload :AccountIdentity, '2020-06-30-preview/generated/azure_mgmt_automanage/models/account_identity.rb'
32
+ autoload :ErrorAdditionalInfo, '2020-06-30-preview/generated/azure_mgmt_automanage/models/error_additional_info.rb'
33
+ autoload :ErrorResponse, '2020-06-30-preview/generated/azure_mgmt_automanage/models/error_response.rb'
34
+ autoload :AccountList, '2020-06-30-preview/generated/azure_mgmt_automanage/models/account_list.rb'
35
+ autoload :ErrorResponseError, '2020-06-30-preview/generated/azure_mgmt_automanage/models/error_response_error.rb'
36
+ autoload :ConfigurationProfileAssignmentProperties, '2020-06-30-preview/generated/azure_mgmt_automanage/models/configuration_profile_assignment_properties.rb'
37
+ autoload :ConfigurationProfileAssignmentList, '2020-06-30-preview/generated/azure_mgmt_automanage/models/configuration_profile_assignment_list.rb'
38
+ autoload :ConfigurationProfilePreferenceList, '2020-06-30-preview/generated/azure_mgmt_automanage/models/configuration_profile_preference_list.rb'
39
+ autoload :ConfigurationProfilePreferenceAntiMalware, '2020-06-30-preview/generated/azure_mgmt_automanage/models/configuration_profile_preference_anti_malware.rb'
40
+ autoload :OperationDisplay, '2020-06-30-preview/generated/azure_mgmt_automanage/models/operation_display.rb'
41
+ autoload :Resource, '2020-06-30-preview/generated/azure_mgmt_automanage/models/resource.rb'
42
+ autoload :Operation, '2020-06-30-preview/generated/azure_mgmt_automanage/models/operation.rb'
43
+ autoload :ConfigurationProfileAssignmentCompliance, '2020-06-30-preview/generated/azure_mgmt_automanage/models/configuration_profile_assignment_compliance.rb'
44
+ autoload :OperationList, '2020-06-30-preview/generated/azure_mgmt_automanage/models/operation_list.rb'
45
+ autoload :ConfigurationProfilePreferenceVmBackup, '2020-06-30-preview/generated/azure_mgmt_automanage/models/configuration_profile_preference_vm_backup.rb'
46
+ autoload :UpdateResource, '2020-06-30-preview/generated/azure_mgmt_automanage/models/update_resource.rb'
47
+ autoload :Account, '2020-06-30-preview/generated/azure_mgmt_automanage/models/account.rb'
48
+ autoload :AccountUpdate, '2020-06-30-preview/generated/azure_mgmt_automanage/models/account_update.rb'
49
+ autoload :ConfigurationProfileAssignment, '2020-06-30-preview/generated/azure_mgmt_automanage/models/configuration_profile_assignment.rb'
50
+ autoload :ConfigurationProfilePreference, '2020-06-30-preview/generated/azure_mgmt_automanage/models/configuration_profile_preference.rb'
51
+ autoload :ConfigurationProfilePreferenceUpdate, '2020-06-30-preview/generated/azure_mgmt_automanage/models/configuration_profile_preference_update.rb'
52
+ autoload :ProxyResource, '2020-06-30-preview/generated/azure_mgmt_automanage/models/proxy_resource.rb'
53
+ autoload :AzureEntityResource, '2020-06-30-preview/generated/azure_mgmt_automanage/models/azure_entity_resource.rb'
54
+ autoload :TrackedResource, '2020-06-30-preview/generated/azure_mgmt_automanage/models/tracked_resource.rb'
55
+ autoload :ResourceIdentityType, '2020-06-30-preview/generated/azure_mgmt_automanage/models/resource_identity_type.rb'
56
+ autoload :ConfigurationProfile, '2020-06-30-preview/generated/azure_mgmt_automanage/models/configuration_profile.rb'
57
+ autoload :ProvisioningState, '2020-06-30-preview/generated/azure_mgmt_automanage/models/provisioning_state.rb'
58
+ autoload :UpdateStatus, '2020-06-30-preview/generated/azure_mgmt_automanage/models/update_status.rb'
59
+ autoload :EnableRealTimeProtection, '2020-06-30-preview/generated/azure_mgmt_automanage/models/enable_real_time_protection.rb'
60
+ autoload :RunScheduledScan, '2020-06-30-preview/generated/azure_mgmt_automanage/models/run_scheduled_scan.rb'
61
+ autoload :ScanType, '2020-06-30-preview/generated/azure_mgmt_automanage/models/scan_type.rb'
62
+ end
63
+ end
@@ -0,0 +1,646 @@
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::Automanage::Mgmt::V2020_06_30_preview
7
+ #
8
+ # Automanage Client
9
+ #
10
+ class Accounts
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Accounts class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [AutomanageClient] reference to the AutomanageClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Creates an Automanage Account
26
+ #
27
+ # @param account_name [String] Name of the Automanage account.
28
+ # @param resource_group_name [String] The name of the resource group. The name
29
+ # is case insensitive.
30
+ # @param parameters [Account] Parameters supplied to create or update
31
+ # Automanage account.
32
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
33
+ # will be added to the HTTP request.
34
+ #
35
+ # @return [Account] operation results.
36
+ #
37
+ def create_or_update(account_name, resource_group_name, parameters, custom_headers:nil)
38
+ response = create_or_update_async(account_name, resource_group_name, parameters, custom_headers:custom_headers).value!
39
+ response.body unless response.nil?
40
+ end
41
+
42
+ #
43
+ # Creates an Automanage Account
44
+ #
45
+ # @param account_name [String] Name of the Automanage account.
46
+ # @param resource_group_name [String] The name of the resource group. The name
47
+ # is case insensitive.
48
+ # @param parameters [Account] Parameters supplied to create or update
49
+ # Automanage account.
50
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
51
+ # will be added to the HTTP request.
52
+ #
53
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
54
+ #
55
+ def create_or_update_with_http_info(account_name, resource_group_name, parameters, custom_headers:nil)
56
+ create_or_update_async(account_name, resource_group_name, parameters, custom_headers:custom_headers).value!
57
+ end
58
+
59
+ #
60
+ # Creates an Automanage Account
61
+ #
62
+ # @param account_name [String] Name of the Automanage account.
63
+ # @param resource_group_name [String] The name of the resource group. The name
64
+ # is case insensitive.
65
+ # @param parameters [Account] Parameters supplied to create or update
66
+ # Automanage account.
67
+ # @param [Hash{String => String}] A hash of custom headers that will be added
68
+ # to the HTTP request.
69
+ #
70
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
71
+ #
72
+ def create_or_update_async(account_name, resource_group_name, parameters, custom_headers:nil)
73
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
74
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
75
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
76
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
77
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
78
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
79
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
80
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
81
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
82
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
83
+
84
+
85
+ request_headers = {}
86
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
87
+
88
+ # Set Headers
89
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
90
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
91
+
92
+ # Serialize Request
93
+ request_mapper = Azure::Automanage::Mgmt::V2020_06_30_preview::Models::Account.mapper()
94
+ request_content = @client.serialize(request_mapper, parameters)
95
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
96
+
97
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automanage/accounts/{accountName}'
98
+
99
+ request_url = @base_url || @client.base_url
100
+
101
+ options = {
102
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
103
+ path_params: {'accountName' => account_name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
104
+ query_params: {'api-version' => @client.api_version},
105
+ body: request_content,
106
+ headers: request_headers.merge(custom_headers || {}),
107
+ base_url: request_url
108
+ }
109
+ promise = @client.make_request_async(:put, path_template, options)
110
+
111
+ promise = promise.then do |result|
112
+ http_response = result.response
113
+ status_code = http_response.status
114
+ response_content = http_response.body
115
+ unless status_code == 201 || status_code == 200
116
+ error_model = JSON.load(response_content)
117
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
118
+ end
119
+
120
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
121
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
122
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
123
+ # Deserialize Response
124
+ if status_code == 201
125
+ begin
126
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
127
+ result_mapper = Azure::Automanage::Mgmt::V2020_06_30_preview::Models::Account.mapper()
128
+ result.body = @client.deserialize(result_mapper, parsed_response)
129
+ rescue Exception => e
130
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
131
+ end
132
+ end
133
+ # Deserialize Response
134
+ if status_code == 200
135
+ begin
136
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
137
+ result_mapper = Azure::Automanage::Mgmt::V2020_06_30_preview::Models::Account.mapper()
138
+ result.body = @client.deserialize(result_mapper, parsed_response)
139
+ rescue Exception => e
140
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
141
+ end
142
+ end
143
+
144
+ result
145
+ end
146
+
147
+ promise.execute
148
+ end
149
+
150
+ #
151
+ # Get information about a Automanage account
152
+ #
153
+ # @param account_name [String] The Automanage account name.
154
+ # @param resource_group_name [String] The name of the resource group. The name
155
+ # is case insensitive.
156
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
157
+ # will be added to the HTTP request.
158
+ #
159
+ # @return [Account] operation results.
160
+ #
161
+ def get(account_name, resource_group_name, custom_headers:nil)
162
+ response = get_async(account_name, resource_group_name, custom_headers:custom_headers).value!
163
+ response.body unless response.nil?
164
+ end
165
+
166
+ #
167
+ # Get information about a Automanage account
168
+ #
169
+ # @param account_name [String] The Automanage account name.
170
+ # @param resource_group_name [String] The name of the resource group. The name
171
+ # is case insensitive.
172
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
173
+ # will be added to the HTTP request.
174
+ #
175
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
176
+ #
177
+ def get_with_http_info(account_name, resource_group_name, custom_headers:nil)
178
+ get_async(account_name, resource_group_name, custom_headers:custom_headers).value!
179
+ end
180
+
181
+ #
182
+ # Get information about a Automanage account
183
+ #
184
+ # @param account_name [String] The Automanage account name.
185
+ # @param resource_group_name [String] The name of the resource group. The name
186
+ # is case insensitive.
187
+ # @param [Hash{String => String}] A hash of custom headers that will be added
188
+ # to the HTTP request.
189
+ #
190
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
191
+ #
192
+ def get_async(account_name, resource_group_name, custom_headers:nil)
193
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
194
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
195
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
196
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
197
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
198
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
199
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
200
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
201
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
202
+
203
+
204
+ request_headers = {}
205
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
206
+
207
+ # Set Headers
208
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
209
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
210
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automanage/accounts/{accountName}'
211
+
212
+ request_url = @base_url || @client.base_url
213
+
214
+ options = {
215
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
216
+ path_params: {'accountName' => account_name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
217
+ query_params: {'api-version' => @client.api_version},
218
+ headers: request_headers.merge(custom_headers || {}),
219
+ base_url: request_url
220
+ }
221
+ promise = @client.make_request_async(:get, path_template, options)
222
+
223
+ promise = promise.then do |result|
224
+ http_response = result.response
225
+ status_code = http_response.status
226
+ response_content = http_response.body
227
+ unless status_code == 200
228
+ error_model = JSON.load(response_content)
229
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
230
+ end
231
+
232
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
233
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
234
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
235
+ # Deserialize Response
236
+ if status_code == 200
237
+ begin
238
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
239
+ result_mapper = Azure::Automanage::Mgmt::V2020_06_30_preview::Models::Account.mapper()
240
+ result.body = @client.deserialize(result_mapper, parsed_response)
241
+ rescue Exception => e
242
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
243
+ end
244
+ end
245
+
246
+ result
247
+ end
248
+
249
+ promise.execute
250
+ end
251
+
252
+ #
253
+ # Delete a Automanage account
254
+ #
255
+ # @param resource_group_name [String] The name of the resource group. The name
256
+ # is case insensitive.
257
+ # @param account_name [String] Name of the Automanage account
258
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
259
+ # will be added to the HTTP request.
260
+ #
261
+ #
262
+ def delete(resource_group_name, account_name, custom_headers:nil)
263
+ response = delete_async(resource_group_name, account_name, custom_headers:custom_headers).value!
264
+ nil
265
+ end
266
+
267
+ #
268
+ # Delete a Automanage account
269
+ #
270
+ # @param resource_group_name [String] The name of the resource group. The name
271
+ # is case insensitive.
272
+ # @param account_name [String] Name of the Automanage account
273
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
274
+ # will be added to the HTTP request.
275
+ #
276
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
277
+ #
278
+ def delete_with_http_info(resource_group_name, account_name, custom_headers:nil)
279
+ delete_async(resource_group_name, account_name, custom_headers:custom_headers).value!
280
+ end
281
+
282
+ #
283
+ # Delete a Automanage account
284
+ #
285
+ # @param resource_group_name [String] The name of the resource group. The name
286
+ # is case insensitive.
287
+ # @param account_name [String] Name of the Automanage account
288
+ # @param [Hash{String => String}] A hash of custom headers that will be added
289
+ # to the HTTP request.
290
+ #
291
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
292
+ #
293
+ def delete_async(resource_group_name, account_name, custom_headers:nil)
294
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
295
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
296
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
297
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
298
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
299
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
300
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
301
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
302
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
303
+
304
+
305
+ request_headers = {}
306
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
307
+
308
+ # Set Headers
309
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
310
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
311
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automanage/accounts/{accountName}'
312
+
313
+ request_url = @base_url || @client.base_url
314
+
315
+ options = {
316
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
317
+ path_params: {'resourceGroupName' => resource_group_name,'accountName' => account_name,'subscriptionId' => @client.subscription_id},
318
+ query_params: {'api-version' => @client.api_version},
319
+ headers: request_headers.merge(custom_headers || {}),
320
+ base_url: request_url
321
+ }
322
+ promise = @client.make_request_async(:delete, path_template, options)
323
+
324
+ promise = promise.then do |result|
325
+ http_response = result.response
326
+ status_code = http_response.status
327
+ response_content = http_response.body
328
+ unless status_code == 200 || status_code == 204
329
+ error_model = JSON.load(response_content)
330
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
331
+ end
332
+
333
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
334
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
335
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
336
+
337
+ result
338
+ end
339
+
340
+ promise.execute
341
+ end
342
+
343
+ #
344
+ # Updates an Automanage Account
345
+ #
346
+ # @param account_name [String] Name of the Automanage account.
347
+ # @param resource_group_name [String] The name of the resource group. The name
348
+ # is case insensitive.
349
+ # @param parameters [AccountUpdate] Parameters supplied to update Automanage
350
+ # account.
351
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
352
+ # will be added to the HTTP request.
353
+ #
354
+ # @return [Account] operation results.
355
+ #
356
+ def update(account_name, resource_group_name, parameters, custom_headers:nil)
357
+ response = update_async(account_name, resource_group_name, parameters, custom_headers:custom_headers).value!
358
+ response.body unless response.nil?
359
+ end
360
+
361
+ #
362
+ # Updates an Automanage Account
363
+ #
364
+ # @param account_name [String] Name of the Automanage account.
365
+ # @param resource_group_name [String] The name of the resource group. The name
366
+ # is case insensitive.
367
+ # @param parameters [AccountUpdate] Parameters supplied to update Automanage
368
+ # account.
369
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
370
+ # will be added to the HTTP request.
371
+ #
372
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
373
+ #
374
+ def update_with_http_info(account_name, resource_group_name, parameters, custom_headers:nil)
375
+ update_async(account_name, resource_group_name, parameters, custom_headers:custom_headers).value!
376
+ end
377
+
378
+ #
379
+ # Updates an Automanage Account
380
+ #
381
+ # @param account_name [String] Name of the Automanage account.
382
+ # @param resource_group_name [String] The name of the resource group. The name
383
+ # is case insensitive.
384
+ # @param parameters [AccountUpdate] Parameters supplied to update Automanage
385
+ # account.
386
+ # @param [Hash{String => String}] A hash of custom headers that will be added
387
+ # to the HTTP request.
388
+ #
389
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
390
+ #
391
+ def update_async(account_name, resource_group_name, parameters, custom_headers:nil)
392
+ fail ArgumentError, 'account_name is nil' if account_name.nil?
393
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
394
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
395
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
396
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
397
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
398
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
399
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
400
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
401
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
402
+
403
+
404
+ request_headers = {}
405
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
406
+
407
+ # Set Headers
408
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
409
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
410
+
411
+ # Serialize Request
412
+ request_mapper = Azure::Automanage::Mgmt::V2020_06_30_preview::Models::AccountUpdate.mapper()
413
+ request_content = @client.serialize(request_mapper, parameters)
414
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
415
+
416
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automanage/accounts/{accountName}'
417
+
418
+ request_url = @base_url || @client.base_url
419
+
420
+ options = {
421
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
422
+ path_params: {'accountName' => account_name,'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
423
+ query_params: {'api-version' => @client.api_version},
424
+ body: request_content,
425
+ headers: request_headers.merge(custom_headers || {}),
426
+ base_url: request_url
427
+ }
428
+ promise = @client.make_request_async(:patch, path_template, options)
429
+
430
+ promise = promise.then do |result|
431
+ http_response = result.response
432
+ status_code = http_response.status
433
+ response_content = http_response.body
434
+ unless status_code == 200
435
+ error_model = JSON.load(response_content)
436
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
437
+ end
438
+
439
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
440
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
441
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
442
+ # Deserialize Response
443
+ if status_code == 200
444
+ begin
445
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
446
+ result_mapper = Azure::Automanage::Mgmt::V2020_06_30_preview::Models::Account.mapper()
447
+ result.body = @client.deserialize(result_mapper, parsed_response)
448
+ rescue Exception => e
449
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
450
+ end
451
+ end
452
+
453
+ result
454
+ end
455
+
456
+ promise.execute
457
+ end
458
+
459
+ #
460
+ # Retrieve a list of Automanage accounts within a given resource group
461
+ #
462
+ # @param resource_group_name [String] The name of the resource group. The name
463
+ # is case insensitive.
464
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
465
+ # will be added to the HTTP request.
466
+ #
467
+ # @return [AccountList] operation results.
468
+ #
469
+ def list_by_resource_group(resource_group_name, custom_headers:nil)
470
+ response = list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
471
+ response.body unless response.nil?
472
+ end
473
+
474
+ #
475
+ # Retrieve a list of Automanage accounts within a given resource group
476
+ #
477
+ # @param resource_group_name [String] The name of the resource group. The name
478
+ # is case insensitive.
479
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
480
+ # will be added to the HTTP request.
481
+ #
482
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
483
+ #
484
+ def list_by_resource_group_with_http_info(resource_group_name, custom_headers:nil)
485
+ list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
486
+ end
487
+
488
+ #
489
+ # Retrieve a list of Automanage accounts within a given resource group
490
+ #
491
+ # @param resource_group_name [String] The name of the resource group. The name
492
+ # is case insensitive.
493
+ # @param [Hash{String => String}] A hash of custom headers that will be added
494
+ # to the HTTP request.
495
+ #
496
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
497
+ #
498
+ def list_by_resource_group_async(resource_group_name, custom_headers:nil)
499
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
500
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
501
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
502
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
503
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
504
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
505
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
506
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
507
+
508
+
509
+ request_headers = {}
510
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
511
+
512
+ # Set Headers
513
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
514
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
515
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automanage/accounts'
516
+
517
+ request_url = @base_url || @client.base_url
518
+
519
+ options = {
520
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
521
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
522
+ query_params: {'api-version' => @client.api_version},
523
+ headers: request_headers.merge(custom_headers || {}),
524
+ base_url: request_url
525
+ }
526
+ promise = @client.make_request_async(:get, path_template, options)
527
+
528
+ promise = promise.then do |result|
529
+ http_response = result.response
530
+ status_code = http_response.status
531
+ response_content = http_response.body
532
+ unless status_code == 200
533
+ error_model = JSON.load(response_content)
534
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
535
+ end
536
+
537
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
538
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
539
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
540
+ # Deserialize Response
541
+ if status_code == 200
542
+ begin
543
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
544
+ result_mapper = Azure::Automanage::Mgmt::V2020_06_30_preview::Models::AccountList.mapper()
545
+ result.body = @client.deserialize(result_mapper, parsed_response)
546
+ rescue Exception => e
547
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
548
+ end
549
+ end
550
+
551
+ result
552
+ end
553
+
554
+ promise.execute
555
+ end
556
+
557
+ #
558
+ # Retrieve a list of Automanage accounts within a subscription
559
+ #
560
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
561
+ # will be added to the HTTP request.
562
+ #
563
+ # @return [AccountList] operation results.
564
+ #
565
+ def list_by_subscription(custom_headers:nil)
566
+ response = list_by_subscription_async(custom_headers:custom_headers).value!
567
+ response.body unless response.nil?
568
+ end
569
+
570
+ #
571
+ # Retrieve a list of Automanage accounts within a subscription
572
+ #
573
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
574
+ # will be added to the HTTP request.
575
+ #
576
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
577
+ #
578
+ def list_by_subscription_with_http_info(custom_headers:nil)
579
+ list_by_subscription_async(custom_headers:custom_headers).value!
580
+ end
581
+
582
+ #
583
+ # Retrieve a list of Automanage accounts within a subscription
584
+ #
585
+ # @param [Hash{String => String}] A hash of custom headers that will be added
586
+ # to the HTTP request.
587
+ #
588
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
589
+ #
590
+ def list_by_subscription_async(custom_headers:nil)
591
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
592
+ fail ArgumentError, "'@client.subscription_id' should satisfy the constraint - 'MinLength': '1'" if !@client.subscription_id.nil? && @client.subscription_id.length < 1
593
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
594
+ fail ArgumentError, "'@client.api_version' should satisfy the constraint - 'MinLength': '1'" if !@client.api_version.nil? && @client.api_version.length < 1
595
+
596
+
597
+ request_headers = {}
598
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
599
+
600
+ # Set Headers
601
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
602
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
603
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Automanage/accounts'
604
+
605
+ request_url = @base_url || @client.base_url
606
+
607
+ options = {
608
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
609
+ path_params: {'subscriptionId' => @client.subscription_id},
610
+ query_params: {'api-version' => @client.api_version},
611
+ headers: request_headers.merge(custom_headers || {}),
612
+ base_url: request_url
613
+ }
614
+ promise = @client.make_request_async(:get, path_template, options)
615
+
616
+ promise = promise.then do |result|
617
+ http_response = result.response
618
+ status_code = http_response.status
619
+ response_content = http_response.body
620
+ unless status_code == 200
621
+ error_model = JSON.load(response_content)
622
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
623
+ end
624
+
625
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
626
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
627
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
628
+ # Deserialize Response
629
+ if status_code == 200
630
+ begin
631
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
632
+ result_mapper = Azure::Automanage::Mgmt::V2020_06_30_preview::Models::AccountList.mapper()
633
+ result.body = @client.deserialize(result_mapper, parsed_response)
634
+ rescue Exception => e
635
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
636
+ end
637
+ end
638
+
639
+ result
640
+ end
641
+
642
+ promise.execute
643
+ end
644
+
645
+ end
646
+ end