Skip to content

UserInfoClient

Namespace: IntegrationTests.ApiClient

public class UserInfoClient

Inheritance ObjectUserInfoClient

Properties

BaseUrl

public string BaseUrl { get; set; }

Property Value

String

ReadResponseAsString

public bool ReadResponseAsString { get; set; }

Property Value

Boolean

Constructors

UserInfoClient(String, HttpClient)

public UserInfoClient(string baseUrl, HttpClient httpClient)

Parameters

baseUrl String

httpClient HttpClient

Methods

ChangePasswordAsync(ChangePassword)

Changes the password for a user.

public Task<FileResponse> ChangePasswordAsync(ChangePassword input)

Parameters

input ChangePassword

The change password request containing user ID, current password, and new password.

Returns

Ok if successful; otherwise, an error response.

Exceptions

ApiException

A server side error occurred.

ChangePasswordAsync(ChangePassword, CancellationToken)

Changes the password for a user.

public Task<FileResponse> ChangePasswordAsync(ChangePassword input, CancellationToken cancellationToken)

Parameters

input ChangePassword

The change password request containing user ID, current password, and new password.

cancellationToken CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

Ok if successful; otherwise, an error response.

Exceptions

ApiException

A server side error occurred.

ChangeUserAsync(ApiUser)

Updates user information.

public Task<FileResponse> ChangeUserAsync(ApiUser user)

Parameters

user ApiUser

The user object with updated information.

Returns

Ok if successful; otherwise, an error response.

Exceptions

ApiException

A server side error occurred.

ChangeUserAsync(ApiUser, CancellationToken)

Updates user information.

public Task<FileResponse> ChangeUserAsync(ApiUser user, CancellationToken cancellationToken)

Parameters

user ApiUser

The user object with updated information.

cancellationToken CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

Ok if successful; otherwise, an error response.

Exceptions

ApiException

A server side error occurred.

DeleteUserAsync(String)

Deletes a user by their unique identifier.

public Task<FileResponse> DeleteUserAsync(string userId)

Parameters

userId String

The unique identifier of the user to delete.

Returns

Ok if successful; otherwise, an error response.

Exceptions

ApiException

A server side error occurred.

DeleteUserAsync(String, CancellationToken)

Deletes a user by their unique identifier.

public Task<FileResponse> DeleteUserAsync(string userId, CancellationToken cancellationToken)

Parameters

userId String

The unique identifier of the user to delete.

cancellationToken CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

Ok if successful; otherwise, an error response.

Exceptions

ApiException

A server side error occurred.

GetUserByIdAsync(String)

Retrieves a user by their unique identifier.

public Task<FileResponse> GetUserByIdAsync(string userId)

Parameters

userId String

The unique identifier of the user.

Returns

The user information if found; otherwise, NotFound.

Exceptions

ApiException

A server side error occurred.

GetUserByIdAsync(String, CancellationToken)

Retrieves a user by their unique identifier.

public Task<FileResponse> GetUserByIdAsync(string userId, CancellationToken cancellationToken)

Parameters

userId String

The unique identifier of the user.

cancellationToken CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

The user information if found; otherwise, NotFound.

Exceptions

ApiException

A server side error occurred.

ReadObjectResponseAsync<T>(HttpResponseMessage, IReadOnlyDictionary<String, IEnumerable<String>>, CancellationToken)

protected Task<ObjectResponseResult<T>> ReadObjectResponseAsync<T>(HttpResponseMessage response, IReadOnlyDictionary<String, IEnumerable<String>> headers, CancellationToken cancellationToken)

Type Parameters

T

Parameters

response HttpResponseMessage

headers IReadOnlyDictionary<String, IEnumerable<String>>

cancellationToken CancellationToken

Returns

Task<ObjectResponseResult<T>>