OpportunityWithRelationships.ts•8.54 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 { Outcome } from './Outcome.js';
import {
OutcomeFromJSON,
OutcomeFromJSONTyped,
OutcomeToJSON,
OutcomeToJSONTyped,
} from './Outcome.js';
import type { Insight } from './Insight.js';
import {
InsightFromJSON,
InsightFromJSONTyped,
InsightToJSON,
InsightToJSONTyped,
} from './Insight.js';
import type { Topic } from './Topic.js';
import {
TopicFromJSON,
TopicFromJSONTyped,
TopicToJSON,
TopicToJSONTyped,
} from './Topic.js';
import type { Solution } from './Solution.js';
import {
SolutionFromJSON,
SolutionFromJSONTyped,
SolutionToJSON,
SolutionToJSONTyped,
} from './Solution.js';
/**
* Opportunity with relationships
* @export
* @interface OpportunityWithRelationships
*/
export interface OpportunityWithRelationships {
/**
* Unique identifier for the opportunity
* @type {string}
* @memberof OpportunityWithRelationships
*/
id: string;
/**
* Whether the opportunity has been read
* @type {boolean}
* @memberof OpportunityWithRelationships
*/
read: boolean;
/**
* Current status of the opportunity
* @type {string}
* @memberof OpportunityWithRelationships
*/
status: OpportunityWithRelationshipsStatusEnum;
/**
* Title of the opportunity
* @type {string}
* @memberof OpportunityWithRelationships
*/
title: string;
/**
* Description of the opportunity
* @type {string}
* @memberof OpportunityWithRelationships
*/
description: string;
/**
* Current state of solution generation
* @type {string}
* @memberof OpportunityWithRelationships
*/
solutionsGeneratingState: OpportunityWithRelationshipsSolutionsGeneratingStateEnum;
/**
* How the opportunity was created
* @type {string}
* @memberof OpportunityWithRelationships
*/
createdBy: OpportunityWithRelationshipsCreatedByEnum;
/**
* Whether the opportunity content should be hidden
* @type {boolean}
* @memberof OpportunityWithRelationships
*/
hideContent: boolean;
/**
* ID of the opportunity owner
* @type {string}
* @memberof OpportunityWithRelationships
*/
ownerId?: string;
/**
* Creation timestamp
* @type {string}
* @memberof OpportunityWithRelationships
*/
createdAt: string;
/**
* Last update timestamp
* @type {string}
* @memberof OpportunityWithRelationships
*/
updatedAt: string;
/**
* Whether the opportunity has unseen insights
* @type {boolean}
* @memberof OpportunityWithRelationships
*/
hasUnseenInsights: boolean;
/**
*
* @type {Array<Solution>}
* @memberof OpportunityWithRelationships
*/
solutions: Array<Solution>;
/**
*
* @type {Array<Insight>}
* @memberof OpportunityWithRelationships
*/
insights: Array<Insight>;
/**
*
* @type {Array<Outcome>}
* @memberof OpportunityWithRelationships
*/
outcomes: Array<Outcome>;
/**
*
* @type {Array<Topic>}
* @memberof OpportunityWithRelationships
*/
topics: Array<Topic>;
}
/**
* @export
*/
export const OpportunityWithRelationshipsStatusEnum = {
New: 'New',
Solved: 'Solved',
Planned: 'Planned',
InProgress: 'InProgress'
} as const;
export type OpportunityWithRelationshipsStatusEnum = typeof OpportunityWithRelationshipsStatusEnum[keyof typeof OpportunityWithRelationshipsStatusEnum];
/**
* @export
*/
export const OpportunityWithRelationshipsSolutionsGeneratingStateEnum = {
Generating: 'generating',
Generated: 'generated',
Initial: 'initial',
Error: 'error'
} as const;
export type OpportunityWithRelationshipsSolutionsGeneratingStateEnum = typeof OpportunityWithRelationshipsSolutionsGeneratingStateEnum[keyof typeof OpportunityWithRelationshipsSolutionsGeneratingStateEnum];
/**
* @export
*/
export const OpportunityWithRelationshipsCreatedByEnum = {
User: 'user',
Generated: 'generated'
} as const;
export type OpportunityWithRelationshipsCreatedByEnum = typeof OpportunityWithRelationshipsCreatedByEnum[keyof typeof OpportunityWithRelationshipsCreatedByEnum];
/**
* Check if a given object implements the OpportunityWithRelationships interface.
*/
export function instanceOfOpportunityWithRelationships(value: object): value is OpportunityWithRelationships {
if (!('id' in value) || value['id'] === undefined) return false;
if (!('read' in value) || value['read'] === undefined) return false;
if (!('status' in value) || value['status'] === undefined) return false;
if (!('title' in value) || value['title'] === undefined) return false;
if (!('description' in value) || value['description'] === undefined) return false;
if (!('solutionsGeneratingState' in value) || value['solutionsGeneratingState'] === undefined) return false;
if (!('createdBy' in value) || value['createdBy'] === undefined) return false;
if (!('hideContent' in value) || value['hideContent'] === undefined) return false;
if (!('createdAt' in value) || value['createdAt'] === undefined) return false;
if (!('updatedAt' in value) || value['updatedAt'] === undefined) return false;
if (!('hasUnseenInsights' in value) || value['hasUnseenInsights'] === undefined) return false;
if (!('solutions' in value) || value['solutions'] === undefined) return false;
if (!('insights' in value) || value['insights'] === undefined) return false;
if (!('outcomes' in value) || value['outcomes'] === undefined) return false;
if (!('topics' in value) || value['topics'] === undefined) return false;
return true;
}
export function OpportunityWithRelationshipsFromJSON(json: any): OpportunityWithRelationships {
return OpportunityWithRelationshipsFromJSONTyped(json, false);
}
export function OpportunityWithRelationshipsFromJSONTyped(json: any, ignoreDiscriminator: boolean): OpportunityWithRelationships {
if (json == null) {
return json;
}
return {
'id': json['id'],
'read': json['read'],
'status': json['status'],
'title': json['title'],
'description': json['description'],
'solutionsGeneratingState': json['solutionsGeneratingState'],
'createdBy': json['createdBy'],
'hideContent': json['hideContent'],
'ownerId': json['ownerId'] == null ? undefined : json['ownerId'],
'createdAt': json['createdAt'],
'updatedAt': json['updatedAt'],
'hasUnseenInsights': json['hasUnseenInsights'],
'solutions': ((json['solutions'] as Array<any>).map(SolutionFromJSON)),
'insights': ((json['insights'] as Array<any>).map(InsightFromJSON)),
'outcomes': ((json['outcomes'] as Array<any>).map(OutcomeFromJSON)),
'topics': ((json['topics'] as Array<any>).map(TopicFromJSON)),
};
}
export function OpportunityWithRelationshipsToJSON(json: any): OpportunityWithRelationships {
return OpportunityWithRelationshipsToJSONTyped(json, false);
}
export function OpportunityWithRelationshipsToJSONTyped(value?: OpportunityWithRelationships | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'id': value['id'],
'read': value['read'],
'status': value['status'],
'title': value['title'],
'description': value['description'],
'solutionsGeneratingState': value['solutionsGeneratingState'],
'createdBy': value['createdBy'],
'hideContent': value['hideContent'],
'ownerId': value['ownerId'],
'createdAt': value['createdAt'],
'updatedAt': value['updatedAt'],
'hasUnseenInsights': value['hasUnseenInsights'],
'solutions': ((value['solutions'] as Array<any>).map(SolutionToJSON)),
'insights': ((value['insights'] as Array<any>).map(InsightToJSON)),
'outcomes': ((value['outcomes'] as Array<any>).map(OutcomeToJSON)),
'topics': ((value['topics'] as Array<any>).map(TopicToJSON)),
};
}