Skip to content

Commit 685ebb5

Browse files
committed
async search error handling
1 parent ea95e94 commit 685ebb5

File tree

3 files changed

+42
-0
lines changed

3 files changed

+42
-0
lines changed

specification/async_search/_types/AsyncSearchResponseBase.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
*/
1919

2020
import { Id } from '@_types/common'
21+
import { ErrorCause } from '@_types/Errors'
2122
import { DateTime, EpochTime, UnitMillis } from '@_types/Time'
2223
import { AsyncSearch } from './AsyncSearch'
2324

@@ -48,6 +49,7 @@ export class AsyncSearchResponseBase {
4849
*/
4950
completion_time?: DateTime
5051
completion_time_in_millis?: EpochTime<UnitMillis>
52+
error?: ErrorCause
5153
}
5254
export class AsyncSearchDocumentResponseBase<
5355
TDocument

specification/async_search/get/AsyncSearchGetResponse.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,29 @@
1717
* under the License.
1818
*/
1919

20+
import { ErrorCause } from '@_types/Errors'
21+
import { DateTime, EpochTime, UnitMillis } from '@_types/Time'
22+
import { AsyncSearch } from '@async_search/_types/AsyncSearch'
2023
import { AsyncSearchDocumentResponseBase } from '@async_search/_types/AsyncSearchResponseBase'
2124

2225
export class Response<TDocument> {
2326
/** @codegen_name result */
2427
body: AsyncSearchDocumentResponseBase<TDocument>
28+
exceptions: [
29+
{
30+
statusCodes: [404, 400, 500, 429]
31+
body: {
32+
is_partial: boolean
33+
is_running: boolean
34+
expiration_time?: DateTime
35+
expiration_time_in_millis: EpochTime<UnitMillis>
36+
start_time?: DateTime
37+
start_time_in_millis: EpochTime<UnitMillis>
38+
completion_time?: DateTime
39+
completion_time_in_millis?: EpochTime<UnitMillis>
40+
error?: ErrorCause
41+
response?: AsyncSearch<TDocument>
42+
}
43+
}
44+
]
2545
}

specification/async_search/submit/AsyncSearchSubmitResponse.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,29 @@
1717
* under the License.
1818
*/
1919

20+
import { ErrorCause } from '@_types/Errors'
21+
import { DateTime, EpochTime, UnitMillis } from '@_types/Time'
22+
import { AsyncSearch } from '@async_search/_types/AsyncSearch'
2023
import { AsyncSearchDocumentResponseBase } from '@async_search/_types/AsyncSearchResponseBase'
2124

2225
export class Response<TDocument> {
2326
/** @codegen_name result */
2427
body: AsyncSearchDocumentResponseBase<TDocument>
28+
exceptions: [
29+
{
30+
statusCodes: [404, 400, 500, 429]
31+
body: {
32+
is_partial: boolean
33+
is_running: boolean
34+
expiration_time?: DateTime
35+
expiration_time_in_millis: EpochTime<UnitMillis>
36+
start_time?: DateTime
37+
start_time_in_millis: EpochTime<UnitMillis>
38+
completion_time?: DateTime
39+
completion_time_in_millis?: EpochTime<UnitMillis>
40+
error?: ErrorCause
41+
response?: AsyncSearch<TDocument>
42+
}
43+
}
44+
]
2545
}

0 commit comments

Comments
 (0)