mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-02 12:49:02 -05:00
139 lines
3.1 KiB
TypeScript
139 lines
3.1 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 { mapValues } from '../runtime';
|
|
import type { Group } from './Group';
|
|
import {
|
|
GroupFromJSON,
|
|
GroupFromJSONTyped,
|
|
GroupToJSON,
|
|
} from './Group';
|
|
import type { User } from './User';
|
|
import {
|
|
UserFromJSON,
|
|
UserFromJSONTyped,
|
|
UserToJSON,
|
|
} from './User';
|
|
|
|
/**
|
|
* Adds nested create feature
|
|
* @export
|
|
* @interface UserSpace
|
|
*/
|
|
export interface UserSpace {
|
|
/**
|
|
*
|
|
* @type {number}
|
|
* @memberof UserSpace
|
|
*/
|
|
readonly id: number;
|
|
/**
|
|
*
|
|
* @type {User}
|
|
* @memberof UserSpace
|
|
*/
|
|
readonly user: User;
|
|
/**
|
|
*
|
|
* @type {number}
|
|
* @memberof UserSpace
|
|
*/
|
|
readonly space: number;
|
|
/**
|
|
*
|
|
* @type {Array<Group>}
|
|
* @memberof UserSpace
|
|
*/
|
|
groups: Array<Group>;
|
|
/**
|
|
*
|
|
* @type {boolean}
|
|
* @memberof UserSpace
|
|
*/
|
|
active?: boolean;
|
|
/**
|
|
*
|
|
* @type {string}
|
|
* @memberof UserSpace
|
|
*/
|
|
internalNote?: string;
|
|
/**
|
|
*
|
|
* @type {number}
|
|
* @memberof UserSpace
|
|
*/
|
|
readonly inviteLink: number | null;
|
|
/**
|
|
*
|
|
* @type {Date}
|
|
* @memberof UserSpace
|
|
*/
|
|
readonly createdAt: Date;
|
|
/**
|
|
*
|
|
* @type {Date}
|
|
* @memberof UserSpace
|
|
*/
|
|
readonly updatedAt: Date;
|
|
}
|
|
|
|
/**
|
|
* Check if a given object implements the UserSpace interface.
|
|
*/
|
|
export function instanceOfUserSpace(value: object): boolean {
|
|
if (!('id' in value)) return false;
|
|
if (!('user' in value)) return false;
|
|
if (!('space' in value)) return false;
|
|
if (!('groups' in value)) return false;
|
|
if (!('inviteLink' in value)) return false;
|
|
if (!('createdAt' in value)) return false;
|
|
if (!('updatedAt' in value)) return false;
|
|
return true;
|
|
}
|
|
|
|
export function UserSpaceFromJSON(json: any): UserSpace {
|
|
return UserSpaceFromJSONTyped(json, false);
|
|
}
|
|
|
|
export function UserSpaceFromJSONTyped(json: any, ignoreDiscriminator: boolean): UserSpace {
|
|
if (json == null) {
|
|
return json;
|
|
}
|
|
return {
|
|
|
|
'id': json['id'],
|
|
'user': UserFromJSON(json['user']),
|
|
'space': json['space'],
|
|
'groups': ((json['groups'] as Array<any>).map(GroupFromJSON)),
|
|
'active': json['active'] == null ? undefined : json['active'],
|
|
'internalNote': json['internal_note'] == null ? undefined : json['internal_note'],
|
|
'inviteLink': json['invite_link'],
|
|
'createdAt': (new Date(json['created_at'])),
|
|
'updatedAt': (new Date(json['updated_at'])),
|
|
};
|
|
}
|
|
|
|
export function UserSpaceToJSON(value?: Omit<UserSpace, 'id'|'user'|'space'|'invite_link'|'created_at'|'updated_at'> | null): any {
|
|
if (value == null) {
|
|
return value;
|
|
}
|
|
return {
|
|
|
|
'groups': ((value['groups'] as Array<any>).map(GroupToJSON)),
|
|
'active': value['active'],
|
|
'internal_note': value['internalNote'],
|
|
};
|
|
}
|
|
|