Skip to main content

box_open_sdk/managers/
notes.rs

1// Code generated by box-gantry. DO NOT EDIT.
2
3use crate::runtime::{self, Error};
4
5/// Operations for the "notes" API area.
6pub struct NotesManager {
7    session: std::sync::Arc<runtime::Client>,
8}
9
10impl NotesManager {
11    pub(crate) fn new(session: std::sync::Arc<runtime::Client>) -> Self {
12        Self { session }
13    }
14
15    pub async fn convert(
16        &self,
17        body: crate::models::schemas::NotesConvertRequestBody,
18    ) -> Result<crate::models::schemas::NotesConvertResponse, Error> {
19        let mut url = self.session.base_url("api");
20        url.push_str("/notes");
21        url.push_str("/convert");
22        let mut req = self.session.new_request("POST", &url);
23        req = runtime::with_header(req, "box-version", "2026.0");
24        let payload = serde_json::to_vec(&body)?;
25        req = runtime::with_json_body(req, &payload);
26        let resp = self.session.fetch(req).await?;
27        let data = runtime::response_bytes(&resp)?;
28        Ok(serde_json::from_slice(&data)?)
29    }
30}