/* tslint:disable */
/* eslint-disable */
/**
 * authentik
 * Making authentication simple.
 *
 * The version of the OpenAPI document: 2026.5.0-rc1
 * Contact: hello@goauthentik.io
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

import type { CertAttributeEnum } from "./CertAttributeEnum";
import { CertAttributeEnumFromJSON, CertAttributeEnumToJSON } from "./CertAttributeEnum";
import type { StageModeEnum } from "./StageModeEnum";
import { StageModeEnumFromJSON, StageModeEnumToJSON } from "./StageModeEnum";
import type { UserAttributeEnum } from "./UserAttributeEnum";
import { UserAttributeEnumFromJSON, UserAttributeEnumToJSON } from "./UserAttributeEnum";

/**
 * MutualTLSStage Serializer
 * @export
 * @interface MutualTLSStageRequest
 */
export interface MutualTLSStageRequest {
    /**
     *
     * @type {string}
     * @memberof MutualTLSStageRequest
     */
    name: string;
    /**
     *
     * @type {StageModeEnum}
     * @memberof MutualTLSStageRequest
     */
    mode: StageModeEnum;
    /**
     * Configure certificate authorities to validate the certificate against. This option has a higher priority than the `client_certificate` option on `Brand`.
     * @type {Array<string>}
     * @memberof MutualTLSStageRequest
     */
    certificateAuthorities?: Array<string>;
    /**
     *
     * @type {CertAttributeEnum}
     * @memberof MutualTLSStageRequest
     */
    certAttribute: CertAttributeEnum;
    /**
     *
     * @type {UserAttributeEnum}
     * @memberof MutualTLSStageRequest
     */
    userAttribute: UserAttributeEnum;
}

/**
 * Check if a given object implements the MutualTLSStageRequest interface.
 */
export function instanceOfMutualTLSStageRequest(value: object): value is MutualTLSStageRequest {
    if (!("name" in value) || value["name"] === undefined) return false;
    if (!("mode" in value) || value["mode"] === undefined) return false;
    if (!("certAttribute" in value) || value["certAttribute"] === undefined) return false;
    if (!("userAttribute" in value) || value["userAttribute"] === undefined) return false;
    return true;
}

export function MutualTLSStageRequestFromJSON(json: any): MutualTLSStageRequest {
    return MutualTLSStageRequestFromJSONTyped(json, false);
}

export function MutualTLSStageRequestFromJSONTyped(
    json: any,
    ignoreDiscriminator: boolean,
): MutualTLSStageRequest {
    if (json == null) {
        return json;
    }
    return {
        name: json["name"],
        mode: StageModeEnumFromJSON(json["mode"]),
        certificateAuthorities:
            json["certificate_authorities"] == null ? undefined : json["certificate_authorities"],
        certAttribute: CertAttributeEnumFromJSON(json["cert_attribute"]),
        userAttribute: UserAttributeEnumFromJSON(json["user_attribute"]),
    };
}

export function MutualTLSStageRequestToJSON(json: any): MutualTLSStageRequest {
    return MutualTLSStageRequestToJSONTyped(json, false);
}

export function MutualTLSStageRequestToJSONTyped(
    value?: MutualTLSStageRequest | null,
    ignoreDiscriminator: boolean = false,
): any {
    if (value == null) {
        return value;
    }

    return {
        name: value["name"],
        mode: StageModeEnumToJSON(value["mode"]),
        certificate_authorities: value["certificateAuthorities"],
        cert_attribute: CertAttributeEnumToJSON(value["certAttribute"]),
        user_attribute: UserAttributeEnumToJSON(value["userAttribute"]),
    };
}
