@indexea/sdk
Version:
Indexea JavaScript SDK (indexea.com)
65 lines (64 loc) • 2.94 kB
JavaScript
;
/* tslint:disable */
/* eslint-disable */
/**
* Indexea OpenAPI
* 这是 Indexea 搜索服务平台的 OpenAPI,用于描述平台的所有接口信息,你可以通过这个页面来了解和在线验证平台的所有接口信息。 ### Errors 本 API 使用标准的 HTTP 状态码来指示操作成功或者失败,如果失败将会在 body 中以 JSON 格式提供详细的错误信息,如下所示: ``` { \"error\": 404, \"message\": \"page not found\" } ```
*
* The version of the OpenAPI document: 1.0.0
* Contact: indexea.com@gmail.com
*
* 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.CrawlerLogToJSON = exports.CrawlerLogFromJSONTyped = exports.CrawlerLogFromJSON = exports.instanceOfCrawlerLog = void 0;
var runtime_1 = require("../runtime");
/**
* Check if a given object implements the CrawlerLog interface.
*/
function instanceOfCrawlerLog(value) {
var isInstance = true;
return isInstance;
}
exports.instanceOfCrawlerLog = instanceOfCrawlerLog;
function CrawlerLogFromJSON(json) {
return CrawlerLogFromJSONTyped(json, false);
}
exports.CrawlerLogFromJSON = CrawlerLogFromJSON;
function CrawlerLogFromJSONTyped(json, ignoreDiscriminator) {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'id': !(0, runtime_1.exists)(json, 'id') ? undefined : json['id'],
'index': !(0, runtime_1.exists)(json, 'index') ? undefined : json['index'],
'homeUrl': !(0, runtime_1.exists)(json, 'home_url') ? undefined : json['home_url'],
'beginAt': !(0, runtime_1.exists)(json, 'begin_at') ? undefined : (new Date(json['begin_at'])),
'endAt': !(0, runtime_1.exists)(json, 'end_at') ? undefined : (new Date(json['end_at'])),
'usedSeconds': !(0, runtime_1.exists)(json, 'used_seconds') ? undefined : json['used_seconds'],
'successCount': !(0, runtime_1.exists)(json, 'success_count') ? undefined : json['success_count'],
'failedCount': !(0, runtime_1.exists)(json, 'failed_count') ? undefined : json['failed_count'],
};
}
exports.CrawlerLogFromJSONTyped = CrawlerLogFromJSONTyped;
function CrawlerLogToJSON(value) {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'id': value.id,
'index': value.index,
'home_url': value.homeUrl,
'begin_at': value.beginAt === undefined ? undefined : (value.beginAt.toISOString()),
'end_at': value.endAt === undefined ? undefined : (value.endAt.toISOString()),
'used_seconds': value.usedSeconds,
'success_count': value.successCount,
'failed_count': value.failedCount,
};
}
exports.CrawlerLogToJSON = CrawlerLogToJSON;