roboto.domain.collections#

Submodules#

Package Contents#

class roboto.domain.collections.Collection(record, roboto_client=None)#

A higher-level container for grouping datasets together. Collections can also be used to group files from several distinct datasets together.

Parameters:
add_dataset(dataset_id)#
Parameters:

dataset_id (str)

Return type:

Collection

add_event(event_id)#
Parameters:

event_id (str)

Return type:

Collection

add_file(file_id)#
Parameters:

file_id (str)

Return type:

Collection

changes(from_version=None, to_version=None)#
Parameters:
  • from_version (Optional[int])

  • to_version (Optional[int])

Return type:

collections.abc.Generator[roboto.domain.collections.record.CollectionChangeRecord, None, None]

clear_custom_field(name)#

Clear a single custom-field value on this collection to None.

Parameters:

name (str)

Return type:

Collection

clear_custom_fields(names)#

Clear multiple custom-field values on this collection to None.

Parameters:

names (collections.abc.Sequence[str])

Return type:

Collection

property collection_id: str#
Return type:

str

classmethod create(description=None, name=None, resource_type=CollectionResourceType.File, resources=None, dataset_ids=None, event_ids=None, file_ids=None, tags=None, custom_fields=None, roboto_client=None, caller_org_id=None)#
Parameters:
Return type:

Collection

property created: datetime.datetime#
Return type:

datetime.datetime

property created_by: str#
Return type:

str

property custom_fields: dict[str, Any]#

Custom-field values defined on Collections in this org.

Every Ready CustomField defined for (org_id, Collection) appears as a key. Values that have not been set on this collection surface as None rather than being absent. Empty when no custom fields are defined for the org.

Return type:

dict[str, Any]

property datasets: list[str]#
Return type:

list[str]

delete()#
edit_access(edit)#
Parameters:

edit (roboto.auth.EditAccessRequest)

Return type:

roboto.auth.GetAccessResponse

property events: list[str]#
Return type:

list[str]

property files: list[str]#
Return type:

list[str]

classmethod from_id(collection_id, version=None, content_mode=CollectionContentMode.Full, roboto_client=None)#
Parameters:
Return type:

Collection

get_access()#
Return type:

roboto.auth.GetAccessResponse

classmethod list_all(roboto_client=None, owner_org_id=None, content_mode=CollectionContentMode.SummaryOnly, sort_by=None, sort_direction=None)#
Parameters:
Return type:

collections.abc.Generator[Collection, None, None]

property record: roboto.domain.collections.record.CollectionRecord#
Return type:

roboto.domain.collections.record.CollectionRecord

remove_dataset(dataset_id)#
Parameters:

dataset_id (str)

Return type:

Collection

remove_event(event_id)#
Parameters:

event_id (str)

Return type:

Collection

remove_file(file_id)#
Parameters:

file_id (str)

Return type:

Collection

set_custom_field(name, value)#

Set a single custom-field value on this collection.

name must be the name of a Ready custom field for this collection’s org and the Collection entity type; value must satisfy the field’s declared type.

Parameters:
  • name (str)

  • value (Any)

Return type:

Collection

set_custom_fields(fields)#

Set or overwrite multiple custom-field values on this collection.

Each key must name a Ready custom field for this collection’s org and the Collection entity type; each value must satisfy the field’s declared type.

Parameters:

fields (dict[str, Any])

Return type:

Collection

update(add_resources=NotSet, add_tags=NotSet, description=NotSet, name=NotSet, remove_resources=NotSet, remove_tags=NotSet, custom_fields_changeset=None)#
Parameters:
Return type:

Collection

property updated: datetime.datetime#
Return type:

datetime.datetime

property updated_by: str#
Return type:

str

class roboto.domain.collections.CollectionChangeRecord(/, **data)#

Bases: pydantic.BaseModel

A wire-transmissible representation of a collection change record

Parameters:

data (Any)

applied: datetime.datetime#
applied_by: str#
change_set: CollectionChangeSet#
collection_id: str#
from_version: int#
to_version: int#
class roboto.domain.collections.CollectionChangeSet(/, **data)#

Bases: pydantic.BaseModel

Changeset for updating a collection

Parameters:

data (Any)

added_resources: list[CollectionResourceRef] = None#
added_tags: list[str] = None#
field_changes: dict[str, Any] = None#
removed_resources: list[CollectionResourceRef] = None#
removed_tags: list[str] = None#
class roboto.domain.collections.CollectionContentMode#

Bases: roboto.compat.StrEnum

Desired content mode for representing a collection

Full = 'full'#
References = 'references'#
SummaryOnly = 'summary_only'#
class roboto.domain.collections.CollectionRecord(/, **data)#

Bases: pydantic.BaseModel

A wire-transmissible representation of a collection

Parameters:

data (Any)

collection_id: str#
created: datetime.datetime#
created_by: str#
custom_fields: dict[str, Any] = None#

Values for the custom fields defined on Collections in this org.

Every Ready custom field defined for (org_id, Collection) appears as a key; values that have not been set surface as None rather than being absent. Empty when no custom fields are defined for the org.

description: str | None = None#
missing: dict[CollectionResourceType, list[CollectionResourceRef]] = None#
name: str | None = None#
org_id: str#
resource_type: CollectionResourceType#
resources: dict[CollectionResourceType, list[Any]] = None#
tags: list[str] = []#
updated: datetime.datetime#
updated_by: str#
version: int#
class roboto.domain.collections.CollectionResourceRef(/, **data)#

Bases: pydantic.BaseModel

Reference to a collection resource

Parameters:

data (Any)

resource_id: str#
resource_type: CollectionResourceType#
resource_version: str | None = None#
class roboto.domain.collections.CollectionResourceType#

Bases: roboto.compat.StrEnum

Type of resource added to a collection

Dataset = 'dataset'#
Event = 'event'#
File = 'file'#
class roboto.domain.collections.CreateCollectionRequest(/, **data)#

Bases: pydantic.BaseModel

Request payload to create a collection

Parameters:

data (Any)

custom_fields: dict[str, Any] | None = None#

Initial values for Ready custom fields on this collection.

Each key must be the name of a CustomField that is Ready for the caller’s org and the Collection entity type; each value must satisfy the field’s declared type. Names that are undefined or not Ready, and values that don’t match the field’s type, are rejected with a structured error.

description: str | None = None#
name: str | None = None#
resource_type: roboto.domain.collections.record.CollectionResourceType#
resources: list[roboto.domain.collections.record.CollectionResourceRef] | None = None#
tags: list[str] | None = None#
class roboto.domain.collections.UpdateCollectionRequest(/, **data)#

Bases: pydantic.BaseModel

Request payload to update a collection

Parameters:

data (Any)

add_resources: list[roboto.domain.collections.record.CollectionResourceRef] | roboto.sentinels.NotSetType#
add_tags: list[str] | roboto.sentinels.NotSetType#
custom_fields_changeset: roboto.updates.CustomFieldChangeset | None = None#

Changes to apply to Ready custom-field values on this collection.

Each referenced field name must be a Ready custom field for this collection’s org and the Collection entity type; each set_fields value must satisfy the field’s declared type. Names that are undefined or not Ready are rejected with a structured error. Field names not mentioned by the changeset are left unchanged.

description: roboto.sentinels.NotSetType | str | None#
model_config#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

name: roboto.sentinels.NotSetType | str | None#
remove_resources: list[roboto.domain.collections.record.CollectionResourceRef] | roboto.sentinels.NotSetType#
remove_tags: list[str] | roboto.sentinels.NotSetType#