UNPKG

@emergentmethods/asknews-typescript-sdk

Version:
61 lines (60 loc) 2.4 kB
"use strict"; /* tslint:disable */ /* eslint-disable */ /** * AskNews API * AskNews API [![status](https://status.asknews.app/api/badge/2/status?style=for-the-badge)](https://status.asknews.app/status/prod) * * The version of the OpenAPI document: 0.24.22 * 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.URLIndexingRequestToJSONTyped = exports.URLIndexingRequestToJSON = exports.URLIndexingRequestFromJSONTyped = exports.URLIndexingRequestFromJSON = exports.instanceOfURLIndexingRequest = void 0; const ScrapedURLItem_1 = require("./ScrapedURLItem"); /** * Check if a given object implements the URLIndexingRequest interface. */ function instanceOfURLIndexingRequest(value) { if (!('startTime' in value) || value['startTime'] === undefined) return false; if (!('endTime' in value) || value['endTime'] === undefined) return false; if (!('urls' in value) || value['urls'] === undefined) return false; return true; } exports.instanceOfURLIndexingRequest = instanceOfURLIndexingRequest; function URLIndexingRequestFromJSON(json) { return URLIndexingRequestFromJSONTyped(json, false); } exports.URLIndexingRequestFromJSON = URLIndexingRequestFromJSON; function URLIndexingRequestFromJSONTyped(json, ignoreDiscriminator) { if (json == null) { return json; } return { 'startTime': (new Date(json['start_time'])), 'endTime': (new Date(json['end_time'])), 'urls': (json['urls'].map(ScrapedURLItem_1.ScrapedURLItemFromJSON)), }; } exports.URLIndexingRequestFromJSONTyped = URLIndexingRequestFromJSONTyped; function URLIndexingRequestToJSON(json) { return URLIndexingRequestToJSONTyped(json, false); } exports.URLIndexingRequestToJSON = URLIndexingRequestToJSON; function URLIndexingRequestToJSONTyped(value, ignoreDiscriminator = false) { if (value == null) { return value; } return { 'start_time': ((value['startTime']).toISOString()), 'end_time': ((value['endTime']).toISOString()), 'urls': (value['urls'].map(ScrapedURLItem_1.ScrapedURLItemToJSON)), }; } exports.URLIndexingRequestToJSONTyped = URLIndexingRequestToJSONTyped;