stack72 / TeamCitySharp

No Longer Maintained - please use https://github.com/mavezeau/TeamCitySharp
Other
200 stars 165 forks source link

No way to get details for a build #100

Open derhally opened 8 years ago

derhally commented 8 years ago

I started playing around with TeamCitySharp and noticed there was no way to get details about a build. In my case I wanted to find the last successful completed build and the start and finish and other interesting tidbits.

I added a method to Build to do this.

    public Build LastSuccessfulCompletedBuildWithDetails(string configId)
    {
        var locator = BuildLocator.WithDimensions(running: false, status: BuildStatus.SUCCESS);

        var path = $"/app/rest/buildTypes/id:{configId}/builds/{locator}";

        var build = _caller.Get<Build>(path);

        return build ?? new Build();
    }