Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions specification/async_search/_types/AsyncSearchResponseBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/

import { Id } from '@_types/common'
import { ErrorCause } from '@_types/Errors'
import { DateTime, EpochTime, UnitMillis } from '@_types/Time'
import { AsyncSearch } from './AsyncSearch'

Expand Down Expand Up @@ -48,9 +49,23 @@ export class AsyncSearchResponseBase {
*/
completion_time?: DateTime
completion_time_in_millis?: EpochTime<UnitMillis>
error?: ErrorCause
}
export class AsyncSearchDocumentResponseBase<
TDocument
> extends AsyncSearchResponseBase {
response: AsyncSearch<TDocument>
}

export class AsyncSearchResponseException<TDocument> {
is_partial: boolean
is_running: boolean
expiration_time?: DateTime
expiration_time_in_millis: EpochTime<UnitMillis>
start_time?: DateTime
start_time_in_millis: EpochTime<UnitMillis>
completion_time?: DateTime
completion_time_in_millis?: EpochTime<UnitMillis>
error?: ErrorCause
response?: AsyncSearch<TDocument>
}
11 changes: 10 additions & 1 deletion specification/async_search/get/AsyncSearchGetResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,18 @@
* under the License.
*/

import { AsyncSearchDocumentResponseBase } from '@async_search/_types/AsyncSearchResponseBase'
import {
AsyncSearchDocumentResponseBase,
AsyncSearchResponseException
} from '@async_search/_types/AsyncSearchResponseBase'

export class Response<TDocument> {
/** @codegen_name result */
body: AsyncSearchDocumentResponseBase<TDocument>
exceptions: [
{
statusCodes: [404, 400, 500, 429]
body: AsyncSearchResponseException<TDocument>
}
]
}
11 changes: 10 additions & 1 deletion specification/async_search/submit/AsyncSearchSubmitResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,18 @@
* under the License.
*/

import { AsyncSearchDocumentResponseBase } from '@async_search/_types/AsyncSearchResponseBase'
import {
AsyncSearchDocumentResponseBase,
AsyncSearchResponseException
} from '@async_search/_types/AsyncSearchResponseBase'

export class Response<TDocument> {
/** @codegen_name result */
body: AsyncSearchDocumentResponseBase<TDocument>
exceptions: [
{
statusCodes: [404, 400, 500, 429]
body: AsyncSearchResponseException<TDocument>
}
]
}