Table of Contents

Interface IVendorsClient

Namespace
TorBoxSDK.Main.Vendors
Assembly
TorBoxSDK.dll

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

cancellationToken CancellationToken

Cancellation 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

userAuthId string

The auth ID of the user to look up.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<TorBoxResponse<VendorAccount>>

The vendor account details for the user.

Exceptions

ArgumentNullException

Thrown when userAuthId is null.

ArgumentException

Thrown when userAuthId is 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

cancellationToken CancellationToken

Cancellation 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

cancellationToken CancellationToken

Cancellation 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

request RegisterVendorRequest

The vendor registration request.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<TorBoxResponse<VendorAccount>>

The created vendor account details.

Exceptions

ArgumentNullException

Thrown when request is 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

request RegisterVendorUserRequest

The user registration request.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<TorBoxResponse>

The API response.

Exceptions

ArgumentNullException

Thrown when request is 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

request RemoveVendorUserRequest

The user removal request.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<TorBoxResponse>

The API response.

Exceptions

ArgumentNullException

Thrown when request is 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

request UpdateVendorAccountRequest

The update request.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<TorBoxResponse<VendorAccount>>

The updated vendor account details.

Exceptions

ArgumentNullException

Thrown when request is null.

TorBoxException

Thrown when the API returns an error.