Marking#

class nominal.core.Marking(rid: str, id: str, description: str, symbol: Symbol | None, color: str | None, created_at: IntegralNanosecondsUTC, updated_at: IntegralNanosecondsUTC, is_archived: bool)#

Bases: HasRid, RefreshableGrpcMixin[Marking]

A marking, restricting access to the data sources it is applied to.

Markings are scoped to an organization. Creating, updating, and archiving markings requires organization admin permissions; any member of the organization can read them.

rid: str#
id: str#

Human-readable identifier, unique within the organization. Markings have no separate name.

description: str#
symbol: Symbol | None#
color: str | None#

A lowercase six-digit hex color, e.g. #cc0000.

The service constrains stored colors to this form, so a color read back is always lowercase. An uppercase code passed to the SDK is lowercased rather than rejected.

created_at: IntegralNanosecondsUTC#
updated_at: IntegralNanosecondsUTC#
is_archived: bool#
archive() → None#

Archive the marking, preventing it from being applied or modified.

Archived markings are excluded from search but can still be retrieved by RID. Archiving fails if the marking is still applied to any resource.

Note

This does not update the instance in place; call refresh() to see the change reflected.

authorized_group_rids() → Sequence[str]#

The RIDs of groups authorized to access data sources carrying this marking.

Groups the user does not have permission to read are omitted.

Raises:

NominalError – If the request fails.

refresh() → Self#
unarchive() → None#

Unarchive the marking, restoring the ability to apply and modify it.

Note

This does not update the instance in place; call refresh() to see the change reflected.

update(*, id: str | None = None, description: str | None = None, authorized_groups: Sequence[str] | None = None, symbol: Symbol | None | _NotProvided = _NotProvided(), color: str | None | _NotProvided = _NotProvided()) → Self#

Replace marking metadata, updating the current instance and returning it.

Parameters:
  • id – New human-readable identifier. Must be unique within the organization.

  • description – New description for the marking.

  • authorized_groups – Group RIDs replacing the existing ones. An empty sequence clears them.

  • symbol – New symbol. Pass None to remove the marking’s symbol.

  • color – New six-digit hex color, e.g. #cc0000, in either case. Pass None to remove it.

Returns:

This marking, updated in place.

Note

Every argument left unset is omitted from the request and the corresponding field is left unchanged. That is distinct from passing None to symbol/color or an empty sequence to authorized_groups, which clear those fields.

Raises:
  • ValueError – If id is not a valid marking id, or color is not a valid hex color.

  • NominalError – If the update request fails, including when the marking is archived.