Class CreateKeyResponse

java.lang.Object
ai.shipeasy.admin.model.CreateKeyResponse

@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen", comments="Generator version: 7.23.0") public class CreateKeyResponse extends Object
The minted key. The plaintext `key` is returned **once**, here — it is stored hashed and can never be retrieved again.
  • Field Details

  • Constructor Details

    • CreateKeyResponse

      public CreateKeyResponse()
  • Method Details

    • id

      public CreateKeyResponse id(@Nonnull String id)
    • getId

      @Nonnull public String getId()
      Stable opaque key id (UUID). Use it to revoke the key.
      Returns:
      id
    • setId

      public void setId(@Nonnull String id)
    • type

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

      @Nonnull public CreateKeyResponse.TypeEnum getType()
      The kind of key that was minted.
      Returns:
      type
    • setType

      public void setType(@Nonnull CreateKeyResponse.TypeEnum type)
    • env

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

      @Nonnull public CreateKeyResponse.EnvEnum getEnv()
      Environment the key is bound to (`prod` for `admin`/`ops`).
      Returns:
      env
    • setEnv

      public void setEnv(@Nonnull CreateKeyResponse.EnvEnum env)
    • key

      public CreateKeyResponse key(@Nonnull String key)
    • getKey

      @Nonnull public String getKey()
      The plaintext API token (e.g. `sdk_server_…`). Returned once — store it now; it cannot be recovered.
      Returns:
      key
    • setKey

      public void setKey(@Nonnull String key)
    • expiresAt

      public CreateKeyResponse expiresAt(@Nullable String expiresAt)
    • getExpiresAt

      @Nullable public String getExpiresAt()
      ISO-8601 expiry, or `null` if the key never expires.
      Returns:
      expiresAt
    • setExpiresAt

      public void setExpiresAt(@Nullable String expiresAt)
    • 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 CreateKeyResponse
    • fromJson

      public static CreateKeyResponse fromJson(String jsonString) throws IOException
      Create an instance of CreateKeyResponse given an JSON string
      Parameters:
      jsonString - JSON string
      Returns:
      An instance of CreateKeyResponse
      Throws:
      IOException - if the JSON string is invalid with respect to CreateKeyResponse
    • toJson

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