@@ -48,11 +48,23 @@ export default class Ml {
4848 async closeJob ( this : That , params : T . MlCloseJobRequest | TB . MlCloseJobRequest , options ?: TransportRequestOptions ) : Promise < T . MlCloseJobResponse >
4949 async closeJob ( this : That , params : T . MlCloseJobRequest | TB . MlCloseJobRequest , options ?: TransportRequestOptions ) : Promise < any > {
5050 const acceptedPath : string [ ] = [ 'job_id' ]
51+ const acceptedBody : string [ ] = [ 'allow_no_match' , 'force' , 'timeout' ]
5152 const querystring : Record < string , any > = { }
52- const body = undefined
53+ // @ts -expect-error
54+ const userBody : any = params ?. body
55+ let body : Record < string , any > | string
56+ if ( typeof userBody === 'string' ) {
57+ body = userBody
58+ } else {
59+ body = userBody != null ? { ...userBody } : undefined
60+ }
5361
5462 for ( const key in params ) {
55- if ( acceptedPath . includes ( key ) ) {
63+ if ( acceptedBody . includes ( key ) ) {
64+ body = body ?? { }
65+ // @ts -expect-error
66+ body [ key ] = params [ key ]
67+ } else if ( acceptedPath . includes ( key ) ) {
5668 continue
5769 } else if ( key !== 'body' ) {
5870 // @ts -expect-error
@@ -425,10 +437,10 @@ export default class Ml {
425437 return await this . transport . request ( { path, method, querystring, body } , options )
426438 }
427439
428- async explainDataFrameAnalytics ( this : That , params : T . MlExplainDataFrameAnalyticsRequest | TB . MlExplainDataFrameAnalyticsRequest , options ?: TransportRequestOptionsWithOutMeta ) : Promise < T . MlExplainDataFrameAnalyticsResponse >
429- async explainDataFrameAnalytics ( this : That , params : T . MlExplainDataFrameAnalyticsRequest | TB . MlExplainDataFrameAnalyticsRequest , options ?: TransportRequestOptionsWithMeta ) : Promise < TransportResult < T . MlExplainDataFrameAnalyticsResponse , unknown > >
430- async explainDataFrameAnalytics ( this : That , params : T . MlExplainDataFrameAnalyticsRequest | TB . MlExplainDataFrameAnalyticsRequest , options ?: TransportRequestOptions ) : Promise < T . MlExplainDataFrameAnalyticsResponse >
431- async explainDataFrameAnalytics ( this : That , params : T . MlExplainDataFrameAnalyticsRequest | TB . MlExplainDataFrameAnalyticsRequest , options ?: TransportRequestOptions ) : Promise < any > {
440+ async explainDataFrameAnalytics ( this : That , params ? : T . MlExplainDataFrameAnalyticsRequest | TB . MlExplainDataFrameAnalyticsRequest , options ?: TransportRequestOptionsWithOutMeta ) : Promise < T . MlExplainDataFrameAnalyticsResponse >
441+ async explainDataFrameAnalytics ( this : That , params ? : T . MlExplainDataFrameAnalyticsRequest | TB . MlExplainDataFrameAnalyticsRequest , options ?: TransportRequestOptionsWithMeta ) : Promise < TransportResult < T . MlExplainDataFrameAnalyticsResponse , unknown > >
442+ async explainDataFrameAnalytics ( this : That , params ? : T . MlExplainDataFrameAnalyticsRequest | TB . MlExplainDataFrameAnalyticsRequest , options ?: TransportRequestOptions ) : Promise < T . MlExplainDataFrameAnalyticsResponse >
443+ async explainDataFrameAnalytics ( this : That , params ? : T . MlExplainDataFrameAnalyticsRequest | TB . MlExplainDataFrameAnalyticsRequest , options ?: TransportRequestOptions ) : Promise < any > {
432444 const acceptedPath : string [ ] = [ 'id' ]
433445 const acceptedBody : string [ ] = [ 'source' , 'dest' , 'analysis' , 'description' , 'model_memory_limit' , 'max_num_threads' , 'analyzed_fields' , 'allow_lazy_start' ]
434446 const querystring : Record < string , any > = { }
@@ -441,6 +453,7 @@ export default class Ml {
441453 body = userBody != null ? { ...userBody } : undefined
442454 }
443455
456+ params = params ?? { }
444457 for ( const key in params ) {
445458 if ( acceptedBody . includes ( key ) ) {
446459 body = body ?? { }
@@ -471,7 +484,7 @@ export default class Ml {
471484 async flushJob ( this : That , params : T . MlFlushJobRequest | TB . MlFlushJobRequest , options ?: TransportRequestOptions ) : Promise < T . MlFlushJobResponse >
472485 async flushJob ( this : That , params : T . MlFlushJobRequest | TB . MlFlushJobRequest , options ?: TransportRequestOptions ) : Promise < any > {
473486 const acceptedPath : string [ ] = [ 'job_id' ]
474- const acceptedBody : string [ ] = [ 'advance_time' , 'calc_interim' , 'end' , 'start' ]
487+ const acceptedBody : string [ ] = [ 'advance_time' , 'calc_interim' , 'end' , 'skip_time' , ' start']
475488 const querystring : Record < string , any > = { }
476489 // @ts -expect-error
477490 const userBody : any = params ?. body
@@ -539,7 +552,7 @@ export default class Ml {
539552 async getBuckets ( this : That , params : T . MlGetBucketsRequest | TB . MlGetBucketsRequest , options ?: TransportRequestOptions ) : Promise < T . MlGetBucketsResponse >
540553 async getBuckets ( this : That , params : T . MlGetBucketsRequest | TB . MlGetBucketsRequest , options ?: TransportRequestOptions ) : Promise < any > {
541554 const acceptedPath : string [ ] = [ 'job_id' , 'timestamp' ]
542- const acceptedBody : string [ ] = [ 'anomaly_score' , 'desc' , 'exclude_interim' , 'expand' , 'sort ' , 'start ' , 'end ' ]
555+ const acceptedBody : string [ ] = [ 'anomaly_score' , 'desc' , 'end' , ' exclude_interim', 'expand' , 'page ' , 'sort ' , 'start ' ]
543556 const querystring : Record < string , any > = { }
544557 // @ts -expect-error
545558 const userBody : any = params ?. body
@@ -929,7 +942,7 @@ export default class Ml {
929942 async getModelSnapshots ( this : That , params : T . MlGetModelSnapshotsRequest | TB . MlGetModelSnapshotsRequest , options ?: TransportRequestOptions ) : Promise < T . MlGetModelSnapshotsResponse >
930943 async getModelSnapshots ( this : That , params : T . MlGetModelSnapshotsRequest | TB . MlGetModelSnapshotsRequest , options ?: TransportRequestOptions ) : Promise < any > {
931944 const acceptedPath : string [ ] = [ 'job_id' , 'snapshot_id' ]
932- const acceptedBody : string [ ] = [ 'start ' , 'end' ]
945+ const acceptedBody : string [ ] = [ 'desc ' , 'end' , 'page' , 'sort' , 'start ']
933946 const querystring : Record < string , any > = { }
934947 // @ts -expect-error
935948 const userBody : any = params ?. body
@@ -970,11 +983,23 @@ export default class Ml {
970983 async getOverallBuckets ( this : That , params : T . MlGetOverallBucketsRequest | TB . MlGetOverallBucketsRequest , options ?: TransportRequestOptions ) : Promise < T . MlGetOverallBucketsResponse >
971984 async getOverallBuckets ( this : That , params : T . MlGetOverallBucketsRequest | TB . MlGetOverallBucketsRequest , options ?: TransportRequestOptions ) : Promise < any > {
972985 const acceptedPath : string [ ] = [ 'job_id' ]
986+ const acceptedBody : string [ ] = [ 'allow_no_match' , 'bucket_span' , 'end' , 'exclude_interim' , 'overall_score' , 'start' , 'top_n' ]
973987 const querystring : Record < string , any > = { }
974- const body = undefined
988+ // @ts -expect-error
989+ const userBody : any = params ?. body
990+ let body : Record < string , any > | string
991+ if ( typeof userBody === 'string' ) {
992+ body = userBody
993+ } else {
994+ body = userBody != null ? { ...userBody } : undefined
995+ }
975996
976997 for ( const key in params ) {
977- if ( acceptedPath . includes ( key ) ) {
998+ if ( acceptedBody . includes ( key ) ) {
999+ body = body ?? { }
1000+ // @ts -expect-error
1001+ body [ key ] = params [ key ]
1002+ } else if ( acceptedPath . includes ( key ) ) {
9781003 continue
9791004 } else if ( key !== 'body' ) {
9801005 // @ts -expect-error
@@ -992,7 +1017,7 @@ export default class Ml {
9921017 async getRecords ( this : That , params : T . MlGetRecordsRequest | TB . MlGetRecordsRequest , options ?: TransportRequestOptions ) : Promise < T . MlGetRecordsResponse >
9931018 async getRecords ( this : That , params : T . MlGetRecordsRequest | TB . MlGetRecordsRequest , options ?: TransportRequestOptions ) : Promise < any > {
9941019 const acceptedPath : string [ ] = [ 'job_id' ]
995- const acceptedBody : string [ ] = [ 'desc' , 'exclude_interim' , 'page' , 'record_score' , 'sort' , 'start' , 'end ']
1020+ const acceptedBody : string [ ] = [ 'desc' , 'end' , ' exclude_interim', 'page' , 'record_score' , 'sort' , 'start' ]
9961021 const querystring : Record < string , any > = { }
9971022 // @ts -expect-error
9981023 const userBody : any = params ?. body
@@ -1021,28 +1046,6 @@ export default class Ml {
10211046 return await this . transport . request ( { path, method, querystring, body } , options )
10221047 }
10231048
1024- async getTrainedModelDeploymentStats ( this : That , params ?: T . TODO | TB . TODO , options ?: TransportRequestOptionsWithOutMeta ) : Promise < T . TODO >
1025- async getTrainedModelDeploymentStats ( this : That , params ?: T . TODO | TB . TODO , options ?: TransportRequestOptionsWithMeta ) : Promise < TransportResult < T . TODO , unknown > >
1026- async getTrainedModelDeploymentStats ( this : That , params ?: T . TODO | TB . TODO , options ?: TransportRequestOptions ) : Promise < T . TODO >
1027- async getTrainedModelDeploymentStats ( this : That , params ?: T . TODO | TB . TODO , options ?: TransportRequestOptions ) : Promise < any > {
1028- const acceptedPath : string [ ] = [ 'model_id' ]
1029- const querystring : Record < string , any > = { }
1030- const body = undefined
1031-
1032- params = params ?? { }
1033- for ( const key in params ) {
1034- if ( acceptedPath . includes ( key ) ) {
1035- continue
1036- } else if ( key !== 'body' ) {
1037- querystring [ key ] = params [ key ]
1038- }
1039- }
1040-
1041- const method = 'GET'
1042- const path = `/_ml/trained_models/${ encodeURIComponent ( params . model_id . toString ( ) ) } /deployment/_stats`
1043- return await this . transport . request ( { path, method, querystring, body } , options )
1044- }
1045-
10461049 async getTrainedModels ( this : That , params ?: T . MlGetTrainedModelsRequest | TB . MlGetTrainedModelsRequest , options ?: TransportRequestOptionsWithOutMeta ) : Promise < T . MlGetTrainedModelsResponse >
10471050 async getTrainedModels ( this : That , params ?: T . MlGetTrainedModelsRequest | TB . MlGetTrainedModelsRequest , options ?: TransportRequestOptionsWithMeta ) : Promise < TransportResult < T . MlGetTrainedModelsResponse , unknown > >
10481051 async getTrainedModels ( this : That , params ?: T . MlGetTrainedModelsRequest | TB . MlGetTrainedModelsRequest , options ?: TransportRequestOptions ) : Promise < T . MlGetTrainedModelsResponse >
@@ -1332,7 +1335,7 @@ export default class Ml {
13321335 async putCalendar ( this : That , params : T . MlPutCalendarRequest | TB . MlPutCalendarRequest , options ?: TransportRequestOptions ) : Promise < T . MlPutCalendarResponse >
13331336 async putCalendar ( this : That , params : T . MlPutCalendarRequest | TB . MlPutCalendarRequest , options ?: TransportRequestOptions ) : Promise < any > {
13341337 const acceptedPath : string [ ] = [ 'calendar_id' ]
1335- const acceptedBody : string [ ] = [ 'description' ]
1338+ const acceptedBody : string [ ] = [ 'job_ids' , ' description']
13361339 const querystring : Record < string , any > = { }
13371340 // @ts -expect-error
13381341 const userBody : any = params ?. body
@@ -1422,7 +1425,7 @@ export default class Ml {
14221425 async putDatafeed ( this : That , params : T . MlPutDatafeedRequest | TB . MlPutDatafeedRequest , options ?: TransportRequestOptions ) : Promise < T . MlPutDatafeedResponse >
14231426 async putDatafeed ( this : That , params : T . MlPutDatafeedRequest | TB . MlPutDatafeedRequest , options ?: TransportRequestOptions ) : Promise < any > {
14241427 const acceptedPath : string [ ] = [ 'datafeed_id' ]
1425- const acceptedBody : string [ ] = [ 'aggregations' , 'chunking_config' , 'delayed_data_check_config' , 'frequency' , 'indices' , 'indices_options' , 'job_id' , 'max_empty_searches' , 'query' , 'query_delay' , 'runtime_mappings' , 'script_fields' , 'scroll_size' ]
1428+ const acceptedBody : string [ ] = [ 'aggregations' , 'chunking_config' , 'delayed_data_check_config' , 'frequency' , 'indices' , 'indexes' , ' indices_options', 'job_id' , 'max_empty_searches' , 'query' , 'query_delay' , 'runtime_mappings' , 'script_fields' , 'scroll_size' ]
14261429 const querystring : Record < string , any > = { }
14271430 // @ts -expect-error
14281431 const userBody : any = params ?. body
@@ -1524,7 +1527,7 @@ export default class Ml {
15241527 async putTrainedModel ( this : That , params : T . MlPutTrainedModelRequest | TB . MlPutTrainedModelRequest , options ?: TransportRequestOptions ) : Promise < T . MlPutTrainedModelResponse >
15251528 async putTrainedModel ( this : That , params : T . MlPutTrainedModelRequest | TB . MlPutTrainedModelRequest , options ?: TransportRequestOptions ) : Promise < any > {
15261529 const acceptedPath : string [ ] = [ 'model_id' ]
1527- const acceptedBody : string [ ] = [ 'compressed_definition' , 'definition' , 'description' , 'inference_config' , 'input' , 'metadata' , 'tags' ]
1530+ const acceptedBody : string [ ] = [ 'compressed_definition' , 'definition' , 'description' , 'inference_config' , 'input' , 'metadata' , 'model_type' , ' tags']
15281531 const querystring : Record < string , any > = { }
15291532 // @ts -expect-error
15301533 const userBody : any = params ?. body
@@ -1803,7 +1806,7 @@ export default class Ml {
18031806 async stopDatafeed ( this : That , params : T . MlStopDatafeedRequest | TB . MlStopDatafeedRequest , options ?: TransportRequestOptions ) : Promise < T . MlStopDatafeedResponse >
18041807 async stopDatafeed ( this : That , params : T . MlStopDatafeedRequest | TB . MlStopDatafeedRequest , options ?: TransportRequestOptions ) : Promise < any > {
18051808 const acceptedPath : string [ ] = [ 'datafeed_id' ]
1806- const acceptedBody : string [ ] = [ 'force' , 'timeout' ]
1809+ const acceptedBody : string [ ] = [ 'allow_no_match' , ' force', 'timeout' ]
18071810 const querystring : Record < string , any > = { }
18081811 // @ts -expect-error
18091812 const userBody : any = params ?. body
@@ -1888,19 +1891,31 @@ export default class Ml {
18881891 return await this . transport . request ( { path, method, querystring, body } , options )
18891892 }
18901893
1891- async updateDatafeed ( this : That , params ? : T . TODO | TB . TODO , options ?: TransportRequestOptionsWithOutMeta ) : Promise < T . TODO >
1892- async updateDatafeed ( this : That , params ? : T . TODO | TB . TODO , options ?: TransportRequestOptionsWithMeta ) : Promise < TransportResult < T . TODO , unknown > >
1893- async updateDatafeed ( this : That , params ? : T . TODO | TB . TODO , options ?: TransportRequestOptions ) : Promise < T . TODO >
1894- async updateDatafeed ( this : That , params ? : T . TODO | TB . TODO , options ?: TransportRequestOptions ) : Promise < any > {
1894+ async updateDatafeed ( this : That , params : T . MlUpdateDatafeedRequest | TB . MlUpdateDatafeedRequest , options ?: TransportRequestOptionsWithOutMeta ) : Promise < T . MlUpdateDatafeedResponse >
1895+ async updateDatafeed ( this : That , params : T . MlUpdateDatafeedRequest | TB . MlUpdateDatafeedRequest , options ?: TransportRequestOptionsWithMeta ) : Promise < TransportResult < T . MlUpdateDatafeedResponse , unknown > >
1896+ async updateDatafeed ( this : That , params : T . MlUpdateDatafeedRequest | TB . MlUpdateDatafeedRequest , options ?: TransportRequestOptions ) : Promise < T . MlUpdateDatafeedResponse >
1897+ async updateDatafeed ( this : That , params : T . MlUpdateDatafeedRequest | TB . MlUpdateDatafeedRequest , options ?: TransportRequestOptions ) : Promise < any > {
18951898 const acceptedPath : string [ ] = [ 'datafeed_id' ]
1899+ const acceptedBody : string [ ] = [ 'aggregations' , 'chunking_config' , 'delayed_data_check_config' , 'frequency' , 'indices' , 'indexes' , 'indices_options' , 'max_empty_searches' , 'query' , 'query_delay' , 'runtime_mappings' , 'script_fields' , 'scroll_size' ]
18961900 const querystring : Record < string , any > = { }
1897- const body = undefined
1901+ // @ts -expect-error
1902+ const userBody : any = params ?. body
1903+ let body : Record < string , any > | string
1904+ if ( typeof userBody === 'string' ) {
1905+ body = userBody
1906+ } else {
1907+ body = userBody != null ? { ...userBody } : undefined
1908+ }
18981909
1899- params = params ?? { }
19001910 for ( const key in params ) {
1901- if ( acceptedPath . includes ( key ) ) {
1911+ if ( acceptedBody . includes ( key ) ) {
1912+ body = body ?? { }
1913+ // @ts -expect-error
1914+ body [ key ] = params [ key ]
1915+ } else if ( acceptedPath . includes ( key ) ) {
19021916 continue
19031917 } else if ( key !== 'body' ) {
1918+ // @ts -expect-error
19041919 querystring [ key ] = params [ key ]
19051920 }
19061921 }
0 commit comments