/*
 * Artifact Keeper API
 *
 * Enterprise artifact registry supporting 45+ package formats.  ## Authentication  The JSON management API under `/api/v1/_*` accepts **API tokens only as `Authorization: Bearer <token>`**. This is the canonical scheme for programmatic access; JWTs issued by the login flow also use `Bearer`. HTTP Basic credentials on `/api/v1/_*` are validated *only* as a real `username:password` login — the password half is **not** retried as an API token. A request to `/api/v1/_*` that sends an API token in the password field of Basic auth therefore returns `401 AUTH_ERROR`; switch to `Authorization: Bearer <token>`.  Format (package-manager) endpoints such as `/v2/_*` (OCI), `/incus/_*`, `/debian/_*`, and the language registries are intentionally more permissive for client compatibility: in addition to Bearer, they accept HTTP **Basic** auth with the API token supplied in the *password* field (any username), matching the `pip` netrc / Artifactory-style `token:<api_token>` convention used by package managers that cannot send a Bearer header. This Basic-with-token fallback applies to format endpoints only, never to `/api/v1/_*`.
 *
 * The version of the OpenAPI document: 1.2.4
 * 
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CreateSamlConfigRequest {
    #[serde(rename = "admin_group", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub admin_group: Option<Option<String>>,
    #[serde(rename = "attribute_mapping", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub attribute_mapping: Option<Option<serde_json::Value>>,
    #[serde(rename = "certificate")]
    pub certificate: String,
    #[serde(rename = "entity_id")]
    pub entity_id: String,
    #[serde(rename = "is_enabled", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub is_enabled: Option<Option<bool>>,
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "name_id_format", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub name_id_format: Option<Option<String>>,
    #[serde(rename = "require_signed_assertions", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub require_signed_assertions: Option<Option<bool>>,
    #[serde(rename = "sign_requests", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub sign_requests: Option<Option<bool>>,
    #[serde(rename = "slo_url", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub slo_url: Option<Option<String>>,
    #[serde(rename = "sp_entity_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub sp_entity_id: Option<Option<String>>,
    #[serde(rename = "sso_url")]
    pub sso_url: String,
}

impl CreateSamlConfigRequest {
    pub fn new(certificate: String, entity_id: String, name: String, sso_url: String) -> CreateSamlConfigRequest {
        CreateSamlConfigRequest {
            admin_group: None,
            attribute_mapping: None,
            certificate,
            entity_id,
            is_enabled: None,
            name,
            name_id_format: None,
            require_signed_assertions: None,
            sign_requests: None,
            slo_url: None,
            sp_entity_id: None,
            sso_url,
        }
    }
}

