Class UserRequest.Builder

java.lang.Object
ai.vectros.types.UserRequest.Builder
All Implemented Interfaces:
UserRequest._FinalStage, UserRequest.ExternalIdStage
Enclosing class:
UserRequest

public static final class UserRequest.Builder extends Object implements UserRequest.ExternalIdStage, UserRequest._FinalStage
  • Method Details

    • from

      public UserRequest.Builder from(UserRequest other)
      Specified by:
      from in interface UserRequest.ExternalIdStage
    • externalId

      public UserRequest._FinalStage externalId(@NotNull @NotNull String externalId)

      Your own unique identifier for this user. Drives idempotent upsert: if a user with this externalId already exists, it is returned instead of creating a duplicate.

      Your own unique identifier for this user. Drives idempotent upsert: if a user with this externalId already exists, it is returned instead of creating a duplicate.

      Specified by:
      externalId in interface UserRequest.ExternalIdStage
      Returns:
      Reference to this so that method calls can be chained together.
    • emailVerifiedAttestation

      public UserRequest._FinalStage emailVerifiedAttestation(Boolean emailVerifiedAttestation)

      Your attestation that the invitee's email was verified by your authentication system before this call. Must be true to activate a pending invitation. Vectros cannot inspect your authentication system, so asserting this accurately is your responsibility.

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

      public UserRequest._FinalStage emailVerifiedAttestation(Optional<Boolean> emailVerifiedAttestation)

      Your attestation that the invitee's email was verified by your authentication system before this call. Must be true to activate a pending invitation. Vectros cannot inspect your authentication system, so asserting this accurately is your responsibility.

      Specified by:
      emailVerifiedAttestation in interface UserRequest._FinalStage
    • externalSubject

      public UserRequest._FinalStage externalSubject(String externalSubject)

      The user's identifier in your own authentication system (for example, a Cognito sub or Auth0 user ID). Required to activate a pending invitation; ignored on subsequent updates. Treat it as immutable once the user is activated.

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

      public UserRequest._FinalStage externalSubject(Optional<String> externalSubject)

      The user's identifier in your own authentication system (for example, a Cognito sub or Auth0 user ID). Required to activate a pending invitation; ignored on subsequent updates. Treat it as immutable once the user is activated.

      Specified by:
      externalSubject in interface UserRequest._FinalStage
    • inviteToken

      public UserRequest._FinalStage inviteToken(String inviteToken)

      The raw invite token from the invitation email link. Required to activate a pending invitation (moving the user from PENDING to ACTIVE); ignored otherwise. The token's signature is verified server-side.

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

      public UserRequest._FinalStage inviteToken(Optional<String> inviteToken)

      The raw invite token from the invitation email link. Required to activate a pending invitation (moving the user from PENDING to ACTIVE); ignored otherwise. The token's signature is verified server-side.

      Specified by:
      inviteToken in interface UserRequest._FinalStage
    • schemaId

      public UserRequest._FinalStage schemaId(String schemaId)

      Optional ID of a record schema (created via POST /v1/schemas) that drives payload validation and lookup indexing. When set, the schema must belong to your account, the payload is validated against the schema's fields on save, and the schema's lookup fields become queryable via GET /v1/users (using type, field, and a lookup mode). When omitted, the payload is free-form and no lookup rows are written.

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

      public UserRequest._FinalStage schemaId(Optional<String> schemaId)

      Optional ID of a record schema (created via POST /v1/schemas) that drives payload validation and lookup indexing. When set, the schema must belong to your account, the payload is validated against the schema's fields on save, and the schema's lookup fields become queryable via GET /v1/users (using type, field, and a lookup mode). When omitted, the payload is free-form and no lookup rows are written.

      Specified by:
      schemaId in interface UserRequest._FinalStage
    • payload

      public UserRequest._FinalStage payload(Map<String,Object> payload)

      Arbitrary key-value attributes to store on the user, useful for carrying additional data from your own system.

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

      public UserRequest._FinalStage payload(Optional<Map<String,Object>> payload)

      Arbitrary key-value attributes to store on the user, useful for carrying additional data from your own system.

      Specified by:
      payload in interface UserRequest._FinalStage
    • type

      The kind of user. HUMAN (the default) is a real person; SERVICE is a bot, agent, scheduled job, or other named integration with no specific person behind it. Service users may omit email. The type is immutable after creation — to change it, create a new user.

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

      The kind of user. HUMAN (the default) is a real person; SERVICE is a bot, agent, scheduled job, or other named integration with no specific person behind it. Service users may omit email. The type is immutable after creation — to change it, create a new user.

      Specified by:
      type in interface UserRequest._FinalStage
    • status

      The user's lifecycle status. ACTIVE users can be used normally; SUSPENDED users are retained but blocked from new operations. PENDING is a server-managed state for invitations awaiting acceptance — you cannot set it directly. (A pending user becomes ACTIVE by sending status=ACTIVE together with inviteToken, externalSubject, and emailVerifiedAttestation=true.) You may set only ACTIVE or SUSPENDED directly.

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

      The user's lifecycle status. ACTIVE users can be used normally; SUSPENDED users are retained but blocked from new operations. PENDING is a server-managed state for invitations awaiting acceptance — you cannot set it directly. (A pending user becomes ACTIVE by sending status=ACTIVE together with inviteToken, externalSubject, and emailVerifiedAttestation=true.) You may set only ACTIVE or SUSPENDED directly.

      Specified by:
      status in interface UserRequest._FinalStage
    • email

      public UserRequest._FinalStage email(String email)

      The user's email address. Used for display and notifications only; it is not used for authentication to the Vectros API.

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

      public UserRequest._FinalStage email(Optional<String> email)

      The user's email address. Used for display and notifications only; it is not used for authentication to the Vectros API.

      Specified by:
      email in interface UserRequest._FinalStage
    • build

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

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

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