azure_mgmt_authorization 0.16.0 → 0.16.1
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.
- checksums.yaml +4 -4
- data/lib/2015-06-01/generated/azure_mgmt_authorization/authorization_management_client.rb +130 -0
- data/lib/2015-06-01/generated/azure_mgmt_authorization/classic_administrators.rb +228 -0
- data/lib/2015-06-01/generated/azure_mgmt_authorization/models/classic_administrator.rb +90 -0
- data/lib/2015-06-01/generated/azure_mgmt_authorization/models/classic_administrator_list_result.rb +98 -0
- data/lib/2015-06-01/generated/azure_mgmt_authorization/module_definition.rb +9 -0
- data/lib/2015-06-01/generated/azure_mgmt_authorization.rb +30 -0
- data/lib/2015-07-01/generated/azure_mgmt_authorization/authorization_management_client.rb +1 -1
- data/lib/2017-10-01-preview/generated/azure_mgmt_authorization/authorization_management_client.rb +130 -0
- data/lib/2017-10-01-preview/generated/azure_mgmt_authorization/models/role_assignment.rb +115 -0
- data/lib/2017-10-01-preview/generated/azure_mgmt_authorization/models/role_assignment_create_parameters.rb +71 -0
- data/lib/2017-10-01-preview/generated/azure_mgmt_authorization/models/role_assignment_filter.rb +57 -0
- data/lib/2017-10-01-preview/generated/azure_mgmt_authorization/models/role_assignment_list_result.rb +98 -0
- data/lib/2017-10-01-preview/generated/azure_mgmt_authorization/module_definition.rb +9 -0
- data/lib/2017-10-01-preview/generated/azure_mgmt_authorization/role_assignments.rb +1493 -0
- data/lib/2017-10-01-preview/generated/azure_mgmt_authorization.rb +32 -0
- data/lib/2018-01-01-preview/generated/azure_mgmt_authorization/authorization_management_client.rb +143 -0
- data/lib/2018-01-01-preview/generated/azure_mgmt_authorization/models/permission.rb +111 -0
- data/lib/2018-01-01-preview/generated/azure_mgmt_authorization/models/permission_get_result.rb +98 -0
- data/lib/2018-01-01-preview/generated/azure_mgmt_authorization/models/provider_operation.rb +101 -0
- data/lib/2018-01-01-preview/generated/azure_mgmt_authorization/models/provider_operations_metadata.rb +119 -0
- data/lib/2018-01-01-preview/generated/azure_mgmt_authorization/models/provider_operations_metadata_list_result.rb +98 -0
- data/lib/2018-01-01-preview/generated/azure_mgmt_authorization/models/resource_type.rb +77 -0
- data/lib/2018-01-01-preview/generated/azure_mgmt_authorization/models/role_assignment.rb +115 -0
- data/lib/2018-01-01-preview/generated/azure_mgmt_authorization/models/role_assignment_create_parameters.rb +71 -0
- data/lib/2018-01-01-preview/generated/azure_mgmt_authorization/models/role_assignment_filter.rb +57 -0
- data/lib/2018-01-01-preview/generated/azure_mgmt_authorization/models/role_assignment_list_result.rb +98 -0
- data/lib/2018-01-01-preview/generated/azure_mgmt_authorization/models/role_definition.rb +143 -0
- data/lib/2018-01-01-preview/generated/azure_mgmt_authorization/models/role_definition_filter.rb +57 -0
- data/lib/2018-01-01-preview/generated/azure_mgmt_authorization/models/role_definition_list_result.rb +98 -0
- data/lib/2018-01-01-preview/generated/azure_mgmt_authorization/module_definition.rb +9 -0
- data/lib/2018-01-01-preview/generated/azure_mgmt_authorization/permissions.rb +452 -0
- data/lib/2018-01-01-preview/generated/azure_mgmt_authorization/provider_operations_metadata_operations.rb +316 -0
- data/lib/2018-01-01-preview/generated/azure_mgmt_authorization/role_assignments.rb +1493 -0
- data/lib/2018-01-01-preview/generated/azure_mgmt_authorization/role_definitions.rb +622 -0
- data/lib/2018-01-01-preview/generated/azure_mgmt_authorization.rb +44 -0
- data/lib/azure_mgmt_authorization.rb +3 -0
- data/lib/profiles/latest/modules/authorization_profile_module.rb +63 -71
- data/lib/version.rb +1 -1
- metadata +36 -2
@@ -0,0 +1,316 @@
|
|
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::Authorization::Mgmt::V2018_01_01_preview
|
7
|
+
#
|
8
|
+
# Role based access control provides you a way to apply granular level policy
|
9
|
+
# administration down to individual resources or resource groups. These
|
10
|
+
# operations enable you to manage role definitions and role assignments. A
|
11
|
+
# role definition describes the set of actions that can be performed on
|
12
|
+
# resources. A role assignment grants access to Azure Active Directory users.
|
13
|
+
#
|
14
|
+
class ProviderOperationsMetadataOperations
|
15
|
+
include MsRestAzure
|
16
|
+
|
17
|
+
#
|
18
|
+
# Creates and initializes a new instance of the ProviderOperationsMetadataOperations class.
|
19
|
+
# @param client service class for accessing basic functionality.
|
20
|
+
#
|
21
|
+
def initialize(client)
|
22
|
+
@client = client
|
23
|
+
end
|
24
|
+
|
25
|
+
# @return [AuthorizationManagementClient] reference to the AuthorizationManagementClient
|
26
|
+
attr_reader :client
|
27
|
+
|
28
|
+
#
|
29
|
+
# Gets provider operations metadata for the specified resource provider.
|
30
|
+
#
|
31
|
+
# @param resource_provider_namespace [String] The namespace of the resource
|
32
|
+
# provider.
|
33
|
+
# @param expand [String] Specifies whether to expand the values.
|
34
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
35
|
+
# will be added to the HTTP request.
|
36
|
+
#
|
37
|
+
# @return [ProviderOperationsMetadata] operation results.
|
38
|
+
#
|
39
|
+
def get(resource_provider_namespace, expand:'resourceTypes', custom_headers:nil)
|
40
|
+
response = get_async(resource_provider_namespace, expand:expand, custom_headers:custom_headers).value!
|
41
|
+
response.body unless response.nil?
|
42
|
+
end
|
43
|
+
|
44
|
+
#
|
45
|
+
# Gets provider operations metadata for the specified resource provider.
|
46
|
+
#
|
47
|
+
# @param resource_provider_namespace [String] The namespace of the resource
|
48
|
+
# provider.
|
49
|
+
# @param expand [String] Specifies whether to expand the values.
|
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 get_with_http_info(resource_provider_namespace, expand:'resourceTypes', custom_headers:nil)
|
56
|
+
get_async(resource_provider_namespace, expand:expand, custom_headers:custom_headers).value!
|
57
|
+
end
|
58
|
+
|
59
|
+
#
|
60
|
+
# Gets provider operations metadata for the specified resource provider.
|
61
|
+
#
|
62
|
+
# @param resource_provider_namespace [String] The namespace of the resource
|
63
|
+
# provider.
|
64
|
+
# @param expand [String] Specifies whether to expand the values.
|
65
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
66
|
+
# to the HTTP request.
|
67
|
+
#
|
68
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
69
|
+
#
|
70
|
+
def get_async(resource_provider_namespace, expand:'resourceTypes', custom_headers:nil)
|
71
|
+
fail ArgumentError, 'resource_provider_namespace is nil' if resource_provider_namespace.nil?
|
72
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
73
|
+
|
74
|
+
|
75
|
+
request_headers = {}
|
76
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
77
|
+
|
78
|
+
# Set Headers
|
79
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
80
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
81
|
+
path_template = 'providers/Microsoft.Authorization/providerOperations/{resourceProviderNamespace}'
|
82
|
+
|
83
|
+
request_url = @base_url || @client.base_url
|
84
|
+
|
85
|
+
options = {
|
86
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
87
|
+
path_params: {'resourceProviderNamespace' => resource_provider_namespace},
|
88
|
+
query_params: {'api-version' => @client.api_version,'$expand' => expand},
|
89
|
+
headers: request_headers.merge(custom_headers || {}),
|
90
|
+
base_url: request_url
|
91
|
+
}
|
92
|
+
promise = @client.make_request_async(:get, path_template, options)
|
93
|
+
|
94
|
+
promise = promise.then do |result|
|
95
|
+
http_response = result.response
|
96
|
+
status_code = http_response.status
|
97
|
+
response_content = http_response.body
|
98
|
+
unless status_code == 200
|
99
|
+
error_model = JSON.load(response_content)
|
100
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
101
|
+
end
|
102
|
+
|
103
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
104
|
+
# Deserialize Response
|
105
|
+
if status_code == 200
|
106
|
+
begin
|
107
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
108
|
+
result_mapper = Azure::Authorization::Mgmt::V2018_01_01_preview::Models::ProviderOperationsMetadata.mapper()
|
109
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
110
|
+
rescue Exception => e
|
111
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
115
|
+
result
|
116
|
+
end
|
117
|
+
|
118
|
+
promise.execute
|
119
|
+
end
|
120
|
+
|
121
|
+
#
|
122
|
+
# Gets provider operations metadata for all resource providers.
|
123
|
+
#
|
124
|
+
# @param expand [String] Specifies whether to expand the values.
|
125
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
126
|
+
# will be added to the HTTP request.
|
127
|
+
#
|
128
|
+
# @return [Array<ProviderOperationsMetadata>] operation results.
|
129
|
+
#
|
130
|
+
def list(expand:'resourceTypes', custom_headers:nil)
|
131
|
+
first_page = list_as_lazy(expand:expand, custom_headers:custom_headers)
|
132
|
+
first_page.get_all_items
|
133
|
+
end
|
134
|
+
|
135
|
+
#
|
136
|
+
# Gets provider operations metadata for all resource providers.
|
137
|
+
#
|
138
|
+
# @param expand [String] Specifies whether to expand the values.
|
139
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
140
|
+
# will be added to the HTTP request.
|
141
|
+
#
|
142
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
143
|
+
#
|
144
|
+
def list_with_http_info(expand:'resourceTypes', custom_headers:nil)
|
145
|
+
list_async(expand:expand, custom_headers:custom_headers).value!
|
146
|
+
end
|
147
|
+
|
148
|
+
#
|
149
|
+
# Gets provider operations metadata for all resource providers.
|
150
|
+
#
|
151
|
+
# @param expand [String] Specifies whether to expand the values.
|
152
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
153
|
+
# to the HTTP request.
|
154
|
+
#
|
155
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
156
|
+
#
|
157
|
+
def list_async(expand:'resourceTypes', custom_headers:nil)
|
158
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
159
|
+
|
160
|
+
|
161
|
+
request_headers = {}
|
162
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
163
|
+
|
164
|
+
# Set Headers
|
165
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
166
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
167
|
+
path_template = 'providers/Microsoft.Authorization/providerOperations'
|
168
|
+
|
169
|
+
request_url = @base_url || @client.base_url
|
170
|
+
|
171
|
+
options = {
|
172
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
173
|
+
query_params: {'api-version' => @client.api_version,'$expand' => expand},
|
174
|
+
headers: request_headers.merge(custom_headers || {}),
|
175
|
+
base_url: request_url
|
176
|
+
}
|
177
|
+
promise = @client.make_request_async(:get, path_template, options)
|
178
|
+
|
179
|
+
promise = promise.then do |result|
|
180
|
+
http_response = result.response
|
181
|
+
status_code = http_response.status
|
182
|
+
response_content = http_response.body
|
183
|
+
unless status_code == 200
|
184
|
+
error_model = JSON.load(response_content)
|
185
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
186
|
+
end
|
187
|
+
|
188
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
189
|
+
# Deserialize Response
|
190
|
+
if status_code == 200
|
191
|
+
begin
|
192
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
193
|
+
result_mapper = Azure::Authorization::Mgmt::V2018_01_01_preview::Models::ProviderOperationsMetadataListResult.mapper()
|
194
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
195
|
+
rescue Exception => e
|
196
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
197
|
+
end
|
198
|
+
end
|
199
|
+
|
200
|
+
result
|
201
|
+
end
|
202
|
+
|
203
|
+
promise.execute
|
204
|
+
end
|
205
|
+
|
206
|
+
#
|
207
|
+
# Gets provider operations metadata for all resource providers.
|
208
|
+
#
|
209
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
210
|
+
# to List operation.
|
211
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
212
|
+
# will be added to the HTTP request.
|
213
|
+
#
|
214
|
+
# @return [ProviderOperationsMetadataListResult] operation results.
|
215
|
+
#
|
216
|
+
def list_next(next_page_link, custom_headers:nil)
|
217
|
+
response = list_next_async(next_page_link, custom_headers:custom_headers).value!
|
218
|
+
response.body unless response.nil?
|
219
|
+
end
|
220
|
+
|
221
|
+
#
|
222
|
+
# Gets provider operations metadata for all resource providers.
|
223
|
+
#
|
224
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
225
|
+
# to List operation.
|
226
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
227
|
+
# will be added to the HTTP request.
|
228
|
+
#
|
229
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
230
|
+
#
|
231
|
+
def list_next_with_http_info(next_page_link, custom_headers:nil)
|
232
|
+
list_next_async(next_page_link, custom_headers:custom_headers).value!
|
233
|
+
end
|
234
|
+
|
235
|
+
#
|
236
|
+
# Gets provider operations metadata for all resource providers.
|
237
|
+
#
|
238
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
239
|
+
# to List operation.
|
240
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
241
|
+
# to the HTTP request.
|
242
|
+
#
|
243
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
244
|
+
#
|
245
|
+
def list_next_async(next_page_link, custom_headers:nil)
|
246
|
+
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
247
|
+
|
248
|
+
|
249
|
+
request_headers = {}
|
250
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
251
|
+
|
252
|
+
# Set Headers
|
253
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
254
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
255
|
+
path_template = '{nextLink}'
|
256
|
+
|
257
|
+
request_url = @base_url || @client.base_url
|
258
|
+
|
259
|
+
options = {
|
260
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
261
|
+
skip_encoding_path_params: {'nextLink' => next_page_link},
|
262
|
+
headers: request_headers.merge(custom_headers || {}),
|
263
|
+
base_url: request_url
|
264
|
+
}
|
265
|
+
promise = @client.make_request_async(:get, path_template, options)
|
266
|
+
|
267
|
+
promise = promise.then do |result|
|
268
|
+
http_response = result.response
|
269
|
+
status_code = http_response.status
|
270
|
+
response_content = http_response.body
|
271
|
+
unless status_code == 200
|
272
|
+
error_model = JSON.load(response_content)
|
273
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
274
|
+
end
|
275
|
+
|
276
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
277
|
+
# Deserialize Response
|
278
|
+
if status_code == 200
|
279
|
+
begin
|
280
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
281
|
+
result_mapper = Azure::Authorization::Mgmt::V2018_01_01_preview::Models::ProviderOperationsMetadataListResult.mapper()
|
282
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
283
|
+
rescue Exception => e
|
284
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
285
|
+
end
|
286
|
+
end
|
287
|
+
|
288
|
+
result
|
289
|
+
end
|
290
|
+
|
291
|
+
promise.execute
|
292
|
+
end
|
293
|
+
|
294
|
+
#
|
295
|
+
# Gets provider operations metadata for all resource providers.
|
296
|
+
#
|
297
|
+
# @param expand [String] Specifies whether to expand the values.
|
298
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
299
|
+
# will be added to the HTTP request.
|
300
|
+
#
|
301
|
+
# @return [ProviderOperationsMetadataListResult] which provide lazy access to
|
302
|
+
# pages of the response.
|
303
|
+
#
|
304
|
+
def list_as_lazy(expand:'resourceTypes', custom_headers:nil)
|
305
|
+
response = list_async(expand:expand, custom_headers:custom_headers).value!
|
306
|
+
unless response.nil?
|
307
|
+
page = response.body
|
308
|
+
page.next_method = Proc.new do |next_page_link|
|
309
|
+
list_next_async(next_page_link, custom_headers:custom_headers)
|
310
|
+
end
|
311
|
+
page
|
312
|
+
end
|
313
|
+
end
|
314
|
+
|
315
|
+
end
|
316
|
+
end
|