Class ApiClient
public sealed class ApiClient : IDisposable
- Inheritance
-
ApiClient
- Implements
- Inherited Members
Constructors
ApiClient(string)
public ApiClient(string baseUrl)
Parameters
baseUrlstring
Properties
BaseUrl
public string BaseUrl { get; }
Property Value
RefreshToken
public string? RefreshToken { get; }
Property Value
Token
public string? Token { get; }
Property Value
Methods
CreateChannelAsync(string, string?)
public Task<ChannelDto?> CreateChannelAsync(string name, string? topic = null)
Parameters
Returns
DeleteChannelAsync(string)
public Task DeleteChannelAsync(string channelName)
Parameters
channelNamestring
Returns
Dispose()
public void Dispose()
GetChannelsAsync()
public Task<List<ChannelDto>> GetChannelsAsync()
Returns
GetServerInfoAsync()
public Task<ServerStatusDto?> GetServerInfoAsync()
Returns
GetUserProfileAsync(string)
public Task<UserProfileDto?> GetUserProfileAsync(string username)
Parameters
usernamestring
Returns
GetValidTokenAsync()
Returns a valid access token, refreshing if expired. Used by EchoHubConnection for SignalR token provider.
public Task<string?> GetValidTokenAsync()
Returns
LoginAsync(string, string)
public Task<LoginResponse> LoginAsync(string username, string password)
Parameters
Returns
LogoutAsync()
public Task LogoutAsync()
Returns
RefreshTokenAsync()
public Task RefreshTokenAsync()
Returns
RegisterAsync(string, string, string?)
public Task<LoginResponse> RegisterAsync(string username, string password, string? displayName = null)
Parameters
Returns
SendUrlAsync(string, string)
public Task<MessageDto?> SendUrlAsync(string channelName, string url)
Parameters
Returns
UpdateChannelTopicAsync(string, string?)
public Task<ChannelDto?> UpdateChannelTopicAsync(string channelName, string? topic)
Parameters
Returns
UpdateProfileAsync(UpdateProfileRequest)
public Task<UserProfileDto?> UpdateProfileAsync(UpdateProfileRequest request)
Parameters
requestUpdateProfileRequest
Returns
UploadAvatarAsync(Stream, string)
public Task<string?> UploadAvatarAsync(Stream imageStream, string fileName)
Parameters
Returns
UploadFileAsync(string, Stream, string)
public Task<MessageDto?> UploadFileAsync(string channelName, Stream fileStream, string fileName)