Files
recipes/models/InviteLink.ts

146 lines
3.4 KiB
TypeScript

/* tslint:disable */
/* eslint-disable */
/**
* Tandoor
* Tandoor API Docs
*
* The version of the OpenAPI document: 0.0.0
*
*
* 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 { Group } from './Group';
import {
GroupFromJSON,
GroupFromJSONTyped,
GroupToJSON,
} from './Group';
/**
* Adds nested create feature
* @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 {Group}
* @memberof InviteLink
*/
group: Group;
/**
*
* @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 {number}
* @memberof InviteLink
*/
readonly createdBy: number;
/**
*
* @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 && "id" in value;
isInstance = isInstance && "uuid" in value;
isInstance = isInstance && "group" in value;
isInstance = isInstance && "createdBy" in value;
isInstance = isInstance && "createdAt" 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': json['id'],
'uuid': json['uuid'],
'email': !exists(json, 'email') ? undefined : json['email'],
'group': GroupFromJSON(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': json['created_by'],
'createdAt': (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': GroupToJSON(value.group),
'valid_until': value.validUntil === undefined ? undefined : (value.validUntil.toISOString().substr(0,10)),
'used_by': value.usedBy,
'reusable': value.reusable,
'internal_note': value.internalNote,
};
}