# Marking

## class nominal.core.Marking(rid, id, description, symbol, color, created_at, updated_at, is_archived)

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()

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()`](https://dev.nominal.io/python/ref/generated/nominal.core.Marking.md#nominal.core.Marking.refresh "nominal.core.Marking.refresh") to see the change reflected.

### authorized_group_rids()

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**](https://dev.nominal.io/python/ref/generated/nominal.exceptions.NominalError.md#nominal.exceptions.NominalError "nominal.exceptions.NominalError") – If the request fails.

Return type:
:   [*Sequence*](https://docs.python.org/3/library/typing.html#typing.Sequence "(in Python v3.15)")[[*str*](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")]

### refresh()

Return type:
:   [*Self*](https://docs.python.org/3/library/typing.html#typing.Self "(in Python v3.15)")

### unarchive()

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

> **Note**
>
> This does not update the instance in place; call [`refresh()`](https://dev.nominal.io/python/ref/generated/nominal.core.Marking.md#nominal.core.Marking.refresh "nominal.core.Marking.refresh") to see the change reflected.

### update(*, id=None, description=None, authorized_groups=None, symbol=_NotProvided(), color=_NotProvided())

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

Parameters:
:   - **id** ([*str*](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") *|* *None*)

      New human-readable identifier. Must be unique within the organization.
    - **description** ([*str*](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") *|* *None*)

      New description for the marking.
    - **authorized_groups** (*Sequence**[*[*str*](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)")*]* *|* *None*)

      Group RIDs replacing the existing ones. An empty sequence clears them.
    - **symbol** ([*Symbol*](https://dev.nominal.io/python/ref/generated/nominal.core.Symbol.md#nominal.core.Symbol "nominal.core.Symbol") *|* *None* *|* *_NotProvided*)

      New symbol. Pass None to remove the marking’s symbol.
    - **color** ([*str*](https://docs.python.org/3/builtins/stdtypes.html#str "(in Python v3.15)") *|* *None* *|* *_NotProvided*)

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

Returns:
:   This marking, updated in place.

Return type:
:   *Self*

> **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`](https://dev.nominal.io/python/ref/generated/nominal.core.Marking.md#nominal.core.Marking.symbol "nominal.core.Marking.symbol")/[`color`](https://dev.nominal.io/python/ref/generated/nominal.core.Marking.md#nominal.core.Marking.color "nominal.core.Marking.color") or an empty sequence to
> `authorized_groups`, which clear those fields.

Raises:
:   - [**ValueError**](https://docs.python.org/3/builtins/exceptions.html#ValueError "(in Python v3.15)") – If [`id`](https://dev.nominal.io/python/ref/generated/nominal.core.Marking.md#nominal.core.Marking.id "nominal.core.Marking.id") is not a valid marking id, or [`color`](https://dev.nominal.io/python/ref/generated/nominal.core.Marking.md#nominal.core.Marking.color "nominal.core.Marking.color") is not a valid hex color.
    - [**NominalError**](https://dev.nominal.io/python/ref/generated/nominal.exceptions.NominalError.md#nominal.exceptions.NominalError "nominal.exceptions.NominalError") – If the update request fails, including when the marking is archived.

Return type:
:   *Self*
