azure_graph_rbac2 0.18.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 (60) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/lib/1.6/generated/azure_graph_rbac2/applications.rb +1131 -0
  4. data/lib/1.6/generated/azure_graph_rbac2/domains.rb +200 -0
  5. data/lib/1.6/generated/azure_graph_rbac2/graph_rbac_client.rb +151 -0
  6. data/lib/1.6/generated/azure_graph_rbac2/groups.rb +1079 -0
  7. data/lib/1.6/generated/azure_graph_rbac2/models/aadobject.rb +297 -0
  8. data/lib/1.6/generated/azure_graph_rbac2/models/adgroup.rb +116 -0
  9. data/lib/1.6/generated/azure_graph_rbac2/models/application.rb +196 -0
  10. data/lib/1.6/generated/azure_graph_rbac2/models/application_add_owner_parameters.rb +69 -0
  11. data/lib/1.6/generated/azure_graph_rbac2/models/application_create_parameters.rb +202 -0
  12. data/lib/1.6/generated/azure_graph_rbac2/models/application_list_result.rb +98 -0
  13. data/lib/1.6/generated/azure_graph_rbac2/models/application_update_parameters.rb +201 -0
  14. data/lib/1.6/generated/azure_graph_rbac2/models/check_group_membership_parameters.rb +77 -0
  15. data/lib/1.6/generated/azure_graph_rbac2/models/check_group_membership_result.rb +67 -0
  16. data/lib/1.6/generated/azure_graph_rbac2/models/directory_object.rb +92 -0
  17. data/lib/1.6/generated/azure_graph_rbac2/models/directory_object_list_result.rb +57 -0
  18. data/lib/1.6/generated/azure_graph_rbac2/models/domain.rb +101 -0
  19. data/lib/1.6/generated/azure_graph_rbac2/models/domain_list_result.rb +55 -0
  20. data/lib/1.6/generated/azure_graph_rbac2/models/get_objects_parameters.rb +104 -0
  21. data/lib/1.6/generated/azure_graph_rbac2/models/get_objects_result.rb +98 -0
  22. data/lib/1.6/generated/azure_graph_rbac2/models/graph_error.rb +57 -0
  23. data/lib/1.6/generated/azure_graph_rbac2/models/group_add_member_parameters.rb +69 -0
  24. data/lib/1.6/generated/azure_graph_rbac2/models/group_create_parameters.rb +106 -0
  25. data/lib/1.6/generated/azure_graph_rbac2/models/group_get_member_groups_parameters.rb +67 -0
  26. data/lib/1.6/generated/azure_graph_rbac2/models/group_get_member_groups_result.rb +55 -0
  27. data/lib/1.6/generated/azure_graph_rbac2/models/group_list_result.rb +98 -0
  28. data/lib/1.6/generated/azure_graph_rbac2/models/key_credential.rb +132 -0
  29. data/lib/1.6/generated/azure_graph_rbac2/models/key_credential_list_result.rb +55 -0
  30. data/lib/1.6/generated/azure_graph_rbac2/models/key_credentials_update_parameters.rb +55 -0
  31. data/lib/1.6/generated/azure_graph_rbac2/models/password_credential.rb +98 -0
  32. data/lib/1.6/generated/azure_graph_rbac2/models/password_credential_list_result.rb +56 -0
  33. data/lib/1.6/generated/azure_graph_rbac2/models/password_credentials_update_parameters.rb +56 -0
  34. data/lib/1.6/generated/azure_graph_rbac2/models/password_profile.rb +76 -0
  35. data/lib/1.6/generated/azure_graph_rbac2/models/required_resource_access.rb +94 -0
  36. data/lib/1.6/generated/azure_graph_rbac2/models/resource_access.rb +80 -0
  37. data/lib/1.6/generated/azure_graph_rbac2/models/service_principal.rb +124 -0
  38. data/lib/1.6/generated/azure_graph_rbac2/models/service_principal_create_parameters.rb +117 -0
  39. data/lib/1.6/generated/azure_graph_rbac2/models/service_principal_list_result.rb +98 -0
  40. data/lib/1.6/generated/azure_graph_rbac2/models/sign_in_name.rb +79 -0
  41. data/lib/1.6/generated/azure_graph_rbac2/models/user.rb +221 -0
  42. data/lib/1.6/generated/azure_graph_rbac2/models/user_base.rb +118 -0
  43. data/lib/1.6/generated/azure_graph_rbac2/models/user_create_parameters.rb +158 -0
  44. data/lib/1.6/generated/azure_graph_rbac2/models/user_get_member_groups_parameters.rb +67 -0
  45. data/lib/1.6/generated/azure_graph_rbac2/models/user_get_member_groups_result.rb +55 -0
  46. data/lib/1.6/generated/azure_graph_rbac2/models/user_list_result.rb +98 -0
  47. data/lib/1.6/generated/azure_graph_rbac2/models/user_type.rb +16 -0
  48. data/lib/1.6/generated/azure_graph_rbac2/models/user_update_parameters.rb +147 -0
  49. data/lib/1.6/generated/azure_graph_rbac2/module_definition.rb +8 -0
  50. data/lib/1.6/generated/azure_graph_rbac2/objects.rb +314 -0
  51. data/lib/1.6/generated/azure_graph_rbac2/service_principals.rb +949 -0
  52. data/lib/1.6/generated/azure_graph_rbac2/users.rb +686 -0
  53. data/lib/1.6/generated/azure_graph_rbac2.rb +75 -0
  54. data/lib/azure_graph_rbac2.rb +6 -0
  55. data/lib/module_definition.rb +6 -0
  56. data/lib/profiles/latest/graphrbac_latest_profile_client.rb +38 -0
  57. data/lib/profiles/latest/graphrbac_module_definition.rb +8 -0
  58. data/lib/profiles/latest/modules/graphrbac_profile_module.rb +237 -0
  59. data/lib/version.rb +7 -0
  60. metadata +190 -0
@@ -0,0 +1,1079 @@
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::GraphRbac2::V1_6
7
+ #
8
+ # The Graph RBAC Management Client
9
+ #
10
+ class Groups
11
+ include MsRestAzure2
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Groups 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
+ # Checks whether the specified user, group, contact, or service principal is a
26
+ # direct or transitive member of the specified group.
27
+ #
28
+ # @param parameters [CheckGroupMembershipParameters] The check group membership
29
+ # parameters.
30
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
31
+ # will be added to the HTTP request.
32
+ #
33
+ # @return [CheckGroupMembershipResult] operation results.
34
+ #
35
+ def is_member_of(parameters, custom_headers:nil)
36
+ response = is_member_of_async(parameters, custom_headers:custom_headers).value!
37
+ response.body unless response.nil?
38
+ end
39
+
40
+ #
41
+ # Checks whether the specified user, group, contact, or service principal is a
42
+ # direct or transitive member of the specified group.
43
+ #
44
+ # @param parameters [CheckGroupMembershipParameters] The check group membership
45
+ # parameters.
46
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
47
+ # will be added to the HTTP request.
48
+ #
49
+ # @return [MsRestAzure2::AzureOperationResponse] HTTP response information.
50
+ #
51
+ def is_member_of_with_http_info(parameters, custom_headers:nil)
52
+ is_member_of_async(parameters, custom_headers:custom_headers).value!
53
+ end
54
+
55
+ #
56
+ # Checks whether the specified user, group, contact, or service principal is a
57
+ # direct or transitive member of the specified group.
58
+ #
59
+ # @param parameters [CheckGroupMembershipParameters] The check group membership
60
+ # parameters.
61
+ # @param [Hash{String => String}] A hash of custom headers that will be added
62
+ # to the HTTP request.
63
+ #
64
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
65
+ #
66
+ def is_member_of_async(parameters, custom_headers:nil)
67
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
68
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
69
+ fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil?
70
+
71
+
72
+ request_headers = {}
73
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
74
+
75
+ # Set Headers
76
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
77
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
78
+
79
+ # Serialize Request
80
+ request_mapper = Azure::GraphRbac2::V1_6::Models::CheckGroupMembershipParameters.mapper()
81
+ request_content = @client.serialize(request_mapper, parameters)
82
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
83
+
84
+ path_template = '{tenantID}/isMemberOf'
85
+
86
+ request_url = @base_url || @client.base_url
87
+
88
+ options = {
89
+ middlewares: [[MsRest2::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
90
+ path_params: {'tenantID' => @client.tenant_id},
91
+ query_params: {'api-version' => @client.api_version},
92
+ body: request_content,
93
+ headers: request_headers.merge(custom_headers || {}),
94
+ base_url: request_url
95
+ }
96
+ promise = @client.make_request_async(:post, path_template, options)
97
+
98
+ promise = promise.then do |result|
99
+ http_response = result.response
100
+ status_code = http_response.status
101
+ response_content = http_response.body
102
+ unless status_code == 200
103
+ error_model = JSON.load(response_content)
104
+ fail MsRest2::HttpOperationError.new(result.request, http_response, error_model)
105
+ end
106
+
107
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
108
+ # Deserialize Response
109
+ if status_code == 200
110
+ begin
111
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
112
+ result_mapper = Azure::GraphRbac2::V1_6::Models::CheckGroupMembershipResult.mapper()
113
+ result.body = @client.deserialize(result_mapper, parsed_response)
114
+ rescue Exception => e
115
+ fail MsRest2::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
116
+ end
117
+ end
118
+
119
+ result
120
+ end
121
+
122
+ promise.execute
123
+ end
124
+
125
+ #
126
+ # Remove a member from a group.
127
+ #
128
+ # @param group_object_id [String] The object ID of the group from which to
129
+ # remove the member.
130
+ # @param member_object_id [String] Member object id
131
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
132
+ # will be added to the HTTP request.
133
+ #
134
+ #
135
+ def remove_member(group_object_id, member_object_id, custom_headers:nil)
136
+ response = remove_member_async(group_object_id, member_object_id, custom_headers:custom_headers).value!
137
+ nil
138
+ end
139
+
140
+ #
141
+ # Remove a member from a group.
142
+ #
143
+ # @param group_object_id [String] The object ID of the group from which to
144
+ # remove the member.
145
+ # @param member_object_id [String] Member object id
146
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
147
+ # will be added to the HTTP request.
148
+ #
149
+ # @return [MsRestAzure2::AzureOperationResponse] HTTP response information.
150
+ #
151
+ def remove_member_with_http_info(group_object_id, member_object_id, custom_headers:nil)
152
+ remove_member_async(group_object_id, member_object_id, custom_headers:custom_headers).value!
153
+ end
154
+
155
+ #
156
+ # Remove a member from a group.
157
+ #
158
+ # @param group_object_id [String] The object ID of the group from which to
159
+ # remove the member.
160
+ # @param member_object_id [String] Member object id
161
+ # @param [Hash{String => String}] A hash of custom headers that will be added
162
+ # to the HTTP request.
163
+ #
164
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
165
+ #
166
+ def remove_member_async(group_object_id, member_object_id, custom_headers:nil)
167
+ fail ArgumentError, 'group_object_id is nil' if group_object_id.nil?
168
+ fail ArgumentError, 'member_object_id is nil' if member_object_id.nil?
169
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
170
+ fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil?
171
+
172
+
173
+ request_headers = {}
174
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
175
+
176
+ # Set Headers
177
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
178
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
179
+ path_template = '{tenantID}/groups/{groupObjectId}/$links/members/{memberObjectId}'
180
+
181
+ request_url = @base_url || @client.base_url
182
+
183
+ options = {
184
+ middlewares: [[MsRest2::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
185
+ path_params: {'groupObjectId' => group_object_id,'memberObjectId' => member_object_id,'tenantID' => @client.tenant_id},
186
+ query_params: {'api-version' => @client.api_version},
187
+ headers: request_headers.merge(custom_headers || {}),
188
+ base_url: request_url
189
+ }
190
+ promise = @client.make_request_async(:delete, path_template, options)
191
+
192
+ promise = promise.then do |result|
193
+ http_response = result.response
194
+ status_code = http_response.status
195
+ response_content = http_response.body
196
+ unless status_code == 204
197
+ error_model = JSON.load(response_content)
198
+ fail MsRest2::HttpOperationError.new(result.request, http_response, error_model)
199
+ end
200
+
201
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
202
+
203
+ result
204
+ end
205
+
206
+ promise.execute
207
+ end
208
+
209
+ #
210
+ # Add a member to a group.
211
+ #
212
+ # @param group_object_id [String] The object ID of the group to which to add
213
+ # the member.
214
+ # @param parameters [GroupAddMemberParameters] The URL of the member object,
215
+ # such as
216
+ # https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd.
217
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
218
+ # will be added to the HTTP request.
219
+ #
220
+ #
221
+ def add_member(group_object_id, parameters, custom_headers:nil)
222
+ response = add_member_async(group_object_id, parameters, custom_headers:custom_headers).value!
223
+ nil
224
+ end
225
+
226
+ #
227
+ # Add a member to a group.
228
+ #
229
+ # @param group_object_id [String] The object ID of the group to which to add
230
+ # the member.
231
+ # @param parameters [GroupAddMemberParameters] The URL of the member object,
232
+ # such as
233
+ # https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd.
234
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
235
+ # will be added to the HTTP request.
236
+ #
237
+ # @return [MsRestAzure2::AzureOperationResponse] HTTP response information.
238
+ #
239
+ def add_member_with_http_info(group_object_id, parameters, custom_headers:nil)
240
+ add_member_async(group_object_id, parameters, custom_headers:custom_headers).value!
241
+ end
242
+
243
+ #
244
+ # Add a member to a group.
245
+ #
246
+ # @param group_object_id [String] The object ID of the group to which to add
247
+ # the member.
248
+ # @param parameters [GroupAddMemberParameters] The URL of the member object,
249
+ # such as
250
+ # https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd.
251
+ # @param [Hash{String => String}] A hash of custom headers that will be added
252
+ # to the HTTP request.
253
+ #
254
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
255
+ #
256
+ def add_member_async(group_object_id, parameters, custom_headers:nil)
257
+ fail ArgumentError, 'group_object_id is nil' if group_object_id.nil?
258
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
259
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
260
+ fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil?
261
+
262
+
263
+ request_headers = {}
264
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
265
+
266
+ # Set Headers
267
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
268
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
269
+
270
+ # Serialize Request
271
+ request_mapper = Azure::GraphRbac2::V1_6::Models::GroupAddMemberParameters.mapper()
272
+ request_content = @client.serialize(request_mapper, parameters)
273
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
274
+
275
+ path_template = '{tenantID}/groups/{groupObjectId}/$links/members'
276
+
277
+ request_url = @base_url || @client.base_url
278
+
279
+ options = {
280
+ middlewares: [[MsRest2::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
281
+ path_params: {'groupObjectId' => group_object_id,'tenantID' => @client.tenant_id},
282
+ query_params: {'api-version' => @client.api_version},
283
+ body: request_content,
284
+ headers: request_headers.merge(custom_headers || {}),
285
+ base_url: request_url
286
+ }
287
+ promise = @client.make_request_async(:post, path_template, options)
288
+
289
+ promise = promise.then do |result|
290
+ http_response = result.response
291
+ status_code = http_response.status
292
+ response_content = http_response.body
293
+ unless status_code == 204
294
+ error_model = JSON.load(response_content)
295
+ fail MsRest2::HttpOperationError.new(result.request, http_response, error_model)
296
+ end
297
+
298
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
299
+
300
+ result
301
+ end
302
+
303
+ promise.execute
304
+ end
305
+
306
+ #
307
+ # Create a group in the directory.
308
+ #
309
+ # @param parameters [GroupCreateParameters] The parameters for the group to
310
+ # create.
311
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
312
+ # will be added to the HTTP request.
313
+ #
314
+ # @return [ADGroup] operation results.
315
+ #
316
+ def create(parameters, custom_headers:nil)
317
+ response = create_async(parameters, custom_headers:custom_headers).value!
318
+ response.body unless response.nil?
319
+ end
320
+
321
+ #
322
+ # Create a group in the directory.
323
+ #
324
+ # @param parameters [GroupCreateParameters] The parameters for the group to
325
+ # create.
326
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
327
+ # will be added to the HTTP request.
328
+ #
329
+ # @return [MsRestAzure2::AzureOperationResponse] HTTP response information.
330
+ #
331
+ def create_with_http_info(parameters, custom_headers:nil)
332
+ create_async(parameters, custom_headers:custom_headers).value!
333
+ end
334
+
335
+ #
336
+ # Create a group in the directory.
337
+ #
338
+ # @param parameters [GroupCreateParameters] The parameters for the group to
339
+ # create.
340
+ # @param [Hash{String => String}] A hash of custom headers that will be added
341
+ # to the HTTP request.
342
+ #
343
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
344
+ #
345
+ def create_async(parameters, custom_headers:nil)
346
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
347
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
348
+ fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil?
349
+
350
+
351
+ request_headers = {}
352
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
353
+
354
+ # Set Headers
355
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
356
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
357
+
358
+ # Serialize Request
359
+ request_mapper = Azure::GraphRbac2::V1_6::Models::GroupCreateParameters.mapper()
360
+ request_content = @client.serialize(request_mapper, parameters)
361
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
362
+
363
+ path_template = '{tenantID}/groups'
364
+
365
+ request_url = @base_url || @client.base_url
366
+
367
+ options = {
368
+ middlewares: [[MsRest2::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
369
+ path_params: {'tenantID' => @client.tenant_id},
370
+ query_params: {'api-version' => @client.api_version},
371
+ body: request_content,
372
+ headers: request_headers.merge(custom_headers || {}),
373
+ base_url: request_url
374
+ }
375
+ promise = @client.make_request_async(:post, path_template, options)
376
+
377
+ promise = promise.then do |result|
378
+ http_response = result.response
379
+ status_code = http_response.status
380
+ response_content = http_response.body
381
+ unless status_code == 201
382
+ error_model = JSON.load(response_content)
383
+ fail MsRest2::HttpOperationError.new(result.request, http_response, error_model)
384
+ end
385
+
386
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
387
+ # Deserialize Response
388
+ if status_code == 201
389
+ begin
390
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
391
+ result_mapper = Azure::GraphRbac2::V1_6::Models::ADGroup.mapper()
392
+ result.body = @client.deserialize(result_mapper, parsed_response)
393
+ rescue Exception => e
394
+ fail MsRest2::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
395
+ end
396
+ end
397
+
398
+ result
399
+ end
400
+
401
+ promise.execute
402
+ end
403
+
404
+ #
405
+ # Gets list of groups for the current tenant.
406
+ #
407
+ # @param filter [String] The filter to apply to the operation.
408
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
409
+ # will be added to the HTTP request.
410
+ #
411
+ # @return [Array<ADGroup>] operation results.
412
+ #
413
+ def list(filter:nil, custom_headers:nil)
414
+ first_page = list_as_lazy(filter:filter, custom_headers:custom_headers)
415
+ first_page.get_all_items
416
+ end
417
+
418
+ #
419
+ # Gets list of groups for the current tenant.
420
+ #
421
+ # @param filter [String] The filter to apply to the operation.
422
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
423
+ # will be added to the HTTP request.
424
+ #
425
+ # @return [MsRestAzure2::AzureOperationResponse] HTTP response information.
426
+ #
427
+ def list_with_http_info(filter:nil, custom_headers:nil)
428
+ list_async(filter:filter, custom_headers:custom_headers).value!
429
+ end
430
+
431
+ #
432
+ # Gets list of groups for the current tenant.
433
+ #
434
+ # @param filter [String] The filter to apply to the operation.
435
+ # @param [Hash{String => String}] A hash of custom headers that will be added
436
+ # to the HTTP request.
437
+ #
438
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
439
+ #
440
+ def list_async(filter:nil, custom_headers:nil)
441
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
442
+ fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil?
443
+
444
+
445
+ request_headers = {}
446
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
447
+
448
+ # Set Headers
449
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
450
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
451
+ path_template = '{tenantID}/groups'
452
+
453
+ request_url = @base_url || @client.base_url
454
+
455
+ options = {
456
+ middlewares: [[MsRest2::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
457
+ path_params: {'tenantID' => @client.tenant_id},
458
+ query_params: {'$filter' => filter,'api-version' => @client.api_version},
459
+ headers: request_headers.merge(custom_headers || {}),
460
+ base_url: request_url
461
+ }
462
+ promise = @client.make_request_async(:get, path_template, options)
463
+
464
+ promise = promise.then do |result|
465
+ http_response = result.response
466
+ status_code = http_response.status
467
+ response_content = http_response.body
468
+ unless status_code == 200
469
+ error_model = JSON.load(response_content)
470
+ fail MsRest2::HttpOperationError.new(result.request, http_response, error_model)
471
+ end
472
+
473
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
474
+ # Deserialize Response
475
+ if status_code == 200
476
+ begin
477
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
478
+ result_mapper = Azure::GraphRbac2::V1_6::Models::GroupListResult.mapper()
479
+ result.body = @client.deserialize(result_mapper, parsed_response)
480
+ rescue Exception => e
481
+ fail MsRest2::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
482
+ end
483
+ end
484
+
485
+ result
486
+ end
487
+
488
+ promise.execute
489
+ end
490
+
491
+ #
492
+ # Gets the members of a group.
493
+ #
494
+ # @param object_id [String] The object ID of the group whose members should be
495
+ # retrieved.
496
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
497
+ # will be added to the HTTP request.
498
+ #
499
+ # @return [Array<AADObject>] operation results.
500
+ #
501
+ def get_group_members(object_id, custom_headers:nil)
502
+ first_page = get_group_members_as_lazy(object_id, custom_headers:custom_headers)
503
+ first_page.get_all_items
504
+ end
505
+
506
+ #
507
+ # Gets the members of a group.
508
+ #
509
+ # @param object_id [String] The object ID of the group whose members should be
510
+ # retrieved.
511
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
512
+ # will be added to the HTTP request.
513
+ #
514
+ # @return [MsRestAzure2::AzureOperationResponse] HTTP response information.
515
+ #
516
+ def get_group_members_with_http_info(object_id, custom_headers:nil)
517
+ get_group_members_async(object_id, custom_headers:custom_headers).value!
518
+ end
519
+
520
+ #
521
+ # Gets the members of a group.
522
+ #
523
+ # @param object_id [String] The object ID of the group whose members should be
524
+ # retrieved.
525
+ # @param [Hash{String => String}] A hash of custom headers that will be added
526
+ # to the HTTP request.
527
+ #
528
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
529
+ #
530
+ def get_group_members_async(object_id, custom_headers:nil)
531
+ fail ArgumentError, 'object_id is nil' if object_id.nil?
532
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
533
+ fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil?
534
+
535
+
536
+ request_headers = {}
537
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
538
+
539
+ # Set Headers
540
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
541
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
542
+ path_template = '{tenantID}/groups/{objectId}/members'
543
+
544
+ request_url = @base_url || @client.base_url
545
+
546
+ options = {
547
+ middlewares: [[MsRest2::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
548
+ path_params: {'objectId' => object_id,'tenantID' => @client.tenant_id},
549
+ query_params: {'api-version' => @client.api_version},
550
+ headers: request_headers.merge(custom_headers || {}),
551
+ base_url: request_url
552
+ }
553
+ promise = @client.make_request_async(:get, path_template, options)
554
+
555
+ promise = promise.then do |result|
556
+ http_response = result.response
557
+ status_code = http_response.status
558
+ response_content = http_response.body
559
+ unless status_code == 200
560
+ error_model = JSON.load(response_content)
561
+ fail MsRest2::HttpOperationError.new(result.request, http_response, error_model)
562
+ end
563
+
564
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
565
+ # Deserialize Response
566
+ if status_code == 200
567
+ begin
568
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
569
+ result_mapper = Azure::GraphRbac2::V1_6::Models::GetObjectsResult.mapper()
570
+ result.body = @client.deserialize(result_mapper, parsed_response)
571
+ rescue Exception => e
572
+ fail MsRest2::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
573
+ end
574
+ end
575
+
576
+ result
577
+ end
578
+
579
+ promise.execute
580
+ end
581
+
582
+ #
583
+ # Gets group information from the directory.
584
+ #
585
+ # @param object_id [String] The object ID of the user for which to get group
586
+ # information.
587
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
588
+ # will be added to the HTTP request.
589
+ #
590
+ # @return [ADGroup] operation results.
591
+ #
592
+ def get(object_id, custom_headers:nil)
593
+ response = get_async(object_id, custom_headers:custom_headers).value!
594
+ response.body unless response.nil?
595
+ end
596
+
597
+ #
598
+ # Gets group information from the directory.
599
+ #
600
+ # @param object_id [String] The object ID of the user for which to get group
601
+ # information.
602
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
603
+ # will be added to the HTTP request.
604
+ #
605
+ # @return [MsRestAzure2::AzureOperationResponse] HTTP response information.
606
+ #
607
+ def get_with_http_info(object_id, custom_headers:nil)
608
+ get_async(object_id, custom_headers:custom_headers).value!
609
+ end
610
+
611
+ #
612
+ # Gets group information from the directory.
613
+ #
614
+ # @param object_id [String] The object ID of the user for which to get group
615
+ # information.
616
+ # @param [Hash{String => String}] A hash of custom headers that will be added
617
+ # to the HTTP request.
618
+ #
619
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
620
+ #
621
+ def get_async(object_id, custom_headers:nil)
622
+ fail ArgumentError, 'object_id is nil' if object_id.nil?
623
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
624
+ fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil?
625
+
626
+
627
+ request_headers = {}
628
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
629
+
630
+ # Set Headers
631
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
632
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
633
+ path_template = '{tenantID}/groups/{objectId}'
634
+
635
+ request_url = @base_url || @client.base_url
636
+
637
+ options = {
638
+ middlewares: [[MsRest2::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
639
+ path_params: {'objectId' => object_id,'tenantID' => @client.tenant_id},
640
+ query_params: {'api-version' => @client.api_version},
641
+ headers: request_headers.merge(custom_headers || {}),
642
+ base_url: request_url
643
+ }
644
+ promise = @client.make_request_async(:get, path_template, options)
645
+
646
+ promise = promise.then do |result|
647
+ http_response = result.response
648
+ status_code = http_response.status
649
+ response_content = http_response.body
650
+ unless status_code == 200
651
+ error_model = JSON.load(response_content)
652
+ fail MsRest2::HttpOperationError.new(result.request, http_response, error_model)
653
+ end
654
+
655
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
656
+ # Deserialize Response
657
+ if status_code == 200
658
+ begin
659
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
660
+ result_mapper = Azure::GraphRbac2::V1_6::Models::ADGroup.mapper()
661
+ result.body = @client.deserialize(result_mapper, parsed_response)
662
+ rescue Exception => e
663
+ fail MsRest2::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
664
+ end
665
+ end
666
+
667
+ result
668
+ end
669
+
670
+ promise.execute
671
+ end
672
+
673
+ #
674
+ # Delete a group from the directory.
675
+ #
676
+ # @param object_id [String] The object ID of the group to delete.
677
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
678
+ # will be added to the HTTP request.
679
+ #
680
+ #
681
+ def delete(object_id, custom_headers:nil)
682
+ response = delete_async(object_id, custom_headers:custom_headers).value!
683
+ nil
684
+ end
685
+
686
+ #
687
+ # Delete a group from the directory.
688
+ #
689
+ # @param object_id [String] The object ID of the group to delete.
690
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
691
+ # will be added to the HTTP request.
692
+ #
693
+ # @return [MsRestAzure2::AzureOperationResponse] HTTP response information.
694
+ #
695
+ def delete_with_http_info(object_id, custom_headers:nil)
696
+ delete_async(object_id, custom_headers:custom_headers).value!
697
+ end
698
+
699
+ #
700
+ # Delete a group from the directory.
701
+ #
702
+ # @param object_id [String] The object ID of the group to delete.
703
+ # @param [Hash{String => String}] A hash of custom headers that will be added
704
+ # to the HTTP request.
705
+ #
706
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
707
+ #
708
+ def delete_async(object_id, custom_headers:nil)
709
+ fail ArgumentError, 'object_id is nil' if object_id.nil?
710
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
711
+ fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil?
712
+
713
+
714
+ request_headers = {}
715
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
716
+
717
+ # Set Headers
718
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
719
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
720
+ path_template = '{tenantID}/groups/{objectId}'
721
+
722
+ request_url = @base_url || @client.base_url
723
+
724
+ options = {
725
+ middlewares: [[MsRest2::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
726
+ path_params: {'objectId' => object_id,'tenantID' => @client.tenant_id},
727
+ query_params: {'api-version' => @client.api_version},
728
+ headers: request_headers.merge(custom_headers || {}),
729
+ base_url: request_url
730
+ }
731
+ promise = @client.make_request_async(:delete, path_template, options)
732
+
733
+ promise = promise.then do |result|
734
+ http_response = result.response
735
+ status_code = http_response.status
736
+ response_content = http_response.body
737
+ unless status_code == 204
738
+ error_model = JSON.load(response_content)
739
+ fail MsRest2::HttpOperationError.new(result.request, http_response, error_model)
740
+ end
741
+
742
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
743
+
744
+ result
745
+ end
746
+
747
+ promise.execute
748
+ end
749
+
750
+ #
751
+ # Gets a collection of object IDs of groups of which the specified group is a
752
+ # member.
753
+ #
754
+ # @param object_id [String] The object ID of the group for which to get group
755
+ # membership.
756
+ # @param parameters [GroupGetMemberGroupsParameters] Group filtering
757
+ # parameters.
758
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
759
+ # will be added to the HTTP request.
760
+ #
761
+ # @return [GroupGetMemberGroupsResult] operation results.
762
+ #
763
+ def get_member_groups(object_id, parameters, custom_headers:nil)
764
+ response = get_member_groups_async(object_id, parameters, custom_headers:custom_headers).value!
765
+ response.body unless response.nil?
766
+ end
767
+
768
+ #
769
+ # Gets a collection of object IDs of groups of which the specified group is a
770
+ # member.
771
+ #
772
+ # @param object_id [String] The object ID of the group for which to get group
773
+ # membership.
774
+ # @param parameters [GroupGetMemberGroupsParameters] Group filtering
775
+ # parameters.
776
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
777
+ # will be added to the HTTP request.
778
+ #
779
+ # @return [MsRestAzure2::AzureOperationResponse] HTTP response information.
780
+ #
781
+ def get_member_groups_with_http_info(object_id, parameters, custom_headers:nil)
782
+ get_member_groups_async(object_id, parameters, custom_headers:custom_headers).value!
783
+ end
784
+
785
+ #
786
+ # Gets a collection of object IDs of groups of which the specified group is a
787
+ # member.
788
+ #
789
+ # @param object_id [String] The object ID of the group for which to get group
790
+ # membership.
791
+ # @param parameters [GroupGetMemberGroupsParameters] Group filtering
792
+ # parameters.
793
+ # @param [Hash{String => String}] A hash of custom headers that will be added
794
+ # to the HTTP request.
795
+ #
796
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
797
+ #
798
+ def get_member_groups_async(object_id, parameters, custom_headers:nil)
799
+ fail ArgumentError, 'object_id is nil' if object_id.nil?
800
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
801
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
802
+ fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil?
803
+
804
+
805
+ request_headers = {}
806
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
807
+
808
+ # Set Headers
809
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
810
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
811
+
812
+ # Serialize Request
813
+ request_mapper = Azure::GraphRbac2::V1_6::Models::GroupGetMemberGroupsParameters.mapper()
814
+ request_content = @client.serialize(request_mapper, parameters)
815
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
816
+
817
+ path_template = '{tenantID}/groups/{objectId}/getMemberGroups'
818
+
819
+ request_url = @base_url || @client.base_url
820
+
821
+ options = {
822
+ middlewares: [[MsRest2::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
823
+ path_params: {'objectId' => object_id,'tenantID' => @client.tenant_id},
824
+ query_params: {'api-version' => @client.api_version},
825
+ body: request_content,
826
+ headers: request_headers.merge(custom_headers || {}),
827
+ base_url: request_url
828
+ }
829
+ promise = @client.make_request_async(:post, path_template, options)
830
+
831
+ promise = promise.then do |result|
832
+ http_response = result.response
833
+ status_code = http_response.status
834
+ response_content = http_response.body
835
+ unless status_code == 200
836
+ error_model = JSON.load(response_content)
837
+ fail MsRest2::HttpOperationError.new(result.request, http_response, error_model)
838
+ end
839
+
840
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
841
+ # Deserialize Response
842
+ if status_code == 200
843
+ begin
844
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
845
+ result_mapper = Azure::GraphRbac2::V1_6::Models::GroupGetMemberGroupsResult.mapper()
846
+ result.body = @client.deserialize(result_mapper, parsed_response)
847
+ rescue Exception => e
848
+ fail MsRest2::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
849
+ end
850
+ end
851
+
852
+ result
853
+ end
854
+
855
+ promise.execute
856
+ end
857
+
858
+ #
859
+ # Gets a list of groups for the current tenant.
860
+ #
861
+ # @param next_link [String] Next link for the list operation.
862
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
863
+ # will be added to the HTTP request.
864
+ #
865
+ # @return [Array<ADGroup>] operation results.
866
+ #
867
+ def list_next(next_link, custom_headers:nil)
868
+ response = list_next_async(next_link, custom_headers:custom_headers).value!
869
+ response.body unless response.nil?
870
+ end
871
+
872
+ #
873
+ # Gets a list of groups for the current tenant.
874
+ #
875
+ # @param next_link [String] Next link for the list operation.
876
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
877
+ # will be added to the HTTP request.
878
+ #
879
+ # @return [MsRestAzure2::AzureOperationResponse] HTTP response information.
880
+ #
881
+ def list_next_with_http_info(next_link, custom_headers:nil)
882
+ list_next_async(next_link, custom_headers:custom_headers).value!
883
+ end
884
+
885
+ #
886
+ # Gets a list of groups for the current tenant.
887
+ #
888
+ # @param next_link [String] Next link for the list operation.
889
+ # @param [Hash{String => String}] A hash of custom headers that will be added
890
+ # to the HTTP request.
891
+ #
892
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
893
+ #
894
+ def list_next_async(next_link, custom_headers:nil)
895
+ fail ArgumentError, 'next_link is nil' if next_link.nil?
896
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
897
+ fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil?
898
+
899
+
900
+ request_headers = {}
901
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
902
+
903
+ # Set Headers
904
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
905
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
906
+ path_template = '{tenantID}/{nextLink}'
907
+
908
+ request_url = @base_url || @client.base_url
909
+
910
+ options = {
911
+ middlewares: [[MsRest2::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
912
+ path_params: {'tenantID' => @client.tenant_id},
913
+ skip_encoding_path_params: {'nextLink' => next_link},
914
+ query_params: {'api-version' => @client.api_version},
915
+ headers: request_headers.merge(custom_headers || {}),
916
+ base_url: request_url
917
+ }
918
+ promise = @client.make_request_async(:get, path_template, options)
919
+
920
+ promise = promise.then do |result|
921
+ http_response = result.response
922
+ status_code = http_response.status
923
+ response_content = http_response.body
924
+ unless status_code == 200
925
+ error_model = JSON.load(response_content)
926
+ fail MsRest2::HttpOperationError.new(result.request, http_response, error_model)
927
+ end
928
+
929
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
930
+ # Deserialize Response
931
+ if status_code == 200
932
+ begin
933
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
934
+ result_mapper = Azure::GraphRbac2::V1_6::Models::GroupListResult.mapper()
935
+ result.body = @client.deserialize(result_mapper, parsed_response)
936
+ rescue Exception => e
937
+ fail MsRest2::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
938
+ end
939
+ end
940
+
941
+ result
942
+ end
943
+
944
+ promise.execute
945
+ end
946
+
947
+ #
948
+ # Gets the members of a group.
949
+ #
950
+ # @param next_link [String] Next link for the list operation.
951
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
952
+ # will be added to the HTTP request.
953
+ #
954
+ # @return [Array<AADObject>] operation results.
955
+ #
956
+ def get_group_members_next(next_link, custom_headers:nil)
957
+ response = get_group_members_next_async(next_link, custom_headers:custom_headers).value!
958
+ response.body unless response.nil?
959
+ end
960
+
961
+ #
962
+ # Gets the members of a group.
963
+ #
964
+ # @param next_link [String] Next link for the list operation.
965
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
966
+ # will be added to the HTTP request.
967
+ #
968
+ # @return [MsRestAzure2::AzureOperationResponse] HTTP response information.
969
+ #
970
+ def get_group_members_next_with_http_info(next_link, custom_headers:nil)
971
+ get_group_members_next_async(next_link, custom_headers:custom_headers).value!
972
+ end
973
+
974
+ #
975
+ # Gets the members of a group.
976
+ #
977
+ # @param next_link [String] Next link for the list operation.
978
+ # @param [Hash{String => String}] A hash of custom headers that will be added
979
+ # to the HTTP request.
980
+ #
981
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
982
+ #
983
+ def get_group_members_next_async(next_link, custom_headers:nil)
984
+ fail ArgumentError, 'next_link is nil' if next_link.nil?
985
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
986
+ fail ArgumentError, '@client.tenant_id is nil' if @client.tenant_id.nil?
987
+
988
+
989
+ request_headers = {}
990
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
991
+
992
+ # Set Headers
993
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
994
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
995
+ path_template = '{tenantID}/{nextLink}'
996
+
997
+ request_url = @base_url || @client.base_url
998
+
999
+ options = {
1000
+ middlewares: [[MsRest2::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1001
+ path_params: {'tenantID' => @client.tenant_id},
1002
+ skip_encoding_path_params: {'nextLink' => next_link},
1003
+ query_params: {'api-version' => @client.api_version},
1004
+ headers: request_headers.merge(custom_headers || {}),
1005
+ base_url: request_url
1006
+ }
1007
+ promise = @client.make_request_async(:get, path_template, options)
1008
+
1009
+ promise = promise.then do |result|
1010
+ http_response = result.response
1011
+ status_code = http_response.status
1012
+ response_content = http_response.body
1013
+ unless status_code == 200
1014
+ error_model = JSON.load(response_content)
1015
+ fail MsRest2::HttpOperationError.new(result.request, http_response, error_model)
1016
+ end
1017
+
1018
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1019
+ # Deserialize Response
1020
+ if status_code == 200
1021
+ begin
1022
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1023
+ result_mapper = Azure::GraphRbac2::V1_6::Models::GetObjectsResult.mapper()
1024
+ result.body = @client.deserialize(result_mapper, parsed_response)
1025
+ rescue Exception => e
1026
+ fail MsRest2::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1027
+ end
1028
+ end
1029
+
1030
+ result
1031
+ end
1032
+
1033
+ promise.execute
1034
+ end
1035
+
1036
+ #
1037
+ # Gets list of groups for the current tenant.
1038
+ #
1039
+ # @param filter [String] The filter to apply to the operation.
1040
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1041
+ # will be added to the HTTP request.
1042
+ #
1043
+ # @return [GroupListResult] which provide lazy access to pages of the response.
1044
+ #
1045
+ def list_as_lazy(filter:nil, custom_headers:nil)
1046
+ response = list_async(filter:filter, custom_headers:custom_headers).value!
1047
+ unless response.nil?
1048
+ page = response.body
1049
+ page.next_method = Proc.new do |next_link|
1050
+ list_next_async(next_link, custom_headers:custom_headers)
1051
+ end
1052
+ page
1053
+ end
1054
+ end
1055
+
1056
+ #
1057
+ # Gets the members of a group.
1058
+ #
1059
+ # @param object_id [String] The object ID of the group whose members should be
1060
+ # retrieved.
1061
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1062
+ # will be added to the HTTP request.
1063
+ #
1064
+ # @return [GetObjectsResult] which provide lazy access to pages of the
1065
+ # response.
1066
+ #
1067
+ def get_group_members_as_lazy(object_id, custom_headers:nil)
1068
+ response = get_group_members_async(object_id, custom_headers:custom_headers).value!
1069
+ unless response.nil?
1070
+ page = response.body
1071
+ page.next_method = Proc.new do |next_link|
1072
+ get_group_members_next_async(next_link, custom_headers:custom_headers)
1073
+ end
1074
+ page
1075
+ end
1076
+ end
1077
+
1078
+ end
1079
+ end