box-open-sdk 0.3.0

Box API client for Rust (open source, community, punk rock) — typed models, async managers, and a reqwest runtime with retry, backoff, and token refresh.
Documentation
// Code generated by box-gantry. DO NOT EDIT.

use crate::runtime::{self, Error};

/// Operations for the "notes" API area.
pub struct NotesManager {
    session: std::sync::Arc<runtime::Client>,
}

impl NotesManager {
    pub(crate) fn new(session: std::sync::Arc<runtime::Client>) -> Self {
        Self { session }
    }

    pub async fn convert(
        &self,
        body: crate::models::schemas::NotesConvertRequestBody,
    ) -> Result<crate::models::schemas::NotesConvertResponse, Error> {
        let mut url = self.session.base_url("api");
        url.push_str("/notes");
        url.push_str("/convert");
        let mut req = self.session.new_request("POST", &url);
        req = runtime::with_header(req, "box-version", "2026.0");
        let payload = serde_json::to_vec(&body)?;
        req = runtime::with_json_body(req, &payload);
        let resp = self.session.fetch(req).await?;
        let data = runtime::response_bytes(&resp)?;
        Ok(serde_json::from_slice(&data)?)
    }
}