Class ApiKey

  • All Implemented Interfaces:

    
    public final class ApiKey
    
                        
    • Constructor Detail

    • Method Detail

      • id

         final String id()

        ID of the API key.

      • createdBy

         final Optional<ApiKeyCreatedBy> createdBy()

        The ID and type of the actor that created the API key, or null when the creator is not recorded (legacy, workload-identity-federated, or system-created keys).

      • principal

         final Optional<ApiKey.Principal> principal()

        The principal the API key acts as (a User or a Service Account), or null if the API key is not bound to a principal.

      • scope

         final ApiKey.Scope scope()

        Where the API key belongs: its Workspace ({"type": "workspace", "workspace_id": "wrkspc_..."}, with the Workspace's real ID even when it is the organization's default Workspace), or the organization ({"type": "organization"}) for a principal-bound API key that has no Workspace.

      • _type

         final JsonValue _type()

        Object type.

        For API Keys, this is always "api_key".

        Expected to always return the following:

        JsonValue.from("api_key")

        However, this method can be useful for debugging and logging (e.g. if the server responded with an unexpected value).

      • _id

         final JsonField<String> _id()

        Returns the raw JSON value of id.

        Unlike id, this method doesn't throw if the JSON field has an unexpected type.

      • _createdAt

         final JsonField<OffsetDateTime> _createdAt()

        Returns the raw JSON value of createdAt.

        Unlike createdAt, this method doesn't throw if the JSON field has an unexpected type.

      • _createdBy

         final JsonField<ApiKeyCreatedBy> _createdBy()

        Returns the raw JSON value of createdBy.

        Unlike createdBy, this method doesn't throw if the JSON field has an unexpected type.

      • _expiresAt

         final JsonField<OffsetDateTime> _expiresAt()

        Returns the raw JSON value of expiresAt.

        Unlike expiresAt, this method doesn't throw if the JSON field has an unexpected type.

      • _name

         final JsonField<String> _name()

        Returns the raw JSON value of name.

        Unlike name, this method doesn't throw if the JSON field has an unexpected type.

      • _partialKeyHint

         final JsonField<String> _partialKeyHint()

        Returns the raw JSON value of partialKeyHint.

        Unlike partialKeyHint, this method doesn't throw if the JSON field has an unexpected type.

      • _principal

         final JsonField<ApiKey.Principal> _principal()

        Returns the raw JSON value of principal.

        Unlike principal, this method doesn't throw if the JSON field has an unexpected type.

      • _scope

         final JsonField<ApiKey.Scope> _scope()

        Returns the raw JSON value of scope.

        Unlike scope, this method doesn't throw if the JSON field has an unexpected type.

      • _status

         final JsonField<ApiKey.Status> _status()

        Returns the raw JSON value of status.

        Unlike status, this method doesn't throw if the JSON field has an unexpected type.

      • validate

         final ApiKey validate()

        Validates that the types of all values in this object match their expected types recursively.

        This method is not forwards compatible with new types from the API for existing fields.

      • builder

         final static ApiKey.Builder builder()

        Returns a mutable builder for constructing an instance of ApiKey.

        The following fields are required:

        .id()
        .createdAt()
        .createdBy()
        .expiresAt()
        .name()
        .partialKeyHint()
        .principal()
        .scope()
        .status()