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`.
  • Field Details

  • Constructor Details

    • CreateKeyRequest

      public CreateKeyRequest()
  • Method Details

    • type

      public CreateKeyRequest type(@Nonnull CreateKeyRequest.TypeEnum type)
    • getType

      @Nonnull public CreateKeyRequest.TypeEnum 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

      public void setType(@Nonnull CreateKeyRequest.TypeEnum type)
    • name

      public CreateKeyRequest name(@Nullable String name)
    • getName

      @Nullable public String 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

      public void setName(@Nullable String name)
    • scopes

      public CreateKeyRequest scopes(@Nullable List<CreateKeyRequest.ScopesEnum> scopes)
    • addScopesItem

      public CreateKeyRequest addScopesItem(CreateKeyRequest.ScopesEnum scopesItem)
    • getScopes

      @Nullable public List<CreateKeyRequest.ScopesEnum> 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

      public void setScopes(@Nullable List<CreateKeyRequest.ScopesEnum> scopes)
    • expiresInDays

      public CreateKeyRequest expiresInDays(@Nullable Integer expiresInDays)
    • getExpiresInDays

      @Nullable public Integer 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

      public void setExpiresInDays(@Nullable Integer expiresInDays)
    • env

      public CreateKeyRequest env(@Nonnull CreateKeyRequest.EnvEnum env)
    • getEnv

      @Nonnull public CreateKeyRequest.EnvEnum 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

      public void setEnv(@Nonnull CreateKeyRequest.EnvEnum env)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • validateJsonElement

      public static void validateJsonElement(com.google.gson.JsonElement jsonElement) throws IOException
      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

      public static CreateKeyRequest fromJson(String jsonString) throws IOException
      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

      public String toJson()
      Convert an instance of CreateKeyRequest to an JSON string
      Returns:
      JSON string