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

/**
 * Invitation Serializer
 * @export
 * @interface PatchedInvitationRequest
 */
export interface PatchedInvitationRequest {
    /**
     *
     * @type {string}
     * @memberof PatchedInvitationRequest
     */
    name?: string;
    /**
     *
     * @type {Date}
     * @memberof PatchedInvitationRequest
     */
    expires?: Date | null;
    /**
     *
     * @type {{ [key: string]: any; }}
     * @memberof PatchedInvitationRequest
     */
    fixedData?: { [key: string]: any };
    /**
     * When enabled, the invitation will be deleted after usage.
     * @type {boolean}
     * @memberof PatchedInvitationRequest
     */
    singleUse?: boolean;
    /**
     * When set, only the configured flow can use this invitation.
     * @type {string}
     * @memberof PatchedInvitationRequest
     */
    flow?: string | null;
}

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

export function PatchedInvitationRequestFromJSON(json: any): PatchedInvitationRequest {
    return PatchedInvitationRequestFromJSONTyped(json, false);
}

export function PatchedInvitationRequestFromJSONTyped(
    json: any,
    ignoreDiscriminator: boolean,
): PatchedInvitationRequest {
    if (json == null) {
        return json;
    }
    return {
        name: json["name"] == null ? undefined : json["name"],
        expires: json["expires"] == null ? undefined : new Date(json["expires"]),
        fixedData: json["fixed_data"] == null ? undefined : json["fixed_data"],
        singleUse: json["single_use"] == null ? undefined : json["single_use"],
        flow: json["flow"] == null ? undefined : json["flow"],
    };
}

export function PatchedInvitationRequestToJSON(json: any): PatchedInvitationRequest {
    return PatchedInvitationRequestToJSONTyped(json, false);
}

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

    return {
        name: value["name"],
        expires: value["expires"] == null ? value["expires"] : value["expires"].toISOString(),
        fixed_data: value["fixedData"],
        single_use: value["singleUse"],
        flow: value["flow"],
    };
}
