Opportunity.ts•5.36 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';
/**
* Opportunity data for a business
* @export
* @interface Opportunity
*/
export interface Opportunity {
/**
* Unique identifier for the opportunity
* @type {string}
* @memberof Opportunity
*/
id: string;
/**
* Whether the opportunity has been read
* @type {boolean}
* @memberof Opportunity
*/
read: boolean;
/**
* Current status of the opportunity
* @type {string}
* @memberof Opportunity
*/
status: OpportunityStatusEnum;
/**
* Title of the opportunity
* @type {string}
* @memberof Opportunity
*/
title: string;
/**
* Description of the opportunity
* @type {string}
* @memberof Opportunity
*/
description: string;
/**
* Current state of solution generation
* @type {string}
* @memberof Opportunity
*/
solutionsGeneratingState: OpportunitySolutionsGeneratingStateEnum;
/**
* How the opportunity was created
* @type {string}
* @memberof Opportunity
*/
createdBy: OpportunityCreatedByEnum;
/**
* Whether the opportunity content should be hidden
* @type {boolean}
* @memberof Opportunity
*/
hideContent: boolean;
/**
* ID of the opportunity owner
* @type {string}
* @memberof Opportunity
*/
ownerId?: string;
/**
* Creation timestamp
* @type {string}
* @memberof Opportunity
*/
createdAt: string;
/**
* Last update timestamp
* @type {string}
* @memberof Opportunity
*/
updatedAt: string;
}
/**
* @export
*/
export const OpportunityStatusEnum = {
New: 'New',
Solved: 'Solved',
Planned: 'Planned',
InProgress: 'InProgress'
} as const;
export type OpportunityStatusEnum = typeof OpportunityStatusEnum[keyof typeof OpportunityStatusEnum];
/**
* @export
*/
export const OpportunitySolutionsGeneratingStateEnum = {
Generating: 'generating',
Generated: 'generated',
Initial: 'initial',
Error: 'error'
} as const;
export type OpportunitySolutionsGeneratingStateEnum = typeof OpportunitySolutionsGeneratingStateEnum[keyof typeof OpportunitySolutionsGeneratingStateEnum];
/**
* @export
*/
export const OpportunityCreatedByEnum = {
User: 'user',
Generated: 'generated'
} as const;
export type OpportunityCreatedByEnum = typeof OpportunityCreatedByEnum[keyof typeof OpportunityCreatedByEnum];
/**
* Check if a given object implements the Opportunity interface.
*/
export function instanceOfOpportunity(value: object): value is Opportunity {
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;
return true;
}
export function OpportunityFromJSON(json: any): Opportunity {
return OpportunityFromJSONTyped(json, false);
}
export function OpportunityFromJSONTyped(json: any, ignoreDiscriminator: boolean): Opportunity {
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'],
};
}
export function OpportunityToJSON(json: any): Opportunity {
return OpportunityToJSONTyped(json, false);
}
export function OpportunityToJSONTyped(value?: Opportunity | 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'],
};
}