Interface IVendorsClient
Defines operations for managing vendors through the TorBox Main API.
public interface IVendorsClient
Methods
GetAccountAsync(CancellationToken)
Retrieves the authenticated vendor's account details.
Task<TorBoxResponse<VendorAccount>> GetAccountAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<TorBoxResponse<VendorAccount>>
The vendor account details.
Exceptions
- TorBoxException
Thrown when the API returns an error.
GetAccountByAuthIdAsync(string, CancellationToken)
Retrieves a specific user account by auth ID.
Task<TorBoxResponse<VendorAccount>> GetAccountByAuthIdAsync(string userAuthId, CancellationToken cancellationToken = default)
Parameters
userAuthIdstringThe auth ID of the user to look up.
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<TorBoxResponse<VendorAccount>>
The vendor account details for the user.
Exceptions
- ArgumentNullException
Thrown when
userAuthIdis null.- ArgumentException
Thrown when
userAuthIdis empty.- TorBoxException
Thrown when the API returns an error.
GetAccountsAsync(CancellationToken)
Retrieves all user accounts managed by the vendor.
Task<TorBoxResponse<IReadOnlyList<VendorAccount>>> GetAccountsAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<TorBoxResponse<IReadOnlyList<VendorAccount>>>
A list of vendor accounts.
Exceptions
- TorBoxException
Thrown when the API returns an error.
RefreshAsync(CancellationToken)
Refreshes the vendor's API credentials.
Task<TorBoxResponse<VendorAccount>> RefreshAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<TorBoxResponse<VendorAccount>>
The updated vendor account with new credentials.
Exceptions
- TorBoxException
Thrown when the API returns an error.
RegisterAsync(RegisterVendorRequest, CancellationToken)
Registers a new vendor account.
Task<TorBoxResponse<VendorAccount>> RegisterAsync(RegisterVendorRequest request, CancellationToken cancellationToken = default)
Parameters
requestRegisterVendorRequestThe vendor registration request.
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<TorBoxResponse<VendorAccount>>
The created vendor account details.
Exceptions
- ArgumentNullException
Thrown when
requestis null.- TorBoxException
Thrown when the API returns an error.
RegisterUserAsync(RegisterVendorUserRequest, CancellationToken)
Registers a new user under the vendor's account.
Task<TorBoxResponse> RegisterUserAsync(RegisterVendorUserRequest request, CancellationToken cancellationToken = default)
Parameters
requestRegisterVendorUserRequestThe user registration request.
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<TorBoxResponse>
The API response.
Exceptions
- ArgumentNullException
Thrown when
requestis null.- TorBoxException
Thrown when the API returns an error.
RemoveUserAsync(RemoveVendorUserRequest, CancellationToken)
Removes a user from the vendor's account.
Task<TorBoxResponse> RemoveUserAsync(RemoveVendorUserRequest request, CancellationToken cancellationToken = default)
Parameters
requestRemoveVendorUserRequestThe user removal request.
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<TorBoxResponse>
The API response.
Exceptions
- ArgumentNullException
Thrown when
requestis null.- TorBoxException
Thrown when the API returns an error.
UpdateAccountAsync(UpdateVendorAccountRequest, CancellationToken)
Updates the authenticated vendor's account details.
Task<TorBoxResponse<VendorAccount>> UpdateAccountAsync(UpdateVendorAccountRequest request, CancellationToken cancellationToken = default)
Parameters
requestUpdateVendorAccountRequestThe update request.
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<TorBoxResponse<VendorAccount>>
The updated vendor account details.
Exceptions
- ArgumentNullException
Thrown when
requestis null.- TorBoxException
Thrown when the API returns an error.