WorkbooksClient#

pub struct WorkbooksClient#

Client for workbook collection operations (get, search).

Implementations#

impl WorkbooksClient
pub async fn create_from_template(&self, template: &Template, scope: WorkbookDataScope, create: WorkbookCreate) -> Result<Workbook>#

Create a new workbook from a template, attached to the given asset or run.

The workbook reuses the template’s layout and content as-is. The title and description default to the template’s values when not overridden.

Example

use nominal::core::{WorkbookCreate, WorkbookDataScope};
let template = client.templates().get("ri.scout.cerulean-staging.template.<uuid>").await?;
let workbook = client.workbooks().create_from_template(
    &template,
    WorkbookDataScope::assets(["ri.scout.cerulean-staging.asset.<uuid>"]),
    WorkbookCreate::new().properties([("source_template_rid", template.rid())]),
).await?;
pub async fn get(&self, rid: &str) -> Result<Workbook>#

Get a workbook by RID.

pub async fn get_batch<I, S>(&self, rids: I) -> Result<HashMap<String, Workbook>> where I: IntoIterator<Item = S>, S: AsRef<str>#

Get multiple workbooks by RID.

Returns a map from RID string to Workbook. RIDs not found in Nominal are omitted.

pub async fn search(&self, query: WorkbookQuery) -> Result<Vec<Workbook>>#

Search workbooks with a query, collecting all pages eagerly.

Example

use nominal::core::WorkbookQuery;
let workbooks = client.workbooks()
    .search(WorkbookQuery::and([
        WorkbookQuery::asset_rid("ri.scout.cerulean-staging.asset.<uuid>"),
        WorkbookQuery::property("source_template_rid", "ri.scout.cerulean-staging.template.<uuid>"),
    ]))
    .await?;
pub async fn archive(&self, rid: &str) -> Result<()>#

Archive a workbook. Archived workbooks are hidden from the UI but not deleted.

pub async fn unarchive(&self, rid: &str) -> Result<()>#

Unarchive a workbook, restoring its visibility in the UI.

Trait implementations#

Auto traits: Send, Sync, Unpin, !UnwindSafe, !RefUnwindSafe