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

/**
 * Serializer for authenticator devices
 * @export
 * @interface Device
 */
export interface Device {
    /**
     * Return object's verbose_name
     * @type {string}
     * @memberof Device
     */
    readonly verboseName: string;
    /**
     * Return object's plural verbose_name
     * @type {string}
     * @memberof Device
     */
    readonly verboseNamePlural: string;
    /**
     * Return internal model name
     * @type {string}
     * @memberof Device
     */
    readonly metaModelName: string;
    /**
     *
     * @type {string}
     * @memberof Device
     */
    pk: string;
    /**
     *
     * @type {string}
     * @memberof Device
     */
    name: string;
    /**
     * Get type of device
     * @type {string}
     * @memberof Device
     */
    readonly type: string;
    /**
     *
     * @type {boolean}
     * @memberof Device
     */
    confirmed: boolean;
    /**
     *
     * @type {Date}
     * @memberof Device
     */
    readonly created: Date;
    /**
     *
     * @type {Date}
     * @memberof Device
     */
    readonly lastUpdated: Date;
    /**
     *
     * @type {Date}
     * @memberof Device
     */
    readonly lastUsed: Date | null;
    /**
     * Get extra description
     * @type {string}
     * @memberof Device
     */
    readonly extraDescription: string | null;
    /**
     * Get external Device ID
     * @type {string}
     * @memberof Device
     */
    readonly externalId: string | null;
}

/**
 * Check if a given object implements the Device interface.
 */
export function instanceOfDevice(value: object): value is Device {
    if (!("verboseName" in value) || value["verboseName"] === undefined) return false;
    if (!("verboseNamePlural" in value) || value["verboseNamePlural"] === undefined) return false;
    if (!("metaModelName" in value) || value["metaModelName"] === undefined) return false;
    if (!("pk" in value) || value["pk"] === undefined) return false;
    if (!("name" in value) || value["name"] === undefined) return false;
    if (!("type" in value) || value["type"] === undefined) return false;
    if (!("confirmed" in value) || value["confirmed"] === undefined) return false;
    if (!("created" in value) || value["created"] === undefined) return false;
    if (!("lastUpdated" in value) || value["lastUpdated"] === undefined) return false;
    if (!("lastUsed" in value) || value["lastUsed"] === undefined) return false;
    if (!("extraDescription" in value) || value["extraDescription"] === undefined) return false;
    if (!("externalId" in value) || value["externalId"] === undefined) return false;
    return true;
}

export function DeviceFromJSON(json: any): Device {
    return DeviceFromJSONTyped(json, false);
}

export function DeviceFromJSONTyped(json: any, ignoreDiscriminator: boolean): Device {
    if (json == null) {
        return json;
    }
    return {
        verboseName: json["verbose_name"],
        verboseNamePlural: json["verbose_name_plural"],
        metaModelName: json["meta_model_name"],
        pk: json["pk"],
        name: json["name"],
        type: json["type"],
        confirmed: json["confirmed"],
        created: new Date(json["created"]),
        lastUpdated: new Date(json["last_updated"]),
        lastUsed: json["last_used"] == null ? null : new Date(json["last_used"]),
        extraDescription: json["extra_description"],
        externalId: json["external_id"],
    };
}

export function DeviceToJSON(json: any): Device {
    return DeviceToJSONTyped(json, false);
}

export function DeviceToJSONTyped(
    value?: Omit<
        Device,
        | "verbose_name"
        | "verbose_name_plural"
        | "meta_model_name"
        | "type"
        | "created"
        | "last_updated"
        | "last_used"
        | "extra_description"
        | "external_id"
    > | null,
    ignoreDiscriminator: boolean = false,
): any {
    if (value == null) {
        return value;
    }

    return {
        pk: value["pk"],
        name: value["name"],
        confirmed: value["confirmed"],
    };
}
