/*
 * 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.4.1
 * 
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct UpdateOidcConfigRequest {
    #[serde(rename = "allow_legacy_rsa_keys", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub allow_legacy_rsa_keys: Option<Option<bool>>,
    /// Partial update for `attribute_mapping`. Keys present in this object overwrite the matching keys in the stored mapping. Keys not present are preserved. To remove a key, set it to `null`. To replace the whole mapping atomically, set `attribute_mapping_replace = true`. (See issue #1191.)
    #[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>>,
    /// When `true`, treat `attribute_mapping` as a wholesale replacement (legacy behavior). Defaults to `false` — partial merge.
    #[serde(rename = "attribute_mapping_replace", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub attribute_mapping_replace: Option<Option<bool>>,
    #[serde(rename = "auto_create_users", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub auto_create_users: Option<Option<bool>>,
    #[serde(rename = "client_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub client_id: Option<Option<String>>,
    #[serde(rename = "client_secret", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub client_secret: Option<Option<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 = "issuer_url", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub issuer_url: Option<Option<String>>,
    #[serde(rename = "map_groups_to_groups", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub map_groups_to_groups: Option<Option<bool>>,
    #[serde(rename = "name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub name: Option<Option<String>>,
    #[serde(rename = "pkce_enabled", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub pkce_enabled: Option<Option<bool>>,
    #[serde(rename = "scopes", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub scopes: Option<Option<Vec<String>>>,
}

impl UpdateOidcConfigRequest {
    pub fn new() -> UpdateOidcConfigRequest {
        UpdateOidcConfigRequest {
            allow_legacy_rsa_keys: None,
            attribute_mapping: None,
            attribute_mapping_replace: None,
            auto_create_users: None,
            client_id: None,
            client_secret: None,
            is_enabled: None,
            issuer_url: None,
            map_groups_to_groups: None,
            name: None,
            pkce_enabled: None,
            scopes: None,
        }
    }
}

