Class NamespaceRequest.Builder

java.lang.Object
ai.vectros.types.NamespaceRequest.Builder
All Implemented Interfaces:
NamespaceRequest._FinalStage, NamespaceRequest.NamespaceStage, NamespaceRequest.SpecificityRankStage
Enclosing class:
NamespaceRequest

public static final class NamespaceRequest.Builder extends Object implements NamespaceRequest.NamespaceStage, NamespaceRequest.SpecificityRankStage, NamespaceRequest._FinalStage
  • Method Details

    • from

      Specified by:
      from in interface NamespaceRequest.NamespaceStage
    • namespace

      public NamespaceRequest.SpecificityRankStage namespace(@NotNull @NotNull String namespace)

      The namespace to register: 2-32 characters, a lowercase letter first, then lowercase letters, digits, _ or -. org and client are reserved names, registered the same way as any other namespace. Deleting any namespace — these two included — is refused while entities still reference it. Required on registration; on update it must match the path and is otherwise ignored (the namespace is immutable).

      The namespace to register: 2-32 characters, a lowercase letter first, then lowercase letters, digits, _ or -. org and client are reserved names, registered the same way as any other namespace. Deleting any namespace — these two included — is refused while entities still reference it. Required on registration; on update it must match the path and is otherwise ignored (the namespace is immutable).

      Specified by:
      namespace in interface NamespaceRequest.NamespaceStage
      Returns:
      Reference to this so that method calls can be chained together.
    • specificityRank

      public NamespaceRequest._FinalStage specificityRank(int specificityRank)

      This namespace's position in your account's specificity order, used to break a tie when a caller holds two scope dimensions at once during recordType schema resolution — the higher-ranked (more specific) dimension's schema wins. Required on registration (no default); must be an integer between 0 and 1000000, and unique across every namespace in your account — including org and client, once registered (org=1000, client=2000). Optional on update — omit to leave it unchanged.

      This namespace's position in your account's specificity order, used to break a tie when a caller holds two scope dimensions at once during recordType schema resolution — the higher-ranked (more specific) dimension's schema wins. Required on registration (no default); must be an integer between 0 and 1000000, and unique across every namespace in your account — including org and client, once registered (org=1000, client=2000). Optional on update — omit to leave it unchanged.

      Specified by:
      specificityRank in interface NamespaceRequest.SpecificityRankStage
      Returns:
      Reference to this so that method calls can be chained together.
    • membershipLevels

      public NamespaceRequest._FinalStage membershipLevels(List<String> membershipLevels)

      Optional. The complete set of level labels this namespace allows, each following the namespace grammar. A role naming a level that is not in this list is rejected when it is authored, rather than silently matching nothing — so a typo is reported to whoever can fix it. Required alongside membershipLevelField.

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

      public NamespaceRequest._FinalStage membershipLevels(Optional<List<String>> membershipLevels)

      Optional. The complete set of level labels this namespace allows, each following the namespace grammar. A role naming a level that is not in this list is rejected when it is authored, rather than silently matching nothing — so a typo is reported to whoever can fix it. Required alongside membershipLevelField.

      Specified by:
      membershipLevels in interface NamespaceRequest._FinalStage
    • membershipLevelField

      public NamespaceRequest._FinalStage membershipLevelField(String membershipLevelField)

      Optional. The field on membershipRecordType naming a grant's LEVEL, so the same user can hold different levels in different values of this namespace — an admin of one team and a viewer of another. Supply it together with membershipLevels, or omit both for plain in-or-out membership. A role selects a level by naming ${{ member.scope.<namespace>:<level> }}. Because the level is an ordinary field on an ordinary record, it is only as trustworthy as who may write that record type: grant create/update/delete on membershipRecordType to the people who ISSUE grants, never to the members those grants govern — a member who can update their own grant row can raise their own level, and it takes effect on their next request.

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

      public NamespaceRequest._FinalStage membershipLevelField(Optional<String> membershipLevelField)

      Optional. The field on membershipRecordType naming a grant's LEVEL, so the same user can hold different levels in different values of this namespace — an admin of one team and a viewer of another. Supply it together with membershipLevels, or omit both for plain in-or-out membership. A role selects a level by naming ${{ member.scope.<namespace>:<level> }}. Because the level is an ordinary field on an ordinary record, it is only as trustworthy as who may write that record type: grant create/update/delete on membershipRecordType to the people who ISSUE grants, never to the members those grants govern — a member who can update their own grant row can raise their own level, and it takes effect on their next request.

      Specified by:
      membershipLevelField in interface NamespaceRequest._FinalStage
    • membershipContextId

      public NamespaceRequest._FinalStage membershipContextId(String membershipContextId)

      Optional. Which app context holds the membership records. Required alongside the other membership fields on a TENANT-WIDE registration (records always belong to one app context, while a tenant-wide registration is account-wide). Meaningless — and rejected if it disagrees — on a registration owned by one context via ?contextId=: that context's grants live in its own context by construction, so this field need not repeat it.

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

      public NamespaceRequest._FinalStage membershipContextId(Optional<String> membershipContextId)

      Optional. Which app context holds the membership records. Required alongside the other membership fields on a TENANT-WIDE registration (records always belong to one app context, while a tenant-wide registration is account-wide). Meaningless — and rejected if it disagrees — on a registration owned by one context via ?contextId=: that context's grants live in its own context by construction, so this field need not repeat it.

      Specified by:
      membershipContextId in interface NamespaceRequest._FinalStage
    • membershipTargetField

      public NamespaceRequest._FinalStage membershipTargetField(String membershipTargetField)

      Optional. The field on membershipRecordType naming the user a grant is FOR. It is an ordinary reference field, not an ownership field — the grant is owned by whoever created it, and the namespace value it applies to is the grant's own scope stamp, which is what your placement authority is checked against when you write it.

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

      public NamespaceRequest._FinalStage membershipTargetField(Optional<String> membershipTargetField)

      Optional. The field on membershipRecordType naming the user a grant is FOR. It is an ordinary reference field, not an ownership field — the grant is owned by whoever created it, and the namespace value it applies to is the grant's own scope stamp, which is what your placement authority is checked against when you write it.

      Specified by:
      membershipTargetField in interface NamespaceRequest._FinalStage
    • membershipRecordType

      public NamespaceRequest._FinalStage membershipRecordType(String membershipRecordType)

      Optional. The record type holding this namespace's MEMBERSHIP grants — the records that say which values of this namespace a given user belongs to. Supply it together with membershipTargetField and membershipContextId, or omit all three. Declaring it grants nobody anything on its own: a credential receives membership-derived access only if its own role or access profile asks for it by naming ${{ member.scope.<namespace> }} in data_scope.

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

      public NamespaceRequest._FinalStage membershipRecordType(Optional<String> membershipRecordType)

      Optional. The record type holding this namespace's MEMBERSHIP grants — the records that say which values of this namespace a given user belongs to. Supply it together with membershipTargetField and membershipContextId, or omit all three. Declaring it grants nobody anything on its own: a credential receives membership-derived access only if its own role or access profile asks for it by naming ${{ member.scope.<namespace> }} in data_scope.

      Specified by:
      membershipRecordType in interface NamespaceRequest._FinalStage
    • defaultSchemaId

      public NamespaceRequest._FinalStage defaultSchemaId(String defaultSchemaId)

      Optional ID of a record schema (created via POST /v1/schemas) bound as the default governing schema for entities created in this namespace. Must belong to your account.

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

      public NamespaceRequest._FinalStage defaultSchemaId(Optional<String> defaultSchemaId)

      Optional ID of a record schema (created via POST /v1/schemas) bound as the default governing schema for entities created in this namespace. Must belong to your account.

      Specified by:
      defaultSchemaId in interface NamespaceRequest._FinalStage
    • entityBacked

      public NamespaceRequest._FinalStage entityBacked(Boolean entityBacked)

      When true, every scope:<namespace> value in this namespace must resolve to an existing identity entity of the same account and namespace (create entities via POST /v1/entities/{namespace}), and the namespace gains the full identity-entity surface — list its entities, look them up by schema field, and filter other resources by them as a parent. When false (the default), values in this namespace are free-form strings validated by grammar only.

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

      public NamespaceRequest._FinalStage entityBacked(Optional<Boolean> entityBacked)

      When true, every scope:<namespace> value in this namespace must resolve to an existing identity entity of the same account and namespace (create entities via POST /v1/entities/{namespace}), and the namespace gains the full identity-entity surface — list its entities, look them up by schema field, and filter other resources by them as a parent. When false (the default), values in this namespace are free-form strings validated by grammar only.

      Specified by:
      entityBacked in interface NamespaceRequest._FinalStage
    • build

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

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

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