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 serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct GetConfigurationResponse {
    /// REQUIRED. The PDP identifier URL (HTTPS, no query or fragment).
    #[serde(rename = "policy_decision_point")]
    pub policy_decision_point: String,
    /// REQUIRED. The access evaluation endpoint URL.
    #[serde(rename = "access_evaluation_endpoint")]
    pub access_evaluation_endpoint: String,
    /// OPTIONAL. The batch evaluations endpoint URL.
    #[serde(
        rename = "access_evaluations_endpoint",
        skip_serializing_if = "Option::is_none"
    )]
    pub access_evaluations_endpoint: Option<String>,
    /// OPTIONAL. The subject search endpoint URL.
    #[serde(
        rename = "search_subject_endpoint",
        skip_serializing_if = "Option::is_none"
    )]
    pub search_subject_endpoint: Option<String>,
    /// OPTIONAL. The resource search endpoint URL.
    #[serde(
        rename = "search_resource_endpoint",
        skip_serializing_if = "Option::is_none"
    )]
    pub search_resource_endpoint: Option<String>,
    /// OPTIONAL. The action search endpoint URL.
    #[serde(
        rename = "search_action_endpoint",
        skip_serializing_if = "Option::is_none"
    )]
    pub search_action_endpoint: Option<String>,
    /// OPTIONAL. Supported capabilities as URN strings.
    #[serde(rename = "capabilities", skip_serializing_if = "Option::is_none")]
    pub capabilities: Option<Vec<String>>,
    /// OPTIONAL. Signed metadata JWT per AuthZEN metadata specification.
    #[serde(rename = "signed_metadata", skip_serializing_if = "Option::is_none")]
    pub signed_metadata: Option<String>,
}

impl GetConfigurationResponse {
    pub fn new(
        policy_decision_point: String,
        access_evaluation_endpoint: String,
    ) -> GetConfigurationResponse {
        GetConfigurationResponse {
            policy_decision_point,
            access_evaluation_endpoint,
            access_evaluations_endpoint: None,
            search_subject_endpoint: None,
            search_resource_endpoint: None,
            search_action_endpoint: None,
            capabilities: None,
            signed_metadata: None,
        }
    }
}