# 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

```rust
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

```rust
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`](https://doc.rust-lang.org/1.98.1/core/marker/trait.Send.html), [`Sync`](https://doc.rust-lang.org/1.98.1/core/marker/trait.Sync.html), [`Unpin`](https://doc.rust-lang.org/1.98.1/core/marker/trait.Unpin.html), [`!UnwindSafe`](https://doc.rust-lang.org/1.98.1/core/panic/unwind_safe/trait.UnwindSafe.html), [`!RefUnwindSafe`](https://doc.rust-lang.org/1.98.1/core/panic/unwind_safe/trait.RefUnwindSafe.html)
