UNPKG

@emergentmethods/asknews-typescript-sdk

Version:
145 lines (134 loc) 3.63 kB
/* tslint:disable */ /* eslint-disable */ /** * AskNews API * AskNews API * * The version of the OpenAPI document: 0.19.10 * Contact: contact@emergentmethods.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'; /** * * @export * @interface AlertLog */ export interface AlertLog { /** * * @type {string} * @memberof AlertLog */ id: string; /** * * @type {Date} * @memberof AlertLog */ createdAt: Date; /** * * @type {string} * @memberof AlertLog */ alertId: string; /** * * @type {string} * @memberof AlertLog */ userId: string; /** * * @type {boolean} * @memberof AlertLog */ alert: boolean; /** * * @type {string} * @memberof AlertLog */ reasoning: string; /** * * @type {string} * @memberof AlertLog */ report?: string | null; /** * * @type {string} * @memberof AlertLog */ reportUrl?: string | null; /** * * @type {Array<string>} * @memberof AlertLog */ articleIds: Array<string>; /** * * @type {{ [key: string]: any; }} * @memberof AlertLog */ webhook?: { [key: string]: any; } | null; } /** * Check if a given object implements the AlertLog interface. */ export function instanceOfAlertLog(value: object): value is AlertLog { if (!('id' in value) || value['id'] === undefined) return false; if (!('createdAt' in value) || value['createdAt'] === undefined) return false; if (!('alertId' in value) || value['alertId'] === undefined) return false; if (!('userId' in value) || value['userId'] === undefined) return false; if (!('alert' in value) || value['alert'] === undefined) return false; if (!('reasoning' in value) || value['reasoning'] === undefined) return false; if (!('articleIds' in value) || value['articleIds'] === undefined) return false; return true; } export function AlertLogFromJSON(json: any): AlertLog { return AlertLogFromJSONTyped(json, false); } export function AlertLogFromJSONTyped(json: any, ignoreDiscriminator: boolean): AlertLog { if (json == null) { return json; } return { 'id': json['id'], 'createdAt': (new Date(json['created_at'])), 'alertId': json['alert_id'], 'userId': json['user_id'], 'alert': json['alert'], 'reasoning': json['reasoning'], 'report': json['report'] == null ? undefined : json['report'], 'reportUrl': json['report_url'] == null ? undefined : json['report_url'], 'articleIds': json['article_ids'], 'webhook': json['webhook'] == null ? undefined : json['webhook'], }; } export function AlertLogToJSON(json: any): AlertLog { return AlertLogToJSONTyped(json, false); } export function AlertLogToJSONTyped(value?: AlertLog | null, ignoreDiscriminator: boolean = false): any { if (value == null) { return value; } return { 'id': value['id'], 'created_at': ((value['createdAt']).toISOString()), 'alert_id': value['alertId'], 'user_id': value['userId'], 'alert': value['alert'], 'reasoning': value['reasoning'], 'report': value['report'], 'report_url': value['reportUrl'], 'article_ids': value['articleIds'], 'webhook': value['webhook'], }; }