datasets
client.datasets lists the tenant’s registered datasets and registers new ones. Registering a dataset creates its root key domain.
list
list returns every registered dataset.
list(): Promise<Dataset[]>;func list() async throws -> [Dataset]suspend fun list(): List<Dataset>Returns: Every Dataset registered in the tenant.
Records: Nothing. Not a decision.
Errors: no-session, unreachable.
register
register registers a dataset and creates its root key domain. When this device’s person is the first domain owner, the SDK creates the domain key and saves a recovery copy of it. It needs a complete backup key registration.
register(dataset: Omit<Dataset, 'root'> & { storageBinding: unknown; firstOwner: Person }): Promise<Decided<Dataset>>;func register(_ registration: DatasetRegistration) async throws -> Decided<Dataset>suspend fun register(registration: DatasetRegistration): Decided<Dataset>In Swift and Kotlin the argument is a DatasetRegistration, declared under Types. Its fields are the same.
| Parameter | Type | Description |
|---|---|---|
name | string | The dataset’s name. |
classification | Classification | "phi", "pii", "public" or "de-identified". |
storage | { kind: "object-storage" | "file-share" | "database" } | The storage kind. |
indexFields | string[] | Fields the saving Client writes into the folder index. They are searchable. |
subjectField | string, optional | The field the SDK tokenizes into the subject ref at save. |
segmentFields | string[] | Fields with a segment of their own, the HIPAA identifiers by default and what the customer adds. |
retentionFloor | seconds | The dataset’s retention floor. |
storageBinding | StorageBinding | Where and under what credentials the objects live, such as a bucket, a prefix, a region and a role for a dataset on S3. |
firstOwner | Person | The dataset’s first domain owner. |
Returns: A Decided<Dataset>: on allow, the registered Dataset with its root.
Records: One decision and one access event.
Who may call it: The Owner or Admin role.
Errors: no-session, unreachable, storage-unreachable.
Types
Dataset
interface Dataset { name: string; classification: Classification; storage: { kind: 'object-storage' | 'file-share' | 'database' }; root: Locator; indexFields: string[]; subjectField?: string; segmentFields: string[]; retentionFloor: Seconds;}struct Dataset { let name: String let classification: Classification let storage: Storage let root: Locator let indexFields: [String] let subjectField: String? let segmentFields: [String] let retentionFloor: TimeInterval
struct Storage { let kind: Kind } enum Kind { case objectStorage, fileShare, database }}data class Dataset( val name: String, val classification: Classification, val storage: Storage, val root: Locator, val indexFields: List<String>, val subjectField: String?, val segmentFields: List<String>, val retentionFloor: Duration,) { data class Storage(val kind: Kind) enum class Kind { OBJECT_STORAGE, FILE_SHARE, DATABASE }}| Field | Type | Description |
|---|---|---|
name | string | The dataset’s name. |
classification | Classification | Its classification. |
storage | { kind } | Object storage, a file share or a database. |
root | Locator | The dataset’s root key domain. |
indexFields | string[] | Fields written into the folder index. They are searchable on the device. |
subjectField | string, optional | The field the SDK tokenizes into the subject ref at save. |
segmentFields | string[] | Fields with a segment of their own. |
retentionFloor | seconds | The dataset’s retention floor. |
DatasetRegistration
What register takes: every field of Dataset except root, which the Seald Healthcare Cloud assigns, plus storageBinding and firstOwner.
// written inline in the register signature:type DatasetRegistration = Omit<Dataset, 'root'> & { storageBinding: StorageBinding; firstOwner: Person };struct DatasetRegistration { let name: String let classification: Classification let storage: Dataset.Storage let indexFields: [String] var subjectField: String? = nil let segmentFields: [String] let retentionFloor: TimeInterval let storageBinding: StorageBinding let firstOwner: Person}data class DatasetRegistration( val name: String, val classification: Classification, val storage: Dataset.Storage, val indexFields: List<String>, val subjectField: String? = null, val segmentFields: List<String>, val retentionFloor: Duration, val storageBinding: StorageBinding, val firstOwner: Person,)| Field | Type | Description |
|---|---|---|
name, classification, storage, indexFields, subjectField, segmentFields, retentionFloor | as on Dataset | The dataset’s own fields. |
storageBinding | StorageBinding | Where and under what credentials the objects live. Only the Seald Healthcare Cloud holds the binding and its credentials. A device never does. |
firstOwner | Person | The dataset’s first domain owner. |
StorageBinding
Where a dataset’s objects live: a bucket on S3, or a table in a database.
type StorageBinding = { s3: S3Binding } | { database: DatabaseBinding };enum StorageBinding { case s3(S3Binding) case database(DatabaseBinding)}sealed interface StorageBinding { data class S3(val s3: S3Binding) : StorageBinding data class Database(val database: DatabaseBinding) : StorageBinding}| Case | Holds |
|---|---|
s3 | An S3Binding, for a dataset on object storage. |
database | A DatabaseBinding, for a dataset in a database. |
S3Binding
interface S3Binding { bucket: string; prefix: string; region: string; role: string;}struct S3Binding { let bucket: String let prefix: String let region: String let role: String}data class S3Binding(val bucket: String, val prefix: String, val region: String, val role: String)| Field | Type | Description |
|---|---|---|
bucket | string | The bucket the objects live in. |
prefix | string | The key prefix under which the Seald Healthcare Cloud grants access. |
region | string | The bucket’s region. |
role | string | The role the Seald Healthcare Cloud assumes for the bucket and prefix. |
DatabaseBinding
interface DatabaseBinding { schema: string; table: string;}struct DatabaseBinding { let schema: String let table: String}data class DatabaseBinding(val schema: String, val table: String)| Field | Type | Description |
|---|---|---|
schema | string | The database schema that holds the table. |
table | string | The table the records live in. |