1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
* 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 WriteRequestWrites {
#[serde(rename = "tuple_keys")]
pub tuple_keys: Vec<models::TupleKey>,
/// On 'error' ( or unspecified ), the API returns an error if an identical tuple already exists. On 'ignore', identical writes are treated as no-ops (matching on user, relation, object, and RelationshipCondition).
#[serde(rename = "on_duplicate", skip_serializing_if = "Option::is_none")]
pub on_duplicate: Option<OnDuplicate>,
}
impl WriteRequestWrites {
pub fn new(tuple_keys: Vec<models::TupleKey>) -> WriteRequestWrites {
WriteRequestWrites {
tuple_keys,
on_duplicate: None,
}
}
}
/// On 'error' ( or unspecified ), the API returns an error if an identical tuple already exists. On 'ignore', identical writes are treated as no-ops (matching on user, relation, object, and RelationshipCondition).
#[derive(
Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, Default,
)]
pub enum OnDuplicate {
#[serde(rename = "error")]
#[default]
Error,
#[serde(rename = "ignore")]
Ignore,
}