/* 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.
 */

/**
 * CertificateKeyPair Serializer
 * @export
 * @interface CertificateKeyPairRequest
 */
export interface CertificateKeyPairRequest {
    /**
     *
     * @type {string}
     * @memberof CertificateKeyPairRequest
     */
    name: string;
    /**
     * PEM-encoded Certificate data
     * @type {string}
     * @memberof CertificateKeyPairRequest
     */
    certificateData: string;
    /**
     * Optional Private Key. If this is set, you can use this keypair for encryption.
     * @type {string}
     * @memberof CertificateKeyPairRequest
     */
    keyData?: string;
}

/**
 * Check if a given object implements the CertificateKeyPairRequest interface.
 */
export function instanceOfCertificateKeyPairRequest(
    value: object,
): value is CertificateKeyPairRequest {
    if (!("name" in value) || value["name"] === undefined) return false;
    if (!("certificateData" in value) || value["certificateData"] === undefined) return false;
    return true;
}

export function CertificateKeyPairRequestFromJSON(json: any): CertificateKeyPairRequest {
    return CertificateKeyPairRequestFromJSONTyped(json, false);
}

export function CertificateKeyPairRequestFromJSONTyped(
    json: any,
    ignoreDiscriminator: boolean,
): CertificateKeyPairRequest {
    if (json == null) {
        return json;
    }
    return {
        name: json["name"],
        certificateData: json["certificate_data"],
        keyData: json["key_data"] == null ? undefined : json["key_data"],
    };
}

export function CertificateKeyPairRequestToJSON(json: any): CertificateKeyPairRequest {
    return CertificateKeyPairRequestToJSONTyped(json, false);
}

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

    return {
        name: value["name"],
        certificate_data: value["certificateData"],
        key_data: value["keyData"],
    };
}
