Class TokenRequest.Builder

java.lang.Object
ai.vectros.resources.auth.requests.TokenRequest.Builder
All Implemented Interfaces:
TokenRequest._FinalStage, TokenRequest.ScopeStage
Enclosing class:
TokenRequest

public static final class TokenRequest.Builder extends Object implements TokenRequest.ScopeStage, TokenRequest._FinalStage
  • Method Details

    • from

      public TokenRequest.Builder from(TokenRequest other)
      Specified by:
      from in interface TokenRequest.ScopeStage
    • scope

      public TokenRequest._FinalStage scope(@NotNull @NotNull ScopeRequest scope)
      Specified by:
      scope in interface TokenRequest.ScopeStage
    • expiresInSeconds

      public TokenRequest._FinalStage expiresInSeconds(Integer expiresInSeconds)

      How long the token remains valid, in seconds. Maximum 3600 (1 hour), which is also the default.

      Specified by:
      expiresInSeconds in interface TokenRequest._FinalStage
      Returns:
      Reference to this so that method calls can be chained together.
    • expiresInSeconds

      public TokenRequest._FinalStage expiresInSeconds(Optional<Integer> expiresInSeconds)

      How long the token remains valid, in seconds. Maximum 3600 (1 hour), which is also the default.

      Specified by:
      expiresInSeconds in interface TokenRequest._FinalStage
    • contextId

      public TokenRequest._FinalStage contextId(String contextId)

      The app context to mint the token into. Optional — omit it to inherit your own credential's context (a root API key defaults to default). Must reference an app context that already exists in your tenant (create one via POST /v1/app-contexts); an unrecognized value returns a uniform 404 not found. Only meaningful for root API key callers — this endpoint is root-key-only, so there is no confined credential this could let reach a context it doesn't hold.

      Specified by:
      contextId in interface TokenRequest._FinalStage
      Returns:
      Reference to this so that method calls can be chained together.
    • contextId

      public TokenRequest._FinalStage contextId(Optional<String> contextId)

      The app context to mint the token into. Optional — omit it to inherit your own credential's context (a root API key defaults to default). Must reference an app context that already exists in your tenant (create one via POST /v1/app-contexts); an unrecognized value returns a uniform 404 not found. Only meaningful for root API key callers — this endpoint is root-key-only, so there is no confined credential this could let reach a context it doesn't hold.

      Specified by:
      contextId in interface TokenRequest._FinalStage
    • userId

      public TokenRequest._FinalStage userId(String userId)

      The Vectros user ID of the end user this token is minted for. This is the UUID returned when you created the user via POST /v1/users. Optional — omit it for service-to-service tokens that have no specific user context. If provided, it must reference a real user in your account. Use GET /v1/users?externalId={yourId} to resolve your own system's user ID to the Vectros user ID.

      Specified by:
      userId in interface TokenRequest._FinalStage
      Returns:
      Reference to this so that method calls can be chained together.
    • userId

      public TokenRequest._FinalStage userId(Optional<String> userId)

      The Vectros user ID of the end user this token is minted for. This is the UUID returned when you created the user via POST /v1/users. Optional — omit it for service-to-service tokens that have no specific user context. If provided, it must reference a real user in your account. Use GET /v1/users?externalId={yourId} to resolve your own system's user ID to the Vectros user ID.

      Specified by:
      userId in interface TokenRequest._FinalStage
    • build

      public TokenRequest build()
      Specified by:
      build in interface TokenRequest._FinalStage
    • additionalProperty

      public TokenRequest.Builder additionalProperty(String key, Object value)
      Specified by:
      additionalProperty in interface TokenRequest._FinalStage
    • additionalProperties

      public TokenRequest.Builder additionalProperties(Map<String,Object> additionalProperties)
      Specified by:
      additionalProperties in interface TokenRequest._FinalStage