/* tslint:disable */ /* eslint-disable */ /** * Fabric API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.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 { CommentWithAuthorAnonymousIdentity } from './CommentWithAuthorAnonymousIdentity'; import { CommentWithAuthorAnonymousIdentityFromJSON, CommentWithAuthorAnonymousIdentityFromJSONTyped, CommentWithAuthorAnonymousIdentityToJSON, CommentWithAuthorAnonymousIdentityToJSONTyped, } from './CommentWithAuthorAnonymousIdentity'; import type { UserProfilePublic } from './UserProfilePublic'; import { UserProfilePublicFromJSON, UserProfilePublicFromJSONTyped, UserProfilePublicToJSON, UserProfilePublicToJSONTyped, } from './UserProfilePublic'; /** * * @export * @interface CommentWithAuthor */ export interface CommentWithAuthor { /** * * @type {string} * @memberof CommentWithAuthor */ 'id': string; /** * * @type {string} * @memberof CommentWithAuthor */ 'content': string; /** * * @type {string} * @memberof CommentWithAuthor */ 'createdAt': string; /** * * @type {string} * @memberof CommentWithAuthor */ 'modifiedAt': string; /** * * @type {string} * @memberof CommentWithAuthor */ 'resourceId': string; /** * * @type {CommentWithAuthorAnonymousIdentity} * @memberof CommentWithAuthor */ 'anonymousIdentity': CommentWithAuthorAnonymousIdentity | null; /** * * @type {UserProfilePublic} * @memberof CommentWithAuthor */ 'user': UserProfilePublic | null; /** * * @type {Array} * @memberof CommentWithAuthor */ 'mentionedUsers': Array; } /** * Check if a given object implements the CommentWithAuthor interface. */ export function instanceOfCommentWithAuthor(value: object): value is CommentWithAuthor { if (!('id' in value) || value['id'] === undefined) return false; if (!('content' in value) || value['content'] === undefined) return false; if (!('createdAt' in value) || value['createdAt'] === undefined) return false; if (!('modifiedAt' in value) || value['modifiedAt'] === undefined) return false; if (!('resourceId' in value) || value['resourceId'] === undefined) return false; if (!('anonymousIdentity' in value) || value['anonymousIdentity'] === undefined) return false; if (!('user' in value) || value['user'] === undefined) return false; if (!('mentionedUsers' in value) || value['mentionedUsers'] === undefined) return false; return true; } export function CommentWithAuthorFromJSON(json: any): CommentWithAuthor { return CommentWithAuthorFromJSONTyped(json, false); } export function CommentWithAuthorFromJSONTyped(json: any, ignoreDiscriminator: boolean): CommentWithAuthor { if (json == null) { return json; } const result = { } as CommentWithAuthor; if (json['id'] !== undefined) { result['id'] = json['id']; } if (json['content'] !== undefined) { result['content'] = json['content']; } if (json['createdAt'] !== undefined) { result['createdAt'] = json['createdAt']; } if (json['modifiedAt'] !== undefined) { result['modifiedAt'] = json['modifiedAt']; } if (json['resourceId'] !== undefined) { result['resourceId'] = json['resourceId']; } if (json['anonymousIdentity'] !== undefined) { if (json['anonymousIdentity'] === null) { result['anonymousIdentity'] = null; } else { result['anonymousIdentity'] = CommentWithAuthorAnonymousIdentityFromJSON(json['anonymousIdentity']); } } if (json['user'] !== undefined) { if (json['user'] === null) { result['user'] = null; } else { result['user'] = UserProfilePublicFromJSON(json['user']); } } if (json['mentionedUsers'] !== undefined) { result['mentionedUsers'] = (json['mentionedUsers'] as Array).map(UserProfilePublicFromJSON); } return result; } export function CommentWithAuthorToJSON(json: any): CommentWithAuthor { return CommentWithAuthorToJSONTyped(json, false); } export function CommentWithAuthorToJSONTyped(value?: CommentWithAuthor | null, ignoreDiscriminator: boolean = false): any { if (value == null) { return value; } return { 'id': value['id'], 'content': value['content'], 'createdAt': value['createdAt'], 'modifiedAt': value['modifiedAt'], 'resourceId': value['resourceId'], 'anonymousIdentity': CommentWithAuthorAnonymousIdentityToJSON(value['anonymousIdentity']), 'user': UserProfilePublicToJSON(value['user']), 'mentionedUsers': ((value['mentionedUsers'] as Array).map(UserProfilePublicToJSON)), }; }