openai-client-base 0.13.0

Auto-generated Rust client for the OpenAI API
/*
 * OpenAI API
 *
 * The OpenAI REST API. Please see https://platform.openai.com/docs/api-reference for more details.
 *
 * The version of the OpenAPI document: 2.3.0
 *
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// UpdateOrganizationDataRetentionBody : Parameters for updating organization data retention controls.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, bon::Builder)]
pub struct UpdateOrganizationDataRetentionBody {
    /// The desired organization data retention type.
    #[serde(rename = "retention_type")]
    pub retention_type: RetentionType,
}

impl UpdateOrganizationDataRetentionBody {
    /// Parameters for updating organization data retention controls.
    pub fn new(retention_type: RetentionType) -> UpdateOrganizationDataRetentionBody {
        UpdateOrganizationDataRetentionBody { retention_type }
    }
}
/// The desired organization data retention type.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum RetentionType {
    #[serde(rename = "zero_data_retention")]
    ZeroDataRetention,
    #[serde(rename = "modified_abuse_monitoring")]
    ModifiedAbuseMonitoring,
    #[serde(rename = "enhanced_zero_data_retention")]
    EnhancedZeroDataRetention,
    #[serde(rename = "enhanced_modified_abuse_monitoring")]
    EnhancedModifiedAbuseMonitoring,
}

impl Default for RetentionType {
    fn default() -> RetentionType {
        Self::ZeroDataRetention
    }
}

impl std::fmt::Display for UpdateOrganizationDataRetentionBody {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        match serde_json::to_string(self) {
            Ok(s) => write!(f, "{}", s),
            Err(_) => Err(std::fmt::Error),
        }
    }
}