azure_graph_rbac 0.16.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE.txt +21 -0
- data/lib/1.6/generated/azure_graph_rbac.rb +75 -0
- data/lib/1.6/generated/azure_graph_rbac/applications.rb +1131 -0
- data/lib/1.6/generated/azure_graph_rbac/domains.rb +200 -0
- data/lib/1.6/generated/azure_graph_rbac/graph_rbac_client.rb +150 -0
- data/lib/1.6/generated/azure_graph_rbac/groups.rb +1079 -0
- data/lib/1.6/generated/azure_graph_rbac/models/aadobject.rb +297 -0
- data/lib/1.6/generated/azure_graph_rbac/models/adgroup.rb +116 -0
- data/lib/1.6/generated/azure_graph_rbac/models/application.rb +196 -0
- data/lib/1.6/generated/azure_graph_rbac/models/application_add_owner_parameters.rb +69 -0
- data/lib/1.6/generated/azure_graph_rbac/models/application_create_parameters.rb +202 -0
- data/lib/1.6/generated/azure_graph_rbac/models/application_list_result.rb +98 -0
- data/lib/1.6/generated/azure_graph_rbac/models/application_update_parameters.rb +201 -0
- data/lib/1.6/generated/azure_graph_rbac/models/check_group_membership_parameters.rb +77 -0
- data/lib/1.6/generated/azure_graph_rbac/models/check_group_membership_result.rb +67 -0
- data/lib/1.6/generated/azure_graph_rbac/models/directory_object.rb +92 -0
- data/lib/1.6/generated/azure_graph_rbac/models/directory_object_list_result.rb +57 -0
- data/lib/1.6/generated/azure_graph_rbac/models/domain.rb +101 -0
- data/lib/1.6/generated/azure_graph_rbac/models/domain_list_result.rb +55 -0
- data/lib/1.6/generated/azure_graph_rbac/models/get_objects_parameters.rb +104 -0
- data/lib/1.6/generated/azure_graph_rbac/models/get_objects_result.rb +98 -0
- data/lib/1.6/generated/azure_graph_rbac/models/graph_error.rb +57 -0
- data/lib/1.6/generated/azure_graph_rbac/models/group_add_member_parameters.rb +69 -0
- data/lib/1.6/generated/azure_graph_rbac/models/group_create_parameters.rb +106 -0
- data/lib/1.6/generated/azure_graph_rbac/models/group_get_member_groups_parameters.rb +67 -0
- data/lib/1.6/generated/azure_graph_rbac/models/group_get_member_groups_result.rb +55 -0
- data/lib/1.6/generated/azure_graph_rbac/models/group_list_result.rb +98 -0
- data/lib/1.6/generated/azure_graph_rbac/models/key_credential.rb +121 -0
- data/lib/1.6/generated/azure_graph_rbac/models/key_credential_list_result.rb +55 -0
- data/lib/1.6/generated/azure_graph_rbac/models/key_credentials_update_parameters.rb +55 -0
- data/lib/1.6/generated/azure_graph_rbac/models/password_credential.rb +98 -0
- data/lib/1.6/generated/azure_graph_rbac/models/password_credential_list_result.rb +56 -0
- data/lib/1.6/generated/azure_graph_rbac/models/password_credentials_update_parameters.rb +56 -0
- data/lib/1.6/generated/azure_graph_rbac/models/password_profile.rb +76 -0
- data/lib/1.6/generated/azure_graph_rbac/models/required_resource_access.rb +94 -0
- data/lib/1.6/generated/azure_graph_rbac/models/resource_access.rb +80 -0
- data/lib/1.6/generated/azure_graph_rbac/models/service_principal.rb +124 -0
- data/lib/1.6/generated/azure_graph_rbac/models/service_principal_create_parameters.rb +117 -0
- data/lib/1.6/generated/azure_graph_rbac/models/service_principal_list_result.rb +98 -0
- data/lib/1.6/generated/azure_graph_rbac/models/sign_in_name.rb +79 -0
- data/lib/1.6/generated/azure_graph_rbac/models/user.rb +221 -0
- data/lib/1.6/generated/azure_graph_rbac/models/user_base.rb +118 -0
- data/lib/1.6/generated/azure_graph_rbac/models/user_create_parameters.rb +158 -0
- data/lib/1.6/generated/azure_graph_rbac/models/user_get_member_groups_parameters.rb +67 -0
- data/lib/1.6/generated/azure_graph_rbac/models/user_get_member_groups_result.rb +55 -0
- data/lib/1.6/generated/azure_graph_rbac/models/user_list_result.rb +98 -0
- data/lib/1.6/generated/azure_graph_rbac/models/user_type.rb +16 -0
- data/lib/1.6/generated/azure_graph_rbac/models/user_update_parameters.rb +147 -0
- data/lib/1.6/generated/azure_graph_rbac/module_definition.rb +8 -0
- data/lib/1.6/generated/azure_graph_rbac/objects.rb +314 -0
- data/lib/1.6/generated/azure_graph_rbac/service_principals.rb +949 -0
- data/lib/1.6/generated/azure_graph_rbac/users.rb +686 -0
- data/lib/azure_graph_rbac.rb +6 -0
- data/lib/module_definition.rb +6 -0
- data/lib/profiles/latest/graphrbac_latest_profile_client.rb +38 -0
- data/lib/profiles/latest/graphrbac_module_definition.rb +8 -0
- data/lib/profiles/latest/modules/graphrbac_profile_module.rb +237 -0
- data/lib/version.rb +7 -0
- metadata +177 -0
@@ -0,0 +1,949 @@
|
|
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::GraphRbac::V1_6
|
7
|
+
#
|
8
|
+
# The Graph RBAC Management Client
|
9
|
+
#
|
10
|
+
class ServicePrincipals
|
11
|
+
include MsRestAzure
|
12
|
+
|
13
|
+
#
|
14
|
+
# Creates and initializes a new instance of the ServicePrincipals class.
|
15
|
+
# @param client service class for accessing basic functionality.
|
16
|
+
#
|
17
|
+
def initialize(client)
|
18
|
+
@client = client
|
19
|
+
end
|
20
|
+
|
21
|
+
# @return [GraphRbacClient] reference to the GraphRbacClient
|
22
|
+
attr_reader :client
|
23
|
+
|
24
|
+
#
|
25
|
+
# Creates a service principal in the directory.
|
26
|
+
#
|
27
|
+
# @param parameters [ServicePrincipalCreateParameters] Parameters to create a
|
28
|
+
# service principal.
|
29
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
30
|
+
# will be added to the HTTP request.
|
31
|
+
#
|
32
|
+
# @return [ServicePrincipal] operation results.
|
33
|
+
#
|
34
|
+
def create(parameters, custom_headers:nil)
|
35
|
+
response = create_async(parameters, custom_headers:custom_headers).value!
|
36
|
+
response.body unless response.nil?
|
37
|
+
end
|
38
|
+
|
39
|
+
#
|
40
|
+
# Creates a service principal in the directory.
|
41
|
+
#
|
42
|
+
# @param parameters [ServicePrincipalCreateParameters] Parameters to create a
|
43
|
+
# service principal.
|
44
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
45
|
+
# will be added to the HTTP request.
|
46
|
+
#
|
47
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
48
|
+
#
|
49
|
+
def create_with_http_info(parameters, custom_headers:nil)
|
50
|
+
create_async(parameters, custom_headers:custom_headers).value!
|
51
|
+
end
|
52
|
+
|
53
|
+
#
|
54
|
+
# Creates a service principal in the directory.
|
55
|
+
#
|
56
|
+
# @param parameters [ServicePrincipalCreateParameters] Parameters to create a
|
57
|
+
# service principal.
|
58
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
59
|
+
# to the HTTP request.
|
60
|
+
#
|
61
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
62
|
+
#
|
63
|
+
def create_async(parameters, custom_headers:nil)
|
64
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
65
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
66
|
+
fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil?
|
67
|
+
|
68
|
+
|
69
|
+
request_headers = {}
|
70
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
71
|
+
|
72
|
+
# Set Headers
|
73
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
74
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
75
|
+
|
76
|
+
# Serialize Request
|
77
|
+
request_mapper = Azure::GraphRbac::V1_6::Models::ServicePrincipalCreateParameters.mapper()
|
78
|
+
request_content = @client.serialize(request_mapper, parameters)
|
79
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
80
|
+
|
81
|
+
path_template = '{tenantID}/servicePrincipals'
|
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: {'tenantID' => @client.tenant_id},
|
88
|
+
query_params: {'api-version' => @client.api_version},
|
89
|
+
body: request_content,
|
90
|
+
headers: request_headers.merge(custom_headers || {}),
|
91
|
+
base_url: request_url
|
92
|
+
}
|
93
|
+
promise = @client.make_request_async(:post, 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 == 201
|
100
|
+
error_model = JSON.load(response_content)
|
101
|
+
fail MsRest::HttpOperationError.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 == 201
|
107
|
+
begin
|
108
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
109
|
+
result_mapper = Azure::GraphRbac::V1_6::Models::ServicePrincipal.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
|
+
# Gets a list of service principals from the current tenant.
|
124
|
+
#
|
125
|
+
# @param filter [String] The filter to apply to the operation.
|
126
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
127
|
+
# will be added to the HTTP request.
|
128
|
+
#
|
129
|
+
# @return [Array<ServicePrincipal>] operation results.
|
130
|
+
#
|
131
|
+
def list(filter:nil, custom_headers:nil)
|
132
|
+
first_page = list_as_lazy(filter:filter, custom_headers:custom_headers)
|
133
|
+
first_page.get_all_items
|
134
|
+
end
|
135
|
+
|
136
|
+
#
|
137
|
+
# Gets a list of service principals from the current tenant.
|
138
|
+
#
|
139
|
+
# @param filter [String] The filter to apply to the operation.
|
140
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
141
|
+
# will be added to the HTTP request.
|
142
|
+
#
|
143
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
144
|
+
#
|
145
|
+
def list_with_http_info(filter:nil, custom_headers:nil)
|
146
|
+
list_async(filter:filter, custom_headers:custom_headers).value!
|
147
|
+
end
|
148
|
+
|
149
|
+
#
|
150
|
+
# Gets a list of service principals from the current tenant.
|
151
|
+
#
|
152
|
+
# @param filter [String] The filter to apply to the operation.
|
153
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
154
|
+
# to the HTTP request.
|
155
|
+
#
|
156
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
157
|
+
#
|
158
|
+
def list_async(filter:nil, custom_headers:nil)
|
159
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
160
|
+
fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil?
|
161
|
+
|
162
|
+
|
163
|
+
request_headers = {}
|
164
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
165
|
+
|
166
|
+
# Set Headers
|
167
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
168
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
169
|
+
path_template = '{tenantID}/servicePrincipals'
|
170
|
+
|
171
|
+
request_url = @base_url || @client.base_url
|
172
|
+
|
173
|
+
options = {
|
174
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
175
|
+
path_params: {'tenantID' => @client.tenant_id},
|
176
|
+
query_params: {'$filter' => filter,'api-version' => @client.api_version},
|
177
|
+
headers: request_headers.merge(custom_headers || {}),
|
178
|
+
base_url: request_url
|
179
|
+
}
|
180
|
+
promise = @client.make_request_async(:get, path_template, options)
|
181
|
+
|
182
|
+
promise = promise.then do |result|
|
183
|
+
http_response = result.response
|
184
|
+
status_code = http_response.status
|
185
|
+
response_content = http_response.body
|
186
|
+
unless status_code == 200
|
187
|
+
error_model = JSON.load(response_content)
|
188
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
189
|
+
end
|
190
|
+
|
191
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
192
|
+
# Deserialize Response
|
193
|
+
if status_code == 200
|
194
|
+
begin
|
195
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
196
|
+
result_mapper = Azure::GraphRbac::V1_6::Models::ServicePrincipalListResult.mapper()
|
197
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
198
|
+
rescue Exception => e
|
199
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
200
|
+
end
|
201
|
+
end
|
202
|
+
|
203
|
+
result
|
204
|
+
end
|
205
|
+
|
206
|
+
promise.execute
|
207
|
+
end
|
208
|
+
|
209
|
+
#
|
210
|
+
# Deletes a service principal from the directory.
|
211
|
+
#
|
212
|
+
# @param object_id [String] The object ID of the service principal to delete.
|
213
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
214
|
+
# will be added to the HTTP request.
|
215
|
+
#
|
216
|
+
#
|
217
|
+
def delete(object_id, custom_headers:nil)
|
218
|
+
response = delete_async(object_id, custom_headers:custom_headers).value!
|
219
|
+
nil
|
220
|
+
end
|
221
|
+
|
222
|
+
#
|
223
|
+
# Deletes a service principal from the directory.
|
224
|
+
#
|
225
|
+
# @param object_id [String] The object ID of the service principal to delete.
|
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 delete_with_http_info(object_id, custom_headers:nil)
|
232
|
+
delete_async(object_id, custom_headers:custom_headers).value!
|
233
|
+
end
|
234
|
+
|
235
|
+
#
|
236
|
+
# Deletes a service principal from the directory.
|
237
|
+
#
|
238
|
+
# @param object_id [String] The object ID of the service principal to delete.
|
239
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
240
|
+
# to the HTTP request.
|
241
|
+
#
|
242
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
243
|
+
#
|
244
|
+
def delete_async(object_id, custom_headers:nil)
|
245
|
+
fail ArgumentError, 'object_id is nil' if object_id.nil?
|
246
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
247
|
+
fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil?
|
248
|
+
|
249
|
+
|
250
|
+
request_headers = {}
|
251
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
252
|
+
|
253
|
+
# Set Headers
|
254
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
255
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
256
|
+
path_template = '{tenantID}/servicePrincipals/{objectId}'
|
257
|
+
|
258
|
+
request_url = @base_url || @client.base_url
|
259
|
+
|
260
|
+
options = {
|
261
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
262
|
+
path_params: {'objectId' => object_id,'tenantID' => @client.tenant_id},
|
263
|
+
query_params: {'api-version' => @client.api_version},
|
264
|
+
headers: request_headers.merge(custom_headers || {}),
|
265
|
+
base_url: request_url
|
266
|
+
}
|
267
|
+
promise = @client.make_request_async(:delete, path_template, options)
|
268
|
+
|
269
|
+
promise = promise.then do |result|
|
270
|
+
http_response = result.response
|
271
|
+
status_code = http_response.status
|
272
|
+
response_content = http_response.body
|
273
|
+
unless status_code == 204
|
274
|
+
error_model = JSON.load(response_content)
|
275
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
276
|
+
end
|
277
|
+
|
278
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
279
|
+
|
280
|
+
result
|
281
|
+
end
|
282
|
+
|
283
|
+
promise.execute
|
284
|
+
end
|
285
|
+
|
286
|
+
#
|
287
|
+
# Gets service principal information from the directory.
|
288
|
+
#
|
289
|
+
# @param object_id [String] The object ID of the service principal to get.
|
290
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
291
|
+
# will be added to the HTTP request.
|
292
|
+
#
|
293
|
+
# @return [ServicePrincipal] operation results.
|
294
|
+
#
|
295
|
+
def get(object_id, custom_headers:nil)
|
296
|
+
response = get_async(object_id, custom_headers:custom_headers).value!
|
297
|
+
response.body unless response.nil?
|
298
|
+
end
|
299
|
+
|
300
|
+
#
|
301
|
+
# Gets service principal information from the directory.
|
302
|
+
#
|
303
|
+
# @param object_id [String] The object ID of the service principal to get.
|
304
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
305
|
+
# will be added to the HTTP request.
|
306
|
+
#
|
307
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
308
|
+
#
|
309
|
+
def get_with_http_info(object_id, custom_headers:nil)
|
310
|
+
get_async(object_id, custom_headers:custom_headers).value!
|
311
|
+
end
|
312
|
+
|
313
|
+
#
|
314
|
+
# Gets service principal information from the directory.
|
315
|
+
#
|
316
|
+
# @param object_id [String] The object ID of the service principal to get.
|
317
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
318
|
+
# to the HTTP request.
|
319
|
+
#
|
320
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
321
|
+
#
|
322
|
+
def get_async(object_id, custom_headers:nil)
|
323
|
+
fail ArgumentError, 'object_id is nil' if object_id.nil?
|
324
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
325
|
+
fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil?
|
326
|
+
|
327
|
+
|
328
|
+
request_headers = {}
|
329
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
330
|
+
|
331
|
+
# Set Headers
|
332
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
333
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
334
|
+
path_template = '{tenantID}/servicePrincipals/{objectId}'
|
335
|
+
|
336
|
+
request_url = @base_url || @client.base_url
|
337
|
+
|
338
|
+
options = {
|
339
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
340
|
+
path_params: {'objectId' => object_id,'tenantID' => @client.tenant_id},
|
341
|
+
query_params: {'api-version' => @client.api_version},
|
342
|
+
headers: request_headers.merge(custom_headers || {}),
|
343
|
+
base_url: request_url
|
344
|
+
}
|
345
|
+
promise = @client.make_request_async(:get, path_template, options)
|
346
|
+
|
347
|
+
promise = promise.then do |result|
|
348
|
+
http_response = result.response
|
349
|
+
status_code = http_response.status
|
350
|
+
response_content = http_response.body
|
351
|
+
unless status_code == 200
|
352
|
+
error_model = JSON.load(response_content)
|
353
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
354
|
+
end
|
355
|
+
|
356
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
357
|
+
# Deserialize Response
|
358
|
+
if status_code == 200
|
359
|
+
begin
|
360
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
361
|
+
result_mapper = Azure::GraphRbac::V1_6::Models::ServicePrincipal.mapper()
|
362
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
363
|
+
rescue Exception => e
|
364
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
365
|
+
end
|
366
|
+
end
|
367
|
+
|
368
|
+
result
|
369
|
+
end
|
370
|
+
|
371
|
+
promise.execute
|
372
|
+
end
|
373
|
+
|
374
|
+
#
|
375
|
+
# Directory objects that are owners of this service principal.
|
376
|
+
#
|
377
|
+
# The owners are a set of non-admin users who are allowed to modify this
|
378
|
+
# object.
|
379
|
+
#
|
380
|
+
# @param object_id [String] The object ID of the service principal for which to
|
381
|
+
# get owners.
|
382
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
383
|
+
# will be added to the HTTP request.
|
384
|
+
#
|
385
|
+
# @return [DirectoryObjectListResult] operation results.
|
386
|
+
#
|
387
|
+
def list_owners(object_id, custom_headers:nil)
|
388
|
+
response = list_owners_async(object_id, custom_headers:custom_headers).value!
|
389
|
+
response.body unless response.nil?
|
390
|
+
end
|
391
|
+
|
392
|
+
#
|
393
|
+
# Directory objects that are owners of this service principal.
|
394
|
+
#
|
395
|
+
# The owners are a set of non-admin users who are allowed to modify this
|
396
|
+
# object.
|
397
|
+
#
|
398
|
+
# @param object_id [String] The object ID of the service principal for which to
|
399
|
+
# get owners.
|
400
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
401
|
+
# will be added to the HTTP request.
|
402
|
+
#
|
403
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
404
|
+
#
|
405
|
+
def list_owners_with_http_info(object_id, custom_headers:nil)
|
406
|
+
list_owners_async(object_id, custom_headers:custom_headers).value!
|
407
|
+
end
|
408
|
+
|
409
|
+
#
|
410
|
+
# Directory objects that are owners of this service principal.
|
411
|
+
#
|
412
|
+
# The owners are a set of non-admin users who are allowed to modify this
|
413
|
+
# object.
|
414
|
+
#
|
415
|
+
# @param object_id [String] The object ID of the service principal for which to
|
416
|
+
# get owners.
|
417
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
418
|
+
# to the HTTP request.
|
419
|
+
#
|
420
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
421
|
+
#
|
422
|
+
def list_owners_async(object_id, custom_headers:nil)
|
423
|
+
fail ArgumentError, 'object_id is nil' if object_id.nil?
|
424
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
425
|
+
fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil?
|
426
|
+
|
427
|
+
|
428
|
+
request_headers = {}
|
429
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
430
|
+
|
431
|
+
# Set Headers
|
432
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
433
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
434
|
+
path_template = '{tenantID}/servicePrincipals/{objectId}/owners'
|
435
|
+
|
436
|
+
request_url = @base_url || @client.base_url
|
437
|
+
|
438
|
+
options = {
|
439
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
440
|
+
path_params: {'objectId' => object_id,'tenantID' => @client.tenant_id},
|
441
|
+
query_params: {'api-version' => @client.api_version},
|
442
|
+
headers: request_headers.merge(custom_headers || {}),
|
443
|
+
base_url: request_url
|
444
|
+
}
|
445
|
+
promise = @client.make_request_async(:get, path_template, options)
|
446
|
+
|
447
|
+
promise = promise.then do |result|
|
448
|
+
http_response = result.response
|
449
|
+
status_code = http_response.status
|
450
|
+
response_content = http_response.body
|
451
|
+
unless status_code == 200
|
452
|
+
error_model = JSON.load(response_content)
|
453
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
454
|
+
end
|
455
|
+
|
456
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
457
|
+
# Deserialize Response
|
458
|
+
if status_code == 200
|
459
|
+
begin
|
460
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
461
|
+
result_mapper = Azure::GraphRbac::V1_6::Models::DirectoryObjectListResult.mapper()
|
462
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
463
|
+
rescue Exception => e
|
464
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
465
|
+
end
|
466
|
+
end
|
467
|
+
|
468
|
+
result
|
469
|
+
end
|
470
|
+
|
471
|
+
promise.execute
|
472
|
+
end
|
473
|
+
|
474
|
+
#
|
475
|
+
# Get the keyCredentials associated with the specified service principal.
|
476
|
+
#
|
477
|
+
# @param object_id [String] The object ID of the service principal for which to
|
478
|
+
# get keyCredentials.
|
479
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
480
|
+
# will be added to the HTTP request.
|
481
|
+
#
|
482
|
+
# @return [KeyCredentialListResult] operation results.
|
483
|
+
#
|
484
|
+
def list_key_credentials(object_id, custom_headers:nil)
|
485
|
+
response = list_key_credentials_async(object_id, custom_headers:custom_headers).value!
|
486
|
+
response.body unless response.nil?
|
487
|
+
end
|
488
|
+
|
489
|
+
#
|
490
|
+
# Get the keyCredentials associated with the specified service principal.
|
491
|
+
#
|
492
|
+
# @param object_id [String] The object ID of the service principal for which to
|
493
|
+
# get keyCredentials.
|
494
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
495
|
+
# will be added to the HTTP request.
|
496
|
+
#
|
497
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
498
|
+
#
|
499
|
+
def list_key_credentials_with_http_info(object_id, custom_headers:nil)
|
500
|
+
list_key_credentials_async(object_id, custom_headers:custom_headers).value!
|
501
|
+
end
|
502
|
+
|
503
|
+
#
|
504
|
+
# Get the keyCredentials associated with the specified service principal.
|
505
|
+
#
|
506
|
+
# @param object_id [String] The object ID of the service principal for which to
|
507
|
+
# get keyCredentials.
|
508
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
509
|
+
# to the HTTP request.
|
510
|
+
#
|
511
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
512
|
+
#
|
513
|
+
def list_key_credentials_async(object_id, custom_headers:nil)
|
514
|
+
fail ArgumentError, 'object_id is nil' if object_id.nil?
|
515
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
516
|
+
fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil?
|
517
|
+
|
518
|
+
|
519
|
+
request_headers = {}
|
520
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
521
|
+
|
522
|
+
# Set Headers
|
523
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
524
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
525
|
+
path_template = '{tenantID}/servicePrincipals/{objectId}/keyCredentials'
|
526
|
+
|
527
|
+
request_url = @base_url || @client.base_url
|
528
|
+
|
529
|
+
options = {
|
530
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
531
|
+
path_params: {'objectId' => object_id,'tenantID' => @client.tenant_id},
|
532
|
+
query_params: {'api-version' => @client.api_version},
|
533
|
+
headers: request_headers.merge(custom_headers || {}),
|
534
|
+
base_url: request_url
|
535
|
+
}
|
536
|
+
promise = @client.make_request_async(:get, path_template, options)
|
537
|
+
|
538
|
+
promise = promise.then do |result|
|
539
|
+
http_response = result.response
|
540
|
+
status_code = http_response.status
|
541
|
+
response_content = http_response.body
|
542
|
+
unless status_code == 200
|
543
|
+
error_model = JSON.load(response_content)
|
544
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
545
|
+
end
|
546
|
+
|
547
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
548
|
+
# Deserialize Response
|
549
|
+
if status_code == 200
|
550
|
+
begin
|
551
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
552
|
+
result_mapper = Azure::GraphRbac::V1_6::Models::KeyCredentialListResult.mapper()
|
553
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
554
|
+
rescue Exception => e
|
555
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
556
|
+
end
|
557
|
+
end
|
558
|
+
|
559
|
+
result
|
560
|
+
end
|
561
|
+
|
562
|
+
promise.execute
|
563
|
+
end
|
564
|
+
|
565
|
+
#
|
566
|
+
# Update the keyCredentials associated with a service principal.
|
567
|
+
#
|
568
|
+
# @param object_id [String] The object ID for which to get service principal
|
569
|
+
# information.
|
570
|
+
# @param parameters [KeyCredentialsUpdateParameters] Parameters to update the
|
571
|
+
# keyCredentials of an existing service principal.
|
572
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
573
|
+
# will be added to the HTTP request.
|
574
|
+
#
|
575
|
+
#
|
576
|
+
def update_key_credentials(object_id, parameters, custom_headers:nil)
|
577
|
+
response = update_key_credentials_async(object_id, parameters, custom_headers:custom_headers).value!
|
578
|
+
nil
|
579
|
+
end
|
580
|
+
|
581
|
+
#
|
582
|
+
# Update the keyCredentials associated with a service principal.
|
583
|
+
#
|
584
|
+
# @param object_id [String] The object ID for which to get service principal
|
585
|
+
# information.
|
586
|
+
# @param parameters [KeyCredentialsUpdateParameters] Parameters to update the
|
587
|
+
# keyCredentials of an existing service principal.
|
588
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
589
|
+
# will be added to the HTTP request.
|
590
|
+
#
|
591
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
592
|
+
#
|
593
|
+
def update_key_credentials_with_http_info(object_id, parameters, custom_headers:nil)
|
594
|
+
update_key_credentials_async(object_id, parameters, custom_headers:custom_headers).value!
|
595
|
+
end
|
596
|
+
|
597
|
+
#
|
598
|
+
# Update the keyCredentials associated with a service principal.
|
599
|
+
#
|
600
|
+
# @param object_id [String] The object ID for which to get service principal
|
601
|
+
# information.
|
602
|
+
# @param parameters [KeyCredentialsUpdateParameters] Parameters to update the
|
603
|
+
# keyCredentials of an existing service principal.
|
604
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
605
|
+
# to the HTTP request.
|
606
|
+
#
|
607
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
608
|
+
#
|
609
|
+
def update_key_credentials_async(object_id, parameters, custom_headers:nil)
|
610
|
+
fail ArgumentError, 'object_id is nil' if object_id.nil?
|
611
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
612
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
613
|
+
fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil?
|
614
|
+
|
615
|
+
|
616
|
+
request_headers = {}
|
617
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
618
|
+
|
619
|
+
# Set Headers
|
620
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
621
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
622
|
+
|
623
|
+
# Serialize Request
|
624
|
+
request_mapper = Azure::GraphRbac::V1_6::Models::KeyCredentialsUpdateParameters.mapper()
|
625
|
+
request_content = @client.serialize(request_mapper, parameters)
|
626
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
627
|
+
|
628
|
+
path_template = '{tenantID}/servicePrincipals/{objectId}/keyCredentials'
|
629
|
+
|
630
|
+
request_url = @base_url || @client.base_url
|
631
|
+
|
632
|
+
options = {
|
633
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
634
|
+
path_params: {'objectId' => object_id,'tenantID' => @client.tenant_id},
|
635
|
+
query_params: {'api-version' => @client.api_version},
|
636
|
+
body: request_content,
|
637
|
+
headers: request_headers.merge(custom_headers || {}),
|
638
|
+
base_url: request_url
|
639
|
+
}
|
640
|
+
promise = @client.make_request_async(:patch, path_template, options)
|
641
|
+
|
642
|
+
promise = promise.then do |result|
|
643
|
+
http_response = result.response
|
644
|
+
status_code = http_response.status
|
645
|
+
response_content = http_response.body
|
646
|
+
unless status_code == 204
|
647
|
+
error_model = JSON.load(response_content)
|
648
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
649
|
+
end
|
650
|
+
|
651
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
652
|
+
|
653
|
+
result
|
654
|
+
end
|
655
|
+
|
656
|
+
promise.execute
|
657
|
+
end
|
658
|
+
|
659
|
+
#
|
660
|
+
# Gets the passwordCredentials associated with a service principal.
|
661
|
+
#
|
662
|
+
# @param object_id [String] The object ID of the service principal.
|
663
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
664
|
+
# will be added to the HTTP request.
|
665
|
+
#
|
666
|
+
# @return [PasswordCredentialListResult] operation results.
|
667
|
+
#
|
668
|
+
def list_password_credentials(object_id, custom_headers:nil)
|
669
|
+
response = list_password_credentials_async(object_id, custom_headers:custom_headers).value!
|
670
|
+
response.body unless response.nil?
|
671
|
+
end
|
672
|
+
|
673
|
+
#
|
674
|
+
# Gets the passwordCredentials associated with a service principal.
|
675
|
+
#
|
676
|
+
# @param object_id [String] The object ID of the service principal.
|
677
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
678
|
+
# will be added to the HTTP request.
|
679
|
+
#
|
680
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
681
|
+
#
|
682
|
+
def list_password_credentials_with_http_info(object_id, custom_headers:nil)
|
683
|
+
list_password_credentials_async(object_id, custom_headers:custom_headers).value!
|
684
|
+
end
|
685
|
+
|
686
|
+
#
|
687
|
+
# Gets the passwordCredentials associated with a service principal.
|
688
|
+
#
|
689
|
+
# @param object_id [String] The object ID of the service principal.
|
690
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
691
|
+
# to the HTTP request.
|
692
|
+
#
|
693
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
694
|
+
#
|
695
|
+
def list_password_credentials_async(object_id, custom_headers:nil)
|
696
|
+
fail ArgumentError, 'object_id is nil' if object_id.nil?
|
697
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
698
|
+
fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil?
|
699
|
+
|
700
|
+
|
701
|
+
request_headers = {}
|
702
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
703
|
+
|
704
|
+
# Set Headers
|
705
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
706
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
707
|
+
path_template = '{tenantID}/servicePrincipals/{objectId}/passwordCredentials'
|
708
|
+
|
709
|
+
request_url = @base_url || @client.base_url
|
710
|
+
|
711
|
+
options = {
|
712
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
713
|
+
path_params: {'objectId' => object_id,'tenantID' => @client.tenant_id},
|
714
|
+
query_params: {'api-version' => @client.api_version},
|
715
|
+
headers: request_headers.merge(custom_headers || {}),
|
716
|
+
base_url: request_url
|
717
|
+
}
|
718
|
+
promise = @client.make_request_async(:get, path_template, options)
|
719
|
+
|
720
|
+
promise = promise.then do |result|
|
721
|
+
http_response = result.response
|
722
|
+
status_code = http_response.status
|
723
|
+
response_content = http_response.body
|
724
|
+
unless status_code == 200
|
725
|
+
error_model = JSON.load(response_content)
|
726
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
727
|
+
end
|
728
|
+
|
729
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
730
|
+
# Deserialize Response
|
731
|
+
if status_code == 200
|
732
|
+
begin
|
733
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
734
|
+
result_mapper = Azure::GraphRbac::V1_6::Models::PasswordCredentialListResult.mapper()
|
735
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
736
|
+
rescue Exception => e
|
737
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
738
|
+
end
|
739
|
+
end
|
740
|
+
|
741
|
+
result
|
742
|
+
end
|
743
|
+
|
744
|
+
promise.execute
|
745
|
+
end
|
746
|
+
|
747
|
+
#
|
748
|
+
# Updates the passwordCredentials associated with a service principal.
|
749
|
+
#
|
750
|
+
# @param object_id [String] The object ID of the service principal.
|
751
|
+
# @param parameters [PasswordCredentialsUpdateParameters] Parameters to update
|
752
|
+
# the passwordCredentials of an existing service principal.
|
753
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
754
|
+
# will be added to the HTTP request.
|
755
|
+
#
|
756
|
+
#
|
757
|
+
def update_password_credentials(object_id, parameters, custom_headers:nil)
|
758
|
+
response = update_password_credentials_async(object_id, parameters, custom_headers:custom_headers).value!
|
759
|
+
nil
|
760
|
+
end
|
761
|
+
|
762
|
+
#
|
763
|
+
# Updates the passwordCredentials associated with a service principal.
|
764
|
+
#
|
765
|
+
# @param object_id [String] The object ID of the service principal.
|
766
|
+
# @param parameters [PasswordCredentialsUpdateParameters] Parameters to update
|
767
|
+
# the passwordCredentials of an existing service principal.
|
768
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
769
|
+
# will be added to the HTTP request.
|
770
|
+
#
|
771
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
772
|
+
#
|
773
|
+
def update_password_credentials_with_http_info(object_id, parameters, custom_headers:nil)
|
774
|
+
update_password_credentials_async(object_id, parameters, custom_headers:custom_headers).value!
|
775
|
+
end
|
776
|
+
|
777
|
+
#
|
778
|
+
# Updates the passwordCredentials associated with a service principal.
|
779
|
+
#
|
780
|
+
# @param object_id [String] The object ID of the service principal.
|
781
|
+
# @param parameters [PasswordCredentialsUpdateParameters] Parameters to update
|
782
|
+
# the passwordCredentials of an existing service principal.
|
783
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
784
|
+
# to the HTTP request.
|
785
|
+
#
|
786
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
787
|
+
#
|
788
|
+
def update_password_credentials_async(object_id, parameters, custom_headers:nil)
|
789
|
+
fail ArgumentError, 'object_id is nil' if object_id.nil?
|
790
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
791
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
792
|
+
fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil?
|
793
|
+
|
794
|
+
|
795
|
+
request_headers = {}
|
796
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
797
|
+
|
798
|
+
# Set Headers
|
799
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
800
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
801
|
+
|
802
|
+
# Serialize Request
|
803
|
+
request_mapper = Azure::GraphRbac::V1_6::Models::PasswordCredentialsUpdateParameters.mapper()
|
804
|
+
request_content = @client.serialize(request_mapper, parameters)
|
805
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
806
|
+
|
807
|
+
path_template = '{tenantID}/servicePrincipals/{objectId}/passwordCredentials'
|
808
|
+
|
809
|
+
request_url = @base_url || @client.base_url
|
810
|
+
|
811
|
+
options = {
|
812
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
813
|
+
path_params: {'objectId' => object_id,'tenantID' => @client.tenant_id},
|
814
|
+
query_params: {'api-version' => @client.api_version},
|
815
|
+
body: request_content,
|
816
|
+
headers: request_headers.merge(custom_headers || {}),
|
817
|
+
base_url: request_url
|
818
|
+
}
|
819
|
+
promise = @client.make_request_async(:patch, path_template, options)
|
820
|
+
|
821
|
+
promise = promise.then do |result|
|
822
|
+
http_response = result.response
|
823
|
+
status_code = http_response.status
|
824
|
+
response_content = http_response.body
|
825
|
+
unless status_code == 204
|
826
|
+
error_model = JSON.load(response_content)
|
827
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
828
|
+
end
|
829
|
+
|
830
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
831
|
+
|
832
|
+
result
|
833
|
+
end
|
834
|
+
|
835
|
+
promise.execute
|
836
|
+
end
|
837
|
+
|
838
|
+
#
|
839
|
+
# Gets a list of service principals from the current tenant.
|
840
|
+
#
|
841
|
+
# @param next_link [String] Next link for the list operation.
|
842
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
843
|
+
# will be added to the HTTP request.
|
844
|
+
#
|
845
|
+
# @return [Array<ServicePrincipal>] operation results.
|
846
|
+
#
|
847
|
+
def list_next(next_link, custom_headers:nil)
|
848
|
+
response = list_next_async(next_link, custom_headers:custom_headers).value!
|
849
|
+
response.body unless response.nil?
|
850
|
+
end
|
851
|
+
|
852
|
+
#
|
853
|
+
# Gets a list of service principals from the current tenant.
|
854
|
+
#
|
855
|
+
# @param next_link [String] Next link for the list operation.
|
856
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
857
|
+
# will be added to the HTTP request.
|
858
|
+
#
|
859
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
860
|
+
#
|
861
|
+
def list_next_with_http_info(next_link, custom_headers:nil)
|
862
|
+
list_next_async(next_link, custom_headers:custom_headers).value!
|
863
|
+
end
|
864
|
+
|
865
|
+
#
|
866
|
+
# Gets a list of service principals from the current tenant.
|
867
|
+
#
|
868
|
+
# @param next_link [String] Next link for the list operation.
|
869
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
870
|
+
# to the HTTP request.
|
871
|
+
#
|
872
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
873
|
+
#
|
874
|
+
def list_next_async(next_link, custom_headers:nil)
|
875
|
+
fail ArgumentError, 'next_link is nil' if next_link.nil?
|
876
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
877
|
+
fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil?
|
878
|
+
|
879
|
+
|
880
|
+
request_headers = {}
|
881
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
882
|
+
|
883
|
+
# Set Headers
|
884
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
885
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
886
|
+
path_template = '{tenantID}/{nextLink}'
|
887
|
+
|
888
|
+
request_url = @base_url || @client.base_url
|
889
|
+
|
890
|
+
options = {
|
891
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
892
|
+
path_params: {'tenantID' => @client.tenant_id},
|
893
|
+
skip_encoding_path_params: {'nextLink' => next_link},
|
894
|
+
query_params: {'api-version' => @client.api_version},
|
895
|
+
headers: request_headers.merge(custom_headers || {}),
|
896
|
+
base_url: request_url
|
897
|
+
}
|
898
|
+
promise = @client.make_request_async(:get, path_template, options)
|
899
|
+
|
900
|
+
promise = promise.then do |result|
|
901
|
+
http_response = result.response
|
902
|
+
status_code = http_response.status
|
903
|
+
response_content = http_response.body
|
904
|
+
unless status_code == 200
|
905
|
+
error_model = JSON.load(response_content)
|
906
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
907
|
+
end
|
908
|
+
|
909
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
910
|
+
# Deserialize Response
|
911
|
+
if status_code == 200
|
912
|
+
begin
|
913
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
914
|
+
result_mapper = Azure::GraphRbac::V1_6::Models::ServicePrincipalListResult.mapper()
|
915
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
916
|
+
rescue Exception => e
|
917
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
918
|
+
end
|
919
|
+
end
|
920
|
+
|
921
|
+
result
|
922
|
+
end
|
923
|
+
|
924
|
+
promise.execute
|
925
|
+
end
|
926
|
+
|
927
|
+
#
|
928
|
+
# Gets a list of service principals from the current tenant.
|
929
|
+
#
|
930
|
+
# @param filter [String] The filter to apply to the operation.
|
931
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
932
|
+
# will be added to the HTTP request.
|
933
|
+
#
|
934
|
+
# @return [ServicePrincipalListResult] which provide lazy access to pages of
|
935
|
+
# the response.
|
936
|
+
#
|
937
|
+
def list_as_lazy(filter:nil, custom_headers:nil)
|
938
|
+
response = list_async(filter:filter, custom_headers:custom_headers).value!
|
939
|
+
unless response.nil?
|
940
|
+
page = response.body
|
941
|
+
page.next_method = Proc.new do |next_link|
|
942
|
+
list_next_async(next_link, custom_headers:custom_headers)
|
943
|
+
end
|
944
|
+
page
|
945
|
+
end
|
946
|
+
end
|
947
|
+
|
948
|
+
end
|
949
|
+
end
|