TopicWithRelationships.ts•4.3 kB
/* tslint:disable */
/* eslint-disable */
/**
* Squad API
* API for managing Squad resources
*
* The version of the OpenAPI document: 4.0.0
* Contact: help@meetsquad.ai
*
* 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.js';
import type { Opportunity } from './Opportunity.js';
import {
OpportunityFromJSON,
OpportunityFromJSONTyped,
OpportunityToJSON,
OpportunityToJSONTyped,
} from './Opportunity.js';
import type { Insight } from './Insight.js';
import {
InsightFromJSON,
InsightFromJSONTyped,
InsightToJSON,
InsightToJSONTyped,
} from './Insight.js';
/**
* Topic data
* @export
* @interface TopicWithRelationships
*/
export interface TopicWithRelationships {
/**
*
* @type {string}
* @memberof TopicWithRelationships
*/
id: string;
/**
* Title of the topic
* @type {string}
* @memberof TopicWithRelationships
*/
title: string;
/**
* Description of the topic
* @type {string}
* @memberof TopicWithRelationships
*/
description: string;
/**
* Creation timestamp
* @type {string}
* @memberof TopicWithRelationships
*/
createdAt: string;
/**
* Last update timestamp
* @type {string}
* @memberof TopicWithRelationships
*/
updatedAt: string;
/**
*
* @type {Array<Opportunity>}
* @memberof TopicWithRelationships
*/
opportunities: Array<Opportunity>;
/**
*
* @type {Array<Insight>}
* @memberof TopicWithRelationships
*/
insights: Array<Insight>;
/**
* Number of opportunities associated with the topic
* @type {number}
* @memberof TopicWithRelationships
*/
opportunityCount: number;
}
/**
* Check if a given object implements the TopicWithRelationships interface.
*/
export function instanceOfTopicWithRelationships(value: object): value is TopicWithRelationships {
if (!('id' in value) || value['id'] === undefined) return false;
if (!('title' in value) || value['title'] === undefined) return false;
if (!('description' in value) || value['description'] === undefined) return false;
if (!('createdAt' in value) || value['createdAt'] === undefined) return false;
if (!('updatedAt' in value) || value['updatedAt'] === undefined) return false;
if (!('opportunities' in value) || value['opportunities'] === undefined) return false;
if (!('insights' in value) || value['insights'] === undefined) return false;
if (!('opportunityCount' in value) || value['opportunityCount'] === undefined) return false;
return true;
}
export function TopicWithRelationshipsFromJSON(json: any): TopicWithRelationships {
return TopicWithRelationshipsFromJSONTyped(json, false);
}
export function TopicWithRelationshipsFromJSONTyped(json: any, ignoreDiscriminator: boolean): TopicWithRelationships {
if (json == null) {
return json;
}
return {
'id': json['id'],
'title': json['title'],
'description': json['description'],
'createdAt': json['createdAt'],
'updatedAt': json['updatedAt'],
'opportunities': ((json['opportunities'] as Array<any>).map(OpportunityFromJSON)),
'insights': ((json['insights'] as Array<any>).map(InsightFromJSON)),
'opportunityCount': json['opportunityCount'],
};
}
export function TopicWithRelationshipsToJSON(json: any): TopicWithRelationships {
return TopicWithRelationshipsToJSONTyped(json, false);
}
export function TopicWithRelationshipsToJSONTyped(value?: TopicWithRelationships | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'id': value['id'],
'title': value['title'],
'description': value['description'],
'createdAt': value['createdAt'],
'updatedAt': value['updatedAt'],
'opportunities': ((value['opportunities'] as Array<any>).map(OpportunityToJSON)),
'insights': ((value['insights'] as Array<any>).map(InsightToJSON)),
'opportunityCount': value['opportunityCount'],
};
}