61 lines
1.8 KiB
Protocol Buffer
61 lines
1.8 KiB
Protocol Buffer
syntax="proto3";
|
|
package bts.api.synthetic;
|
|
option csharp_namespace="bts.api.synthetic";
|
|
|
|
|
|
import "lib/api/apicore.proto";
|
|
import "lib/api/apioptions.proto";
|
|
import "lib/domain_model/Security.proto";
|
|
//import "google/protobuf/timestamp.proto";
|
|
import "lib/sparkproto/SparkProtos.proto";
|
|
|
|
message CreateResult {
|
|
enum Error {
|
|
ERROR_OK = 0;
|
|
ERROR_NOT_SYNTHETIC = 1;
|
|
ERROR_ID_ALREADY_ASSIGNED = 2;
|
|
ERROR_BAD_VENUE = 3;
|
|
ERROR_BAD_NAME = 4;
|
|
ERROR_BAD_SYMBOL = 5;
|
|
ERROR_SECURITY_ALREADY_EXISTS = 6;
|
|
}
|
|
uint32 key = 1;
|
|
Error error = 2;
|
|
}
|
|
message UpdateResult {
|
|
enum Error {
|
|
ERROR_OK = 0;
|
|
ERROR_MISSING_KEY = 1;
|
|
ERROR_UNKNOWN_SECURITY = 2;
|
|
ERROR_DATABASE = 3;
|
|
}
|
|
Error error = 1;
|
|
}
|
|
|
|
message Metadata {
|
|
uint32 security_key = 1 [(bts.api.key)=true];
|
|
spark.ExecutionStrategy strategy = 2;
|
|
}
|
|
message MetadataQuery {
|
|
repeated uint32 security_key = 1;
|
|
}
|
|
message MetadataCollection {
|
|
repeated Metadata data = 1;
|
|
}
|
|
|
|
service SyntheticSecurityService {
|
|
option(bts.api.service_description)="Create or query synthetic securities.";
|
|
|
|
// Create synthetic
|
|
rpc create_synthetic(api.Security) returns (CreateResult);
|
|
// Subscribe synthetics -- code only
|
|
|
|
// set/update metadata // spark.ExecutionStrategy
|
|
rpc update_security_metadata(Metadata) returns (UpdateResult);
|
|
// query metadata
|
|
rpc query_security_metadata(MetadataQuery) returns (MetadataCollection)
|
|
{ option (bts.api.method_description)="Returns the metadata for the given set of securities if it exists. If no data for a particular key exists it will not be present in the output collection."; }
|
|
// subscribe metadata -- code only
|
|
rpc metadata(api.VoidMessage) returns (stream Metadata);
|
|
}
|