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 BatchCheckItem {
    #[serde(rename = "tuple_key")]
    pub tuple_key: models::CheckRequestTupleKey,
    #[serde(rename = "contextual_tuples", skip_serializing_if = "Option::is_none")]
    pub contextual_tuples: Option<models::ContextualTupleKeys>,
    #[serde(rename = "context", skip_serializing_if = "Option::is_none")]
    pub context: Option<serde_json::Value>,
    /// correlation_id must be a string containing only letters, numbers, or hyphens, with length ≤ 36 characters.
    #[serde(rename = "correlation_id")]
    pub correlation_id: String,
}

impl BatchCheckItem {
    pub fn new(tuple_key: models::CheckRequestTupleKey, correlation_id: String) -> BatchCheckItem {
        BatchCheckItem {
            tuple_key,
            contextual_tuples: None,
            context: None,
            correlation_id,
        }
    }
}