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

/**
 * Get running and latest version.
 * @export
 * @interface Version
 */
export interface Version {
    /**
     * Get current version
     * @type {string}
     * @memberof Version
     */
    readonly versionCurrent: string;
    /**
     * Get latest version from cache
     * @type {string}
     * @memberof Version
     */
    readonly versionLatest: string;
    /**
     * Check if latest version is valid
     * @type {boolean}
     * @memberof Version
     */
    readonly versionLatestValid: boolean;
    /**
     * Get build hash, if version is not latest or released
     * @type {string}
     * @memberof Version
     */
    readonly buildHash: string;
    /**
     * Check if we're running the latest version
     * @type {boolean}
     * @memberof Version
     */
    readonly outdated: boolean;
    /**
     * Check if any outpost is outdated/has a version mismatch
     * @type {boolean}
     * @memberof Version
     */
    readonly outpostOutdated: boolean;
}

/**
 * Check if a given object implements the Version interface.
 */
export function instanceOfVersion(value: object): value is Version {
    if (!("versionCurrent" in value) || value["versionCurrent"] === undefined) return false;
    if (!("versionLatest" in value) || value["versionLatest"] === undefined) return false;
    if (!("versionLatestValid" in value) || value["versionLatestValid"] === undefined) return false;
    if (!("buildHash" in value) || value["buildHash"] === undefined) return false;
    if (!("outdated" in value) || value["outdated"] === undefined) return false;
    if (!("outpostOutdated" in value) || value["outpostOutdated"] === undefined) return false;
    return true;
}

export function VersionFromJSON(json: any): Version {
    return VersionFromJSONTyped(json, false);
}

export function VersionFromJSONTyped(json: any, ignoreDiscriminator: boolean): Version {
    if (json == null) {
        return json;
    }
    return {
        versionCurrent: json["version_current"],
        versionLatest: json["version_latest"],
        versionLatestValid: json["version_latest_valid"],
        buildHash: json["build_hash"],
        outdated: json["outdated"],
        outpostOutdated: json["outpost_outdated"],
    };
}

export function VersionToJSON(json: any): Version {
    return VersionToJSONTyped(json, false);
}

export function VersionToJSONTyped(
    value?: Omit<
        Version,
        | "version_current"
        | "version_latest"
        | "version_latest_valid"
        | "build_hash"
        | "outdated"
        | "outpost_outdated"
    > | null,
    ignoreDiscriminator: boolean = false,
): any {
    if (value == null) {
        return value;
    }

    return {};
}
