syntax = "proto3";

package golem.componentcompilation.v1;

import "golem/common/empty.proto";
import "golem/common/error_body.proto";
import "golem/common/project_id.proto";
import "golem/component/component_id.proto";

service ComponentCompilationService {
    rpc EnqueueCompilation(ComponentCompilationRequest) returns (ComponentCompilationResponse);
}

message ComponentCompilationRequest {
    golem.component.ComponentId component_id = 1;
    uint64 component_version = 2;
    optional uint32 component_service_port = 3;
    golem.common.ProjectId project_id = 4;
}

message ComponentCompilationResponse {
    oneof result {
        golem.common.Empty success = 1;
        ComponentCompilationError failure = 2;
    }
}

message ComponentCompilationError {
    oneof error {
        golem.common.ErrorsBody bad_request = 1;
        golem.common.ErrorBody not_found = 2;
        golem.common.ErrorBody internal_error = 3;
    }
}
