UNPKG

@indexea/sdk

Version:

Indexea JavaScript SDK (indexea.com)

225 lines (214 loc) 6.17 kB
/* 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. */ import { exists, mapValues } from '../runtime'; import type { IndexStatBean } from './IndexStatBean'; import { IndexStatBeanFromJSON, IndexStatBeanFromJSONTyped, IndexStatBeanToJSON, } from './IndexStatBean'; /** * 索引详情 * @export * @interface IndexBean */ export interface IndexBean { /** * * @type {number} * @memberof IndexBean */ id?: number; /** * * @type {number} * @memberof IndexBean */ account?: number; /** * * @type {number} * @memberof IndexBean */ app?: number; /** * * @type {string} * @memberof IndexBean */ name?: string; /** * 是否系统索引(系统索引不允许用户删除) * @type {boolean} * @memberof IndexBean */ system?: boolean; /** * * @type {string} * @memberof IndexBean */ intro?: string; /** * * @type {Array<string>} * @memberof IndexBean */ alias?: Array<string>; /** * * @type {string} * @memberof IndexBean */ type?: string; /** * 索引关联的临时过滤器 * @type {Array<object>} * @memberof IndexBean */ filters?: Array<object>; /** * 索引关联的临时聚合器 * @type {object} * @memberof IndexBean */ aggs?: object; /** * 索引关联的临时排序 * @type {Array<object>} * @memberof IndexBean */ sorts?: Array<object>; /** * 该索引的分片数 * @type {number} * @memberof IndexBean */ shards?: number; /** * 该索引的副本数 * @type {number} * @memberof IndexBean */ replicas?: number; /** * * @type {string} * @memberof IndexBean */ analyzer?: string; /** * * @type {string} * @memberof IndexBean */ searchAnalyzer?: string; /** * * @type {IndexStatBean} * @memberof IndexBean */ stat?: IndexStatBean; /** * * @type {object} * @memberof IndexBean */ options?: object; /** * * @type {Date} * @memberof IndexBean */ createdAt?: Date; /** * * @type {Date} * @memberof IndexBean */ updatedAt?: Date; /** * * @type {number} * @memberof IndexBean */ status?: number; } /** * Check if a given object implements the IndexBean interface. */ export function instanceOfIndexBean(value: object): boolean { let isInstance = true; return isInstance; } export function IndexBeanFromJSON(json: any): IndexBean { return IndexBeanFromJSONTyped(json, false); } export function IndexBeanFromJSONTyped(json: any, ignoreDiscriminator: boolean): IndexBean { if ((json === undefined) || (json === null)) { return json; } return { 'id': !exists(json, 'id') ? undefined : json['id'], 'account': !exists(json, 'account') ? undefined : json['account'], 'app': !exists(json, 'app') ? undefined : json['app'], 'name': !exists(json, 'name') ? undefined : json['name'], 'system': !exists(json, 'system') ? undefined : json['system'], 'intro': !exists(json, 'intro') ? undefined : json['intro'], 'alias': !exists(json, 'alias') ? undefined : json['alias'], 'type': !exists(json, 'type') ? undefined : json['type'], 'filters': !exists(json, 'filters') ? undefined : json['filters'], 'aggs': !exists(json, 'aggs') ? undefined : json['aggs'], 'sorts': !exists(json, 'sorts') ? undefined : json['sorts'], 'shards': !exists(json, 'shards') ? undefined : json['shards'], 'replicas': !exists(json, 'replicas') ? undefined : json['replicas'], 'analyzer': !exists(json, 'analyzer') ? undefined : json['analyzer'], 'searchAnalyzer': !exists(json, 'search_analyzer') ? undefined : json['search_analyzer'], 'stat': !exists(json, 'stat') ? undefined : IndexStatBeanFromJSON(json['stat']), 'options': !exists(json, 'options') ? undefined : json['options'], 'createdAt': !exists(json, 'created_at') ? undefined : (new Date(json['created_at'])), 'updatedAt': !exists(json, 'updated_at') ? undefined : (new Date(json['updated_at'])), 'status': !exists(json, 'status') ? undefined : json['status'], }; } export function IndexBeanToJSON(value?: IndexBean | null): any { if (value === undefined) { return undefined; } if (value === null) { return null; } return { 'id': value.id, 'account': value.account, 'app': value.app, 'name': value.name, 'system': value.system, 'intro': value.intro, 'alias': value.alias, 'type': value.type, 'filters': value.filters, 'aggs': value.aggs, 'sorts': value.sorts, 'shards': value.shards, 'replicas': value.replicas, 'analyzer': value.analyzer, 'search_analyzer': value.searchAnalyzer, 'stat': IndexStatBeanToJSON(value.stat), 'options': value.options, 'created_at': value.createdAt === undefined ? undefined : (value.createdAt.toISOString()), 'updated_at': value.updatedAt === undefined ? undefined : (value.updatedAt.toISOString()), 'status': value.status, }; }