Files
recipes/vue3/models/InviteLink.ts
2024-03-27 08:34:19 -05:00

142 lines
3.5 KiB
TypeScript

/* tslint:disable */
/* eslint-disable */
/**
* Django Recipes
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document:
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { exists, mapValues } from '../runtime';
import type { InviteLinkGroup } from './InviteLinkGroup';
import {
InviteLinkGroupFromJSON,
InviteLinkGroupFromJSONTyped,
InviteLinkGroupToJSON,
} from './InviteLinkGroup';
/**
*
* @export
* @interface InviteLink
*/
export interface InviteLink {
/**
*
* @type {number}
* @memberof InviteLink
*/
readonly id?: number;
/**
*
* @type {string}
* @memberof InviteLink
*/
readonly uuid?: string;
/**
*
* @type {string}
* @memberof InviteLink
*/
email?: string;
/**
*
* @type {InviteLinkGroup}
* @memberof InviteLink
*/
group: InviteLinkGroup;
/**
*
* @type {Date}
* @memberof InviteLink
*/
validUntil?: Date;
/**
*
* @type {number}
* @memberof InviteLink
*/
usedBy?: number | null;
/**
*
* @type {boolean}
* @memberof InviteLink
*/
reusable?: boolean;
/**
*
* @type {string}
* @memberof InviteLink
*/
internalNote?: string | null;
/**
*
* @type {string}
* @memberof InviteLink
*/
readonly createdBy?: string;
/**
*
* @type {Date}
* @memberof InviteLink
*/
readonly createdAt?: Date;
}
/**
* Check if a given object implements the InviteLink interface.
*/
export function instanceOfInviteLink(value: object): boolean {
let isInstance = true;
isInstance = isInstance && "group" in value;
return isInstance;
}
export function InviteLinkFromJSON(json: any): InviteLink {
return InviteLinkFromJSONTyped(json, false);
}
export function InviteLinkFromJSONTyped(json: any, ignoreDiscriminator: boolean): InviteLink {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'id': !exists(json, 'id') ? undefined : json['id'],
'uuid': !exists(json, 'uuid') ? undefined : json['uuid'],
'email': !exists(json, 'email') ? undefined : json['email'],
'group': InviteLinkGroupFromJSON(json['group']),
'validUntil': !exists(json, 'valid_until') ? undefined : (new Date(json['valid_until'])),
'usedBy': !exists(json, 'used_by') ? undefined : json['used_by'],
'reusable': !exists(json, 'reusable') ? undefined : json['reusable'],
'internalNote': !exists(json, 'internal_note') ? undefined : json['internal_note'],
'createdBy': !exists(json, 'created_by') ? undefined : json['created_by'],
'createdAt': !exists(json, 'created_at') ? undefined : (new Date(json['created_at'])),
};
}
export function InviteLinkToJSON(value?: InviteLink | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'email': value.email,
'group': InviteLinkGroupToJSON(value.group),
'valid_until': value.validUntil === undefined ? undefined : (value.validUntil.toISOString().substring(0,10)),
'used_by': value.usedBy,
'reusable': value.reusable,
'internal_note': value.internalNote,
};
}