Interface IUsersClient
Exposes methods for managing users in the Vonage platform, including creating, retrieving, updating, and deleting users with their associated communication channels.
public interface IUsersClient
Methods
CreateUserAsync(Result<CreateUserRequest>)
Creates a new user in the Vonage platform with optional profile information and communication channels.
Task<Result<User>> CreateUserAsync(Result<CreateUserRequest> request)
Parameters
requestResult<CreateUserRequest>The request containing user details. Use Build() to create the request.
Returns
- Task<Result<User>>
A result containing the created User with their assigned ID on success, or error details on failure.
Examples
var request = CreateUserRequest.Build()
.WithName("my-user")
.WithDisplayName("John Doe")
.Create();
var result = await client.CreateUserAsync(request);
DeleteUserAsync(Result<DeleteUserRequest>)
Deletes an existing user from the Vonage platform.
Task<Result<Unit>> DeleteUserAsync(Result<DeleteUserRequest> request)
Parameters
requestResult<DeleteUserRequest>The request containing the user ID to delete. Use Parse(string) to create the request.
Returns
- Task<Result<Unit>>
A result indicating success or failure. On success, returns Unit. On failure, contains error details.
Examples
var request = DeleteUserRequest.Parse("USR-12345678-1234-1234-1234-123456789012");
var result = await client.DeleteUserAsync(request);
GetUserAsync(Result<GetUserRequest>)
Retrieves a specific user by their unique identifier.
Task<Result<User>> GetUserAsync(Result<GetUserRequest> request)
Parameters
requestResult<GetUserRequest>The request containing the user ID to retrieve. Use Parse(string) to create the request.
Returns
Examples
var request = GetUserRequest.Parse("USR-12345678-1234-1234-1234-123456789012");
var result = await client.GetUserAsync(request);
GetUsersAsync(Result<GetUsersRequest>)
Retrieves a paginated list of users with optional filtering by name.
Task<Result<GetUsersResponse>> GetUsersAsync(Result<GetUsersRequest> request)
Parameters
requestResult<GetUsersRequest>The request containing pagination and filter options. Use Build() to create the request.
Returns
- Task<Result<GetUsersResponse>>
A result containing the GetUsersResponse with user summaries and pagination links on success, or error details on failure.
Examples
var request = GetUsersRequest.Build()
.WithPageSize(20)
.WithOrder(FetchOrder.Descending)
.Create();
var result = await client.GetUsersAsync(request);
UpdateUserAsync(Result<UpdateUserRequest>)
Updates an existing user's profile information and communication channels.
Task<Result<User>> UpdateUserAsync(Result<UpdateUserRequest> request)
Parameters
requestResult<UpdateUserRequest>The request containing the user ID and updated details. Use Build() to create the request.
Returns
Examples
var request = UpdateUserRequest.Build()
.WithId("USR-12345678-1234-1234-1234-123456789012")
.WithDisplayName("Jane Doe")
.Create();
var result = await client.UpdateUserAsync(request);