API generation

This commit is contained in:
delvedor
2021-10-25 09:32:19 +02:00
parent 702e71ec18
commit 66222f0111
4 changed files with 26 additions and 8 deletions

View File

@ -180,12 +180,18 @@ export default class Ml {
async deleteExpiredData (this: That, params?: T.MlDeleteExpiredDataRequest | TB.MlDeleteExpiredDataRequest, options?: TransportRequestOptions): Promise<T.MlDeleteExpiredDataResponse>
async deleteExpiredData (this: That, params?: T.MlDeleteExpiredDataRequest | TB.MlDeleteExpiredDataRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['job_id']
const acceptedBody: string[] = ['requests_per_second', 'timeout']
const querystring: Record<string, any> = {}
const body = undefined
// @ts-expect-error
let body: Record<string, any> = params?.body ?? undefined
params = params ?? {}
for (const key in params) {
if (acceptedPath.includes(key)) {
if (acceptedBody.includes(key)) {
body = body ?? {}
// @ts-expect-error
body[key] = params[key]
} else if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
// @ts-expect-error
@ -863,11 +869,17 @@ export default class Ml {
async getModelSnapshots (this: That, params: T.MlGetModelSnapshotsRequest | TB.MlGetModelSnapshotsRequest, options?: TransportRequestOptions): Promise<T.MlGetModelSnapshotsResponse>
async getModelSnapshots (this: That, params: T.MlGetModelSnapshotsRequest | TB.MlGetModelSnapshotsRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['job_id', 'snapshot_id']
const acceptedBody: string[] = ['start', 'end']
const querystring: Record<string, any> = {}
const body = undefined
// @ts-expect-error
let body: Record<string, any> = params.body ?? undefined
for (const key in params) {
if (acceptedPath.includes(key)) {
if (acceptedBody.includes(key)) {
body = body ?? {}
// @ts-expect-error
body[key] = params[key]
} else if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
// @ts-expect-error

View File

@ -42,11 +42,17 @@ export default async function ScrollApi<TDocument = unknown> (this: That, params
export default async function ScrollApi<TDocument = unknown> (this: That, params: T.ScrollRequest | TB.ScrollRequest, options?: TransportRequestOptions): Promise<T.ScrollResponse<TDocument>>
export default async function ScrollApi<TDocument = unknown> (this: That, params: T.ScrollRequest | TB.ScrollRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = []
const acceptedBody: string[] = ['scroll', 'scroll_id']
const querystring: Record<string, any> = {}
const body = undefined
// @ts-expect-error
let body: Record<string, any> = params.body ?? undefined
for (const key in params) {
if (acceptedPath.includes(key)) {
if (acceptedBody.includes(key)) {
body = body ?? {}
// @ts-expect-error
body[key] = params[key]
} else if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
// @ts-expect-error

View File

@ -8280,7 +8280,7 @@ export interface IndicesDataStream {
hidden?: boolean
}
export type IndicesDataStreamHealthStatus = 'green' | 'yellow' | 'red'
export type IndicesDataStreamHealthStatus = 'green' | 'GREEN' | 'yellow' | 'YELLOW' | 'red' | 'RED'
export interface IndicesFielddataFrequencyFilter {
max: double

View File

@ -8436,7 +8436,7 @@ export interface IndicesDataStream {
hidden?: boolean
}
export type IndicesDataStreamHealthStatus = 'green' | 'yellow' | 'red'
export type IndicesDataStreamHealthStatus = 'green' | 'GREEN' | 'yellow' | 'YELLOW' | 'red' | 'RED'
export interface IndicesFielddataFrequencyFilter {
max: double