From b764c28d21046ade414021b254bb6fbcdacc316f Mon Sep 17 00:00:00 2001 From: Kathleen DeRusso Date: Mon, 24 Jul 2023 16:27:42 -0400 Subject: [PATCH] Add json specs; rename value -> values --- output/typescript/types.ts | 2 +- .../_json_spec/query_ruleset.delete.json | 31 +++++++++++++++ .../_json_spec/query_ruleset.get.json | 31 +++++++++++++++ .../_json_spec/query_ruleset.list.json | 37 ++++++++++++++++++ .../_json_spec/query_ruleset.put.json | 38 +++++++++++++++++++ .../query_rules/_types/QueryRuleset.ts | 2 +- 6 files changed, 139 insertions(+), 2 deletions(-) create mode 100644 specification/_json_spec/query_ruleset.delete.json create mode 100644 specification/_json_spec/query_ruleset.get.json create mode 100644 specification/_json_spec/query_ruleset.list.json create mode 100644 specification/_json_spec/query_ruleset.put.json diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 09a230d8aa..d1a1bb0248 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -19004,7 +19004,7 @@ export enum QueryRuleCriteriaType { export interface QueryRuleCriteria { type: QueryRuleCriteriaType metadata: string - value: string + values: (string | number)[] } export interface QueryRuleActions { diff --git a/specification/_json_spec/query_ruleset.delete.json b/specification/_json_spec/query_ruleset.delete.json new file mode 100644 index 0000000000..b8378ca9fc --- /dev/null +++ b/specification/_json_spec/query_ruleset.delete.json @@ -0,0 +1,31 @@ +{ + "query_ruleset.delete": { + "documentation": { + "url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-query-ruleset.html", + "description": "Deletes a query ruleset." + }, + "stability": "experimental", + "visibility": "public", + "headers": { + "accept": [ + "application/json" + ] + }, + "url": { + "paths": [ + { + "path": "/_query_rules/{ruleset_id}", + "methods": [ + "DELETE" + ], + "parts": { + "ruleset_id": { + "type": "string", + "description": "The unique identifier of the query ruleset to delete" + } + } + } + ] + } + } +} diff --git a/specification/_json_spec/query_ruleset.get.json b/specification/_json_spec/query_ruleset.get.json new file mode 100644 index 0000000000..74f822a56a --- /dev/null +++ b/specification/_json_spec/query_ruleset.get.json @@ -0,0 +1,31 @@ +{ + "query_ruleset.get": { + "documentation": { + "url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/get-query-ruleset.html", + "description": "Returns the details about a query ruleset." + }, + "stability": "experimental", + "visibility": "public", + "headers": { + "accept": [ + "application/json" + ] + }, + "url": { + "paths": [ + { + "path": "/_query_rules/{ruleset_id}", + "methods": [ + "GET" + ], + "parts": { + "ruleset_id": { + "type": "string", + "description": "The unique identifier of the query ruleset" + } + } + } + ] + } + } +} diff --git a/specification/_json_spec/query_ruleset.list.json b/specification/_json_spec/query_ruleset.list.json new file mode 100644 index 0000000000..81138b3823 --- /dev/null +++ b/specification/_json_spec/query_ruleset.list.json @@ -0,0 +1,37 @@ +{ + "query_ruleset.list": { + "documentation": { + "url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/list-query-rulesets.html", + "description": "Lists query rulesets." + }, + "stability": "experimental", + "visibility": "public", + "headers": { + "accept": [ + "application/json" + ] + }, + "url": { + "paths": [ + { + "path": "/_query_rules", + "methods": [ + "GET" + ] + } + ] + }, + "params": { + "from": { + "type": "int", + "default": 0, + "description": "Starting offset (default: 0)" + }, + "size": { + "type": "int", + "default": 100, + "description": "specifies a max number of results to get (default: 100)" + } + } + } +} diff --git a/specification/_json_spec/query_ruleset.put.json b/specification/_json_spec/query_ruleset.put.json new file mode 100644 index 0000000000..2964da5f8a --- /dev/null +++ b/specification/_json_spec/query_ruleset.put.json @@ -0,0 +1,38 @@ +{ + "query_ruleset.put": { + "documentation": { + "url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/put-query-ruleset.html", + "description": "Creates or updates a query ruleset." + }, + "stability": "experimental", + "visibility": "public", + "headers": { + "accept": [ + "application/json" + ], + "content_type": [ + "application/json" + ] + }, + "url": { + "paths": [ + { + "path": "/_query_rules/{ruleset_id}", + "methods": [ + "PUT" + ], + "parts": { + "ruleset_id": { + "type": "string", + "description": "The unique identifier of the ruleset to be created or updated." + } + } + } + ] + }, + "body": { + "description": "The query ruleset configuration, including `rules`", + "required": true + } + } +} diff --git a/specification/query_rules/_types/QueryRuleset.ts b/specification/query_rules/_types/QueryRuleset.ts index 5639570f8c..4307ff6d05 100644 --- a/specification/query_rules/_types/QueryRuleset.ts +++ b/specification/query_rules/_types/QueryRuleset.ts @@ -50,7 +50,7 @@ export enum QueryRuleType { export class QueryRuleCriteria { type: QueryRuleCriteriaType metadata: string - values: object[] + values: (string | number)[] } export enum QueryRuleCriteriaType {