azure_mgmt_resources_management 0.15.2 → 0.16.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 (28) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2017-08-31-preview/generated/azure_mgmt_resources_management/management_groups.rb +21 -18
  3. data/lib/2017-08-31-preview/generated/azure_mgmt_resources_management/management_groups_api.rb +4 -1
  4. data/lib/2017-08-31-preview/generated/azure_mgmt_resources_management/operations.rb +15 -13
  5. data/lib/2017-11-01-preview/generated/azure_mgmt_resources_management.rb +42 -0
  6. data/lib/2017-11-01-preview/generated/azure_mgmt_resources_management/management_group_subscriptions.rb +209 -0
  7. data/lib/2017-11-01-preview/generated/azure_mgmt_resources_management/management_groups.rb +698 -0
  8. data/lib/2017-11-01-preview/generated/azure_mgmt_resources_management/management_groups_api.rb +136 -0
  9. data/lib/2017-11-01-preview/generated/azure_mgmt_resources_management/models/create_group_request.rb +59 -0
  10. data/lib/2017-11-01-preview/generated/azure_mgmt_resources_management/models/error_details.rb +57 -0
  11. data/lib/2017-11-01-preview/generated/azure_mgmt_resources_management/models/error_response.rb +47 -0
  12. data/lib/2017-11-01-preview/generated/azure_mgmt_resources_management/models/management_group.rb +130 -0
  13. data/lib/2017-11-01-preview/generated/azure_mgmt_resources_management/models/management_group_child_info.rb +91 -0
  14. data/lib/2017-11-01-preview/generated/azure_mgmt_resources_management/models/management_group_details.rb +81 -0
  15. data/lib/2017-11-01-preview/generated/azure_mgmt_resources_management/models/management_group_info.rb +98 -0
  16. data/lib/2017-11-01-preview/generated/azure_mgmt_resources_management/models/management_group_list_result.rb +99 -0
  17. data/lib/2017-11-01-preview/generated/azure_mgmt_resources_management/models/operation.rb +59 -0
  18. data/lib/2017-11-01-preview/generated/azure_mgmt_resources_management/models/operation_display.rb +83 -0
  19. data/lib/2017-11-01-preview/generated/azure_mgmt_resources_management/models/operation_list_result.rb +103 -0
  20. data/lib/2017-11-01-preview/generated/azure_mgmt_resources_management/models/parent_group_info.rb +59 -0
  21. data/lib/2017-11-01-preview/generated/azure_mgmt_resources_management/module_definition.rb +9 -0
  22. data/lib/2017-11-01-preview/generated/azure_mgmt_resources_management/operations.rb +219 -0
  23. data/lib/azure_mgmt_resources_management.rb +1 -0
  24. data/lib/profiles/latest/modules/resourcesmanagement_profile_module.rb +82 -69
  25. data/lib/profiles/latest/resourcesmanagement_latest_profile_client.rb +28 -9
  26. data/lib/profiles/latest/resourcesmanagement_module_definition.rb +0 -1
  27. data/lib/version.rb +1 -1
  28. metadata +21 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 93f6f53e3185ba1b5d518d584a353beb5ed49571
4
- data.tar.gz: 64b9c0e044aecd4ee48fde2f947257bd79d1a3e9
3
+ metadata.gz: 61494b38a1503c84eff1b90365f7886e63dc30aa
4
+ data.tar.gz: 1c6985d90e5ebc685ab916e532e12d3ae3f82c83
5
5
  SHA512:
6
- metadata.gz: 56a6d848a3aada38483add1c148b354e132eda1a8b91878d30f33364765e9c23006cc18e0a1a0c05168ce700ff7d5b56a9a4966d44912c6c859828204b019d95
7
- data.tar.gz: add8afe5bf2033fd20e4b33ebfae9a50a155506735df9f3eabdad5c17e490c8acf670bd9e5da7347c6e47da6deb9d8d3d20ce03703bfb2b11200ec0758e497fd
6
+ metadata.gz: 046db1b432a0dfcb3eac026048c04d5fb691a3a3cd5e741367ed9243acf30d1139acbf0c6156493991314afe5c85428a5652d42cb972d1ade3d8adb66a7297b1
7
+ data.tar.gz: f6baf192c1505f1cefca2c37da1379e0609936fa3e2f14f550c8585bc07d90e30b1d948027e721f1a7510716c75cac30ed27eb6a7cef8935a81de9a808f84951
@@ -40,8 +40,8 @@ module Azure::ResourcesManagement::Mgmt::V2017_08_31_preview
40
40
  #
41
41
  # @return [Array<ManagementGroupInfo>] operation results.
42
42
  #
43
- def list(skiptoken = nil, custom_headers = nil)
44
- first_page = list_as_lazy(skiptoken, custom_headers)
43
+ def list(skiptoken:nil, custom_headers:nil)
44
+ first_page = list_as_lazy(skiptoken:skiptoken, custom_headers:custom_headers)
45
45
  first_page.get_all_items
46
46
  end
47
47
 
@@ -60,8 +60,8 @@ module Azure::ResourcesManagement::Mgmt::V2017_08_31_preview
60
60
  #
61
61
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
62
62
  #
63
- def list_with_http_info(skiptoken = nil, custom_headers = nil)
64
- list_async(skiptoken, custom_headers).value!
63
+ def list_with_http_info(skiptoken:nil, custom_headers:nil)
64
+ list_async(skiptoken:skiptoken, custom_headers:custom_headers).value!
65
65
  end
66
66
 
67
67
  #
@@ -79,11 +79,12 @@ module Azure::ResourcesManagement::Mgmt::V2017_08_31_preview
79
79
  #
80
80
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
81
81
  #
82
- def list_async(skiptoken = nil, custom_headers = nil)
82
+ def list_async(skiptoken:nil, custom_headers:nil)
83
83
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
84
84
 
85
85
 
86
86
  request_headers = {}
87
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
87
88
 
88
89
  # Set Headers
89
90
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
@@ -141,8 +142,8 @@ module Azure::ResourcesManagement::Mgmt::V2017_08_31_preview
141
142
  #
142
143
  # @return [ManagementGroupWithHierarchy] operation results.
143
144
  #
144
- def get(expand = nil, recurse = nil, custom_headers = nil)
145
- response = get_async(expand, recurse, custom_headers).value!
145
+ def get(expand:nil, recurse:nil, custom_headers:nil)
146
+ response = get_async(expand:expand, recurse:recurse, custom_headers:custom_headers).value!
146
147
  response.body unless response.nil?
147
148
  end
148
149
 
@@ -160,8 +161,8 @@ module Azure::ResourcesManagement::Mgmt::V2017_08_31_preview
160
161
  #
161
162
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
162
163
  #
163
- def get_with_http_info(expand = nil, recurse = nil, custom_headers = nil)
164
- get_async(expand, recurse, custom_headers).value!
164
+ def get_with_http_info(expand:nil, recurse:nil, custom_headers:nil)
165
+ get_async(expand:expand, recurse:recurse, custom_headers:custom_headers).value!
165
166
  end
166
167
 
167
168
  #
@@ -178,12 +179,13 @@ module Azure::ResourcesManagement::Mgmt::V2017_08_31_preview
178
179
  #
179
180
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
180
181
  #
181
- def get_async(expand = nil, recurse = nil, custom_headers = nil)
182
+ def get_async(expand:nil, recurse:nil, custom_headers:nil)
182
183
  fail ArgumentError, '@client.group_id is nil' if @client.group_id.nil?
183
184
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
184
185
 
185
186
 
186
187
  request_headers = {}
188
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
187
189
 
188
190
  # Set Headers
189
191
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
@@ -239,8 +241,8 @@ module Azure::ResourcesManagement::Mgmt::V2017_08_31_preview
239
241
  #
240
242
  # @return [ManagementGroupListResult] operation results.
241
243
  #
242
- def list_next(next_page_link, custom_headers = nil)
243
- response = list_next_async(next_page_link, custom_headers).value!
244
+ def list_next(next_page_link, custom_headers:nil)
245
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
244
246
  response.body unless response.nil?
245
247
  end
246
248
 
@@ -255,8 +257,8 @@ module Azure::ResourcesManagement::Mgmt::V2017_08_31_preview
255
257
  #
256
258
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
257
259
  #
258
- def list_next_with_http_info(next_page_link, custom_headers = nil)
259
- list_next_async(next_page_link, custom_headers).value!
260
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
261
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
260
262
  end
261
263
 
262
264
  #
@@ -270,11 +272,12 @@ module Azure::ResourcesManagement::Mgmt::V2017_08_31_preview
270
272
  #
271
273
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
272
274
  #
273
- def list_next_async(next_page_link, custom_headers = nil)
275
+ def list_next_async(next_page_link, custom_headers:nil)
274
276
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
275
277
 
276
278
 
277
279
  request_headers = {}
280
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
278
281
 
279
282
  # Set Headers
280
283
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
@@ -334,12 +337,12 @@ module Azure::ResourcesManagement::Mgmt::V2017_08_31_preview
334
337
  # @return [ManagementGroupListResult] which provide lazy access to pages of the
335
338
  # response.
336
339
  #
337
- def list_as_lazy(skiptoken = nil, custom_headers = nil)
338
- response = list_async(skiptoken, custom_headers).value!
340
+ def list_as_lazy(skiptoken:nil, custom_headers:nil)
341
+ response = list_async(skiptoken:skiptoken, custom_headers:custom_headers).value!
339
342
  unless response.nil?
340
343
  page = response.body
341
344
  page.next_method = Proc.new do |next_page_link|
342
- list_next_async(next_page_link, custom_headers)
345
+ list_next_async(next_page_link, custom_headers:custom_headers)
343
346
  end
344
347
  page
345
348
  end
@@ -109,6 +109,9 @@ module Azure::ResourcesManagement::Mgmt::V2017_08_31_preview
109
109
  fail ArgumentError, 'path is nil' if path.nil?
110
110
 
111
111
  request_url = options[:base_url] || @base_url
112
+ if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?)
113
+ @request_headers['Content-Type'] = options[:headers]['Content-Type']
114
+ end
112
115
 
113
116
  request_headers = @request_headers
114
117
  request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
@@ -125,7 +128,7 @@ module Azure::ResourcesManagement::Mgmt::V2017_08_31_preview
125
128
  #
126
129
  def add_telemetry
127
130
  sdk_information = 'azure_mgmt_resources_management'
128
- sdk_information = "#{sdk_information}/0.15.2"
131
+ sdk_information = "#{sdk_information}/0.16.0"
129
132
  add_user_agent_information(sdk_information)
130
133
  end
131
134
  end
@@ -33,8 +33,8 @@ module Azure::ResourcesManagement::Mgmt::V2017_08_31_preview
33
33
  #
34
34
  # @return [Array<Operation>] operation results.
35
35
  #
36
- def list(custom_headers = nil)
37
- first_page = list_as_lazy(custom_headers)
36
+ def list(custom_headers:nil)
37
+ first_page = list_as_lazy(custom_headers:custom_headers)
38
38
  first_page.get_all_items
39
39
  end
40
40
 
@@ -46,8 +46,8 @@ module Azure::ResourcesManagement::Mgmt::V2017_08_31_preview
46
46
  #
47
47
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
48
48
  #
49
- def list_with_http_info(custom_headers = nil)
50
- list_async(custom_headers).value!
49
+ def list_with_http_info(custom_headers:nil)
50
+ list_async(custom_headers:custom_headers).value!
51
51
  end
52
52
 
53
53
  #
@@ -58,11 +58,12 @@ module Azure::ResourcesManagement::Mgmt::V2017_08_31_preview
58
58
  #
59
59
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
60
60
  #
61
- def list_async(custom_headers = nil)
61
+ def list_async(custom_headers:nil)
62
62
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
63
63
 
64
64
 
65
65
  request_headers = {}
66
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
66
67
 
67
68
  # Set Headers
68
69
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
@@ -116,8 +117,8 @@ module Azure::ResourcesManagement::Mgmt::V2017_08_31_preview
116
117
  #
117
118
  # @return [OperationListResult] operation results.
118
119
  #
119
- def list_next(next_page_link, custom_headers = nil)
120
- response = list_next_async(next_page_link, custom_headers).value!
120
+ def list_next(next_page_link, custom_headers:nil)
121
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
121
122
  response.body unless response.nil?
122
123
  end
123
124
 
@@ -131,8 +132,8 @@ module Azure::ResourcesManagement::Mgmt::V2017_08_31_preview
131
132
  #
132
133
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
133
134
  #
134
- def list_next_with_http_info(next_page_link, custom_headers = nil)
135
- list_next_async(next_page_link, custom_headers).value!
135
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
136
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
136
137
  end
137
138
 
138
139
  #
@@ -145,11 +146,12 @@ module Azure::ResourcesManagement::Mgmt::V2017_08_31_preview
145
146
  #
146
147
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
147
148
  #
148
- def list_next_async(next_page_link, custom_headers = nil)
149
+ def list_next_async(next_page_link, custom_headers:nil)
149
150
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
150
151
 
151
152
 
152
153
  request_headers = {}
154
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
153
155
 
154
156
  # Set Headers
155
157
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
@@ -202,12 +204,12 @@ module Azure::ResourcesManagement::Mgmt::V2017_08_31_preview
202
204
  # @return [OperationListResult] which provide lazy access to pages of the
203
205
  # response.
204
206
  #
205
- def list_as_lazy(custom_headers = nil)
206
- response = list_async(custom_headers).value!
207
+ def list_as_lazy(custom_headers:nil)
208
+ response = list_async(custom_headers:custom_headers).value!
207
209
  unless response.nil?
208
210
  page = response.body
209
211
  page.next_method = Proc.new do |next_page_link|
210
- list_next_async(next_page_link, custom_headers)
212
+ list_next_async(next_page_link, custom_headers:custom_headers)
211
213
  end
212
214
  page
213
215
  end
@@ -0,0 +1,42 @@
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-11-01-preview/generated/azure_mgmt_resources_management/module_definition'
20
+ require 'ms_rest_azure'
21
+
22
+ module Azure::ResourcesManagement::Mgmt::V2017_11_01_preview
23
+ autoload :ManagementGroups, '2017-11-01-preview/generated/azure_mgmt_resources_management/management_groups.rb'
24
+ autoload :ManagementGroupSubscriptions, '2017-11-01-preview/generated/azure_mgmt_resources_management/management_group_subscriptions.rb'
25
+ autoload :Operations, '2017-11-01-preview/generated/azure_mgmt_resources_management/operations.rb'
26
+ autoload :ManagementGroupsAPI, '2017-11-01-preview/generated/azure_mgmt_resources_management/management_groups_api.rb'
27
+
28
+ module Models
29
+ autoload :ManagementGroupListResult, '2017-11-01-preview/generated/azure_mgmt_resources_management/models/management_group_list_result.rb'
30
+ autoload :ErrorDetails, '2017-11-01-preview/generated/azure_mgmt_resources_management/models/error_details.rb'
31
+ autoload :ParentGroupInfo, '2017-11-01-preview/generated/azure_mgmt_resources_management/models/parent_group_info.rb'
32
+ autoload :OperationDisplay, '2017-11-01-preview/generated/azure_mgmt_resources_management/models/operation_display.rb'
33
+ autoload :ManagementGroupDetails, '2017-11-01-preview/generated/azure_mgmt_resources_management/models/management_group_details.rb'
34
+ autoload :OperationListResult, '2017-11-01-preview/generated/azure_mgmt_resources_management/models/operation_list_result.rb'
35
+ autoload :ManagementGroupChildInfo, '2017-11-01-preview/generated/azure_mgmt_resources_management/models/management_group_child_info.rb'
36
+ autoload :ErrorResponse, '2017-11-01-preview/generated/azure_mgmt_resources_management/models/error_response.rb'
37
+ autoload :ManagementGroup, '2017-11-01-preview/generated/azure_mgmt_resources_management/models/management_group.rb'
38
+ autoload :ManagementGroupInfo, '2017-11-01-preview/generated/azure_mgmt_resources_management/models/management_group_info.rb'
39
+ autoload :CreateGroupRequest, '2017-11-01-preview/generated/azure_mgmt_resources_management/models/create_group_request.rb'
40
+ autoload :Operation, '2017-11-01-preview/generated/azure_mgmt_resources_management/models/operation.rb'
41
+ end
42
+ end
@@ -0,0 +1,209 @@
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::ResourcesManagement::Mgmt::V2017_11_01_preview
7
+ #
8
+ # The Azure Management Groups API enables consolidation of multiple
9
+ # subscriptions/resources into an organizational hierarchy and centrally
10
+ # manage access control, policies, alerting and reporting for those
11
+ # resources.
12
+ #
13
+ #
14
+ class ManagementGroupSubscriptions
15
+ include MsRestAzure
16
+
17
+ #
18
+ # Creates and initializes a new instance of the ManagementGroupSubscriptions class.
19
+ # @param client service class for accessing basic functionality.
20
+ #
21
+ def initialize(client)
22
+ @client = client
23
+ end
24
+
25
+ # @return [ManagementGroupsAPI] reference to the ManagementGroupsAPI
26
+ attr_reader :client
27
+
28
+ #
29
+ # Associates existing subscription with the management group.
30
+ #
31
+ #
32
+ # @param group_id [String] Management Group ID.
33
+ # @param subscription_id [String] Subscription ID.
34
+ # @param cache_control [String] Indicates that the request shouldn't utilize
35
+ # any caches.
36
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
37
+ # will be added to the HTTP request.
38
+ #
39
+ #
40
+ def create(group_id, subscription_id, cache_control:'no-cache', custom_headers:nil)
41
+ response = create_async(group_id, subscription_id, cache_control:cache_control, custom_headers:custom_headers).value!
42
+ nil
43
+ end
44
+
45
+ #
46
+ # Associates existing subscription with the management group.
47
+ #
48
+ #
49
+ # @param group_id [String] Management Group ID.
50
+ # @param subscription_id [String] Subscription ID.
51
+ # @param cache_control [String] Indicates that the request shouldn't utilize
52
+ # any caches.
53
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
54
+ # will be added to the HTTP request.
55
+ #
56
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
57
+ #
58
+ def create_with_http_info(group_id, subscription_id, cache_control:'no-cache', custom_headers:nil)
59
+ create_async(group_id, subscription_id, cache_control:cache_control, custom_headers:custom_headers).value!
60
+ end
61
+
62
+ #
63
+ # Associates existing subscription with the management group.
64
+ #
65
+ #
66
+ # @param group_id [String] Management Group ID.
67
+ # @param subscription_id [String] Subscription ID.
68
+ # @param cache_control [String] Indicates that the request shouldn't utilize
69
+ # any caches.
70
+ # @param [Hash{String => String}] A hash of custom headers that will be added
71
+ # to the HTTP request.
72
+ #
73
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
74
+ #
75
+ def create_async(group_id, subscription_id, cache_control:'no-cache', custom_headers:nil)
76
+ fail ArgumentError, 'group_id is nil' if group_id.nil?
77
+ fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
78
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
79
+
80
+
81
+ request_headers = {}
82
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
83
+
84
+ # Set Headers
85
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
86
+ request_headers['Cache-Control'] = cache_control unless cache_control.nil?
87
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
88
+ path_template = 'providers/Microsoft.Management/managementGroups/{groupId}/subscriptions/{subscriptionId}'
89
+
90
+ request_url = @base_url || @client.base_url
91
+
92
+ options = {
93
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
94
+ path_params: {'groupId' => group_id,'subscriptionId' => subscription_id},
95
+ query_params: {'api-version' => @client.api_version},
96
+ headers: request_headers.merge(custom_headers || {}),
97
+ base_url: request_url
98
+ }
99
+ promise = @client.make_request_async(:put, path_template, options)
100
+
101
+ promise = promise.then do |result|
102
+ http_response = result.response
103
+ status_code = http_response.status
104
+ response_content = http_response.body
105
+ unless status_code == 204
106
+ error_model = JSON.load(response_content)
107
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
108
+ end
109
+
110
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
111
+
112
+ result
113
+ end
114
+
115
+ promise.execute
116
+ end
117
+
118
+ #
119
+ # De-associates subscription from the management group.
120
+ #
121
+ #
122
+ # @param group_id [String] Management Group ID.
123
+ # @param subscription_id [String] Subscription ID.
124
+ # @param cache_control [String] Indicates that the request shouldn't utilize
125
+ # any caches.
126
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
127
+ # will be added to the HTTP request.
128
+ #
129
+ #
130
+ def delete(group_id, subscription_id, cache_control:'no-cache', custom_headers:nil)
131
+ response = delete_async(group_id, subscription_id, cache_control:cache_control, custom_headers:custom_headers).value!
132
+ nil
133
+ end
134
+
135
+ #
136
+ # De-associates subscription from the management group.
137
+ #
138
+ #
139
+ # @param group_id [String] Management Group ID.
140
+ # @param subscription_id [String] Subscription ID.
141
+ # @param cache_control [String] Indicates that the request shouldn't utilize
142
+ # any caches.
143
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
144
+ # will be added to the HTTP request.
145
+ #
146
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
147
+ #
148
+ def delete_with_http_info(group_id, subscription_id, cache_control:'no-cache', custom_headers:nil)
149
+ delete_async(group_id, subscription_id, cache_control:cache_control, custom_headers:custom_headers).value!
150
+ end
151
+
152
+ #
153
+ # De-associates subscription from the management group.
154
+ #
155
+ #
156
+ # @param group_id [String] Management Group ID.
157
+ # @param subscription_id [String] Subscription ID.
158
+ # @param cache_control [String] Indicates that the request shouldn't utilize
159
+ # any caches.
160
+ # @param [Hash{String => String}] A hash of custom headers that will be added
161
+ # to the HTTP request.
162
+ #
163
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
164
+ #
165
+ def delete_async(group_id, subscription_id, cache_control:'no-cache', custom_headers:nil)
166
+ fail ArgumentError, 'group_id is nil' if group_id.nil?
167
+ fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
168
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
169
+
170
+
171
+ request_headers = {}
172
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
173
+
174
+ # Set Headers
175
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
176
+ request_headers['Cache-Control'] = cache_control unless cache_control.nil?
177
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
178
+ path_template = 'providers/Microsoft.Management/managementGroups/{groupId}/subscriptions/{subscriptionId}'
179
+
180
+ request_url = @base_url || @client.base_url
181
+
182
+ options = {
183
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
184
+ path_params: {'groupId' => group_id,'subscriptionId' => subscription_id},
185
+ query_params: {'api-version' => @client.api_version},
186
+ headers: request_headers.merge(custom_headers || {}),
187
+ base_url: request_url
188
+ }
189
+ promise = @client.make_request_async(:delete, path_template, options)
190
+
191
+ promise = promise.then do |result|
192
+ http_response = result.response
193
+ status_code = http_response.status
194
+ response_content = http_response.body
195
+ unless status_code == 204
196
+ error_model = JSON.load(response_content)
197
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
198
+ end
199
+
200
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
201
+
202
+ result
203
+ end
204
+
205
+ promise.execute
206
+ end
207
+
208
+ end
209
+ end