/* 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 PatchedEnrollmentTokenRequest
 */
export interface PatchedEnrollmentTokenRequest {
    /**
     *
     * @type {string}
     * @memberof PatchedEnrollmentTokenRequest
     */
    deviceGroup?: string | null;
    /**
     *
     * @type {string}
     * @memberof PatchedEnrollmentTokenRequest
     */
    connector?: string;
    /**
     *
     * @type {string}
     * @memberof PatchedEnrollmentTokenRequest
     */
    name?: string;
    /**
     *
     * @type {boolean}
     * @memberof PatchedEnrollmentTokenRequest
     */
    expiring?: boolean;
    /**
     *
     * @type {Date}
     * @memberof PatchedEnrollmentTokenRequest
     */
    expires?: Date | null;
}

/**
 * Check if a given object implements the PatchedEnrollmentTokenRequest interface.
 */
export function instanceOfPatchedEnrollmentTokenRequest(
    value: object,
): value is PatchedEnrollmentTokenRequest {
    return true;
}

export function PatchedEnrollmentTokenRequestFromJSON(json: any): PatchedEnrollmentTokenRequest {
    return PatchedEnrollmentTokenRequestFromJSONTyped(json, false);
}

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

export function PatchedEnrollmentTokenRequestToJSON(json: any): PatchedEnrollmentTokenRequest {
    return PatchedEnrollmentTokenRequestToJSONTyped(json, false);
}

export function PatchedEnrollmentTokenRequestToJSONTyped(
    value?: PatchedEnrollmentTokenRequest | 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(),
    };
}
