Skip to content

Commit d5d355d

Browse files
authored
Reorg bulk (#453)
* Reorg bulk * make contrib * Add variants
1 parent ac8c010 commit d5d355d

File tree

5 files changed

+44
-56
lines changed

5 files changed

+44
-56
lines changed

output/schema/schema.json

+8-2
Original file line numberDiff line numberDiff line change
@@ -12563,7 +12563,10 @@
1256312563
}
1256412564
}
1256512565
}
12566-
]
12566+
],
12567+
"variants": {
12568+
"kind": "container"
12569+
}
1256712570
},
1256812571
{
1256912572
"kind": "interface",
@@ -12785,7 +12788,10 @@
1278512788
}
1278612789
}
1278712790
}
12788-
]
12791+
],
12792+
"variants": {
12793+
"kind": "container"
12794+
}
1278912795
},
1279012796
{
1279112797
"inherits": {

specification/_global/bulk/BulkOperation.ts

-51
This file was deleted.

specification/_global/bulk/BulkRequest.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import {
2727
WaitForActiveShards
2828
} from '@_types/common'
2929
import { Time } from '@_types/Time'
30-
import { BulkOperationContainer } from './BulkOperation'
30+
import { BulkOperationContainer } from './types'
3131

3232
/**
3333
* @rest_spec_name bulk

specification/_global/bulk/BulkResponse.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919

2020
import { long } from '@_types/Numeric'
21-
import { BulkResponseItemContainer } from './BulkResponseItemBase'
21+
import { BulkResponseItemContainer } from './types'
2222

2323
export class Response {
2424
body: {

specification/_global/bulk/BulkResponseItemBase.ts specification/_global/bulk/types.ts

+34-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,14 @@
2121
import { InlineGet } from '@global/explain/InlineGet'
2222
import { Dictionary } from '@spec_utils/Dictionary'
2323
import { UserDefinedValue } from '@spec_utils/UserDefinedValue'
24-
import { SequenceNumber, VersionNumber } from '@_types/common'
24+
import {
25+
Id,
26+
IndexName,
27+
Routing,
28+
SequenceNumber,
29+
VersionNumber,
30+
VersionType
31+
} from '@_types/common'
2532
import { ErrorCause } from '@_types/Errors'
2633
import { integer, long } from '@_types/Numeric'
2734
import { ShardStatistics } from '@_types/Stats'
@@ -42,6 +49,7 @@ export class BulkResponseItemBase {
4249
get?: InlineGet<Dictionary<string, UserDefinedValue>>
4350
}
4451

52+
/** @variants container */
4553
export class BulkResponseItemContainer {
4654
index?: BulkIndexResponseItem
4755
create?: BulkCreateResponseItem
@@ -56,3 +64,28 @@ export class BulkCreateResponseItem extends BulkResponseItemBase {}
5664
export class BulkUpdateResponseItem extends BulkResponseItemBase {}
5765

5866
export class BulkDeleteResponseItem extends BulkResponseItemBase {}
67+
68+
export class BulkOperation {
69+
_id: Id
70+
_index: IndexName
71+
retry_on_conflict: integer
72+
routing: Routing
73+
version: VersionNumber
74+
version_type: VersionType
75+
}
76+
77+
/** @variants container */
78+
export class BulkOperationContainer {
79+
index?: BulkIndexOperation
80+
create?: BulkCreateOperation
81+
update?: BulkUpdateOperation
82+
delete?: BulkDeleteOperation
83+
}
84+
85+
export class BulkIndexOperation extends BulkOperation {}
86+
87+
export class BulkCreateOperation extends BulkOperation {}
88+
89+
export class BulkUpdateOperation extends BulkOperation {}
90+
91+
export class BulkDeleteOperation extends BulkOperation {}

0 commit comments

Comments
 (0)