Instance
Singleton GoodMem instance identity, ownership, and audit metadata.
Namespace: Goodmem.Client.Api · Class: InstanceApi
Reach this surface as client.Instance on a GoodmemClient. Every network method is asynchronous — it returns a Task<T> (or an IAsyncEnumerable<T> for pagination and streaming) and accepts a CancellationToken; the Async suffix marks the standard .NET Task-based async pattern.
Methods
| Method | Summary |
|---|---|
GetAsync | Get the GoodMem instance. |
GetAsync
Returns singleton instance identity, ownership, and audit metadata after requiring effective READ_INSTANCE authority. The built-in ADMIN role supplies this authority; instance ownership alone does not. A scoped API key must also retain READ_INSTANCE in its immutable ceiling. This operation does not expose credentials or mutate instance state.
Declaration
public Task<GoodMemInstance> GetAsync(CancellationToken ct = default)
HTTP — GET /v1/instance
Parameters
| Type | Name | Description |
|---|---|---|
CancellationToken | ct | Cancellation / deadline signal for the call. (optional) |
Returns
Task<GoodMemInstance> — an awaitable that resolves to GoodMemInstance.
Exceptions
| Type | Condition |
|---|---|
NetworkException | The request could not reach the server (DNS, connection, or TLS failure). |
ApiException | The server returned a non-success (non-2xx) status. A status-specific subtype is thrown where it applies — e.g. NotFoundException (404), PermissionDeniedException (403), ConflictException (409). |
Example
var instance = await client.Instance.GetAsync();
Console.WriteLine($"{instance.InstanceId} {instance.OwnerId}");