Record Class CreateApiKeyRequest

java.lang.Object
java.lang.Record
dev.dokimos.server.dto.v1.CreateApiKeyRequest
Record Components:
name - human-readable label for the key (required)
role - privilege level granted to callers presenting the key (required)
tenantId - tenant the key is scoped to, or null for an unscoped key

public record CreateApiKeyRequest(@NotBlank String name, @NotNull Role role, String tenantId) extends Record
Request to mint a scoped API key. The server generates the raw key, hashes it, and stores only the hash; the raw key is returned exactly once in the response.
  • Constructor Summary

    Constructors
    Constructor
    Description
    CreateApiKeyRequest(@NotBlank String name, @NotNull Role role, String tenantId)
    Creates an instance of a CreateApiKeyRequest record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    @NotBlank String
    Returns the value of the name record component.
    @NotNull Role
    Returns the value of the role record component.
    Returns the value of the tenantId record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • CreateApiKeyRequest

      public CreateApiKeyRequest(@NotBlank @NotBlank String name, @NotNull @NotNull Role role, String tenantId)
      Creates an instance of a CreateApiKeyRequest record class.
      Parameters:
      name - the value for the name record component
      role - the value for the role record component
      tenantId - the value for the tenantId record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • name

      @NotBlank public @NotBlank String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • role

      @NotNull public @NotNull Role role()
      Returns the value of the role record component.
      Returns:
      the value of the role record component
    • tenantId

      public String tenantId()
      Returns the value of the tenantId record component.
      Returns:
      the value of the tenantId record component