/* 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 PatchedMutualTLSStageRequest
 */
export interface PatchedMutualTLSStageRequest {
    /**
     *
     * @type {string}
     * @memberof PatchedMutualTLSStageRequest
     */
    name?: string;
    /**
     *
     * @type {StageModeEnum}
     * @memberof PatchedMutualTLSStageRequest
     */
    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 PatchedMutualTLSStageRequest
     */
    certificateAuthorities?: Array<string>;
    /**
     *
     * @type {CertAttributeEnum}
     * @memberof PatchedMutualTLSStageRequest
     */
    certAttribute?: CertAttributeEnum;
    /**
     *
     * @type {UserAttributeEnum}
     * @memberof PatchedMutualTLSStageRequest
     */
    userAttribute?: UserAttributeEnum;
}

/**
 * Check if a given object implements the PatchedMutualTLSStageRequest interface.
 */
export function instanceOfPatchedMutualTLSStageRequest(
    value: object,
): value is PatchedMutualTLSStageRequest {
    return true;
}

export function PatchedMutualTLSStageRequestFromJSON(json: any): PatchedMutualTLSStageRequest {
    return PatchedMutualTLSStageRequestFromJSONTyped(json, false);
}

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

export function PatchedMutualTLSStageRequestToJSON(json: any): PatchedMutualTLSStageRequest {
    return PatchedMutualTLSStageRequestToJSONTyped(json, false);
}

export function PatchedMutualTLSStageRequestToJSONTyped(
    value?: PatchedMutualTLSStageRequest | 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"]),
    };
}
