pub struct FuncspecClient { /* private fields */ }Expand description
FuncSpec API client.
Implementations§
Source§impl FuncspecClient
impl FuncspecClient
Sourcepub fn new(base_url: &str, api_key: &str) -> Result<Self, Error>
pub fn new(base_url: &str, api_key: &str) -> Result<Self, Error>
Create a new client for the given host and API key.
Sourcepub fn with_timeout(
base_url: &str,
api_key: &str,
timeout: Duration,
) -> Result<Self, Error>
pub fn with_timeout( base_url: &str, api_key: &str, timeout: Duration, ) -> Result<Self, Error>
Create a client with a custom request timeout.
Sourcepub async fn validate_auth(&self) -> Result<UserInfo, Error>
pub async fn validate_auth(&self) -> Result<UserInfo, Error>
Validate the API key and return user/org info.
pub async fn list_projects(&self) -> Result<Vec<Project>, Error>
pub async fn list_projects_paged( &self, page: u32, per_page: u32, ) -> Result<PagedResponse<Project>, Error>
pub async fn get_project(&self, slug_or_id: &str) -> Result<Project, Error>
pub async fn create_project( &self, params: &CreateProjectParams, ) -> Result<Project, Error>
pub async fn delete_project(&self, slug_or_id: &str) -> Result<(), Error>
pub async fn list_items( &self, project_id: u64, filter: &ItemFilter, ) -> Result<(Vec<SpecItem>, Option<PaginationMeta>), Error>
pub async fn list_items_paged( &self, project_id: u64, filter: &ItemFilter, page: u32, per_page: u32, ) -> Result<PagedResponse<SpecItem>, Error>
Sourcepub async fn list_all_items(
&self,
project_id: u64,
filter: &ItemFilter,
) -> Result<Vec<SpecItem>, Error>
pub async fn list_all_items( &self, project_id: u64, filter: &ItemFilter, ) -> Result<Vec<SpecItem>, Error>
Fetch every item matching filter by walking all pages to exhaustion.
The server caps per at 100, so a large project needs several
round-trips. This loops list_items_paged using the pagination meta’s
total_pages (falling back to “stop on a short page”) so callers get
the complete set in one call.
Sourcepub async fn search_items(
&self,
project_id: u64,
query: &str,
filter: &ItemFilter,
) -> Result<PagedResponse<SpecItem>, Error>
pub async fn search_items( &self, project_id: u64, query: &str, filter: &ItemFilter, ) -> Result<PagedResponse<SpecItem>, Error>
Search spec items by full-text query, with optional type/tag filters.
Calls GET /projects/{project_id}/spec/items?q=
Sourcepub async fn resolve_item_id(
&self,
project_id: u64,
id_or_permalink: &str,
) -> Result<u64, Error>
pub async fn resolve_item_id( &self, project_id: u64, id_or_permalink: &str, ) -> Result<u64, Error>
Resolve an item identifier to a numeric ID.
Accepts either a numeric ID (passed through) or a permalink like F-123 / T-456.
Permalinks are resolved by paginating through items until found.
pub async fn get_item( &self, project_id: u64, id_or_permalink: &str, ) -> Result<SpecItem, Error>
pub async fn create_item( &self, project_id: u64, params: &CreateItemParams, ) -> Result<SpecItem, Error>
pub async fn update_item( &self, project_id: u64, item_id: u64, params: &UpdateItemParams, ) -> Result<SpecItem, Error>
pub async fn delete_item( &self, project_id: u64, item_id: u64, ) -> Result<(), Error>
Sourcepub async fn deprecate_item(
&self,
project_id: u64,
permalink: &str,
reason: Option<&str>,
confirm: bool,
) -> Result<(), Error>
pub async fn deprecate_item( &self, project_id: u64, permalink: &str, reason: Option<&str>, confirm: bool, ) -> Result<(), Error>
Mark a spec item out-of-scope (deprecated). Optional reason; confirm=true is required by the server when the item has active children (cascade). POST /projects/:pid/spec/items/:permalink/deprecate
Sourcepub async fn undeprecate_item(
&self,
project_id: u64,
permalink: &str,
) -> Result<(), Error>
pub async fn undeprecate_item( &self, project_id: u64, permalink: &str, ) -> Result<(), Error>
Restore a previously out-of-scope (deprecated) spec item to active scope. POST /projects/:pid/spec/items/:permalink/undeprecate
Sourcepub async fn transition_item_state(
&self,
project_id: u64,
permalink: &str,
state: &str,
) -> Result<SpecItem, Error>
pub async fn transition_item_state( &self, project_id: u64, permalink: &str, state: &str, ) -> Result<SpecItem, Error>
Transition a spec item’s workflow state.
Valid states: inbox, draft, accepted, integrated.
Allowed transitions: inbox→draft, draft→accepted/inbox,
accepted→integrated/draft, integrated→accepted.
Calls POST /projects/:project_id/spec/items/:permalink/transition.
pub async fn list_reviews( &self, spec_item_id: u64, ) -> Result<Vec<Review>, Error>
pub async fn create_review( &self, spec_item_id: u64, params: &CreateReviewParams, ) -> Result<Review, Error>
pub async fn list_jobs(&self) -> Result<Vec<Job>, Error>
pub async fn get_job(&self, project_id: u64, job_id: u64) -> Result<Job, Error>
Sourcepub async fn review_item(
&self,
project_id: u64,
item_id: u64,
) -> Result<Review, Error>
pub async fn review_item( &self, project_id: u64, item_id: u64, ) -> Result<Review, Error>
Trigger AI review of a single spec item.
Calls POST /projects/:project_id/work_package/:item_id/review.
Sourcepub async fn review_all(&self, project_id: u64) -> Result<u64, Error>
pub async fn review_all(&self, project_id: u64) -> Result<u64, Error>
Trigger batch AI review of all items in a project.
Calls POST /projects/:project_id/work_package/review_all and returns an
async Job that can be polled via [poll_job_until_done].
Sourcepub async fn propose_improvement(
&self,
project_id: u64,
item_id: u64,
) -> Result<Proposal, Error>
pub async fn propose_improvement( &self, project_id: u64, item_id: u64, ) -> Result<Proposal, Error>
Propose an AI-generated improvement for a spec item.
Calls POST /projects/:project_id/work_package/:item_id/propose.
Sourcepub async fn accept_proposal(
&self,
project_id: u64,
item_id: u64,
) -> Result<(), Error>
pub async fn accept_proposal( &self, project_id: u64, item_id: u64, ) -> Result<(), Error>
Accept a pending improvement proposal for a spec item.
Calls POST /projects/:project_id/work_package/:item_id/accept.
Sourcepub async fn reject_proposal(
&self,
project_id: u64,
item_id: u64,
) -> Result<(), Error>
pub async fn reject_proposal( &self, project_id: u64, item_id: u64, ) -> Result<(), Error>
Reject a pending improvement proposal for a spec item.
Calls POST /projects/:project_id/work_package/:item_id/reject.
Sourcepub async fn generate_tech(
&self,
project_id: u64,
item_id: u64,
) -> Result<TechProposals, Error>
pub async fn generate_tech( &self, project_id: u64, item_id: u64, ) -> Result<TechProposals, Error>
Generate technical spec proposals from a functional spec item.
Calls POST /projects/:project_id/work_package/:item_id/generate_tech.
Sourcepub async fn audit_item(
&self,
project_id: u64,
item_id: u64,
) -> Result<AuditResult, Error>
pub async fn audit_item( &self, project_id: u64, item_id: u64, ) -> Result<AuditResult, Error>
Run a code audit for a spec item.
Calls POST /projects/:project_id/work_package/:item_id/audit.
Sourcepub async fn get_project_job(
&self,
project_id: u64,
job_id: u64,
) -> Result<Job, Error>
pub async fn get_project_job( &self, project_id: u64, job_id: u64, ) -> Result<Job, Error>
Fetch a job by ID within a project context.
Calls GET /projects/:project_id/jobs/:job_id.
Sourcepub async fn poll_job_until_done(
&self,
project_id: u64,
job_id: u64,
timeout: Duration,
) -> Result<Job, Error>
pub async fn poll_job_until_done( &self, project_id: u64, job_id: u64, timeout: Duration, ) -> Result<Job, Error>
Poll a job until it reaches a terminal state (Completed or Failed).
Returns the final Job on completion, or Error::Timeout if timeout
elapses before the job finishes. Polls every 500 ms.
Sourcepub async fn transition_item_implementation(
&self,
project_id: u64,
item_id: u64,
status: &str,
) -> Result<(), Error>
pub async fn transition_item_implementation( &self, project_id: u64, item_id: u64, status: &str, ) -> Result<(), Error>
Transition an item’s implementation status one step at a time.
API: POST /projects/:project_id/spec/items/:item_id/transition_implementation
Sourcepub async fn link_commit(
&self,
project_id: u64,
item_id: u64,
params: &LinkCommitParams,
) -> Result<(), Error>
pub async fn link_commit( &self, project_id: u64, item_id: u64, params: &LinkCommitParams, ) -> Result<(), Error>
Associate a git commit with a spec item.
API: POST /projects/:project_id/work_package/:item_id/link_commit
Sourcepub async fn record_run(
&self,
project_id: u64,
item_id: u64,
params: &RecordRunParams,
) -> Result<Option<u64>, Error>
pub async fn record_run( &self, project_id: u64, item_id: u64, params: &RecordRunParams, ) -> Result<Option<u64>, Error>
Record an agent run against a spec item. Returns the run ID if the API provides one.
API: POST /projects/:project_id/work_package/:item_id/record_run
Sourcepub async fn review_item_functional(
&self,
project_id: u64,
item_id: u64,
) -> Result<Review, Error>
pub async fn review_item_functional( &self, project_id: u64, item_id: u64, ) -> Result<Review, Error>
Trigger a functional AI review for a spec item.
API: POST /projects/:project_id/work_package/:item_id/func_review
pub async fn list_usage(&self) -> Result<Vec<UsageLogEntry>, Error>
Sourcepub async fn get_project_stats(
&self,
project_id: u64,
release_version: Option<&str>,
) -> Result<ProjectStats, Error>
pub async fn get_project_stats( &self, project_id: u64, release_version: Option<&str>, ) -> Result<ProjectStats, Error>
Fetch aggregated dashboard stats for a project.
When release_version is Some, the server scopes every figure
(item counts, reviews, verdicts, coverage) to that version’s member
items. The response type becomes release_version_stats.
Sourcepub async fn get_usage_logs(
&self,
project_id: u64,
filter: &UsageFilter,
) -> Result<PagedResponse<UsageLogEntry>, Error>
pub async fn get_usage_logs( &self, project_id: u64, filter: &UsageFilter, ) -> Result<PagedResponse<UsageLogEntry>, Error>
Fetch LLM usage logs for a project (flat rows, no JSON:API wrapper).
Sourcepub async fn get_usage_stats(
&self,
project_id: u64,
year: Option<i32>,
month: Option<u32>,
) -> Result<UsageStats, Error>
pub async fn get_usage_stats( &self, project_id: u64, year: Option<i32>, month: Option<u32>, ) -> Result<UsageStats, Error>
Fetch LLM usage summary for a project (flat JSON, no JSON:API wrapper).
Pass year and month as integers to filter; defaults to the current month.
Sourcepub async fn export_project(
&self,
project_id: u64,
format: &str,
item_type: Option<&str>,
tag: Option<&str>,
release_version: Option<&str>,
) -> Result<ExportData, Error>
pub async fn export_project( &self, project_id: u64, format: &str, item_type: Option<&str>, tag: Option<&str>, release_version: Option<&str>, ) -> Result<ExportData, Error>
Export a project spec in the specified format.
Text formats (markdown, json, csv, html) return ExportData::Text.
Binary formats (pdf, docx) return ExportData::Binary.
Optional item_type ("functional" / "technical") and tag filters are
forwarded as query parameters to the API.
Sourcepub async fn get_viewable_html(&self, project_id: u64) -> Result<String, Error>
pub async fn get_viewable_html(&self, project_id: u64) -> Result<String, Error>
Fetch the viewable HTML spec for a project.
Calls GET /projects/:id/spec/view and returns the response body as a
UTF-8 string.
Sourcepub async fn list_snapshots(
&self,
project_id: u64,
) -> Result<Vec<Snapshot>, Error>
pub async fn list_snapshots( &self, project_id: u64, ) -> Result<Vec<Snapshot>, Error>
List all snapshots for a project.
Calls GET /projects/:project_id/snapshots.
Sourcepub async fn create_snapshot(
&self,
project_id: u64,
params: &CreateSnapshotParams,
) -> Result<Snapshot, Error>
pub async fn create_snapshot( &self, project_id: u64, params: &CreateSnapshotParams, ) -> Result<Snapshot, Error>
Create a new snapshot for a project.
Calls POST /projects/:project_id/snapshots.
Sourcepub async fn get_snapshot(
&self,
project_id: u64,
snapshot_id: u64,
) -> Result<Snapshot, Error>
pub async fn get_snapshot( &self, project_id: u64, snapshot_id: u64, ) -> Result<Snapshot, Error>
Get a single snapshot by ID.
Calls GET /projects/:project_id/snapshots/:snapshot_id.
Sourcepub async fn restore_snapshot(
&self,
project_id: u64,
snapshot_id: u64,
) -> Result<(), Error>
pub async fn restore_snapshot( &self, project_id: u64, snapshot_id: u64, ) -> Result<(), Error>
Restore project to the state captured in a snapshot.
Calls POST /projects/:project_id/snapshots/:snapshot_id/restore.
Sourcepub async fn delete_snapshot(
&self,
project_id: u64,
snapshot_id: u64,
) -> Result<(), Error>
pub async fn delete_snapshot( &self, project_id: u64, snapshot_id: u64, ) -> Result<(), Error>
Delete a snapshot.
Calls DELETE /projects/:project_id/snapshots/:snapshot_id.
Sourcepub async fn diff_snapshot(
&self,
project_id: u64,
snapshot_id: u64,
) -> Result<SnapshotDiff, Error>
pub async fn diff_snapshot( &self, project_id: u64, snapshot_id: u64, ) -> Result<SnapshotDiff, Error>
Get the diff between a snapshot and the current project state.
Calls GET /projects/:project_id/snapshots/:snapshot_id/diff.
Sourcepub async fn list_edges(
&self,
project_id: u64,
source_id: Option<u64>,
target_id: Option<u64>,
edge_type: Option<&str>,
) -> Result<Vec<DependencyEdge>, Error>
pub async fn list_edges( &self, project_id: u64, source_id: Option<u64>, target_id: Option<u64>, edge_type: Option<&str>, ) -> Result<Vec<DependencyEdge>, Error>
List dependency edges for a project, with optional filters.
Calls GET /projects/:project_id/graph/edges.
Sourcepub async fn create_edge(
&self,
project_id: u64,
params: &CreateEdgeParams,
) -> Result<DependencyEdge, Error>
pub async fn create_edge( &self, project_id: u64, params: &CreateEdgeParams, ) -> Result<DependencyEdge, Error>
Create a dependency edge between two spec items.
Calls POST /projects/:project_id/graph/edges.
Sourcepub async fn get_edge(
&self,
project_id: u64,
edge_id: u64,
) -> Result<DependencyEdge, Error>
pub async fn get_edge( &self, project_id: u64, edge_id: u64, ) -> Result<DependencyEdge, Error>
Get a single dependency edge by ID.
Calls GET /projects/:project_id/graph/edges/:id.
Sourcepub async fn delete_edge(
&self,
project_id: u64,
edge_id: u64,
) -> Result<(), Error>
pub async fn delete_edge( &self, project_id: u64, edge_id: u64, ) -> Result<(), Error>
Delete a dependency edge by ID.
Calls DELETE /projects/:project_id/graph/edges/:id.
Sourcepub async fn get_org_slug(&self) -> Result<String, Error>
pub async fn get_org_slug(&self) -> Result<String, Error>
Return the org slug for the authenticated user.
Calls GET /settings which returns data.attributes.slug.
Sourcepub async fn get_agent_instructions(
&self,
project_slug: &str,
) -> Result<Value, Error>
pub async fn get_agent_instructions( &self, project_slug: &str, ) -> Result<Value, Error>
Fetch live agent instructions for a project.
Calls GET /projects/:project_slug/agent_instructions and returns the
raw JSON response. Callers extract content for display or use the full
value for --raw output.
pub async fn list_runs( &self, project_id: u64, page: u32, per: u32, ) -> Result<(Vec<AuditRun>, Option<PaginationMeta>), Error>
Sourcepub async fn preview_run(
&self,
project_id: u64,
params: &CreateRunParams,
) -> Result<RunPreview, Error>
pub async fn preview_run( &self, project_id: u64, params: &CreateRunParams, ) -> Result<RunPreview, Error>
Resolve filter criteria into the matching item set without creating a run.
pub async fn create_run( &self, project_id: u64, params: &CreateRunParams, ) -> Result<AuditRun, Error>
pub async fn get_run( &self, project_id: u64, run_id: u64, page: u32, per: u32, ) -> Result<AuditRun, Error>
pub async fn update_run( &self, project_id: u64, run_id: u64, params: &UpdateRunParams, ) -> Result<AuditRun, Error>
pub async fn start_run( &self, project_id: u64, run_id: u64, ) -> Result<AuditRun, Error>
pub async fn pause_run( &self, project_id: u64, run_id: u64, ) -> Result<AuditRun, Error>
pub async fn resume_run( &self, project_id: u64, run_id: u64, ) -> Result<AuditRun, Error>
pub async fn cancel_run( &self, project_id: u64, run_id: u64, ) -> Result<AuditRun, Error>
pub async fn delete_run( &self, project_id: u64, run_id: u64, ) -> Result<(), Error>
Sourcepub async fn add_items_to_version(
&self,
project_id: u64,
version: &str,
spec_item_keys: &[String],
) -> Result<(), Error>
pub async fn add_items_to_version( &self, project_id: u64, version: &str, spec_item_keys: &[String], ) -> Result<(), Error>
Add one or more spec items to a release version (by semver or id). Items are identified by permalink (e.g. “T-414”) or numeric id. F-517 membership: POST /projects/:pid/release_versions/:ver/items
Sourcepub async fn remove_item_from_version(
&self,
project_id: u64,
version: &str,
spec_item_key: &str,
) -> Result<(), Error>
pub async fn remove_item_from_version( &self, project_id: u64, version: &str, spec_item_key: &str, ) -> Result<(), Error>
Remove a spec item from a release version (by semver or id). DELETE /projects/:pid/release_versions/:ver/items/:spec_item_key
Sourcepub async fn diff_versions(
&self,
project_id: u64,
version: &str,
other: &str,
) -> Result<VersionDiff, Error>
pub async fn diff_versions( &self, project_id: u64, version: &str, other: &str, ) -> Result<VersionDiff, Error>
T-509: diff two release versions by membership. GET /projects/:pid/release_versions/:ver/diff/:other
Sourcepub async fn clone_version(
&self,
project_id: u64,
version: &str,
semver: &str,
name: Option<&str>,
description: Option<&str>,
branch: Option<&str>,
) -> Result<ReleaseVersion, Error>
pub async fn clone_version( &self, project_id: u64, version: &str, semver: &str, name: Option<&str>, description: Option<&str>, branch: Option<&str>, ) -> Result<ReleaseVersion, Error>
T-509: clone a release version into a new one (copies memberships). POST /projects/:pid/release_versions/:ver/clone
Sourcepub async fn delete_version(
&self,
project_id: u64,
version: &str,
) -> Result<(), Error>
pub async fn delete_version( &self, project_id: u64, version: &str, ) -> Result<(), Error>
Delete a release version (does not delete its member items). DELETE /projects/:pid/release_versions/:ver
Sourcepub async fn create_version(
&self,
project_id: u64,
semver: &str,
name: Option<&str>,
description: Option<&str>,
branch: Option<&str>,
) -> Result<ReleaseVersion, Error>
pub async fn create_version( &self, project_id: u64, semver: &str, name: Option<&str>, description: Option<&str>, branch: Option<&str>, ) -> Result<ReleaseVersion, Error>
Create a new release version from scratch (F-503). POST /projects/:pid/release_versions { release_version: { semver, name, description, branch } }
Sourcepub async fn update_version(
&self,
project_id: u64,
version: &str,
semver: Option<&str>,
name: Option<&str>,
description: Option<&str>,
branch: Option<&str>,
) -> Result<ReleaseVersion, Error>
pub async fn update_version( &self, project_id: u64, version: &str, semver: Option<&str>, name: Option<&str>, description: Option<&str>, branch: Option<&str>, ) -> Result<ReleaseVersion, Error>
Update a release version’s metadata (F-503). PATCH /projects/:pid/release_versions/:ver { release_version: { name, semver, description, branch } } Only supplied fields are sent (and thus changed).
Sourcepub async fn transition_version(
&self,
project_id: u64,
version: &str,
lifecycle_state: &str,
) -> Result<ReleaseVersion, Error>
pub async fn transition_version( &self, project_id: u64, version: &str, lifecycle_state: &str, ) -> Result<ReleaseVersion, Error>
Step a release version’s lifecycle (F-503): planned -> in_progress -> shipped. POST /projects/:pid/release_versions/:ver/transition { lifecycle_state }
Sourcepub async fn move_item_in_version(
&self,
project_id: u64,
version: &str,
spec_item_key: &str,
position: i64,
) -> Result<ReleaseVersion, Error>
pub async fn move_item_in_version( &self, project_id: u64, version: &str, spec_item_key: &str, position: i64, ) -> Result<ReleaseVersion, Error>
Reorder a member item within a release version (F-503 ordered membership). PATCH /projects/:pid/release_versions/:ver/items/:spec_item_key { position }
Sourcepub async fn list_versions(
&self,
project_id: u64,
) -> Result<Vec<ReleaseVersion>, Error>
pub async fn list_versions( &self, project_id: u64, ) -> Result<Vec<ReleaseVersion>, Error>
List all release versions for a project. GET /projects/:pid/release_versions
Sourcepub async fn get_version(
&self,
project_id: u64,
version: &str,
include_deprecated: bool,
) -> Result<ReleaseVersion, Error>
pub async fn get_version( &self, project_id: u64, version: &str, include_deprecated: bool, ) -> Result<ReleaseVersion, Error>
Fetch one release version (by semver or id) WITH its member items. GET /projects/:pid/release_versions/:ver[?include_deprecated=true]
Sourcepub async fn report_implementation(
&self,
project_id: u64,
report: &ImplementationReport,
) -> Result<ImplementationReportResult, Error>
pub async fn report_implementation( &self, project_id: u64, report: &ImplementationReport, ) -> Result<ImplementationReportResult, Error>
T-511: batch implementation report-back ingest. Posts a structured report (items with status/drift/notes + newly-created items) to the server’s implementation_reports endpoint, which records drift history and steps each item’s implementation status via the state machine. POST /projects/:pid/implementation_reports
Sourcepub async fn preview_import(
&self,
project_id: u64,
raw_body: &str,
) -> Result<ImportPreview, Error>
pub async fn preview_import( &self, project_id: u64, raw_body: &str, ) -> Result<ImportPreview, Error>
Validate a CSV or JSON import file without committing.
Sends the raw file contents to POST /projects/:id/import/preview.
The server detects the format (CSV vs JSON) from the body content and
returns a preview with counts, duplicate titles, parsed items, and warnings.
Sourcepub async fn commit_import(
&self,
project_id: u64,
items: &[ImportItem],
) -> Result<ImportResult, Error>
pub async fn commit_import( &self, project_id: u64, items: &[ImportItem], ) -> Result<ImportResult, Error>
Commit a set of parsed import items, creating spec items in the project.
Calls POST /projects/{project_id}/import/commit with JSON body {{"items":[...]}}.
Returns an ImportResult with the count of created items and their
permalinks. NOTE: the commit endpoint does not accept a release version —
use add_items_to_version after commit to assign the created items.
Sourcepub async fn upload_document(
&self,
project_id: u64,
filename: &str,
mime_type: &str,
bytes: Vec<u8>,
) -> Result<DocumentUpload, Error>
pub async fn upload_document( &self, project_id: u64, filename: &str, mime_type: &str, bytes: Vec<u8>, ) -> Result<DocumentUpload, Error>
Upload a raw document (PDF / DOCX / Markdown / text) to start an import
session. POST /projects/:id/import/upload (multipart field file).
Sourcepub async fn start_extract(
&self,
project_id: u64,
session_id: u64,
) -> Result<ImportStageStarted, Error>
pub async fn start_extract( &self, project_id: u64, session_id: u64, ) -> Result<ImportStageStarted, Error>
Queue pass-1 extraction. POST .../import/sessions/:sid/extract (202).
A 409 (invalid_state) means a run is already in progress.
Sourcepub async fn start_enrich(
&self,
project_id: u64,
session_id: u64,
) -> Result<ImportStageStarted, Error>
pub async fn start_enrich( &self, project_id: u64, session_id: u64, ) -> Result<ImportStageStarted, Error>
Queue the optional pass-2 enrichment. POST .../import/sessions/:sid/enrich (202).
Sourcepub async fn poll_import_session(
&self,
project_id: u64,
session_id: u64,
) -> Result<ImportSession, Error>
pub async fn poll_import_session( &self, project_id: u64, session_id: u64, ) -> Result<ImportSession, Error>
Fetch a document import session’s status, candidate items, cost and
errors. GET /projects/:id/import/sessions/:sid.
Sourcepub async fn commit_import_session(
&self,
project_id: u64,
session_id: u64,
items: Option<&[DocumentImportItem]>,
) -> Result<DocumentImportCommit, Error>
pub async fn commit_import_session( &self, project_id: u64, session_id: u64, items: Option<&[DocumentImportItem]>, ) -> Result<DocumentImportCommit, Error>
Commit a reviewed session, creating spec items.
POST .../import/sessions/:sid/commit. With items: None the server
commits the session’s extracted items; otherwise items with
included: Some(false) are skipped.