Table of Contents

Class ApiClient

Namespace
Virtufin.Api.Client
Assembly
Virtufin.Api.Client.dll

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

host string

The host address (default: "localhost").

httpPort int?

The HTTP port (default from PortConstants).

Properties

Gateway

Gets the underlying GatewayClient for direct access.

public GatewayClient Gateway { get; }

Property Value

GatewayClient

Host

The host address of the gateway.

public string Host { get; }

Property Value

string

HttpPort

The HTTP port of the gateway.

public int HttpPort { get; }

Property Value

int

Methods

Close()

Closes the client synchronously.

public void Close()

CloseAsync()

Closes the client asynchronously.

public Task CloseAsync()

Returns

Task

Dispose()

Disposes of the client resources.

public void Dispose()

DisposeAsync()

Disposes of the client resources asynchronously.

public ValueTask DisposeAsync()

Returns

ValueTask

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

service string

The service name.

method string

The method name.

requestData Dictionary<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

service string

The service name.

Returns

Task<List<Dictionary<string, object>>>

List of method information.

ListServicesAsync()

Lists all available services asynchronously.

public Task<List<string>> ListServicesAsync()

Returns

Task<List<string>>

List of service names.