Package ai.shipeasy.admin.model
Class CreateKeyRequest
java.lang.Object
ai.shipeasy.admin.model.CreateKeyRequest
@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen",
comments="Generator version: 7.23.0")
public class CreateKeyRequest
extends Object
Body for `POST /api/admin/keys`. Only `type` is required. `env` is **required** for `server` and `client` keys (the key is bound to one environment — that binding is the read-env isolation boundary). For `admin` and `ops` keys `env` is ignored and the key is pinned to `prod`.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic enumEnvironment to bind the key to.static enumGets or Sets scopesstatic enumKey kind to mint. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddScopesItem(CreateKeyRequest.ScopesEnum scopesItem) booleanexpiresInDays(Integer expiresInDays) static CreateKeyRequestCreate an instance of CreateKeyRequest given an JSON stringgetEnv()Environment to bind the key to.Days until the key expires (1–3650), or `null`/omitted for a key that never expires.getName()Optional human label.Optional permission strings recorded on the key.getType()Key kind to mint.inthashCode()scopes(List<CreateKeyRequest.ScopesEnum> scopes) voidvoidsetExpiresInDays(Integer expiresInDays) voidvoidsetScopes(List<CreateKeyRequest.ScopesEnum> scopes) voidtoJson()Convert an instance of CreateKeyRequest to an JSON stringtoString()static voidvalidateJsonElement(com.google.gson.JsonElement jsonElement) Validates the JSON Element and throws an exception if issues found
-
Field Details
-
SERIALIZED_NAME_TYPE
- See Also:
-
SERIALIZED_NAME_NAME
- See Also:
-
SERIALIZED_NAME_SCOPES
- See Also:
-
SERIALIZED_NAME_EXPIRES_IN_DAYS
- See Also:
-
SERIALIZED_NAME_ENV
- See Also:
-
openapiFields
-
openapiRequiredFields
-
-
Constructor Details
-
CreateKeyRequest
public CreateKeyRequest()
-
-
Method Details
-
type
-
getType
Key kind to mint. `server` (back-end), `client` (public, browser), `admin` (CLI/devtools token), `ops` (restricted unattended-trigger credential). `admin`/`ops` keys don't count toward the plan key limit.- Returns:
- type
-
setType
-
name
-
getName
Optional human label. Programmatic (API) mints that omit it get an auto-generated descriptive name; dashboard mints may leave it blank.- Returns:
- name
-
setName
-
scopes
-
addScopesItem
-
getScopes
Optional permission strings recorded on the key. `tickets:public_create` is enforced: a client key needs it (plus the project's `allowPublicTickets` setting) to file a `pending_approval` bug via the public `POST /cli/report` endpoint. The rest are audit/display only.- Returns:
- scopes
-
setScopes
-
expiresInDays
-
getExpiresInDays
Days until the key expires (1–3650), or `null`/omitted for a key that never expires. Ignored for `admin` keys (fixed 90-day expiry) and `ops` keys (short sliding window). minimum: 1 maximum: 3650- Returns:
- expiresInDays
-
setExpiresInDays
-
env
-
getEnv
Environment to bind the key to. Always required. For `server`/`client` keys it is the isolation boundary the worker reads from; `admin`/`ops` keys are env-agnostic and pinned to `prod` by the handler regardless of the value sent.- Returns:
- env
-
setEnv
-
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 CreateKeyRequest
-
fromJson
Create an instance of CreateKeyRequest given an JSON string- Parameters:
jsonString- JSON string- Returns:
- An instance of CreateKeyRequest
- Throws:
IOException- if the JSON string is invalid with respect to CreateKeyRequest
-
toJson
Convert an instance of CreateKeyRequest to an JSON string- Returns:
- JSON string
-