openai-client-base 0.16.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};

/// OrganizationSpendLimitDeletedResource : Confirmation payload returned after deleting an organization hard spend limit.
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, bon::Builder)]
pub struct OrganizationSpendLimitDeletedResource {
    /// The object type, which is always `organization.spend_limit.deleted`.
    #[serde(rename = "object")]
    pub object: Object,
    /// Whether the hard spend limit was deleted.
    #[serde(rename = "deleted")]
    pub deleted: bool,
}

impl OrganizationSpendLimitDeletedResource {
    /// Confirmation payload returned after deleting an organization hard spend limit.
    pub fn new(object: Object, deleted: bool) -> OrganizationSpendLimitDeletedResource {
        OrganizationSpendLimitDeletedResource { object, deleted }
    }
}
/// The object type, which is always `organization.spend_limit.deleted`.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Object {
    #[serde(rename = "organization.spend_limit.deleted")]
    OrganizationSpendLimitDeleted,
}

impl Default for Object {
    fn default() -> Object {
        Self::OrganizationSpendLimitDeleted
    }
}

impl std::fmt::Display for OrganizationSpendLimitDeletedResource {
    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),
        }
    }
}