Refactored type definitions (#1119)

* Updated types generation script

* Refactored api method definitions

* Updated test
- Removed old test code
- Added tsd dev dependency
- Rewritten test with tsd

* Removed unused dependencies

* Fixed definition

* Updated test

* Updated docs

* Improved events type definitions

* Updated test

* Minor fixes in the type definitons

* More type test

* Improved Transport type definitions

* Updated test

* Addressed comments

* Code generation

* Use RequestBody, Response and Context everywhere, also default Context to unknown

* Updated test

* body -> hasBody

* Fixed conflicts

* Updated code generation

* Improved request body type definition

* Updated code generation

* Use BodyType for both request and reponses generics
- Use extends for defining the RequestBody generic to force the user
  following the same shape.
- BodyType and NDBodyType now accepts a generics to allow injecting
  more specific types in the future

* API generation

* Updated test

* Updated docs

* Use BodyType also in ReponseError

* Removed useless client generics

* Renamed generics and types
- prefixed all generics with a T
- BodyType => RequestBody
- NDBodyType => RequestNDBody
- Added ResponseBody

* Updated test

* Updated docs

* Test ResponseBody as well

* Simplify overloads

* API generation

* Updated test

* Updated error types
This commit is contained in:
Tomas Della Vedova
2020-03-23 11:38:18 +01:00
committed by GitHub
parent a80f510a9a
commit 6c82a4967e
23 changed files with 3838 additions and 955 deletions

226
api/requestParams.d.ts vendored
View File

@ -2,6 +2,8 @@
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
import { RequestBody, RequestNDBody } from '../lib/Transport'
export interface Generic {
method?: string;
ignore?: number | number[];
@ -12,7 +14,7 @@ export interface Generic {
source?: string;
}
export interface Bulk<T = any> extends Generic {
export interface Bulk<T = RequestNDBody> extends Generic {
index?: string;
type?: string;
_source_exclude?: string | string[];
@ -249,12 +251,12 @@ export interface CatThreadPool extends Generic {
v?: boolean;
}
export interface ClearScroll<T = any> extends Generic {
export interface ClearScroll<T = RequestBody> extends Generic {
scroll_id?: string | string[];
body?: T;
}
export interface ClusterAllocationExplain<T = any> extends Generic {
export interface ClusterAllocationExplain<T = RequestBody> extends Generic {
include_yes_decisions?: boolean;
include_disk_info?: boolean;
body?: T;
@ -299,7 +301,7 @@ export interface ClusterPendingTasks extends Generic {
master_timeout?: string;
}
export interface ClusterPutComponentTemplate<T = any> extends Generic {
export interface ClusterPutComponentTemplate<T = RequestBody> extends Generic {
name: string;
create?: boolean;
timeout?: string;
@ -307,7 +309,7 @@ export interface ClusterPutComponentTemplate<T = any> extends Generic {
body: T;
}
export interface ClusterPutSettings<T = any> extends Generic {
export interface ClusterPutSettings<T = RequestBody> extends Generic {
flat_settings?: boolean;
master_timeout?: string;
timeout?: string;
@ -317,7 +319,7 @@ export interface ClusterPutSettings<T = any> extends Generic {
export interface ClusterRemoteInfo extends Generic {
}
export interface ClusterReroute<T = any> extends Generic {
export interface ClusterReroute<T = RequestBody> extends Generic {
dry_run?: boolean;
explain?: boolean;
retry_failed?: boolean;
@ -346,7 +348,7 @@ export interface ClusterStats extends Generic {
timeout?: string;
}
export interface Count<T = any> extends Generic {
export interface Count<T = RequestBody> extends Generic {
index?: string | string[];
ignore_unavailable?: boolean;
ignore_throttled?: boolean;
@ -365,7 +367,7 @@ export interface Count<T = any> extends Generic {
body?: T;
}
export interface Create<T = any> extends Generic {
export interface Create<T = RequestBody> extends Generic {
id: string;
index: string;
type?: string;
@ -393,7 +395,7 @@ export interface Delete extends Generic {
version_type?: 'internal' | 'external' | 'external_gte';
}
export interface DeleteByQuery<T = any> extends Generic {
export interface DeleteByQuery<T = RequestBody> extends Generic {
index: string | string[];
_source_exclude?: string | string[];
_source_include?: string | string[];
@ -477,7 +479,7 @@ export interface ExistsSource extends Generic {
version_type?: 'internal' | 'external' | 'external_gte';
}
export interface Explain<T = any> extends Generic {
export interface Explain<T = RequestBody> extends Generic {
id: string;
index: string;
_source_exclude?: string | string[];
@ -550,7 +552,7 @@ export interface GetSource extends Generic {
version_type?: 'internal' | 'external' | 'external_gte';
}
export interface Index<T = any> extends Generic {
export interface Index<T = RequestBody> extends Generic {
id?: string;
index: string;
wait_for_active_shards?: string;
@ -566,7 +568,7 @@ export interface Index<T = any> extends Generic {
body: T;
}
export interface IndicesAnalyze<T = any> extends Generic {
export interface IndicesAnalyze<T = RequestBody> extends Generic {
index?: string;
body?: T;
}
@ -582,7 +584,7 @@ export interface IndicesClearCache extends Generic {
request?: boolean;
}
export interface IndicesClone<T = any> extends Generic {
export interface IndicesClone<T = RequestBody> extends Generic {
index: string;
target: string;
timeout?: string;
@ -601,7 +603,7 @@ export interface IndicesClose extends Generic {
wait_for_active_shards?: string;
}
export interface IndicesCreate<T = any> extends Generic {
export interface IndicesCreate<T = RequestBody> extends Generic {
index: string;
wait_for_active_shards?: string;
timeout?: string;
@ -609,7 +611,7 @@ export interface IndicesCreate<T = any> extends Generic {
body?: T;
}
export interface IndicesCreateDataStream<T = any> extends Generic {
export interface IndicesCreateDataStream<T = RequestBody> extends Generic {
name: string;
body: T;
}
@ -773,7 +775,7 @@ export interface IndicesOpen extends Generic {
wait_for_active_shards?: string;
}
export interface IndicesPutAlias<T = any> extends Generic {
export interface IndicesPutAlias<T = RequestBody> extends Generic {
index: string | string[];
name: string;
timeout?: string;
@ -781,7 +783,7 @@ export interface IndicesPutAlias<T = any> extends Generic {
body?: T;
}
export interface IndicesPutMapping<T = any> extends Generic {
export interface IndicesPutMapping<T = RequestBody> extends Generic {
index: string | string[];
timeout?: string;
master_timeout?: string;
@ -791,7 +793,7 @@ export interface IndicesPutMapping<T = any> extends Generic {
body: T;
}
export interface IndicesPutSettings<T = any> extends Generic {
export interface IndicesPutSettings<T = RequestBody> extends Generic {
index?: string | string[];
master_timeout?: string;
timeout?: string;
@ -803,7 +805,7 @@ export interface IndicesPutSettings<T = any> extends Generic {
body: T;
}
export interface IndicesPutTemplate<T = any> extends Generic {
export interface IndicesPutTemplate<T = RequestBody> extends Generic {
name: string;
order?: number;
create?: boolean;
@ -824,7 +826,7 @@ export interface IndicesRefresh extends Generic {
expand_wildcards?: 'open' | 'closed' | 'hidden' | 'none' | 'all';
}
export interface IndicesRollover<T = any> extends Generic {
export interface IndicesRollover<T = RequestBody> extends Generic {
alias: string;
new_index?: string;
timeout?: string;
@ -850,7 +852,7 @@ export interface IndicesShardStores extends Generic {
expand_wildcards?: 'open' | 'closed' | 'hidden' | 'none' | 'all';
}
export interface IndicesShrink<T = any> extends Generic {
export interface IndicesShrink<T = RequestBody> extends Generic {
index: string;
target: string;
timeout?: string;
@ -859,7 +861,7 @@ export interface IndicesShrink<T = any> extends Generic {
body?: T;
}
export interface IndicesSplit<T = any> extends Generic {
export interface IndicesSplit<T = RequestBody> extends Generic {
index: string;
target: string;
timeout?: string;
@ -883,7 +885,7 @@ export interface IndicesStats extends Generic {
forbid_closed_indices?: boolean;
}
export interface IndicesUpdateAliases<T = any> extends Generic {
export interface IndicesUpdateAliases<T = RequestBody> extends Generic {
timeout?: string;
master_timeout?: string;
body: T;
@ -898,7 +900,7 @@ export interface IndicesUpgrade extends Generic {
only_ancient_segments?: boolean;
}
export interface IndicesValidateQuery<T = any> extends Generic {
export interface IndicesValidateQuery<T = RequestBody> extends Generic {
index?: string | string[];
type?: string | string[];
explain?: boolean;
@ -933,20 +935,20 @@ export interface IngestGetPipeline extends Generic {
export interface IngestProcessorGrok extends Generic {
}
export interface IngestPutPipeline<T = any> extends Generic {
export interface IngestPutPipeline<T = RequestBody> extends Generic {
id: string;
master_timeout?: string;
timeout?: string;
body: T;
}
export interface IngestSimulate<T = any> extends Generic {
export interface IngestSimulate<T = RequestBody> extends Generic {
id?: string;
verbose?: boolean;
body: T;
}
export interface Mget<T = any> extends Generic {
export interface Mget<T = RequestBody> extends Generic {
index?: string;
_source_exclude?: string | string[];
_source_include?: string | string[];
@ -961,7 +963,7 @@ export interface Mget<T = any> extends Generic {
body: T;
}
export interface Msearch<T = any> extends Generic {
export interface Msearch<T = RequestNDBody> extends Generic {
index?: string | string[];
search_type?: 'query_then_fetch' | 'query_and_fetch' | 'dfs_query_then_fetch' | 'dfs_query_and_fetch';
max_concurrent_searches?: number;
@ -973,7 +975,7 @@ export interface Msearch<T = any> extends Generic {
body: T;
}
export interface MsearchTemplate<T = any> extends Generic {
export interface MsearchTemplate<T = RequestNDBody> extends Generic {
index?: string | string[];
search_type?: 'query_then_fetch' | 'query_and_fetch' | 'dfs_query_then_fetch' | 'dfs_query_and_fetch';
typed_keys?: boolean;
@ -983,7 +985,7 @@ export interface MsearchTemplate<T = any> extends Generic {
body: T;
}
export interface Mtermvectors<T = any> extends Generic {
export interface Mtermvectors<T = RequestBody> extends Generic {
index?: string;
ids?: string | string[];
term_statistics?: boolean;
@ -1045,7 +1047,7 @@ export interface NodesUsage extends Generic {
export interface Ping extends Generic {
}
export interface PutScript<T = any> extends Generic {
export interface PutScript<T = RequestBody> extends Generic {
id: string;
context?: string;
timeout?: string;
@ -1053,7 +1055,7 @@ export interface PutScript<T = any> extends Generic {
body: T;
}
export interface RankEval<T = any> extends Generic {
export interface RankEval<T = RequestBody> extends Generic {
index?: string | string[];
ignore_unavailable?: boolean;
allow_no_indices?: boolean;
@ -1062,7 +1064,7 @@ export interface RankEval<T = any> extends Generic {
body: T;
}
export interface Reindex<T = any> extends Generic {
export interface Reindex<T = RequestBody> extends Generic {
refresh?: boolean;
timeout?: string;
wait_for_active_shards?: string;
@ -1079,23 +1081,23 @@ export interface ReindexRethrottle extends Generic {
requests_per_second: number;
}
export interface RenderSearchTemplate<T = any> extends Generic {
export interface RenderSearchTemplate<T = RequestBody> extends Generic {
id?: string;
body?: T;
}
export interface ScriptsPainlessExecute<T = any> extends Generic {
export interface ScriptsPainlessExecute<T = RequestBody> extends Generic {
body?: T;
}
export interface Scroll<T = any> extends Generic {
export interface Scroll<T = RequestBody> extends Generic {
scroll_id?: string;
scroll?: string;
rest_total_hits_as_int?: boolean;
body?: T;
}
export interface Search<T = any> extends Generic {
export interface Search<T = RequestBody> extends Generic {
index?: string | string[];
_source_exclude?: string | string[];
_source_include?: string | string[];
@ -1154,7 +1156,7 @@ export interface SearchShards extends Generic {
expand_wildcards?: 'open' | 'closed' | 'hidden' | 'none' | 'all';
}
export interface SearchTemplate<T = any> extends Generic {
export interface SearchTemplate<T = RequestBody> extends Generic {
index?: string | string[];
ignore_unavailable?: boolean;
ignore_throttled?: boolean;
@ -1172,14 +1174,14 @@ export interface SearchTemplate<T = any> extends Generic {
body: T;
}
export interface SnapshotCleanupRepository<T = any> extends Generic {
export interface SnapshotCleanupRepository<T = RequestBody> extends Generic {
repository: string;
master_timeout?: string;
timeout?: string;
body?: T;
}
export interface SnapshotCreate<T = any> extends Generic {
export interface SnapshotCreate<T = RequestBody> extends Generic {
repository: string;
snapshot: string;
master_timeout?: string;
@ -1187,7 +1189,7 @@ export interface SnapshotCreate<T = any> extends Generic {
body?: T;
}
export interface SnapshotCreateRepository<T = any> extends Generic {
export interface SnapshotCreateRepository<T = RequestBody> extends Generic {
repository: string;
master_timeout?: string;
timeout?: string;
@ -1221,7 +1223,7 @@ export interface SnapshotGetRepository extends Generic {
local?: boolean;
}
export interface SnapshotRestore<T = any> extends Generic {
export interface SnapshotRestore<T = RequestBody> extends Generic {
repository: string;
snapshot: string;
master_timeout?: string;
@ -1265,7 +1267,7 @@ export interface TasksList extends Generic {
timeout?: string;
}
export interface Termvectors<T = any> extends Generic {
export interface Termvectors<T = RequestBody> extends Generic {
index: string;
id?: string;
term_statistics?: boolean;
@ -1282,7 +1284,7 @@ export interface Termvectors<T = any> extends Generic {
body?: T;
}
export interface Update<T = any> extends Generic {
export interface Update<T = RequestBody> extends Generic {
id: string;
index: string;
type?: string;
@ -1302,7 +1304,7 @@ export interface Update<T = any> extends Generic {
body: T;
}
export interface UpdateByQuery<T = any> extends Generic {
export interface UpdateByQuery<T = RequestBody> extends Generic {
index: string | string[];
_source_exclude?: string | string[];
_source_include?: string | string[];
@ -1359,7 +1361,7 @@ export interface AsyncSearchGet extends Generic {
typed_keys?: boolean;
}
export interface AsyncSearchSubmit<T = any> extends Generic {
export interface AsyncSearchSubmit<T = RequestBody> extends Generic {
index?: string | string[];
_source_exclude?: string | string[];
_source_include?: string | string[];
@ -1463,7 +1465,7 @@ export interface CcrDeleteAutoFollowPattern extends Generic {
name: string;
}
export interface CcrFollow<T = any> extends Generic {
export interface CcrFollow<T = RequestBody> extends Generic {
index: string;
wait_for_active_shards?: string;
body: T;
@ -1477,7 +1479,7 @@ export interface CcrFollowStats extends Generic {
index: string | string[];
}
export interface CcrForgetFollower<T = any> extends Generic {
export interface CcrForgetFollower<T = RequestBody> extends Generic {
index: string;
body: T;
}
@ -1494,7 +1496,7 @@ export interface CcrPauseFollow extends Generic {
index: string;
}
export interface CcrPutAutoFollowPattern<T = any> extends Generic {
export interface CcrPutAutoFollowPattern<T = RequestBody> extends Generic {
name: string;
body: T;
}
@ -1503,7 +1505,7 @@ export interface CcrResumeAutoFollowPattern extends Generic {
name: string;
}
export interface CcrResumeFollow<T = any> extends Generic {
export interface CcrResumeFollow<T = RequestBody> extends Generic {
index: string;
body?: T;
}
@ -1534,11 +1536,11 @@ export interface DataFrameTransformDeprecatedGetTransformStats extends Generic {
allow_no_match?: boolean;
}
export interface DataFrameTransformDeprecatedPreviewTransform<T = any> extends Generic {
export interface DataFrameTransformDeprecatedPreviewTransform<T = RequestBody> extends Generic {
body: T;
}
export interface DataFrameTransformDeprecatedPutTransform<T = any> extends Generic {
export interface DataFrameTransformDeprecatedPutTransform<T = RequestBody> extends Generic {
transform_id: string;
defer_validation?: boolean;
body: T;
@ -1556,7 +1558,7 @@ export interface DataFrameTransformDeprecatedStopTransform extends Generic {
allow_no_match?: boolean;
}
export interface DataFrameTransformDeprecatedUpdateTransform<T = any> extends Generic {
export interface DataFrameTransformDeprecatedUpdateTransform<T = RequestBody> extends Generic {
transform_id: string;
defer_validation?: boolean;
body: T;
@ -1575,7 +1577,7 @@ export interface EnrichGetPolicy extends Generic {
name?: string | string[];
}
export interface EnrichPutPolicy<T = any> extends Generic {
export interface EnrichPutPolicy<T = RequestBody> extends Generic {
name: string;
body: T;
}
@ -1583,12 +1585,12 @@ export interface EnrichPutPolicy<T = any> extends Generic {
export interface EnrichStats extends Generic {
}
export interface EqlSearch<T = any> extends Generic {
export interface EqlSearch<T = RequestBody> extends Generic {
index: string;
body: T;
}
export interface GraphExplore<T = any> extends Generic {
export interface GraphExplore<T = RequestBody> extends Generic {
index: string | string[];
routing?: string;
timeout?: string;
@ -1612,12 +1614,12 @@ export interface IlmGetLifecycle extends Generic {
export interface IlmGetStatus extends Generic {
}
export interface IlmMoveToStep<T = any> extends Generic {
export interface IlmMoveToStep<T = RequestBody> extends Generic {
index: string;
body?: T;
}
export interface IlmPutLifecycle<T = any> extends Generic {
export interface IlmPutLifecycle<T = RequestBody> extends Generic {
policy: string;
body?: T;
}
@ -1677,7 +1679,7 @@ export interface LicenseGetBasicStatus extends Generic {
export interface LicenseGetTrialStatus extends Generic {
}
export interface LicensePost<T = any> extends Generic {
export interface LicensePost<T = RequestBody> extends Generic {
acknowledge?: boolean;
body?: T;
}
@ -1695,7 +1697,7 @@ export interface MigrationDeprecations extends Generic {
index?: string;
}
export interface MlCloseJob<T = any> extends Generic {
export interface MlCloseJob<T = RequestBody> extends Generic {
job_id: string;
allow_no_jobs?: boolean;
force?: boolean;
@ -1756,20 +1758,20 @@ export interface MlDeleteTrainedModel extends Generic {
model_id: string;
}
export interface MlEstimateModelMemory<T = any> extends Generic {
export interface MlEstimateModelMemory<T = RequestBody> extends Generic {
body: T;
}
export interface MlEvaluateDataFrame<T = any> extends Generic {
export interface MlEvaluateDataFrame<T = RequestBody> extends Generic {
body: T;
}
export interface MlExplainDataFrameAnalytics<T = any> extends Generic {
export interface MlExplainDataFrameAnalytics<T = RequestBody> extends Generic {
id?: string;
body?: T;
}
export interface MlFindFileStructure<T = any> extends Generic {
export interface MlFindFileStructure<T = RequestNDBody> extends Generic {
lines_to_sample?: number;
line_merge_size_limit?: number;
timeout?: string;
@ -1787,7 +1789,7 @@ export interface MlFindFileStructure<T = any> extends Generic {
body: T;
}
export interface MlFlushJob<T = any> extends Generic {
export interface MlFlushJob<T = RequestBody> extends Generic {
job_id: string;
calc_interim?: boolean;
start?: string;
@ -1803,7 +1805,7 @@ export interface MlForecast extends Generic {
expires_in?: string;
}
export interface MlGetBuckets<T = any> extends Generic {
export interface MlGetBuckets<T = RequestBody> extends Generic {
job_id: string;
timestamp?: string;
expand?: boolean;
@ -1827,14 +1829,14 @@ export interface MlGetCalendarEvents extends Generic {
size?: number;
}
export interface MlGetCalendars<T = any> extends Generic {
export interface MlGetCalendars<T = RequestBody> extends Generic {
calendar_id?: string;
from?: number;
size?: number;
body?: T;
}
export interface MlGetCategories<T = any> extends Generic {
export interface MlGetCategories<T = RequestBody> extends Generic {
job_id: string;
category_id?: number;
from?: number;
@ -1872,7 +1874,7 @@ export interface MlGetFilters extends Generic {
size?: number;
}
export interface MlGetInfluencers<T = any> extends Generic {
export interface MlGetInfluencers<T = RequestBody> extends Generic {
job_id: string;
exclude_interim?: boolean;
from?: number;
@ -1895,7 +1897,7 @@ export interface MlGetJobs extends Generic {
allow_no_jobs?: boolean;
}
export interface MlGetModelSnapshots<T = any> extends Generic {
export interface MlGetModelSnapshots<T = RequestBody> extends Generic {
job_id: string;
snapshot_id?: string;
from?: number;
@ -1907,7 +1909,7 @@ export interface MlGetModelSnapshots<T = any> extends Generic {
body?: T;
}
export interface MlGetOverallBuckets<T = any> extends Generic {
export interface MlGetOverallBuckets<T = RequestBody> extends Generic {
job_id: string;
top_n?: number;
bucket_span?: string;
@ -1919,7 +1921,7 @@ export interface MlGetOverallBuckets<T = any> extends Generic {
body?: T;
}
export interface MlGetRecords<T = any> extends Generic {
export interface MlGetRecords<T = RequestBody> extends Generic {
job_id: string;
exclude_interim?: boolean;
from?: number;
@ -1956,12 +1958,12 @@ export interface MlOpenJob extends Generic {
job_id: string;
}
export interface MlPostCalendarEvents<T = any> extends Generic {
export interface MlPostCalendarEvents<T = RequestBody> extends Generic {
calendar_id: string;
body: T;
}
export interface MlPostData<T = any> extends Generic {
export interface MlPostData<T = RequestBody> extends Generic {
job_id: string;
reset_start?: string;
reset_end?: string;
@ -1972,7 +1974,7 @@ export interface MlPreviewDatafeed extends Generic {
datafeed_id: string;
}
export interface MlPutCalendar<T = any> extends Generic {
export interface MlPutCalendar<T = RequestBody> extends Generic {
calendar_id: string;
body?: T;
}
@ -1982,12 +1984,12 @@ export interface MlPutCalendarJob extends Generic {
job_id: string;
}
export interface MlPutDataFrameAnalytics<T = any> extends Generic {
export interface MlPutDataFrameAnalytics<T = RequestBody> extends Generic {
id: string;
body: T;
}
export interface MlPutDatafeed<T = any> extends Generic {
export interface MlPutDatafeed<T = RequestBody> extends Generic {
datafeed_id: string;
ignore_unavailable?: boolean;
allow_no_indices?: boolean;
@ -1996,22 +1998,22 @@ export interface MlPutDatafeed<T = any> extends Generic {
body: T;
}
export interface MlPutFilter<T = any> extends Generic {
export interface MlPutFilter<T = RequestBody> extends Generic {
filter_id: string;
body: T;
}
export interface MlPutJob<T = any> extends Generic {
export interface MlPutJob<T = RequestBody> extends Generic {
job_id: string;
body: T;
}
export interface MlPutTrainedModel<T = any> extends Generic {
export interface MlPutTrainedModel<T = RequestBody> extends Generic {
model_id: string;
body: T;
}
export interface MlRevertModelSnapshot<T = any> extends Generic {
export interface MlRevertModelSnapshot<T = RequestBody> extends Generic {
job_id: string;
snapshot_id: string;
delete_intervening_results?: boolean;
@ -2023,13 +2025,13 @@ export interface MlSetUpgradeMode extends Generic {
timeout?: string;
}
export interface MlStartDataFrameAnalytics<T = any> extends Generic {
export interface MlStartDataFrameAnalytics<T = RequestBody> extends Generic {
id: string;
timeout?: string;
body?: T;
}
export interface MlStartDatafeed<T = any> extends Generic {
export interface MlStartDatafeed<T = RequestBody> extends Generic {
datafeed_id: string;
start?: string;
end?: string;
@ -2037,7 +2039,7 @@ export interface MlStartDatafeed<T = any> extends Generic {
body?: T;
}
export interface MlStopDataFrameAnalytics<T = any> extends Generic {
export interface MlStopDataFrameAnalytics<T = RequestBody> extends Generic {
id: string;
allow_no_match?: boolean;
force?: boolean;
@ -2052,7 +2054,7 @@ export interface MlStopDatafeed extends Generic {
timeout?: string;
}
export interface MlUpdateDatafeed<T = any> extends Generic {
export interface MlUpdateDatafeed<T = RequestBody> extends Generic {
datafeed_id: string;
ignore_unavailable?: boolean;
allow_no_indices?: boolean;
@ -2061,31 +2063,31 @@ export interface MlUpdateDatafeed<T = any> extends Generic {
body: T;
}
export interface MlUpdateFilter<T = any> extends Generic {
export interface MlUpdateFilter<T = RequestBody> extends Generic {
filter_id: string;
body: T;
}
export interface MlUpdateJob<T = any> extends Generic {
export interface MlUpdateJob<T = RequestBody> extends Generic {
job_id: string;
body: T;
}
export interface MlUpdateModelSnapshot<T = any> extends Generic {
export interface MlUpdateModelSnapshot<T = RequestBody> extends Generic {
job_id: string;
snapshot_id: string;
body: T;
}
export interface MlValidate<T = any> extends Generic {
export interface MlValidate<T = RequestBody> extends Generic {
body: T;
}
export interface MlValidateDetector<T = any> extends Generic {
export interface MlValidateDetector<T = RequestBody> extends Generic {
body: T;
}
export interface MonitoringBulk<T = any> extends Generic {
export interface MonitoringBulk<T = RequestNDBody> extends Generic {
type?: string;
system_id?: string;
system_api_version?: string;
@ -2109,12 +2111,12 @@ export interface RollupGetRollupIndexCaps extends Generic {
index: string;
}
export interface RollupPutJob<T = any> extends Generic {
export interface RollupPutJob<T = RequestBody> extends Generic {
id: string;
body: T;
}
export interface RollupRollupSearch<T = any> extends Generic {
export interface RollupRollupSearch<T = RequestBody> extends Generic {
index: string | string[];
type?: string;
typed_keys?: boolean;
@ -2135,7 +2137,7 @@ export interface RollupStopJob extends Generic {
export interface SecurityAuthenticate extends Generic {
}
export interface SecurityChangePassword<T = any> extends Generic {
export interface SecurityChangePassword<T = RequestBody> extends Generic {
username?: string;
refresh?: 'true' | 'false' | 'wait_for';
body: T;
@ -2150,7 +2152,7 @@ export interface SecurityClearCachedRoles extends Generic {
name: string | string[];
}
export interface SecurityCreateApiKey<T = any> extends Generic {
export interface SecurityCreateApiKey<T = RequestBody> extends Generic {
refresh?: 'true' | 'false' | 'wait_for';
body: T;
}
@ -2210,7 +2212,7 @@ export interface SecurityGetRoleMapping extends Generic {
name?: string;
}
export interface SecurityGetToken<T = any> extends Generic {
export interface SecurityGetToken<T = RequestBody> extends Generic {
body: T;
}
@ -2221,37 +2223,37 @@ export interface SecurityGetUser extends Generic {
export interface SecurityGetUserPrivileges extends Generic {
}
export interface SecurityHasPrivileges<T = any> extends Generic {
export interface SecurityHasPrivileges<T = RequestBody> extends Generic {
user?: string;
body: T;
}
export interface SecurityInvalidateApiKey<T = any> extends Generic {
export interface SecurityInvalidateApiKey<T = RequestBody> extends Generic {
body: T;
}
export interface SecurityInvalidateToken<T = any> extends Generic {
export interface SecurityInvalidateToken<T = RequestBody> extends Generic {
body: T;
}
export interface SecurityPutPrivileges<T = any> extends Generic {
export interface SecurityPutPrivileges<T = RequestBody> extends Generic {
refresh?: 'true' | 'false' | 'wait_for';
body: T;
}
export interface SecurityPutRole<T = any> extends Generic {
export interface SecurityPutRole<T = RequestBody> extends Generic {
name: string;
refresh?: 'true' | 'false' | 'wait_for';
body: T;
}
export interface SecurityPutRoleMapping<T = any> extends Generic {
export interface SecurityPutRoleMapping<T = RequestBody> extends Generic {
name: string;
refresh?: 'true' | 'false' | 'wait_for';
body: T;
}
export interface SecurityPutUser<T = any> extends Generic {
export interface SecurityPutUser<T = RequestBody> extends Generic {
username: string;
refresh?: 'true' | 'false' | 'wait_for';
body: T;
@ -2278,7 +2280,7 @@ export interface SlmGetStats extends Generic {
export interface SlmGetStatus extends Generic {
}
export interface SlmPutLifecycle<T = any> extends Generic {
export interface SlmPutLifecycle<T = RequestBody> extends Generic {
policy_id: string;
body?: T;
}
@ -2289,16 +2291,16 @@ export interface SlmStart extends Generic {
export interface SlmStop extends Generic {
}
export interface SqlClearCursor<T = any> extends Generic {
export interface SqlClearCursor<T = RequestBody> extends Generic {
body: T;
}
export interface SqlQuery<T = any> extends Generic {
export interface SqlQuery<T = RequestBody> extends Generic {
format?: string;
body: T;
}
export interface SqlTranslate<T = any> extends Generic {
export interface SqlTranslate<T = RequestBody> extends Generic {
body: T;
}
@ -2337,11 +2339,11 @@ export interface TransformGetTransformStats extends Generic {
allow_no_match?: boolean;
}
export interface TransformPreviewTransform<T = any> extends Generic {
export interface TransformPreviewTransform<T = RequestBody> extends Generic {
body: T;
}
export interface TransformPutTransform<T = any> extends Generic {
export interface TransformPutTransform<T = RequestBody> extends Generic {
transform_id: string;
defer_validation?: boolean;
body: T;
@ -2361,7 +2363,7 @@ export interface TransformStopTransform extends Generic {
wait_for_checkpoint?: boolean;
}
export interface TransformUpdateTransform<T = any> extends Generic {
export interface TransformUpdateTransform<T = RequestBody> extends Generic {
transform_id: string;
defer_validation?: boolean;
body: T;
@ -2384,7 +2386,7 @@ export interface WatcherDeleteWatch extends Generic {
id: string;
}
export interface WatcherExecuteWatch<T = any> extends Generic {
export interface WatcherExecuteWatch<T = RequestBody> extends Generic {
id?: string;
debug?: boolean;
body?: T;
@ -2394,7 +2396,7 @@ export interface WatcherGetWatch extends Generic {
id: string;
}
export interface WatcherPutWatch<T = any> extends Generic {
export interface WatcherPutWatch<T = RequestBody> extends Generic {
id: string;
active?: boolean;
version?: number;