box-open-sdk 0.2.0

Community, unofficial Box API client for Rust — 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::internal::path_escape;
use crate::runtime::{self, Error};

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

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

    pub async fn get(
        &self,
        enterprise_id: String,
        categories: Vec<String>,
    ) -> Result<crate::models::schemas::EnterpriseConfiguration, Error> {
        let mut url = self.session.base_url("api");
        url.push_str("/enterprise_configurations");
        url.push('/');
        let seg = path_escape(&enterprise_id);
        url.push_str(&seg);
        let mut req = self.session.new_request("GET", &url);
        req = runtime::with_query(req, "categories", &categories.join(","));
        req = runtime::with_header(req, "box-version", "2025.0");
        let resp = self.session.fetch(req).await?;
        let data = runtime::response_bytes(&resp)?;
        Ok(serde_json::from_slice(&data)?)
    }
}