/*
 * Artifact Keeper API
 *
 * Enterprise artifact registry supporting 45+ package formats.
 *
 * The version of the OpenAPI document: 1.0.0-rc.3
 * 
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CreateOidcConfigRequest {
    #[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 = "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")]
    pub client_id: String,
    #[serde(rename = "client_secret")]
    pub client_secret: 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")]
    pub issuer_url: String,
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "scopes", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub scopes: Option<Option<Vec<String>>>,
}

impl CreateOidcConfigRequest {
    pub fn new(client_id: String, client_secret: String, issuer_url: String, name: String) -> CreateOidcConfigRequest {
        CreateOidcConfigRequest {
            attribute_mapping: None,
            auto_create_users: None,
            client_id,
            client_secret,
            is_enabled: None,
            issuer_url,
            name,
            scopes: None,
        }
    }
}

