/* tslint:disable */ /* eslint-disable */ // @ts-nocheck /** * Audius API * * The version of the OpenAPI document: 1.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 { CommentEntityType } from './CommentEntityType'; import { CommentEntityTypeFromJSON, CommentEntityTypeFromJSONTyped, CommentEntityTypeToJSON, } from './CommentEntityType'; /** * * @export * @interface CreateCommentRequestBody */ export interface CreateCommentRequestBody { /** * * @type {CommentEntityType} * @memberof CreateCommentRequestBody */ entityType: CommentEntityType; /** * ID of the entity being commented on * @type {number} * @memberof CreateCommentRequestBody */ entityId: number; /** * Comment text * @type {string} * @memberof CreateCommentRequestBody */ body: string; /** * Optional ID for the comment (will be generated if not provided) * @type {number} * @memberof CreateCommentRequestBody */ commentId?: number; /** * Parent comment ID if this is a reply * @type {number} * @memberof CreateCommentRequestBody */ parentId?: number; /** * Timestamp in the track where the comment was made (in seconds) * @type {number} * @memberof CreateCommentRequestBody */ trackTimestampS?: number; /** * Array of user IDs mentioned in the comment (max 10) * @type {Array} * @memberof CreateCommentRequestBody */ mentions?: Array; } /** * Check if a given object implements the CreateCommentRequestBody interface. */ export function instanceOfCreateCommentRequestBody(value: object): value is CreateCommentRequestBody { let isInstance = true; isInstance = isInstance && "entityType" in value && value["entityType"] !== undefined; isInstance = isInstance && "entityId" in value && value["entityId"] !== undefined; isInstance = isInstance && "body" in value && value["body"] !== undefined; return isInstance; } export function CreateCommentRequestBodyFromJSON(json: any): CreateCommentRequestBody { return CreateCommentRequestBodyFromJSONTyped(json, false); } export function CreateCommentRequestBodyFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateCommentRequestBody { if ((json === undefined) || (json === null)) { return json; } return { 'entityType': CommentEntityTypeFromJSON(json['entityType']), 'entityId': json['entityId'], 'body': json['body'], 'commentId': !exists(json, 'commentId') ? undefined : json['commentId'], 'parentId': !exists(json, 'parentId') ? undefined : json['parentId'], 'trackTimestampS': !exists(json, 'trackTimestampS') ? undefined : json['trackTimestampS'], 'mentions': !exists(json, 'mentions') ? undefined : json['mentions'], }; } export function CreateCommentRequestBodyToJSON(value?: CreateCommentRequestBody | null): any { if (value === undefined) { return undefined; } if (value === null) { return null; } return { 'entityType': CommentEntityTypeToJSON(value.entityType), 'entityId': value.entityId, 'body': value.body, 'commentId': value.commentId, 'parentId': value.parentId, 'trackTimestampS': value.trackTimestampS, 'mentions': value.mentions, }; }