Package ai.shipeasy.admin.api
Class ApiKeysApi
java.lang.Object
ai.shipeasy.admin.api.ApiKeysApi
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateKey(CreateKeyRequest createKeyRequest, String xProjectId) Create an API key Mints a new API key and returns the plaintext token **once** — it is stored hashed and can never be retrieved again, so capture it on creation.okhttp3.CallcreateKeyAsync(CreateKeyRequest createKeyRequest, String xProjectId, ApiCallback<CreateKeyResponse> _callback) Create an API key (asynchronously) Mints a new API key and returns the plaintext token **once** — it is stored hashed and can never be retrieved again, so capture it on creation.okhttp3.CallcreateKeyCall(CreateKeyRequest createKeyRequest, String xProjectId, ApiCallback _callback) Build call for createKeycreateKeyWithHttpInfo(CreateKeyRequest createKeyRequest, String xProjectId) Create an API key Mints a new API key and returns the plaintext token **once** — it is stored hashed and can never be retrieved again, so capture it on creation.intList API keys Returns a single page of the project's API keys ordered by `created_at desc, id desc`, in the standard `{ data, next_cursor }` envelope.okhttp3.CalllistKeysAsync(String xProjectId, Integer limit, String cursor, String q, ApiCallback<ListKeysResponse> _callback) List API keys (asynchronously) Returns a single page of the project's API keys ordered by `created_at desc, id desc`, in the standard `{ data, next_cursor }` envelope.okhttp3.CalllistKeysCall(String xProjectId, Integer limit, String cursor, String q, ApiCallback _callback) Build call for listKeyslistKeysWithHttpInfo(String xProjectId, Integer limit, String cursor, String q) List API keys Returns a single page of the project's API keys ordered by `created_at desc, id desc`, in the standard `{ data, next_cursor }` envelope.Revoke an API key Revokes a key by id — stamps its `revoked_at` and deletes the hot-path KV entry so the token stops authenticating immediately.okhttp3.CallrevokeKeyAsync(String id, String xProjectId, ApiCallback<RevokeKeyResponse> _callback) Revoke an API key (asynchronously) Revokes a key by id — stamps its `revoked_at` and deletes the hot-path KV entry so the token stops authenticating immediately.okhttp3.CallrevokeKeyCall(String id, String xProjectId, ApiCallback _callback) Build call for revokeKeyrevokeKeyWithHttpInfo(String id, String xProjectId) Revoke an API key Revokes a key by id — stamps its `revoked_at` and deletes the hot-path KV entry so the token stops authenticating immediately.voidsetApiClient(ApiClient apiClient) voidsetCustomBaseUrl(String customBaseUrl) voidsetHostIndex(int hostIndex)
-
Constructor Details
-
ApiKeysApi
public ApiKeysApi() -
ApiKeysApi
-
-
Method Details
-
getApiClient
-
setApiClient
-
getHostIndex
public int getHostIndex() -
setHostIndex
public void setHostIndex(int hostIndex) -
getCustomBaseUrl
-
setCustomBaseUrl
-
createKeyCall
public okhttp3.Call createKeyCall(@Nonnull CreateKeyRequest createKeyRequest, @Nullable String xProjectId, ApiCallback _callback) throws ApiException Build call for createKey- Parameters:
createKeyRequest- (required)xProjectId- Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it). (optional)_callback- Callback for upload/download progress- Returns:
- Call to execute
- Throws:
ApiException- If fail to serialize the request body object
-
createKey
public CreateKeyResponse createKey(@Nonnull CreateKeyRequest createKeyRequest, @Nullable String xProjectId) throws ApiException Create an API key Mints a new API key and returns the plaintext token **once** — it is stored hashed and can never be retrieved again, so capture it on creation. Only `type` is required. `env` is **required** for `server` and `client` keys (the key is bound to one environment, which is the read-env isolation boundary); for `admin` and `ops` keys `env` is ignored and the key is pinned to `prod`. Expiry is fixed for some types: `admin` keys always get a 90-day expiry and `ops` keys a short sliding window, regardless of `expiresInDays`. Only `server`/`client` keys count toward the plan key limit. **Use cases** - **Back-end key** — `{ \"type\": \"server\", \"env\": \"prod\" }` for the production server SDK. - **Public browser key** — `{ \"type\": \"client\", \"env\": \"prod\", \"name\": \"marketing site\" }` to embed in the browser SDK. - **Scoped, expiring key** — `{ \"type\": \"server\", \"env\": \"staging\", \"scopes\": [\"gates:evaluate\"], \"expiresInDays\": 30 }` for a time-boxed integration.- Parameters:
createKeyRequest- (required)xProjectId- Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it). (optional)- Returns:
- CreateKeyResponse
- Throws:
ApiException- If fail to call the API, e.g. server error or cannot deserialize the response body
-
createKeyWithHttpInfo
public ApiResponse<CreateKeyResponse> createKeyWithHttpInfo(@Nonnull CreateKeyRequest createKeyRequest, @Nullable String xProjectId) throws ApiException Create an API key Mints a new API key and returns the plaintext token **once** — it is stored hashed and can never be retrieved again, so capture it on creation. Only `type` is required. `env` is **required** for `server` and `client` keys (the key is bound to one environment, which is the read-env isolation boundary); for `admin` and `ops` keys `env` is ignored and the key is pinned to `prod`. Expiry is fixed for some types: `admin` keys always get a 90-day expiry and `ops` keys a short sliding window, regardless of `expiresInDays`. Only `server`/`client` keys count toward the plan key limit. **Use cases** - **Back-end key** — `{ \"type\": \"server\", \"env\": \"prod\" }` for the production server SDK. - **Public browser key** — `{ \"type\": \"client\", \"env\": \"prod\", \"name\": \"marketing site\" }` to embed in the browser SDK. - **Scoped, expiring key** — `{ \"type\": \"server\", \"env\": \"staging\", \"scopes\": [\"gates:evaluate\"], \"expiresInDays\": 30 }` for a time-boxed integration.- Parameters:
createKeyRequest- (required)xProjectId- Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it). (optional)- Returns:
- ApiResponse<CreateKeyResponse>
- Throws:
ApiException- If fail to call the API, e.g. server error or cannot deserialize the response body
-
createKeyAsync
public okhttp3.Call createKeyAsync(@Nonnull CreateKeyRequest createKeyRequest, @Nullable String xProjectId, ApiCallback<CreateKeyResponse> _callback) throws ApiException Create an API key (asynchronously) Mints a new API key and returns the plaintext token **once** — it is stored hashed and can never be retrieved again, so capture it on creation. Only `type` is required. `env` is **required** for `server` and `client` keys (the key is bound to one environment, which is the read-env isolation boundary); for `admin` and `ops` keys `env` is ignored and the key is pinned to `prod`. Expiry is fixed for some types: `admin` keys always get a 90-day expiry and `ops` keys a short sliding window, regardless of `expiresInDays`. Only `server`/`client` keys count toward the plan key limit. **Use cases** - **Back-end key** — `{ \"type\": \"server\", \"env\": \"prod\" }` for the production server SDK. - **Public browser key** — `{ \"type\": \"client\", \"env\": \"prod\", \"name\": \"marketing site\" }` to embed in the browser SDK. - **Scoped, expiring key** — `{ \"type\": \"server\", \"env\": \"staging\", \"scopes\": [\"gates:evaluate\"], \"expiresInDays\": 30 }` for a time-boxed integration.- Parameters:
createKeyRequest- (required)xProjectId- Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it). (optional)_callback- The callback to be executed when the API call finishes- Returns:
- The request call
- Throws:
ApiException- If fail to process the API call, e.g. serializing the request body object
-
listKeysCall
public okhttp3.Call listKeysCall(@Nullable String xProjectId, @Nullable Integer limit, @Nullable String cursor, @Nullable String q, ApiCallback _callback) throws ApiException Build call for listKeys- Parameters:
xProjectId- Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it). (optional)limit- Page size (1–500). Defaults to 100. (optional, default to 100)cursor- Opaque cursor returned in the previous page's `next_cursor`. Omit for the first page. (optional)q- Case-insensitive substring filter across the resource's human-readable text columns (e.g. `name`, `title`, `description`). OR-matched across those columns; omit to return everything. (optional)_callback- Callback for upload/download progress- Returns:
- Call to execute
- Throws:
ApiException- If fail to serialize the request body object
-
listKeys
public ListKeysResponse listKeys(@Nullable String xProjectId, @Nullable Integer limit, @Nullable String cursor, @Nullable String q) throws ApiException List API keys Returns a single page of the project's API keys ordered by `created_at desc, id desc`, in the standard `{ data, next_cursor }` envelope. Use the `cursor` query parameter to paginate. Response fields are **snake_case** (`created_at`, `revoked_at`, `created_by_email`, `last4`). The raw token is never returned — only its `last4` tail, so a held key can be matched against the masked row. Revoked keys are included (with a non-null `revoked_at`). **Use case:** Audit which keys exist for a project — surface stale or never-expiring keys, or drive a CI check that asserts no `client` key is still active in `prod` after a rotation.- Parameters:
xProjectId- Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it). (optional)limit- Page size (1–500). Defaults to 100. (optional, default to 100)cursor- Opaque cursor returned in the previous page's `next_cursor`. Omit for the first page. (optional)q- Case-insensitive substring filter across the resource's human-readable text columns (e.g. `name`, `title`, `description`). OR-matched across those columns; omit to return everything. (optional)- Returns:
- ListKeysResponse
- Throws:
ApiException- If fail to call the API, e.g. server error or cannot deserialize the response body
-
listKeysWithHttpInfo
public ApiResponse<ListKeysResponse> listKeysWithHttpInfo(@Nullable String xProjectId, @Nullable Integer limit, @Nullable String cursor, @Nullable String q) throws ApiException List API keys Returns a single page of the project's API keys ordered by `created_at desc, id desc`, in the standard `{ data, next_cursor }` envelope. Use the `cursor` query parameter to paginate. Response fields are **snake_case** (`created_at`, `revoked_at`, `created_by_email`, `last4`). The raw token is never returned — only its `last4` tail, so a held key can be matched against the masked row. Revoked keys are included (with a non-null `revoked_at`). **Use case:** Audit which keys exist for a project — surface stale or never-expiring keys, or drive a CI check that asserts no `client` key is still active in `prod` after a rotation.- Parameters:
xProjectId- Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it). (optional)limit- Page size (1–500). Defaults to 100. (optional, default to 100)cursor- Opaque cursor returned in the previous page's `next_cursor`. Omit for the first page. (optional)q- Case-insensitive substring filter across the resource's human-readable text columns (e.g. `name`, `title`, `description`). OR-matched across those columns; omit to return everything. (optional)- Returns:
- ApiResponse<ListKeysResponse>
- Throws:
ApiException- If fail to call the API, e.g. server error or cannot deserialize the response body
-
listKeysAsync
public okhttp3.Call listKeysAsync(@Nullable String xProjectId, @Nullable Integer limit, @Nullable String cursor, @Nullable String q, ApiCallback<ListKeysResponse> _callback) throws ApiException List API keys (asynchronously) Returns a single page of the project's API keys ordered by `created_at desc, id desc`, in the standard `{ data, next_cursor }` envelope. Use the `cursor` query parameter to paginate. Response fields are **snake_case** (`created_at`, `revoked_at`, `created_by_email`, `last4`). The raw token is never returned — only its `last4` tail, so a held key can be matched against the masked row. Revoked keys are included (with a non-null `revoked_at`). **Use case:** Audit which keys exist for a project — surface stale or never-expiring keys, or drive a CI check that asserts no `client` key is still active in `prod` after a rotation.- Parameters:
xProjectId- Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it). (optional)limit- Page size (1–500). Defaults to 100. (optional, default to 100)cursor- Opaque cursor returned in the previous page's `next_cursor`. Omit for the first page. (optional)q- Case-insensitive substring filter across the resource's human-readable text columns (e.g. `name`, `title`, `description`). OR-matched across those columns; omit to return everything. (optional)_callback- The callback to be executed when the API call finishes- Returns:
- The request call
- Throws:
ApiException- If fail to process the API call, e.g. serializing the request body object
-
revokeKeyCall
public okhttp3.Call revokeKeyCall(@Nonnull String id, @Nullable String xProjectId, ApiCallback _callback) throws ApiException Build call for revokeKey- Parameters:
id- Stable opaque key id (UUID) returned by `create` / `list`. (required)xProjectId- Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it). (optional)_callback- Callback for upload/download progress- Returns:
- Call to execute
- Throws:
ApiException- If fail to serialize the request body object
-
revokeKey
public RevokeKeyResponse revokeKey(@Nonnull String id, @Nullable String xProjectId) throws ApiException Revoke an API key Revokes a key by id — stamps its `revoked_at` and deletes the hot-path KV entry so the token stops authenticating immediately. Takes no body. Idempotent: revoking an already-revoked key is a no-op and returns the same `{ id, revoked: true }`. Returns `404` if no such key exists in the project. **Use case:** Rotate a leaked or stale credential — mint the replacement, then revoke the old key.- Parameters:
id- Stable opaque key id (UUID) returned by `create` / `list`. (required)xProjectId- Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it). (optional)- Returns:
- RevokeKeyResponse
- Throws:
ApiException- If fail to call the API, e.g. server error or cannot deserialize the response body
-
revokeKeyWithHttpInfo
public ApiResponse<RevokeKeyResponse> revokeKeyWithHttpInfo(@Nonnull String id, @Nullable String xProjectId) throws ApiException Revoke an API key Revokes a key by id — stamps its `revoked_at` and deletes the hot-path KV entry so the token stops authenticating immediately. Takes no body. Idempotent: revoking an already-revoked key is a no-op and returns the same `{ id, revoked: true }`. Returns `404` if no such key exists in the project. **Use case:** Rotate a leaked or stale credential — mint the replacement, then revoke the old key.- Parameters:
id- Stable opaque key id (UUID) returned by `create` / `list`. (required)xProjectId- Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it). (optional)- Returns:
- ApiResponse<RevokeKeyResponse>
- Throws:
ApiException- If fail to call the API, e.g. server error or cannot deserialize the response body
-
revokeKeyAsync
public okhttp3.Call revokeKeyAsync(@Nonnull String id, @Nullable String xProjectId, ApiCallback<RevokeKeyResponse> _callback) throws ApiException Revoke an API key (asynchronously) Revokes a key by id — stamps its `revoked_at` and deletes the hot-path KV entry so the token stops authenticating immediately. Takes no body. Idempotent: revoking an already-revoked key is a no-op and returns the same `{ id, revoked: true }`. Returns `404` if no such key exists in the project. **Use case:** Rotate a leaked or stale credential — mint the replacement, then revoke the old key.- Parameters:
id- Stable opaque key id (UUID) returned by `create` / `list`. (required)xProjectId- Project the request operates on. Optional — defaults to the project the SDK key belongs to; pass it only to scope a multi-project key (the generated client sets it once from its configuration, so per-call callers never thread it). (optional)_callback- The callback to be executed when the API call finishes- Returns:
- The request call
- Throws:
ApiException- If fail to process the API call, e.g. serializing the request body object
-