box-open-sdk 0.4.1

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 0.1.0 (spec 3fb3510fe12f2f80) for Box API 2024.0. DO NOT EDIT.

use super::*;

#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
pub struct TermsOfService {
    pub id: String,
    pub r#type: TermsOfServiceType,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub status: Option<TermsOfServiceStatus>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub enterprise: Option<CollaborationAllowlistEntryEnterprise>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub tos_type: Option<TermsOfServiceTosType>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub text: Option<String>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub created_at: Option<chrono::DateTime<chrono::Utc>>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub modified_at: Option<chrono::DateTime<chrono::Utc>>,
}

#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
pub struct TermsOfServices {
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub total_count: Option<i64>,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub entries: Option<Vec<TermsOfService>>,
}

#[derive(Clone, Debug, Default, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(transparent)]
pub struct TermsOfServiceStatus(pub String);

impl TermsOfServiceStatus {
    pub const ENABLED: &'static str = "enabled";
    pub const DISABLED: &'static str = "disabled";
}

#[derive(Clone, Debug, Default, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(transparent)]
pub struct TermsOfServiceTosType(pub String);

impl TermsOfServiceTosType {
    pub const MANAGED: &'static str = "managed";
    pub const EXTERNAL: &'static str = "external";
}

#[derive(Clone, Debug, Default, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
#[serde(transparent)]
pub struct GetTosType(pub String);

impl GetTosType {
    pub const EXTERNAL: &'static str = "external";
    pub const MANAGED: &'static str = "managed";
}

#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
pub struct CreateTermsOfServiceRequest {
    pub status: TermsOfServiceStatus,
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub tos_type: Option<GetTosType>,
    pub text: String,
}

#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
pub struct UpdateTermsOfServiceRequest {
    pub status: TermsOfServiceStatus,
    pub text: String,
}