Ejemplo n.º 1
0
        public virtual Pageable <string> GetMemberGroups(string objectId, UserGetMemberGroupsParameters parameters, CancellationToken cancellationToken = default)
        {
            if (objectId == null)
            {
                throw new ArgumentNullException(nameof(objectId));
            }
            if (parameters == null)
            {
                throw new ArgumentNullException(nameof(parameters));
            }

            Page <string> FirstPageFunc(int?pageSizeHint)
            {
                using var scope = _clientDiagnostics.CreateScope("UsersClient.GetMemberGroups");
                scope.Start();
                try
                {
                    var response = RestClient.GetMemberGroups(objectId, parameters, cancellationToken);
                    return(Page.FromValues(response.Value.Value, null, response.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            return(PageableHelpers.CreateEnumerable(FirstPageFunc, null));
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Gets a collection that contains the Object IDs of the groups of
 /// which the user is a member.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the Microsoft.Azure.Graph.RBAC.IUserOperations.
 /// </param>
 /// <param name='parameters'>
 /// Required. User filtering parameters.
 /// </param>
 /// <returns>
 /// Server response for GetMemberGroups API call
 /// </returns>
 public static Task <UserGetMemberGroupsResult> GetMemberGroupsAsync(this IUserOperations operations, UserGetMemberGroupsParameters parameters)
 {
     return(operations.GetMemberGroupsAsync(parameters, CancellationToken.None));
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Gets a collection that contains the Object IDs of the groups of
 /// which the user is a member.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the Microsoft.Azure.Graph.RBAC.IUserOperations.
 /// </param>
 /// <param name='parameters'>
 /// Required. User filtering parameters.
 /// </param>
 /// <returns>
 /// Server response for GetMemberGroups API call
 /// </returns>
 public static UserGetMemberGroupsResult GetMemberGroups(this IUserOperations operations, UserGetMemberGroupsParameters parameters)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IUserOperations)s).GetMemberGroupsAsync(parameters);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Gets a collection that contains the object IDs of the groups of which the
 /// user is a member.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='objectId'>
 /// The object ID of the user for which to get group membership.
 /// </param>
 /// <param name='parameters'>
 /// User filtering parameters.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IEnumerable <string> > GetMemberGroupsAsync(this IUsersOperations operations, string objectId, UserGetMemberGroupsParameters parameters, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetMemberGroupsWithHttpMessagesAsync(objectId, parameters, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Gets a collection that contains the object IDs of the groups of which the
 /// user is a member.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='objectId'>
 /// The object ID of the user for which to get group membership.
 /// </param>
 /// <param name='parameters'>
 /// User filtering parameters.
 /// </param>
 public static IEnumerable <string> GetMemberGroups(this IUsersOperations operations, string objectId, UserGetMemberGroupsParameters parameters)
 {
     return(operations.GetMemberGroupsAsync(objectId, parameters).GetAwaiter().GetResult());
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Gets a collection that contains the Object IDs of the groups of which the
 /// user is a member.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='objectId'>
 /// User filtering parameters.
 /// </param>
 /// <param name='parameters'>
 /// User filtering parameters.
 /// </param>
 public static IEnumerable <string> GetMemberGroups(this IUsersOperations operations, string objectId, UserGetMemberGroupsParameters parameters)
 {
     return(Task.Factory.StartNew(s => ((IUsersOperations)s).GetMemberGroupsAsync(objectId, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }