OutcomeWithRelationships.ts•6.58 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';
import type { Metric } from './Metric.js';
import {
MetricFromJSON,
MetricFromJSONTyped,
MetricToJSON,
MetricToJSONTyped,
} from './Metric.js';
import type { Solution } from './Solution.js';
import {
SolutionFromJSON,
SolutionFromJSONTyped,
SolutionToJSON,
SolutionToJSONTyped,
} from './Solution.js';
/**
* Outcome with relationships
* @export
* @interface OutcomeWithRelationships
*/
export interface OutcomeWithRelationships {
/**
* Unique identifier for the outcome
* @type {string}
* @memberof OutcomeWithRelationships
*/
id: string;
/**
* Title of the outcome
* @type {string}
* @memberof OutcomeWithRelationships
*/
title: string;
/**
* Detailed description of the outcome
* @type {string}
* @memberof OutcomeWithRelationships
*/
description: string;
/**
* Priority level of the outcome
* @type {number}
* @memberof OutcomeWithRelationships
*/
priority: number;
/**
* Trend indicator for the outcome
* @type {number}
* @memberof OutcomeWithRelationships
*/
trend?: number;
/**
* List of analytic events associated with the outcome
* @type {Array<string>}
* @memberof OutcomeWithRelationships
*/
analyticEvents?: Array<string>;
/**
* Whether the outcome is hidden
* @type {boolean}
* @memberof OutcomeWithRelationships
*/
hideContent: boolean;
/**
* ID of the owner of the outcome
* @type {string}
* @memberof OutcomeWithRelationships
*/
ownerId?: string;
/**
* Timestamp of when the outcome was created
* @type {string}
* @memberof OutcomeWithRelationships
*/
createdAt: string;
/**
* Timestamp of when the outcome was last updated
* @type {string}
* @memberof OutcomeWithRelationships
*/
updatedAt: string;
/**
*
* @type {Array<Opportunity>}
* @memberof OutcomeWithRelationships
*/
opportunities: Array<Opportunity>;
/**
*
* @type {Array<Solution>}
* @memberof OutcomeWithRelationships
*/
solutions: Array<Solution>;
/**
*
* @type {Array<Insight>}
* @memberof OutcomeWithRelationships
*/
insights: Array<Insight>;
/**
*
* @type {Array<Metric>}
* @memberof OutcomeWithRelationships
*/
metrics: Array<Metric>;
}
/**
* Check if a given object implements the OutcomeWithRelationships interface.
*/
export function instanceOfOutcomeWithRelationships(value: object): value is OutcomeWithRelationships {
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 (!('priority' in value) || value['priority'] === 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 (!('opportunities' in value) || value['opportunities'] === undefined) return false;
if (!('solutions' in value) || value['solutions'] === undefined) return false;
if (!('insights' in value) || value['insights'] === undefined) return false;
if (!('metrics' in value) || value['metrics'] === undefined) return false;
return true;
}
export function OutcomeWithRelationshipsFromJSON(json: any): OutcomeWithRelationships {
return OutcomeWithRelationshipsFromJSONTyped(json, false);
}
export function OutcomeWithRelationshipsFromJSONTyped(json: any, ignoreDiscriminator: boolean): OutcomeWithRelationships {
if (json == null) {
return json;
}
return {
'id': json['id'],
'title': json['title'],
'description': json['description'],
'priority': json['priority'],
'trend': json['trend'] == null ? undefined : json['trend'],
'analyticEvents': json['analyticEvents'] == null ? undefined : json['analyticEvents'],
'hideContent': json['hideContent'],
'ownerId': json['ownerId'] == null ? undefined : json['ownerId'],
'createdAt': json['createdAt'],
'updatedAt': json['updatedAt'],
'opportunities': ((json['opportunities'] as Array<any>).map(OpportunityFromJSON)),
'solutions': ((json['solutions'] as Array<any>).map(SolutionFromJSON)),
'insights': ((json['insights'] as Array<any>).map(InsightFromJSON)),
'metrics': ((json['metrics'] as Array<any>).map(MetricFromJSON)),
};
}
export function OutcomeWithRelationshipsToJSON(json: any): OutcomeWithRelationships {
return OutcomeWithRelationshipsToJSONTyped(json, false);
}
export function OutcomeWithRelationshipsToJSONTyped(value?: OutcomeWithRelationships | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'id': value['id'],
'title': value['title'],
'description': value['description'],
'priority': value['priority'],
'trend': value['trend'],
'analyticEvents': value['analyticEvents'],
'hideContent': value['hideContent'],
'ownerId': value['ownerId'],
'createdAt': value['createdAt'],
'updatedAt': value['updatedAt'],
'opportunities': ((value['opportunities'] as Array<any>).map(OpportunityToJSON)),
'solutions': ((value['solutions'] as Array<any>).map(SolutionToJSON)),
'insights': ((value['insights'] as Array<any>).map(InsightToJSON)),
'metrics': ((value['metrics'] as Array<any>).map(MetricToJSON)),
};
}