UNPKG

@emergentmethods/asknews-typescript-sdk

Version:
82 lines (81 loc) 2.86 kB
"use strict"; /* tslint:disable */ /* eslint-disable */ /** * AskNews API * AskNews API * * The version of the OpenAPI document: 0.21.1 * 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. */ Object.defineProperty(exports, "__esModule", { value: true }); exports.AlertLogToJSONTyped = exports.AlertLogToJSON = exports.AlertLogFromJSONTyped = exports.AlertLogFromJSON = exports.instanceOfAlertLog = void 0; /** * Check if a given object implements the AlertLog interface. */ function instanceOfAlertLog(value) { 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; } exports.instanceOfAlertLog = instanceOfAlertLog; function AlertLogFromJSON(json) { return AlertLogFromJSONTyped(json, false); } exports.AlertLogFromJSON = AlertLogFromJSON; function AlertLogFromJSONTyped(json, ignoreDiscriminator) { 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'], }; } exports.AlertLogFromJSONTyped = AlertLogFromJSONTyped; function AlertLogToJSON(json) { return AlertLogToJSONTyped(json, false); } exports.AlertLogToJSON = AlertLogToJSON; function AlertLogToJSONTyped(value, ignoreDiscriminator = false) { 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'], }; } exports.AlertLogToJSONTyped = AlertLogToJSONTyped;