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:
roboto_client (Optional[roboto.http.RobotoClient])
- add_dataset(dataset_id)#
- Parameters:
dataset_id (str)
- Return type:
- add_event(event_id)#
- Parameters:
event_id (str)
- Return type:
- add_file(file_id)#
- Parameters:
file_id (str)
- Return type:
- 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:
- clear_custom_fields(names)#
Clear multiple custom-field values on this collection to
None.- Parameters:
names (collections.abc.Sequence[str])
- Return type:
- 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:
description (Optional[str])
name (Optional[str])
resource_type (roboto.domain.collections.record.CollectionResourceType)
resources (Optional[list[roboto.domain.collections.record.CollectionResourceRef]])
dataset_ids (Optional[collections.abc.Collection[str]])
event_ids (Optional[collections.abc.Collection[str]])
file_ids (Optional[collections.abc.Collection[str]])
tags (Optional[list[str]])
custom_fields (Optional[dict[str, Any]])
roboto_client (Optional[roboto.http.RobotoClient])
caller_org_id (Optional[str])
- Return type:
- 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
ReadyCustomFielddefined for(org_id, Collection)appears as a key. Values that have not been set on this collection surface asNonerather 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:
- Return type:
- 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:
collection_id (str)
version (Optional[int])
content_mode (roboto.domain.collections.record.CollectionContentMode)
roboto_client (Optional[roboto.http.RobotoClient])
- Return type:
- get_access()#
- Return type:
- classmethod list_all(roboto_client=None, owner_org_id=None, content_mode=CollectionContentMode.SummaryOnly, sort_by=None, sort_direction=None)#
- Parameters:
roboto_client (Optional[roboto.http.RobotoClient])
owner_org_id (Optional[str])
content_mode (roboto.domain.collections.record.CollectionContentMode)
sort_by (Optional[str])
sort_direction (Optional[roboto.query.SortDirection])
- Return type:
collections.abc.Generator[Collection, None, None]
- property record: roboto.domain.collections.record.CollectionRecord#
- Return type:
- remove_dataset(dataset_id)#
- Parameters:
dataset_id (str)
- Return type:
- remove_event(event_id)#
- Parameters:
event_id (str)
- Return type:
- remove_file(file_id)#
- Parameters:
file_id (str)
- Return type:
- set_custom_field(name, value)#
Set a single custom-field value on this collection.
namemust be the name of aReadycustom field for this collection’s org and theCollectionentity type;valuemust satisfy the field’s declared type.- Parameters:
name (str)
value (Any)
- Return type:
- 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
Collectionentity type; each value must satisfy the field’s declared type.- Parameters:
fields (dict[str, Any])
- Return type:
- update(add_resources=NotSet, add_tags=NotSet, description=NotSet, name=NotSet, remove_resources=NotSet, remove_tags=NotSet, custom_fields_changeset=None)#
- Parameters:
add_resources (Union[list[roboto.domain.collections.record.CollectionResourceRef], roboto.sentinels.NotSetType])
add_tags (Union[list[str], roboto.sentinels.NotSetType])
description (Optional[Union[roboto.sentinels.NotSetType, str]])
name (Optional[Union[roboto.sentinels.NotSetType, str]])
remove_resources (Union[list[roboto.domain.collections.record.CollectionResourceRef], roboto.sentinels.NotSetType])
remove_tags (Union[list[str], roboto.sentinels.NotSetType])
custom_fields_changeset (Optional[roboto.updates.CustomFieldChangeset])
- Return type:
- property updated: datetime.datetime#
- Return type:
datetime.datetime
- property updated_by: str#
- Return type:
str
- class roboto.domain.collections.CollectionChangeRecord(/, **data)#
Bases:
pydantic.BaseModelA 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.BaseModelChangeset 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.StrEnumDesired content mode for representing a collection
- Full = 'full'#
- References = 'references'#
- SummaryOnly = 'summary_only'#
- class roboto.domain.collections.CollectionRecord(/, **data)#
Bases:
pydantic.BaseModelA 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
Readycustom field defined for(org_id, Collection)appears as a key; values that have not been set surface asNonerather 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.BaseModelReference 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.StrEnumType of resource added to a collection
- Dataset = 'dataset'#
- Event = 'event'#
- File = 'file'#
- class roboto.domain.collections.CreateCollectionRequest(/, **data)#
Bases:
pydantic.BaseModelRequest 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
CustomFieldthat isReadyfor the caller’s org and theCollectionentity type; each value must satisfy the field’s declared type. Names that are undefined or notReady, 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.BaseModelRequest 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
Readycustom field for this collection’s org and theCollectionentity type; eachset_fieldsvalue must satisfy the field’s declared type. Names that are undefined or notReadyare 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#