use of com.microsoft.azure.management.graphrbac.UserGetMemberGroupsParameters in project azure-sdk-for-java by Azure.
the class UsersInner method getMemberGroupsWithServiceResponseAsync.
/**
* Gets a collection that contains the object IDs of the groups of which the user is a member.
*
* @param objectId The object ID of the user for which to get group membership.
* @param securityEnabledOnly If true, only membership in security-enabled groups should be checked. Otherwise, membership in all groups should be checked.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the List<String> object
*/
public Observable<ServiceResponse<List<String>>> getMemberGroupsWithServiceResponseAsync(String objectId, boolean securityEnabledOnly) {
if (objectId == null) {
throw new IllegalArgumentException("Parameter objectId is required and cannot be null.");
}
if (this.client.tenantID() == null) {
throw new IllegalArgumentException("Parameter this.client.tenantID() is required and cannot be null.");
}
if (this.client.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
}
UserGetMemberGroupsParameters parameters = new UserGetMemberGroupsParameters();
parameters.withSecurityEnabledOnly(securityEnabledOnly);
return service.getMemberGroups(objectId, this.client.tenantID(), this.client.apiVersion(), this.client.acceptLanguage(), parameters, this.client.userAgent()).flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<List<String>>>>() {
@Override
public Observable<ServiceResponse<List<String>>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PageImpl1<String>> result = getMemberGroupsDelegate(response);
ServiceResponse<List<String>> clientResponse = new ServiceResponse<List<String>>(result.body().items(), result.response());
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
}
Aggregations