Class ApiClient
High-level API client for the Virtufin Gateway. Provides synchronous and asynchronous access to gateway operations.
public class ApiClient : IDisposable
- Inheritance
-
ApiClient
- Implements
- Inherited Members
Constructors
ApiClient(string, int?)
Creates a new ApiClient.
public ApiClient(string host = "localhost", int? httpPort = null)
Parameters
hoststringThe host address (default: "localhost").
httpPortint?The HTTP port (default from PortConstants).
Properties
Gateway
Gets the underlying GatewayClient for direct access.
public GatewayClient Gateway { get; }
Property Value
Host
The host address of the gateway.
public string Host { get; }
Property Value
HttpPort
The HTTP port of the gateway.
public int HttpPort { get; }
Property Value
Methods
Close()
Closes the client synchronously.
public void Close()
CloseAsync()
Closes the client asynchronously.
public Task CloseAsync()
Returns
Dispose()
Disposes of the client resources.
public void Dispose()
DisposeAsync()
Disposes of the client resources asynchronously.
public ValueTask DisposeAsync()
Returns
InvokeAsync(string, string, Dictionary<string, object?>?)
Invokes a method on a service asynchronously.
public Task<Dictionary<string, object?>> InvokeAsync(string service, string method, Dictionary<string, object?>? requestData = null)
Parameters
servicestringThe service name.
methodstringThe method name.
requestDataDictionary<string, object>Optional request data.
Returns
- Task<Dictionary<string, object>>
Response as dictionary.
ListMethodsAsync(string)
Lists all methods for a service asynchronously.
public Task<List<Dictionary<string, object?>>> ListMethodsAsync(string service)
Parameters
servicestringThe service name.
Returns
- Task<List<Dictionary<string, object>>>
List of method information.
ListServicesAsync()
Lists all available services asynchronously.
public Task<List<string>> ListServicesAsync()