Dossier API – getEntitiesSample

getEntitiesSample is used to get a random sample of entities matching an optional query argument.

interface DossierClient {
getEntitiesSample(
query?: EntitySharedQuery,
options?: EntitySamplingOptions,
): PromiseResult<
EntitySamplingPayload,
"BadRequest" | "NotAuthorized" | "Generic"
>;
}

interface EntitySharedQuery {
authKeys?: string[];
entityTypes?: string[];
componentTypes?: string[];
status?: EntityStatus[];
valid?: boolean;
linksTo?: EntityReference;
linksFrom?: EntityReference;
boundingBox?: BoundingBox;
text?: string;
}

interface EntitySamplingOptions {
seed?: number;
count?: number;
}

interface EntitySamplingPayload {
seed: number;
totalCount: number;
items: Entity[];
}