Class UserProfile.Builder
-
- All Implemented Interfaces:
public final class UserProfile.BuilderA builder for UserProfile.
-
-
Method Summary
Modifier and Type Method Description final UserProfile.Builderid(String id)Unique identifier for this user profile, prefixed uprof_.final UserProfile.Builderid(JsonField<String> id)Sets Builder.id to an arbitrary JSON value. final UserProfile.BuilderaccessType(UserProfileAccessType accessType)How the platform uses the API for this entity: application(default) orpassthrough.final UserProfile.BuilderaccessType(JsonField<UserProfileAccessType> accessType)Sets Builder.accessType to an arbitrary JSON value. final UserProfile.BuildercreatedAt(OffsetDateTime createdAt)When this user profile was created, in RFC 3339 format. final UserProfile.BuildercreatedAt(JsonField<OffsetDateTime> createdAt)Sets Builder.createdAt to an arbitrary JSON value. final UserProfile.BuilderenforcementActions(List<UserProfileEnforcementAction> enforcementActions)The enforcement actions open on this profile; empty when none is open. final UserProfile.BuilderenforcementActions(JsonField<List<UserProfileEnforcementAction>> enforcementActions)Sets Builder.enforcementActions to an arbitrary JSON value. final UserProfile.BuilderenforcementStatus(UserProfileEnforcementStatus enforcementStatus)Anthropic's enforcement status of this profile, from its open enforcement actions and any identity check under review, by the first rule that applies: bannedwhile any open action is aban;pendingwhile a restriction that an identity check can clear is open, the end user has submitted that check, Anthropic's review of it has not ended, and no open action'sreasonisaccount_compromise;restrictedwhile any action is open;unrestrictedwhile none is.final UserProfile.BuilderenforcementStatus(JsonField<UserProfileEnforcementStatus> enforcementStatus)Sets Builder.enforcementStatus to an arbitrary JSON value. final UserProfile.BuilderexternalUserDetails(UserProfileExternalUserDetails externalUserDetails)Details about the entity this profile represents, as the platform states them; not verified by Anthropic. final UserProfile.BuilderexternalUserDetails(JsonField<UserProfileExternalUserDetails> externalUserDetails)Sets Builder.externalUserDetails to an arbitrary JSON value. final UserProfile.Buildermetadata(UserProfile.Metadata metadata)Arbitrary key-value metadata. final UserProfile.Buildermetadata(JsonField<UserProfile.Metadata> metadata)Sets Builder.metadata to an arbitrary JSON value. final UserProfile.Buildername(String name)Real-world name of the entity this profile represents (company or individual). final UserProfile.Buildername(Optional<String> name)Alias for calling Builder.name with name.orElse(null).final UserProfile.Buildername(JsonField<String> name)Sets Builder.name to an arbitrary JSON value. final UserProfile.Builderprograms(UserProfilePrograms programs)The profile's standing in each Anthropic program, such as the Cyber Verification Program. final UserProfile.Builderprograms(JsonField<UserProfilePrograms> programs)Sets Builder.programs to an arbitrary JSON value. final UserProfile.Buildertype(JsonValue type)Sets the field to an arbitrary JSON value. final UserProfile.BuilderupdatedAt(OffsetDateTime updatedAt)When this user profile was last modified, in RFC 3339 format. final UserProfile.BuilderupdatedAt(JsonField<OffsetDateTime> updatedAt)Sets Builder.updatedAt to an arbitrary JSON value. final UserProfile.BuilderadditionalProperties(Map<String, JsonValue> additionalProperties)final UserProfile.BuilderaddEnforcementAction(UserProfileEnforcementAction enforcementAction)Adds a single UserProfileEnforcementAction to enforcementActions. final UserProfile.BuilderaddEnforcementAction(UserProfileEnforcementActionRestriction restriction)Alias for calling addEnforcementAction with UserProfileEnforcementAction.ofRestriction(restriction).final UserProfile.BuilderaddEnforcementAction(UserProfileEnforcementActionBan ban)Alias for calling addEnforcementAction with UserProfileEnforcementAction.ofBan(ban).final UserProfile.BuilderputAdditionalProperty(String key, JsonValue value)final UserProfile.BuilderputAllAdditionalProperties(Map<String, JsonValue> additionalProperties)final UserProfile.BuilderremoveAdditionalProperty(String key)final UserProfile.BuilderremoveAllAdditionalProperties(Set<String> keys)final UserProfilebuild()Returns an immutable instance of UserProfile. -
-
Method Detail
-
id
final UserProfile.Builder id(String id)
Unique identifier for this user profile, prefixed
uprof_.
-
id
final UserProfile.Builder id(JsonField<String> id)
Sets Builder.id to an arbitrary JSON value.
You should usually call Builder.id with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
accessType
final UserProfile.Builder accessType(UserProfileAccessType accessType)
How the platform uses the API for this entity:
application(default) orpassthrough. Absent under the legacyuser-profiles-2026-03-24beta header.
-
accessType
final UserProfile.Builder accessType(JsonField<UserProfileAccessType> accessType)
Sets Builder.accessType to an arbitrary JSON value.
You should usually call Builder.accessType with a well-typed UserProfileAccessType value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
createdAt
final UserProfile.Builder createdAt(OffsetDateTime createdAt)
When this user profile was created, in RFC 3339 format.
-
createdAt
final UserProfile.Builder createdAt(JsonField<OffsetDateTime> createdAt)
Sets Builder.createdAt to an arbitrary JSON value.
You should usually call Builder.createdAt with a well-typed OffsetDateTime value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
enforcementActions
final UserProfile.Builder enforcementActions(List<UserProfileEnforcementAction> enforcementActions)
The enforcement actions open on this profile; empty when none is open. Absent under the
user-profiles-2026-09-04and earlier beta headers.
-
enforcementActions
final UserProfile.Builder enforcementActions(JsonField<List<UserProfileEnforcementAction>> enforcementActions)
Sets Builder.enforcementActions to an arbitrary JSON value.
You should usually call Builder.enforcementActions with a well-typed
List<UserProfileEnforcementAction>value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
enforcementStatus
final UserProfile.Builder enforcementStatus(UserProfileEnforcementStatus enforcementStatus)
Anthropic's enforcement status of this profile, from its open enforcement actions and any identity check under review, by the first rule that applies:
bannedwhile any open action is aban;pendingwhile a restriction that an identity check can clear is open, the end user has submitted that check, Anthropic's review of it has not ended, and no open action'sreasonisaccount_compromise;restrictedwhile any action is open;unrestrictedwhile none is. Absent under theuser-profiles-2026-09-04and earlier beta headers.
-
enforcementStatus
final UserProfile.Builder enforcementStatus(JsonField<UserProfileEnforcementStatus> enforcementStatus)
Sets Builder.enforcementStatus to an arbitrary JSON value.
You should usually call Builder.enforcementStatus with a well-typed UserProfileEnforcementStatus value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
externalUserDetails
final UserProfile.Builder externalUserDetails(UserProfileExternalUserDetails externalUserDetails)
Details about the entity this profile represents, as the platform states them; not verified by Anthropic. Every field is present,
nulluntil the platform supplies a value. Absent under the legacyuser-profiles-2026-03-24anduser-profiles-2026-08-18beta headers, which servereference_idas the top-levelexternal_idand, underuser-profiles-2026-08-18,onboarded_atasexternal_user_onboarded_at.
-
externalUserDetails
final UserProfile.Builder externalUserDetails(JsonField<UserProfileExternalUserDetails> externalUserDetails)
Sets Builder.externalUserDetails to an arbitrary JSON value.
You should usually call Builder.externalUserDetails with a well-typed UserProfileExternalUserDetails value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
metadata
final UserProfile.Builder metadata(UserProfile.Metadata metadata)
Arbitrary key-value metadata. Maximum 16 pairs, keys up to 64 chars, values up to 512 chars.
-
metadata
final UserProfile.Builder metadata(JsonField<UserProfile.Metadata> metadata)
Sets Builder.metadata to an arbitrary JSON value.
You should usually call Builder.metadata with a well-typed Metadata value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
name
final UserProfile.Builder name(String name)
Real-world name of the entity this profile represents (company or individual). For a company the platform resells Claude access to (
access_typepassthrough) this is that company's name.nulluntil the platform supplies one.
-
name
final UserProfile.Builder name(Optional<String> name)
Alias for calling Builder.name with
name.orElse(null).
-
name
final UserProfile.Builder name(JsonField<String> name)
Sets Builder.name to an arbitrary JSON value.
You should usually call Builder.name with a well-typed String value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
programs
final UserProfile.Builder programs(UserProfilePrograms programs)
The profile's standing in each Anthropic program, such as the Cyber Verification Program. Present when the request sends no user-profiles beta header; absent under the
user-profiles-2026-09-04and earlier beta headers, which servetrust_grantsinstead.
-
programs
final UserProfile.Builder programs(JsonField<UserProfilePrograms> programs)
Sets Builder.programs to an arbitrary JSON value.
You should usually call Builder.programs with a well-typed UserProfilePrograms value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
type
final UserProfile.Builder type(JsonValue type)
Sets the field to an arbitrary JSON value.
It is usually unnecessary to call this method because the field defaults to the following:
JsonValue.from("user_profile")This method is primarily for setting the field to an undocumented or not yet supported value.
-
updatedAt
final UserProfile.Builder updatedAt(OffsetDateTime updatedAt)
When this user profile was last modified, in RFC 3339 format. It normally also updates shortly after Anthropic gives the profile an approval or withdraws one. Other changes to the statuses that Anthropic reports do not always update it, so read the status itself rather than watching this timestamp.
-
updatedAt
final UserProfile.Builder updatedAt(JsonField<OffsetDateTime> updatedAt)
Sets Builder.updatedAt to an arbitrary JSON value.
You should usually call Builder.updatedAt with a well-typed OffsetDateTime value instead. This method is primarily for setting the field to an undocumented or not yet supported value.
-
additionalProperties
final UserProfile.Builder additionalProperties(Map<String, JsonValue> additionalProperties)
-
addEnforcementAction
final UserProfile.Builder addEnforcementAction(UserProfileEnforcementAction enforcementAction)
Adds a single UserProfileEnforcementAction to enforcementActions.
-
addEnforcementAction
final UserProfile.Builder addEnforcementAction(UserProfileEnforcementActionRestriction restriction)
Alias for calling addEnforcementAction with
UserProfileEnforcementAction.ofRestriction(restriction).
-
addEnforcementAction
final UserProfile.Builder addEnforcementAction(UserProfileEnforcementActionBan ban)
Alias for calling addEnforcementAction with
UserProfileEnforcementAction.ofBan(ban).
-
putAdditionalProperty
final UserProfile.Builder putAdditionalProperty(String key, JsonValue value)
-
putAllAdditionalProperties
final UserProfile.Builder putAllAdditionalProperties(Map<String, JsonValue> additionalProperties)
-
removeAdditionalProperty
final UserProfile.Builder removeAdditionalProperty(String key)
-
removeAllAdditionalProperties
final UserProfile.Builder removeAllAdditionalProperties(Set<String> keys)
-
build
final UserProfile build()
Returns an immutable instance of UserProfile.
Further updates to this Builder will not mutate the returned instance.
The following fields are required:
.id() .accessType() .createdAt() .enforcementActions() .enforcementStatus() .externalUserDetails() .metadata() .name() .programs() .updatedAt()
-
-
-
-