/* tslint:disable */
/* eslint-disable */
/**
 * authentik
 * Making authentication simple.
 *
 * The version of the OpenAPI document: 2025.12.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 { mapValues } from '../runtime';
/**
 * CertificateKeyPair Serializer
 * @export
 * @interface CertificateKeyPair
 */
export interface CertificateKeyPair {
    /**
     * 
     * @type {string}
     * @memberof CertificateKeyPair
     */
    readonly pk: string;
    /**
     * 
     * @type {string}
     * @memberof CertificateKeyPair
     */
    name: string;
    /**
     * Get certificate Hash (SHA256)
     * @type {string}
     * @memberof CertificateKeyPair
     */
    readonly fingerprintSha256: string | null;
    /**
     * Get certificate Hash (SHA1)
     * @type {string}
     * @memberof CertificateKeyPair
     */
    readonly fingerprintSha1: string | null;
    /**
     * Get certificate expiry
     * @type {Date}
     * @memberof CertificateKeyPair
     */
    readonly certExpiry: Date | null;
    /**
     * Get certificate subject as full rfc4514
     * @type {string}
     * @memberof CertificateKeyPair
     */
    readonly certSubject: string | null;
    /**
     * Show if this keypair has a private key configured or not
     * @type {boolean}
     * @memberof CertificateKeyPair
     */
    readonly privateKeyAvailable: boolean;
    /**
     * Get the private key's type, if set
     * @type {string}
     * @memberof CertificateKeyPair
     */
    readonly privateKeyType: string | null;
    /**
     * Get URL to download certificate
     * @type {string}
     * @memberof CertificateKeyPair
     */
    readonly certificateDownloadUrl: string;
    /**
     * Get URL to download private key
     * @type {string}
     * @memberof CertificateKeyPair
     */
    readonly privateKeyDownloadUrl: string;
    /**
     * Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update.
     * @type {string}
     * @memberof CertificateKeyPair
     */
    readonly managed: string | null;
}

/**
 * Check if a given object implements the CertificateKeyPair interface.
 */
export function instanceOfCertificateKeyPair(value: object): value is CertificateKeyPair {
    if (!('pk' in value) || value['pk'] === undefined) return false;
    if (!('name' in value) || value['name'] === undefined) return false;
    if (!('fingerprintSha256' in value) || value['fingerprintSha256'] === undefined) return false;
    if (!('fingerprintSha1' in value) || value['fingerprintSha1'] === undefined) return false;
    if (!('certExpiry' in value) || value['certExpiry'] === undefined) return false;
    if (!('certSubject' in value) || value['certSubject'] === undefined) return false;
    if (!('privateKeyAvailable' in value) || value['privateKeyAvailable'] === undefined) return false;
    if (!('privateKeyType' in value) || value['privateKeyType'] === undefined) return false;
    if (!('certificateDownloadUrl' in value) || value['certificateDownloadUrl'] === undefined) return false;
    if (!('privateKeyDownloadUrl' in value) || value['privateKeyDownloadUrl'] === undefined) return false;
    if (!('managed' in value) || value['managed'] === undefined) return false;
    return true;
}

export function CertificateKeyPairFromJSON(json: any): CertificateKeyPair {
    return CertificateKeyPairFromJSONTyped(json, false);
}

export function CertificateKeyPairFromJSONTyped(json: any, ignoreDiscriminator: boolean): CertificateKeyPair {
    if (json == null) {
        return json;
    }
    return {
        
        'pk': json['pk'],
        'name': json['name'],
        'fingerprintSha256': json['fingerprint_sha256'],
        'fingerprintSha1': json['fingerprint_sha1'],
        'certExpiry': (json['cert_expiry'] == null ? null : new Date(json['cert_expiry'])),
        'certSubject': json['cert_subject'],
        'privateKeyAvailable': json['private_key_available'],
        'privateKeyType': json['private_key_type'],
        'certificateDownloadUrl': json['certificate_download_url'],
        'privateKeyDownloadUrl': json['private_key_download_url'],
        'managed': json['managed'],
    };
}

export function CertificateKeyPairToJSON(json: any): CertificateKeyPair {
    return CertificateKeyPairToJSONTyped(json, false);
}

export function CertificateKeyPairToJSONTyped(value?: Omit<CertificateKeyPair, 'pk'|'fingerprint_sha256'|'fingerprint_sha1'|'cert_expiry'|'cert_subject'|'private_key_available'|'private_key_type'|'certificate_download_url'|'private_key_download_url'|'managed'> | null, ignoreDiscriminator: boolean = false): any {
    if (value == null) {
        return value;
    }

    return {
        
        'name': value['name'],
    };
}

