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

/// GroupResourceWithSuccess : Response returned after updating a group.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, bon::Builder)]
pub struct GroupResourceWithSuccess {
    /// Identifier for the group.
    #[serde(rename = "id")]
    pub id: String,
    /// Updated display name for the group.
    #[serde(rename = "name")]
    pub name: String,
    /// Unix timestamp (in seconds) when the group was created.
    #[serde(rename = "created_at")]
    pub created_at: i64,
    /// Whether the group is managed through SCIM and controlled by your identity provider.
    #[serde(rename = "is_scim_managed")]
    pub is_scim_managed: bool,
}

impl GroupResourceWithSuccess {
    /// Response returned after updating a group.
    pub fn new(
        id: String,
        name: String,
        created_at: i64,
        is_scim_managed: bool,
    ) -> GroupResourceWithSuccess {
        GroupResourceWithSuccess {
            id,
            name,
            created_at,
            is_scim_managed,
        }
    }
}

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