diff --git a/output/schema/schema.json b/output/schema/schema.json index fa5d81a480..5565dc2ce7 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -17342,44 +17342,6 @@ } } }, - "exceptions": [ - { - "body": { - "kind": "value", - "value": { - "items": [ - { - "generics": [ - { - "kind": "instance_of", - "type": { - "name": "TDocument", - "namespace": "_global.get" - } - } - ], - "kind": "instance_of", - "type": { - "name": "GetResult", - "namespace": "_global.get" - } - }, - { - "kind": "instance_of", - "type": { - "name": "ErrorResponseBase", - "namespace": "_types" - } - } - ], - "kind": "union_of" - } - }, - "statusCodes": [ - 404 - ] - } - ], "generics": [ { "name": "TDocument", @@ -17391,7 +17353,7 @@ "name": "Response", "namespace": "_global.get" }, - "specLocation": "_global/get/GetResponse.ts#L23-L34" + "specLocation": "_global/get/GetResponse.ts#L23-L25" }, { "attachedBehaviors": [ @@ -155123,11 +155085,7 @@ "name": "status", "required": false, "type": { - "kind": "instance_of", - "type": { - "name": "Status", - "namespace": "tasks._types" - } + "kind": "user_defined_value" } }, { @@ -155153,7 +155111,7 @@ } } ], - "specLocation": "tasks/_types/TaskInfo.ts#L24-L38" + "specLocation": "tasks/_types/TaskInfo.ts#L25-L39" }, { "kind": "interface", @@ -155265,11 +155223,7 @@ "name": "status", "required": false, "type": { - "kind": "instance_of", - "type": { - "name": "Status", - "namespace": "tasks._types" - } + "kind": "user_defined_value" } }, { @@ -155286,206 +155240,6 @@ ], "specLocation": "tasks/_types/TaskState.ts#L24-L36" }, - { - "kind": "interface", - "name": { - "name": "Status", - "namespace": "tasks._types" - }, - "properties": [ - { - "name": "batches", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "long", - "namespace": "_types" - } - } - }, - { - "name": "canceled", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - } - }, - { - "name": "created", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "long", - "namespace": "_types" - } - } - }, - { - "name": "deleted", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "long", - "namespace": "_types" - } - } - }, - { - "name": "noops", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "long", - "namespace": "_types" - } - } - }, - { - "name": "failures", - "required": false, - "type": { - "kind": "array_of", - "value": { - "kind": "instance_of", - "type": { - "name": "string", - "namespace": "_builtins" - } - } - } - }, - { - "name": "requests_per_second", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "float", - "namespace": "_types" - } - } - }, - { - "name": "retries", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "Retries", - "namespace": "_types" - } - } - }, - { - "name": "throttled", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "Time", - "namespace": "_types" - } - } - }, - { - "name": "throttled_millis", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "long", - "namespace": "_types" - } - } - }, - { - "name": "throttled_until", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "Time", - "namespace": "_types" - } - } - }, - { - "name": "throttled_until_millis", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "long", - "namespace": "_types" - } - } - }, - { - "name": "timed_out", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "boolean", - "namespace": "_builtins" - } - } - }, - { - "name": "took", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "long", - "namespace": "_types" - } - } - }, - { - "name": "total", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "long", - "namespace": "_types" - } - } - }, - { - "name": "updated", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "long", - "namespace": "_types" - } - } - }, - { - "name": "version_conflicts", - "required": true, - "type": { - "kind": "instance_of", - "type": { - "name": "long", - "namespace": "_types" - } - } - } - ], - "specLocation": "tasks/_types/TaskStatus.ts#L24-L42" - }, { "inherits": { "type": { @@ -155767,11 +155521,7 @@ "name": "response", "required": false, "type": { - "kind": "instance_of", - "type": { - "name": "Status", - "namespace": "tasks._types" - } + "kind": "user_defined_value" } }, { diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 159a6ac2f9..c3618490f5 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -15629,7 +15629,7 @@ export interface TasksInfo { node: string running_time_in_nanos: long start_time_in_millis: long - status?: TasksStatus + status?: any type: string parent_task_id?: Id } @@ -15644,30 +15644,10 @@ export interface TasksState { parent_task_id?: TaskId running_time_in_nanos: long start_time_in_millis: long - status?: TasksStatus + status?: any type: string } -export interface TasksStatus { - batches: long - canceled?: string - created: long - deleted: long - noops: long - failures?: string[] - requests_per_second: float - retries: Retries - throttled?: Time - throttled_millis: long - throttled_until?: Time - throttled_until_millis: long - timed_out?: boolean - took?: long - total: long - updated: long - version_conflicts: long -} - export interface TasksTaskExecutingNode extends SpecUtilsBaseNode { tasks: Record } @@ -15694,7 +15674,7 @@ export interface TasksGetRequest extends RequestBase { export interface TasksGetResponse { completed: boolean task: TasksInfo - response?: TasksStatus + response?: any error?: ErrorCause } diff --git a/specification/_global/get/GetResponse.ts b/specification/_global/get/GetResponse.ts index 7a0fd0c4c8..39eaa39be0 100644 --- a/specification/_global/get/GetResponse.ts +++ b/specification/_global/get/GetResponse.ts @@ -22,13 +22,4 @@ import { ErrorResponseBase } from '@_types/Base' export class Response { body: GetResult - exceptions: [ - { - // Special case exception for 404 status code, Elasticsearch will return either: - // * index_not_found_exception as an error if the index doesn't exist - // * GetResult with only the requested _id, _index properties and found as a false boolean - statusCodes: [404] - body: GetResult | ErrorResponseBase - } - ] } diff --git a/specification/tasks/_types/TaskInfo.ts b/specification/tasks/_types/TaskInfo.ts index fd555ba5fd..20013cefdb 100644 --- a/specification/tasks/_types/TaskInfo.ts +++ b/specification/tasks/_types/TaskInfo.ts @@ -20,6 +20,7 @@ import { Status } from '@tasks/_types/TaskStatus' import { HttpHeaders, Id } from '@_types/common' import { long } from '@_types/Numeric' +import { UserDefinedValue } from '@spec_utils/UserDefinedValue' export class Info { action: string @@ -32,7 +33,7 @@ export class Info { node: string running_time_in_nanos: long start_time_in_millis: long - status?: Status + status?: UserDefinedValue type: string parent_task_id?: Id } diff --git a/specification/tasks/_types/TaskState.ts b/specification/tasks/_types/TaskState.ts index 196f76562f..363d3b2518 100644 --- a/specification/tasks/_types/TaskState.ts +++ b/specification/tasks/_types/TaskState.ts @@ -19,7 +19,7 @@ import { HttpHeaders, TaskId } from '@_types/common' import { long } from '@_types/Numeric' -import { Status } from './TaskStatus' +import { UserDefinedValue } from '@spec_utils/UserDefinedValue' export class State { action: string @@ -31,6 +31,6 @@ export class State { parent_task_id?: TaskId running_time_in_nanos: long start_time_in_millis: long - status?: Status + status?: UserDefinedValue type: string } diff --git a/specification/tasks/_types/TaskStatus.ts b/specification/tasks/_types/TaskStatus.ts deleted file mode 100644 index 7cfb072bc3..0000000000 --- a/specification/tasks/_types/TaskStatus.ts +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -import { float, long } from '@_types/Numeric' -import { Retries } from '@_types/Retries' -import { Time } from '@_types/Time' - -export class Status { - batches: long - canceled?: string - created: long - deleted: long - noops: long - failures?: string[] - requests_per_second: float - retries: Retries - throttled?: Time - throttled_millis: long - throttled_until?: Time - throttled_until_millis: long - timed_out?: boolean - took?: long - total: long - updated: long - version_conflicts: long -} diff --git a/specification/tasks/get/GetTaskResponse.ts b/specification/tasks/get/GetTaskResponse.ts index 08cc5e5e47..804d8dc2e4 100644 --- a/specification/tasks/get/GetTaskResponse.ts +++ b/specification/tasks/get/GetTaskResponse.ts @@ -17,15 +17,15 @@ * under the License. */ -import { Status } from '@tasks/_types/TaskStatus' import { ErrorCause } from '@_types/Errors' import { Info } from '../_types/TaskInfo' +import { UserDefinedValue } from '@spec_utils/UserDefinedValue' export class Response { body: { completed: boolean task: Info - response?: Status + response?: UserDefinedValue error?: ErrorCause } }