Skip to content

Commit

Permalink
Update APIs for 8.5-SNAPSHOT
Browse files Browse the repository at this point in the history
  • Loading branch information
sethmlarson committed Oct 28, 2022
1 parent ea1cf7e commit 1088053
Show file tree
Hide file tree
Showing 6 changed files with 430 additions and 217 deletions.
4 changes: 4 additions & 0 deletions docs/reference.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -2092,6 +2092,8 @@ client.migration.postFeatureUpgrade(...)
[discrete]
==== clear_trained_model_deployment_cache
Clear the cached results from a trained model deployment

https://www.elastic.co/guide/en/elasticsearch/reference/8.5/clear-trained-model-deployment-cache.html[Endpoint documentation]
[source,ts]
----
client.ml.clearTrainedModelDeploymentCache(...)
Expand Down Expand Up @@ -2998,6 +3000,8 @@ client.security.authenticate(...)
[discrete]
==== bulk_update_api_keys
Updates the attributes of multiple existing API keys.

https://www.elastic.co/guide/en/elasticsearch/reference/8.5/security-api-bulk-update-api-keys.html[Endpoint documentation]
[source,ts]
----
client.security.bulkUpdateApiKeys(...)
Expand Down
11 changes: 6 additions & 5 deletions src/api/api/field_caps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ import * as T from '../types'
import * as TB from '../typesWithBodyKey'
interface That { transport: Transport }

export default async function FieldCapsApi (this: That, params: T.FieldCapsRequest | TB.FieldCapsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.FieldCapsResponse>
export default async function FieldCapsApi (this: That, params: T.FieldCapsRequest | TB.FieldCapsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.FieldCapsResponse, unknown>>
export default async function FieldCapsApi (this: That, params: T.FieldCapsRequest | TB.FieldCapsRequest, options?: TransportRequestOptions): Promise<T.FieldCapsResponse>
export default async function FieldCapsApi (this: That, params: T.FieldCapsRequest | TB.FieldCapsRequest, options?: TransportRequestOptions): Promise<any> {
export default async function FieldCapsApi (this: That, params?: T.FieldCapsRequest | TB.FieldCapsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.FieldCapsResponse>
export default async function FieldCapsApi (this: That, params?: T.FieldCapsRequest | TB.FieldCapsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.FieldCapsResponse, unknown>>
export default async function FieldCapsApi (this: That, params?: T.FieldCapsRequest | TB.FieldCapsRequest, options?: TransportRequestOptions): Promise<T.FieldCapsResponse>
export default async function FieldCapsApi (this: That, params?: T.FieldCapsRequest | TB.FieldCapsRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['index']
const acceptedBody: string[] = ['index_filter', 'runtime_mappings']
const acceptedBody: string[] = ['fields', 'index_filter', 'runtime_mappings']
const querystring: Record<string, any> = {}
// @ts-expect-error
const userBody: any = params?.body
Expand All @@ -53,6 +53,7 @@ export default async function FieldCapsApi (this: That, params: T.FieldCapsReque
body = userBody != null ? { ...userBody } : undefined
}

params = params ?? {}
for (const key in params) {
if (acceptedBody.includes(key)) {
body = body ?? {}
Expand Down
9 changes: 5 additions & 4 deletions src/api/api/license.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,10 @@ export default class License {
return await this.transport.request({ path, method, querystring, body }, options)
}

async post (this: That, params: T.LicensePostRequest | TB.LicensePostRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.LicensePostResponse>
async post (this: That, params: T.LicensePostRequest | TB.LicensePostRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.LicensePostResponse, unknown>>
async post (this: That, params: T.LicensePostRequest | TB.LicensePostRequest, options?: TransportRequestOptions): Promise<T.LicensePostResponse>
async post (this: That, params: T.LicensePostRequest | TB.LicensePostRequest, options?: TransportRequestOptions): Promise<any> {
async post (this: That, params?: T.LicensePostRequest | TB.LicensePostRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.LicensePostResponse>
async post (this: That, params?: T.LicensePostRequest | TB.LicensePostRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.LicensePostResponse, unknown>>
async post (this: That, params?: T.LicensePostRequest | TB.LicensePostRequest, options?: TransportRequestOptions): Promise<T.LicensePostResponse>
async post (this: That, params?: T.LicensePostRequest | TB.LicensePostRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = []
const acceptedBody: string[] = ['license', 'licenses']
const querystring: Record<string, any> = {}
Expand All @@ -151,6 +151,7 @@ export default class License {
body = userBody != null ? { ...userBody } : undefined
}

params = params ?? {}
for (const key in params) {
if (acceptedBody.includes(key)) {
body = body ?? {}
Expand Down
9 changes: 5 additions & 4 deletions src/api/api/ml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ export default class Ml {
this.transport = transport
}

async clearTrainedModelDeploymentCache (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
async clearTrainedModelDeploymentCache (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
async clearTrainedModelDeploymentCache (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>
async clearTrainedModelDeploymentCache (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<any> {
async clearTrainedModelDeploymentCache (this: That, params?: T.MlClearTrainedModelDeploymentCacheRequest | TB.MlClearTrainedModelDeploymentCacheRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.MlClearTrainedModelDeploymentCacheResponse>
async clearTrainedModelDeploymentCache (this: That, params?: T.MlClearTrainedModelDeploymentCacheRequest | TB.MlClearTrainedModelDeploymentCacheRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.MlClearTrainedModelDeploymentCacheResponse, unknown>>
async clearTrainedModelDeploymentCache (this: That, params?: T.MlClearTrainedModelDeploymentCacheRequest | TB.MlClearTrainedModelDeploymentCacheRequest, options?: TransportRequestOptions): Promise<T.MlClearTrainedModelDeploymentCacheResponse>
async clearTrainedModelDeploymentCache (this: That, params?: T.MlClearTrainedModelDeploymentCacheRequest | TB.MlClearTrainedModelDeploymentCacheRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['model_id']
const querystring: Record<string, any> = {}
const body = undefined
Expand All @@ -56,6 +56,7 @@ export default class Ml {
if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
// @ts-expect-error
querystring[key] = params[key]
}
}
Expand Down
Loading

0 comments on commit 1088053

Please sign in to comment.