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

/**
 *
 * @export
 * @interface EnrollmentTokenRequest
 */
export interface EnrollmentTokenRequest {
    /**
     *
     * @type {string}
     * @memberof EnrollmentTokenRequest
     */
    deviceGroup?: string | null;
    /**
     *
     * @type {string}
     * @memberof EnrollmentTokenRequest
     */
    connector: string;
    /**
     *
     * @type {string}
     * @memberof EnrollmentTokenRequest
     */
    name: string;
    /**
     *
     * @type {boolean}
     * @memberof EnrollmentTokenRequest
     */
    expiring?: boolean;
    /**
     *
     * @type {Date}
     * @memberof EnrollmentTokenRequest
     */
    expires?: Date | null;
}

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

export function EnrollmentTokenRequestFromJSON(json: any): EnrollmentTokenRequest {
    return EnrollmentTokenRequestFromJSONTyped(json, false);
}

export function EnrollmentTokenRequestFromJSONTyped(
    json: any,
    ignoreDiscriminator: boolean,
): EnrollmentTokenRequest {
    if (json == null) {
        return json;
    }
    return {
        deviceGroup: json["device_group"] == null ? undefined : json["device_group"],
        connector: json["connector"],
        name: json["name"],
        expiring: json["expiring"] == null ? undefined : json["expiring"],
        expires: json["expires"] == null ? undefined : new Date(json["expires"]),
    };
}

export function EnrollmentTokenRequestToJSON(json: any): EnrollmentTokenRequest {
    return EnrollmentTokenRequestToJSONTyped(json, false);
}

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

    return {
        device_group: value["deviceGroup"],
        connector: value["connector"],
        name: value["name"],
        expiring: value["expiring"],
        expires: value["expires"] == null ? value["expires"] : value["expires"].toISOString(),
    };
}
