Skip to content

Commit

Permalink
update apis for commands definitions (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
zklgame authored Nov 1, 2023
1 parent 31b9161 commit dc97b72
Show file tree
Hide file tree
Showing 17 changed files with 823 additions and 365 deletions.
46 changes: 33 additions & 13 deletions api-schema/xdb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -258,11 +258,9 @@ components:
TimerCommand:
type: object
required:
- firingUnixTimestampSeconds
- delayInSeconds
properties:
commandId:
type: string
firingUnixTimestampSeconds:
delayInSeconds:
type: integer
format: int64
LocalQueueCommand:
Expand Down Expand Up @@ -312,22 +310,34 @@ components:
localQueueResults:
type: array
items:
$ref: '#/components/schemas/LocalQueueMessage'
$ref: '#/components/schemas/LocalQueueResult'
TimerResult:
type: object
required:
- timerStatus
- status
properties:
status:
$ref: '#/components/schemas/CommandStatus'
LocalQueueResult:
type: object
required:
- status
- queueName
properties:
commandId:
status:
$ref: '#/components/schemas/CommandStatus'
queueName:
type: string
timerStatus:
$ref: '#/components/schemas/TimerStatus'
TimerStatus:
messages:
type: array
items:
$ref: '#/components/schemas/LocalQueueMessageResult'
CommandStatus:
type: string
enum:
- SCHEDULED_TIMER
- FIRED_TIMER
- SKIPPED_TIMER
- WAITING_COMMAND
- COMPLETED_COMMAND
- SKIPPED_COMMAND
LocalQueueMessage:
type: object
required:
Expand All @@ -340,6 +350,16 @@ components:
description: UUID to uniquely distinguish different messages. If not specified, the server will generate a UUID instead.
payload:
$ref: '#/components/schemas/EncodedObject'
LocalQueueMessageResult:
type: object
required:
- dedupId
properties:
dedupId:
type: string
description: UUID to uniquely distinguish different messages.
payload:
$ref: '#/components/schemas/EncodedObject'
AsyncStateExecuteResponse:
type: object
description: the output of the execute API
Expand Down
8 changes: 6 additions & 2 deletions goapi/xdbapi/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ docs/AsyncStateWaitUntilResponse.md
docs/AttributeWriteConflictMode.md
docs/CommandRequest.md
docs/CommandResults.md
docs/CommandStatus.md
docs/CommandWaitingType.md
docs/Context.md
docs/DefaultAPI.md
Expand All @@ -26,6 +27,8 @@ docs/LoadGlobalAttributeResponse.md
docs/LoadGlobalAttributesRequest.md
docs/LocalQueueCommand.md
docs/LocalQueueMessage.md
docs/LocalQueueMessageResult.md
docs/LocalQueueResult.md
docs/NotifyImmediateTasksRequest.md
docs/NotifyTimerTasksRequest.md
docs/ProcessExecutionDescribeRequest.md
Expand Down Expand Up @@ -53,7 +56,6 @@ docs/ThreadCloseDecision.md
docs/ThreadCloseType.md
docs/TimerCommand.md
docs/TimerResult.md
docs/TimerStatus.md
docs/WorkerErrorResponse.md
git_push.sh
go.mod
Expand All @@ -67,6 +69,7 @@ model_async_state_wait_until_response.go
model_attribute_write_conflict_mode.go
model_command_request.go
model_command_results.go
model_command_status.go
model_command_waiting_type.go
model_context.go
model_encoded_object.go
Expand All @@ -77,6 +80,8 @@ model_load_global_attribute_response.go
model_load_global_attributes_request.go
model_local_queue_command.go
model_local_queue_message.go
model_local_queue_message_result.go
model_local_queue_result.go
model_notify_immediate_tasks_request.go
model_notify_timer_tasks_request.go
model_process_execution_describe_request.go
Expand Down Expand Up @@ -104,7 +109,6 @@ model_thread_close_decision.go
model_thread_close_type.go
model_timer_command.go
model_timer_result.go
model_timer_status.go
model_worker_error_response.go
response.go
test/api_default_test.go
Expand Down
4 changes: 3 additions & 1 deletion goapi/xdbapi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ Class | Method | HTTP request | Description
- [AttributeWriteConflictMode](docs/AttributeWriteConflictMode.md)
- [CommandRequest](docs/CommandRequest.md)
- [CommandResults](docs/CommandResults.md)
- [CommandStatus](docs/CommandStatus.md)
- [CommandWaitingType](docs/CommandWaitingType.md)
- [Context](docs/Context.md)
- [EncodedObject](docs/EncodedObject.md)
Expand All @@ -108,6 +109,8 @@ Class | Method | HTTP request | Description
- [LoadGlobalAttributesRequest](docs/LoadGlobalAttributesRequest.md)
- [LocalQueueCommand](docs/LocalQueueCommand.md)
- [LocalQueueMessage](docs/LocalQueueMessage.md)
- [LocalQueueMessageResult](docs/LocalQueueMessageResult.md)
- [LocalQueueResult](docs/LocalQueueResult.md)
- [NotifyImmediateTasksRequest](docs/NotifyImmediateTasksRequest.md)
- [NotifyTimerTasksRequest](docs/NotifyTimerTasksRequest.md)
- [ProcessExecutionDescribeRequest](docs/ProcessExecutionDescribeRequest.md)
Expand Down Expand Up @@ -135,7 +138,6 @@ Class | Method | HTTP request | Description
- [ThreadCloseType](docs/ThreadCloseType.md)
- [TimerCommand](docs/TimerCommand.md)
- [TimerResult](docs/TimerResult.md)
- [TimerStatus](docs/TimerStatus.md)
- [WorkerErrorResponse](docs/WorkerErrorResponse.md)


Expand Down
149 changes: 100 additions & 49 deletions goapi/xdbapi/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -257,10 +257,8 @@ components:
example:
commandRequest:
timerCommands:
- firingUnixTimestampSeconds: 0
commandId: commandId
- firingUnixTimestampSeconds: 0
commandId: commandId
- delayInSeconds: 0
- delayInSeconds: 0
waitingType: null
localQueueCommands:
- queueName: queueName
Expand Down Expand Up @@ -291,10 +289,8 @@ components:
CommandRequest:
example:
timerCommands:
- firingUnixTimestampSeconds: 0
commandId: commandId
- firingUnixTimestampSeconds: 0
commandId: commandId
- delayInSeconds: 0
- delayInSeconds: 0
waitingType: null
localQueueCommands:
- queueName: queueName
Expand All @@ -317,16 +313,13 @@ components:
type: object
TimerCommand:
example:
firingUnixTimestampSeconds: 0
commandId: commandId
delayInSeconds: 0
properties:
commandId:
type: string
firingUnixTimestampSeconds:
delayInSeconds:
format: int64
type: integer
required:
- firingUnixTimestampSeconds
- delayInSeconds
type: object
LocalQueueCommand:
example:
Expand Down Expand Up @@ -354,20 +347,30 @@ components:
commandResults:
localQueueResults:
- queueName: queueName
payload:
data: data
encoding: encoding
dedupId: dedupId
messages:
- payload:
data: data
encoding: encoding
dedupId: dedupId
- payload:
data: data
encoding: encoding
dedupId: dedupId
status: null
- queueName: queueName
payload:
data: data
encoding: encoding
dedupId: dedupId
messages:
- payload:
data: data
encoding: encoding
dedupId: dedupId
- payload:
data: data
encoding: encoding
dedupId: dedupId
status: null
timerResults:
- timerStatus: null
commandId: commandId
- timerStatus: null
commandId: commandId
- status: null
- status: null
loadedGlobalAttributes:
tableResponses:
- columns:
Expand Down Expand Up @@ -418,47 +421,80 @@ components:
example:
localQueueResults:
- queueName: queueName
payload:
data: data
encoding: encoding
dedupId: dedupId
messages:
- payload:
data: data
encoding: encoding
dedupId: dedupId
- payload:
data: data
encoding: encoding
dedupId: dedupId
status: null
- queueName: queueName
payload:
data: data
encoding: encoding
dedupId: dedupId
messages:
- payload:
data: data
encoding: encoding
dedupId: dedupId
- payload:
data: data
encoding: encoding
dedupId: dedupId
status: null
timerResults:
- timerStatus: null
commandId: commandId
- timerStatus: null
commandId: commandId
- status: null
- status: null
properties:
timerResults:
items:
$ref: '#/components/schemas/TimerResult'
type: array
localQueueResults:
items:
$ref: '#/components/schemas/LocalQueueMessage'
$ref: '#/components/schemas/LocalQueueResult'
type: array
type: object
TimerResult:
example:
timerStatus: null
commandId: commandId
status: null
properties:
commandId:
status:
$ref: '#/components/schemas/CommandStatus'
required:
- status
type: object
LocalQueueResult:
example:
queueName: queueName
messages:
- payload:
data: data
encoding: encoding
dedupId: dedupId
- payload:
data: data
encoding: encoding
dedupId: dedupId
status: null
properties:
status:
$ref: '#/components/schemas/CommandStatus'
queueName:
type: string
timerStatus:
$ref: '#/components/schemas/TimerStatus'
messages:
items:
$ref: '#/components/schemas/LocalQueueMessageResult'
type: array
required:
- timerStatus
- queueName
- status
type: object
TimerStatus:
CommandStatus:
enum:
- SCHEDULED_TIMER
- FIRED_TIMER
- SKIPPED_TIMER
- WAITING_COMMAND
- COMPLETED_COMMAND
- SKIPPED_COMMAND
type: string
LocalQueueMessage:
example:
Expand All @@ -479,6 +515,21 @@ components:
required:
- queueName
type: object
LocalQueueMessageResult:
example:
payload:
data: data
encoding: encoding
dedupId: dedupId
properties:
dedupId:
description: UUID to uniquely distinguish different messages.
type: string
payload:
$ref: '#/components/schemas/EncodedObject'
required:
- dedupId
type: object
AsyncStateExecuteResponse:
description: the output of the execute API
example:
Expand Down
8 changes: 4 additions & 4 deletions goapi/xdbapi/docs/CommandResults.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**TimerResults** | Pointer to [**[]TimerResult**](TimerResult.md) | | [optional]
**LocalQueueResults** | Pointer to [**[]LocalQueueMessage**](LocalQueueMessage.md) | | [optional]
**LocalQueueResults** | Pointer to [**[]LocalQueueResult**](LocalQueueResult.md) | | [optional]

## Methods

Expand Down Expand Up @@ -53,20 +53,20 @@ HasTimerResults returns a boolean if a field has been set.

### GetLocalQueueResults

`func (o *CommandResults) GetLocalQueueResults() []LocalQueueMessage`
`func (o *CommandResults) GetLocalQueueResults() []LocalQueueResult`

GetLocalQueueResults returns the LocalQueueResults field if non-nil, zero value otherwise.

### GetLocalQueueResultsOk

`func (o *CommandResults) GetLocalQueueResultsOk() (*[]LocalQueueMessage, bool)`
`func (o *CommandResults) GetLocalQueueResultsOk() (*[]LocalQueueResult, bool)`

GetLocalQueueResultsOk returns a tuple with the LocalQueueResults field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetLocalQueueResults

`func (o *CommandResults) SetLocalQueueResults(v []LocalQueueMessage)`
`func (o *CommandResults) SetLocalQueueResults(v []LocalQueueResult)`

SetLocalQueueResults sets LocalQueueResults field to given value.

Expand Down
Loading

0 comments on commit dc97b72

Please sign in to comment.