Skip to content
Roboto
Esc
↑↓navigate↵open⌘Jpreview
On this page

roboto.domain.collections.collection

Module Contents

Collection

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

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

Collection.add_dataset()

add_dataset(dataset_id)#View Source

Parameters

dataset_id str

Return type

Collection.add_event()

add_event(event_id)#View Source

Parameters

event_id str

Return type

Collection.add_file()

add_file(file_id)#View Source

Parameters

file_id str

Return type

Collection.add_session()

add_session(session_id)#View Source

Parameters

session_id str

Return type

Collection.changes()

changes(from_version=None, to_version=None)#View Source

Yield this collection’s revision history, oldest change first.

Version 0 is a real collection version, so 0 is a bound like any other: from_version=0 starts at the beginning, and to_version=0 selects the empty range. Omit a bound to leave that end open.

Parameters

from_version Optional[int]
to_version Optional[int]

Return type

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

Collection.clear_custom_field()

clear_custom_field(name)#View Source

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

Parameters

name str

Return type

Collection.clear_custom_fields()

clear_custom_fields(names)#View Source

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

Parameters

names collections.abc.Sequence[str]

Return type

Properties

Collection.collection_id

collection_id str #
Return type: str

Collection.create()

classmethod create(description=None, name=None, resource_type=CollectionResourceType.File, resources=None, dataset_ids=None, event_ids=None, file_ids=None, session_ids=None, tags=None, custom_fields=None, roboto_client=None, caller_org_id=None)#View Source

Parameters

description Optional[str]
name Optional[str]
dataset_ids Optional[collections.abc.Collection[str]]
event_ids Optional[collections.abc.Collection[str]]
file_ids Optional[collections.abc.Collection[str]]
session_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

Properties

Collection.created

created datetime.datetime #
Return type: datetime.datetime

Collection.created_by

created_by str #
Return type: str

Collection.custom_fields

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.

A Timestamp value is returned as an ISO 8601 string.

Return type: dict[str, Any]

Collection.datasets

datasets list[str] #
Return type: list[str]

Collection.delete()

delete()#View Source

Properties

Collection.description

description str | None #
Return type: Optional[str]

Collection.edit_access()

edit_access(edit)#View Source

Properties

Collection.events

events list[str] #
Return type: list[str]

Collection.files

files list[str] #
Return type: list[str]

Collection.from_id()

classmethod from_id(collection_id, version=None, content_mode=CollectionContentMode.Full, roboto_client=None)#View Source

Parameters

collection_id str
version Optional[int]
roboto_client Optional[roboto.http.RobotoClient]

Return type

Collection.get_access()

get_access()#View Source

Collection.list_all()

classmethod list_all(roboto_client=None, owner_org_id=None, content_mode=CollectionContentMode.SummaryOnly, sort_by=None, sort_direction=None)#View Source

Parameters

roboto_client Optional[roboto.http.RobotoClient]
owner_org_id Optional[str]
sort_by Optional[str]
sort_direction Optional[roboto.query.SortDirection]

Return type

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

Properties

Collection.name

name str | None #
Return type: Optional[str]

Collection.remove_dataset()

remove_dataset(dataset_id)#View Source

Parameters

dataset_id str

Return type

Collection.remove_event()

remove_event(event_id)#View Source

Parameters

event_id str

Return type

Collection.remove_file()

remove_file(file_id)#View Source

Parameters

file_id str

Return type

Collection.remove_session()

remove_session(session_id)#View Source

Parameters

session_id str

Return type

Properties

Collection.resource_count

resource_count int #

Number of resources this collection holds.

Read from the collection record rather than from resources, so it is available in every content mode, including summary-only loads where the member list is empty. Counts every membership reference, including references to resources that have since been deleted.

Return type: int

Collection.sessions

sessions list[str] #
Return type: list[str]

Collection.set_custom_field()

set_custom_field(name, value)#View Source

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

set_custom_fields(fields)#View Source

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

update(add_resources=NotSet, add_tags=NotSet, description=NotSet, name=NotSet, remove_resources=NotSet, remove_tags=NotSet, custom_fields_changeset=None)#View Source

Parameters

add_tags Union[list[str], roboto.sentinels.NotSetType]
description Optional[Union[roboto.sentinels.NotSetType, str]]
name Optional[Union[roboto.sentinels.NotSetType, str]]
remove_tags Union[list[str], roboto.sentinels.NotSetType]
custom_fields_changeset Optional[roboto.updates.CustomFieldChangeset]

Return type

Properties

Collection.updated

updated datetime.datetime #
Return type: datetime.datetime

Collection.updated_by

updated_by str #
Return type: str

Was this page helpful?