62 lines
1.7 KiB
Protocol Buffer
62 lines
1.7 KiB
Protocol Buffer
syntax="proto3";
|
|
package bts.api.orderman.algo;
|
|
option csharp_namespace="bts.api.orderman.algo";
|
|
|
|
import "lib/api/apioptions.proto";
|
|
import "lib/api/apicore.proto";
|
|
import "lib/api/services/OrderService.proto";
|
|
import "google/protobuf/timestamp.proto";
|
|
|
|
message AlgoDefinitionRecordMetadata {
|
|
bool is_active = 1;
|
|
uint32 creator_user_id = 2;
|
|
google.protobuf.Timestamp creation_time = 3;
|
|
google.protobuf.Timestamp last_edit_time = 4;
|
|
google.protobuf.Timestamp deletion_time = 5;
|
|
}
|
|
|
|
message AlgoDefinition {
|
|
string name = 1;
|
|
CustomOrderDefinition definition = 2;
|
|
}
|
|
|
|
message AlgoDefinitionRecord {
|
|
uint32 key = 1 [(bts.api.key)=true];
|
|
AlgoDefinitionRecordMetadata metadata = 2;
|
|
AlgoDefinition algo = 3;
|
|
}
|
|
|
|
///////////////////////////////////////////////////////////
|
|
// API ////////////////////////////////////////////////////
|
|
|
|
message AlgoDefinitionUpdateRequest {
|
|
uint32 user_id = 1;
|
|
uint32 key = 2;
|
|
AlgoDefinition algo = 3;
|
|
}
|
|
|
|
message AlgoDefinitionUpdateResponse {
|
|
bool success = 1;
|
|
string error_message = 2;
|
|
AlgoDefinitionRecord record = 3;
|
|
}
|
|
|
|
message AlgoDefinitionRemoveRequest {
|
|
uint32 key = 1;
|
|
}
|
|
|
|
message AlgoDefinitionRemoveResponse {
|
|
bool success = 1;
|
|
string error_message = 2;
|
|
}
|
|
|
|
service AlgoDefinitionService {
|
|
option (bts.api.service_description)="Provides an interface to manage algo definitions";
|
|
|
|
// service calls
|
|
rpc save_algo_definition(AlgoDefinitionUpdateRequest) returns (AlgoDefinitionUpdateResponse);
|
|
rpc remove_algo_definition(AlgoDefinitionRemoveRequest) returns (AlgoDefinitionRemoveResponse);
|
|
|
|
// streams
|
|
rpc algo_definitions(bts.api.VoidMessage) returns (stream AlgoDefinitionRecord);
|
|
} |