openfga 1.0.2

Rust SDK for OpenFGA — the open-source authorization system
Documentation
/*
 * OpenFGA
 *
 * A high performance and flexible authorization/permission engine built for developers and inspired by Google Zanzibar.
 *
 * The version of the OpenAPI document: 1.x
 * Contact: community@openfga.dev
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct WriteRequestDeletes {
    #[serde(rename = "tuple_keys")]
    pub tuple_keys: Vec<models::TupleKeyWithoutCondition>,
    /// On 'error', the API returns an error when deleting a tuple that does not exist. On 'ignore', deletes of non-existent tuples are treated as no-ops.
    #[serde(rename = "on_missing", skip_serializing_if = "Option::is_none")]
    pub on_missing: Option<OnMissing>,
}

impl WriteRequestDeletes {
    pub fn new(tuple_keys: Vec<models::TupleKeyWithoutCondition>) -> WriteRequestDeletes {
        WriteRequestDeletes {
            tuple_keys,
            on_missing: None,
        }
    }
}
/// On 'error', the API returns an error when deleting a tuple that does not exist. On 'ignore', deletes of non-existent tuples are treated as no-ops.
#[derive(
    Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, Default,
)]
pub enum OnMissing {
    #[serde(rename = "error")]
    #[default]
    Error,
    #[serde(rename = "ignore")]
    Ignore,
}