Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 27 additions & 25 deletions playground/api/v1/api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,11 @@ enum Status {
STATUS_CANCELED = 12;
}

enum ExampleType {
EXAMPLE_TYPE_DEFAULT = 0;
EXAMPLE_TYPE_KATA = 1;
EXAMPLE_TYPE_UNIT_TEST = 2;
enum PrecompiledObjectType {
PRECOMPILED_OBJECT_TYPE_UNSPECIFIED = 0;
PRECOMPILED_OBJECT_TYPE_EXAMPLE = 1;
PRECOMPILED_OBJECT_TYPE_KATA = 2;
PRECOMPILED_OBJECT_TYPE_UNIT_TEST = 3;
}

// RunCodeRequest represents a code text and options of SDK which executes the code.
Expand Down Expand Up @@ -112,42 +113,43 @@ message CancelRequest {
message CancelResponse {
}

// ListOfExamplesRequest contains information of the needed examples sdk and categories.
message GetListOfExamplesRequest{
// GetPrecompiledObjectsRequest contains information of the needed PrecompiledObjects sdk and categories.
message GetPrecompiledObjectsRequest{
Sdk sdk = 1;
string category = 2;
}

// Example represents one example with its information
message Example{
string example_uuid = 1;
// PrecompiledObject represents one PrecompiledObject with its information
message PrecompiledObject{
string cloud_path = 1;
string name = 2;
string description = 3;
ExampleType type = 4;
PrecompiledObjectType type = 4;
}

// Categories represent the array of messages with sdk and categories at this sdk
message Categories{
message Category{
string category_name = 1;
repeated Example examples = 2;
repeated PrecompiledObject precompiled_objects = 2;
}
Sdk sdk = 1;
repeated Category categories = 2;
}

// ListOfExamplesResponse represent the map between sdk and categories for the sdk.
message GetListOfExamplesResponse{
repeated Categories sdk_examples = 1;

// GetListOfPrecompiledObjectsResponse represent the map between sdk and categories for the sdk.
message GetPrecompiledObjectsResponse{
repeated Categories sdk_categories = 1;
}

// ExampleRequest contains information of the example uuid.
message GetExampleRequest{
string example_uuid = 1;
// GetPrecompiledObjectRequest contains information of the PrecompiledObject uuid.
message GetPrecompiledObjectRequest{
string cloud_path = 1;
}

// ExampleResponse represents the source code of the example.
message GetExampleResponse{
// GetPrecompiledObjectResponse represents the source code of the PrecompiledObject.
message GetPrecompiledObjectCodeResponse{
string code = 1;
}

Expand All @@ -171,12 +173,12 @@ service PlaygroundService {
// Cancel code processing
rpc Cancel(CancelRequest) returns (CancelResponse);

// Get the list of precompiled examples.
rpc GetListOfExamples(GetListOfExamplesRequest) returns (GetListOfExamplesResponse);
// Get all precompiled objects from the cloud storage.
rpc GetPrecompiledObjects(GetPrecompiledObjectsRequest) returns (GetPrecompiledObjectsResponse);

// Get the code of an example.
rpc GetExample(GetExampleRequest) returns (GetExampleResponse);
// Get the code of an PrecompiledObject.
rpc GetPrecompiledObjectCode(GetPrecompiledObjectRequest) returns (GetPrecompiledObjectCodeResponse);

// Get the precompiled details of an example.
rpc GetExampleOutput(GetExampleRequest) returns (GetRunOutputResponse);
// Get the precompiled details of an PrecompiledObject.
rpc GetPrecompiledObjectOutput(GetPrecompiledObjectRequest) returns (GetRunOutputResponse);
}
Loading