/* tslint:disable */
/* eslint-disable */
/**
 * authentik
 * Making authentication simple.
 *
 * The version of the OpenAPI document: 2025.10.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.
 */

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

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

export function InvitationRequestFromJSON(json: any): InvitationRequest {
    return InvitationRequestFromJSONTyped(json, false);
}

export function InvitationRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): InvitationRequest {
    if (json == null) {
        return json;
    }
    return {
        
        'name': 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 InvitationRequestToJSON(json: any): InvitationRequest {
    return InvitationRequestToJSONTyped(json, false);
}

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

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

