UNPKG

@indexea/sdk

Version:

Indexea JavaScript SDK (indexea.com)

68 lines (67 loc) 3.09 kB
"use strict"; /* 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.QueryFormToJSON = exports.QueryFormFromJSONTyped = exports.QueryFormFromJSON = exports.instanceOfQueryForm = void 0; var runtime_1 = require("../runtime"); var QuerySortField_1 = require("./QuerySortField"); /** * Check if a given object implements the QueryForm interface. */ function instanceOfQueryForm(value) { var isInstance = true; return isInstance; } exports.instanceOfQueryForm = instanceOfQueryForm; function QueryFormFromJSON(json) { return QueryFormFromJSONTyped(json, false); } exports.QueryFormFromJSON = QueryFormFromJSON; function QueryFormFromJSONTyped(json, ignoreDiscriminator) { if ((json === undefined) || (json === null)) { return json; } return { 'name': !(0, runtime_1.exists)(json, 'name') ? undefined : json['name'], 'intro': !(0, runtime_1.exists)(json, 'intro') ? undefined : json['intro'], 'indices': !(0, runtime_1.exists)(json, 'indices') ? undefined : json['indices'], 'query': !(0, runtime_1.exists)(json, 'query') ? undefined : json['query'], 'suggest': !(0, runtime_1.exists)(json, 'suggest') ? undefined : json['suggest'], 'scriptScore': !(0, runtime_1.exists)(json, 'script_score') ? undefined : json['script_score'], 'scriptFields': !(0, runtime_1.exists)(json, 'script_fields') ? undefined : json['script_fields'], 'sortFields': !(0, runtime_1.exists)(json, 'sort_fields') ? undefined : (json['sort_fields'].map(QuerySortField_1.QuerySortFieldFromJSON)), 'status': !(0, runtime_1.exists)(json, 'status') ? undefined : json['status'], }; } exports.QueryFormFromJSONTyped = QueryFormFromJSONTyped; function QueryFormToJSON(value) { if (value === undefined) { return undefined; } if (value === null) { return null; } return { 'name': value.name, 'intro': value.intro, 'indices': value.indices, 'query': value.query, 'suggest': value.suggest, 'script_score': value.scriptScore, 'script_fields': value.scriptFields, 'sort_fields': value.sortFields === undefined ? undefined : (value.sortFields.map(QuerySortField_1.QuerySortFieldToJSON)), 'status': value.status, }; } exports.QueryFormToJSON = QueryFormToJSON;