Is it possible to get Team Foundation Server 2015 new build definitions using regular object model, or am I forced to get them using the REST API?
If it's possible to using the object model, what class should I use to do so?
I was able to get XAML build definitions using IBuildServer.QueryBuildDefinitions
. Is there an equivalent to this method so I can access new build definitions and their variables?
You're looking for the Build 2.0 REST API's. The documentation can be found here.
There is a client wrapper which ships as part of the new NuGet packages, the Microsoft.TeamFoundation.Build2.WebApi
assembly provides a BuildHttpClient
object which is the starting point to accessing the new build system.