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};

/// AuditLogRoleAssignmentDeleted : The details for events with this `type`.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, bon::Builder)]
pub struct AuditLogRoleAssignmentDeleted {
    /// The identifier of the role assignment.
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    /// The principal (user or group) that had the role removed.
    #[serde(rename = "principal_id", skip_serializing_if = "Option::is_none")]
    pub principal_id: Option<String>,
    /// The type of principal (user or group) that had the role removed.
    #[serde(rename = "principal_type", skip_serializing_if = "Option::is_none")]
    pub principal_type: Option<String>,
    /// The resource the role assignment was scoped to.
    #[serde(rename = "resource_id", skip_serializing_if = "Option::is_none")]
    pub resource_id: Option<String>,
    /// The type of resource the role assignment was scoped to.
    #[serde(rename = "resource_type", skip_serializing_if = "Option::is_none")]
    pub resource_type: Option<String>,
}

impl AuditLogRoleAssignmentDeleted {
    /// The details for events with this `type`.
    pub fn new() -> AuditLogRoleAssignmentDeleted {
        AuditLogRoleAssignmentDeleted {
            id: None,
            principal_id: None,
            principal_type: None,
            resource_id: None,
            resource_type: None,
        }
    }
}

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