mirror of
https://github.com/pikami/cosmium.git
synced 2025-12-19 08:50:46 +00:00
Implement 'Transactional batch operations'
This commit is contained in:
24
api/api_models/models.go
Normal file
24
api/api_models/models.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package apimodels
|
||||
|
||||
const (
|
||||
BatchOperationTypeCreate = "Create"
|
||||
BatchOperationTypeDelete = "Delete"
|
||||
BatchOperationTypeReplace = "Replace"
|
||||
BatchOperationTypeUpsert = "Upsert"
|
||||
BatchOperationTypeRead = "Read"
|
||||
BatchOperationTypePatch = "Patch"
|
||||
)
|
||||
|
||||
type BatchOperation struct {
|
||||
OperationType string `json:"operationType"`
|
||||
Id string `json:"id"`
|
||||
ResourceBody map[string]interface{} `json:"resourceBody"`
|
||||
}
|
||||
|
||||
type BatchOperationResult struct {
|
||||
StatusCode int `json:"statusCode"`
|
||||
RequestCharge float64 `json:"requestCharge"`
|
||||
ResourceBody map[string]interface{} `json:"resourceBody"`
|
||||
Etag string `json:"etag"`
|
||||
Message string `json:"message"`
|
||||
}
|
||||
Reference in New Issue
Block a user