/// <summary> /// Associates/dissociates the given user with/from a role based on toggle /// parameter. /// </summary> /// <remarks> /// Client Credentials Flow required permissions: Users or Users.Write. /// /// Required permissions: Users.Edit. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='key'> /// </param> /// <param name='body'> /// <para />Toggle - States whether to associate or to dissociate the /// role with/from the user. /// <para />Role - The name of the role to be associated/dissociated. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task ToggleRoleByIdAsync(this IUsers operations, long key, UsersToggleRoleParameters body = default(UsersToggleRoleParameters), CancellationToken cancellationToken = default(CancellationToken)) { (await operations.ToggleRoleByIdWithHttpMessagesAsync(key, body, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// Associates/dissociates the given user with/from a role based on toggle /// parameter. /// </summary> /// <remarks> /// Client Credentials Flow required permissions: Users or Users.Write. /// /// Required permissions: Users.Edit. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='key'> /// </param> /// <param name='body'> /// <para />Toggle - States whether to associate or to dissociate the /// role with/from the user. /// <para />Role - The name of the role to be associated/dissociated. /// </param> public static void ToggleRoleById(this IUsers operations, long key, UsersToggleRoleParameters body = default(UsersToggleRoleParameters)) { operations.ToggleRoleByIdAsync(key, body).GetAwaiter().GetResult(); }