syntax = "proto3";

package load.projects.cloud.loadtesting.tasklets.teamcity.run_build;

import "ci/tasklet/common/proto/service.proto";
import "tasklet/api/tasklet.proto";
import "tasklet/services/ci/proto/ci.proto";
import "tasklet/services/yav/proto/yav.proto";

message TeamcityAPI {
    string url = 1;
}

message BuildType {
    string id = 1;
    map<string,string> properties = 2;
}

message Secret {
    string secret_uid = 1;
}

message Input {
    TeamcityAPI teamcity_api = 1;
    BuildType build_type = 2;
    Build dependency = 3;
    Secret secret = 4;

    .ci.TaskletContext context = 5;
}

message Build {
    int32 id = 1;
    string url = 2;
}

message BuildArtifact {
    string name = 1;
    string url = 2;
}

message Output {
    Build build = 1;
    repeated BuildArtifact build_artifacts = 2;
}

message Context {
    option (tasklet.context) = true;

    .ci.CiService ci = 1 [(tasklet.inject) = true];
    yav_service.YavService yav = 2 [(tasklet.inject) = true];
}

message RunBuild {
    option (tasklet.tasklet_interface) = true;

    Input input = 1 [(tasklet.input) = true];
    Output output = 2 [(tasklet.output) = true];

    Context ctx = 3;
}
