Package ai.shipeasy.admin.model
Class KeyRecord
java.lang.Object
ai.shipeasy.admin.model.KeyRecord
@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen",
comments="Generator version: 7.23.0")
public class KeyRecord
extends Object
A single API key as returned by the list endpoint. Response fields are snake_case. The raw token is never returned here — only its `last4` tail. `last4` and the typed `scopes` may be `null` for keys minted before those columns existed.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic enumEnvironment the key is bound to.static enumKey kind. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddScopesItem(String scopesItem) createdByEmail(String createdByEmail) env(KeyRecord.EnvEnum env) booleanstatic KeyRecordCreate an instance of KeyRecord given an JSON stringISO-8601 timestamp the key was minted.Email of the human or actor that minted the key, or `null` when not attributable (e.g.getEnv()Environment the key is bound to.ISO-8601 expiry, or `null` for a key that never expires.getId()Stable opaque key id (UUID).getLast4()Last 4 characters of the raw token, so the dashboard mask is matchable against the held key.getName()Human label for the key.ISO-8601 timestamp the key was revoked, or `null` while the key is active.Permission strings recorded on the key for audit/display, or `null` when none were set.getType()Key kind.inthashCode()voidsetCreatedAt(String createdAt) voidsetCreatedByEmail(String createdByEmail) voidsetEnv(KeyRecord.EnvEnum env) voidsetExpiresAt(String expiresAt) voidvoidvoidvoidsetRevokedAt(String revokedAt) voidvoidsetType(KeyRecord.TypeEnum type) toJson()Convert an instance of KeyRecord to an JSON stringtoString()type(KeyRecord.TypeEnum type) static voidvalidateJsonElement(com.google.gson.JsonElement jsonElement) Validates the JSON Element and throws an exception if issues found
-
Field Details
-
SERIALIZED_NAME_ID
- See Also:
-
SERIALIZED_NAME_TYPE
- See Also:
-
SERIALIZED_NAME_ENV
- See Also:
-
SERIALIZED_NAME_CREATED_AT
- See Also:
-
SERIALIZED_NAME_REVOKED_AT
- See Also:
-
SERIALIZED_NAME_EXPIRES_AT
- See Also:
-
SERIALIZED_NAME_CREATED_BY_EMAIL
- See Also:
-
SERIALIZED_NAME_NAME
- See Also:
-
SERIALIZED_NAME_SCOPES
- See Also:
-
SERIALIZED_NAME_LAST4
- See Also:
-
openapiFields
-
openapiRequiredFields
-
-
Constructor Details
-
KeyRecord
public KeyRecord()
-
-
Method Details
-
id
-
getId
Stable opaque key id (UUID). Use it to revoke the key.- Returns:
- id
-
setId
-
type
-
getType
Key kind. `server` (back-end, full SDK auth), `client` (public, browser-embeddable), `admin` (CLI/devtools auth token), `ops` (restricted unattended-trigger credential).- Returns:
- type
-
setType
-
env
-
getEnv
Environment the key is bound to. The worker derives the read env from the key, so this is the isolation boundary. `admin`/`ops` keys are env-agnostic and pinned to `prod`.- Returns:
- env
-
setEnv
-
createdAt
-
getCreatedAt
ISO-8601 timestamp the key was minted.- Returns:
- createdAt
-
setCreatedAt
-
revokedAt
-
getRevokedAt
ISO-8601 timestamp the key was revoked, or `null` while the key is active.- Returns:
- revokedAt
-
setRevokedAt
-
expiresAt
-
getExpiresAt
ISO-8601 expiry, or `null` for a key that never expires. `admin` keys are fixed at 90 days; `ops` keys use a short sliding window.- Returns:
- expiresAt
-
setExpiresAt
-
createdByEmail
-
getCreatedByEmail
Email of the human or actor that minted the key, or `null` when not attributable (e.g. CLI device-flow).- Returns:
- createdByEmail
-
setCreatedByEmail
-
name
-
getName
Human label for the key. `null` for unnamed dashboard mints; programmatic mints auto-name themselves.- Returns:
- name
-
setName
-
scopes
-
addScopesItem
-
getScopes
Permission strings recorded on the key for audit/display, or `null` when none were set.- Returns:
- scopes
-
setScopes
-
last4
-
getLast4
Last 4 characters of the raw token, so the dashboard mask is matchable against the held key. `null` for keys minted before this column.- Returns:
- last4
-
setLast4
-
equals
-
hashCode
public int hashCode() -
toString
-
validateJsonElement
Validates the JSON Element and throws an exception if issues found- Parameters:
jsonElement- JSON Element- Throws:
IOException- if the JSON Element is invalid with respect to KeyRecord
-
fromJson
Create an instance of KeyRecord given an JSON string- Parameters:
jsonString- JSON string- Returns:
- An instance of KeyRecord
- Throws:
IOException- if the JSON string is invalid with respect to KeyRecord
-
toJson
Convert an instance of KeyRecord to an JSON string- Returns:
- JSON string
-