Skip to main content

box_open_sdk/models/schemas/
terms_of_services.rs

1// Code generated by box-gantry 0.1.0 (spec 3fb3510fe12f2f80) for Box API 2024.0. DO NOT EDIT.
2
3use super::*;
4
5#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
6pub struct TermsOfService {
7    pub id: String,
8    pub r#type: TermsOfServiceType,
9    #[serde(default, skip_serializing_if = "Option::is_none")]
10    pub status: Option<TermsOfServiceStatus>,
11    #[serde(default, skip_serializing_if = "Option::is_none")]
12    pub enterprise: Option<CollaborationAllowlistEntryEnterprise>,
13    #[serde(default, skip_serializing_if = "Option::is_none")]
14    pub tos_type: Option<TermsOfServiceTosType>,
15    #[serde(default, skip_serializing_if = "Option::is_none")]
16    pub text: Option<String>,
17    #[serde(default, skip_serializing_if = "Option::is_none")]
18    pub created_at: Option<chrono::DateTime<chrono::Utc>>,
19    #[serde(default, skip_serializing_if = "Option::is_none")]
20    pub modified_at: Option<chrono::DateTime<chrono::Utc>>,
21}
22
23#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
24pub struct TermsOfServices {
25    #[serde(default, skip_serializing_if = "Option::is_none")]
26    pub total_count: Option<i64>,
27    #[serde(default, skip_serializing_if = "Option::is_none")]
28    pub entries: Option<Vec<TermsOfService>>,
29}
30
31#[derive(Clone, Debug, Default, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
32#[serde(transparent)]
33pub struct TermsOfServiceStatus(pub String);
34
35impl TermsOfServiceStatus {
36    pub const ENABLED: &'static str = "enabled";
37    pub const DISABLED: &'static str = "disabled";
38}
39
40#[derive(Clone, Debug, Default, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
41#[serde(transparent)]
42pub struct TermsOfServiceTosType(pub String);
43
44impl TermsOfServiceTosType {
45    pub const MANAGED: &'static str = "managed";
46    pub const EXTERNAL: &'static str = "external";
47}
48
49#[derive(Clone, Debug, Default, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
50#[serde(transparent)]
51pub struct GetTosType(pub String);
52
53impl GetTosType {
54    pub const EXTERNAL: &'static str = "external";
55    pub const MANAGED: &'static str = "managed";
56}
57
58#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
59pub struct CreateTermsOfServiceRequest {
60    pub status: TermsOfServiceStatus,
61    #[serde(default, skip_serializing_if = "Option::is_none")]
62    pub tos_type: Option<GetTosType>,
63    pub text: String,
64}
65
66#[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
67pub struct UpdateTermsOfServiceRequest {
68    pub status: TermsOfServiceStatus,
69    pub text: String,
70}