From c0cb944b04d67253c8d2c5c5174fa78599b46f23 Mon Sep 17 00:00:00 2001 From: westwok Date: Tue, 12 Jan 2016 12:50:21 +0000 Subject: [PATCH] Added CreateConfigurationById --- packages/repositories.config | 11 ++++++----- src/TeamCitySharp/ActionTypes/BuildConfigs.cs | 7 ++++++- src/TeamCitySharp/ActionTypes/IBuildConfigs.cs | 4 +++- src/TeamCitySharp/TeamCitySharp.csproj | 1 + 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/packages/repositories.config b/packages/repositories.config index bcd17bb0..1956a2ba 100644 --- a/packages/repositories.config +++ b/packages/repositories.config @@ -1,6 +1,7 @@ - - - - - + + + + + + \ No newline at end of file diff --git a/src/TeamCitySharp/ActionTypes/BuildConfigs.cs b/src/TeamCitySharp/ActionTypes/BuildConfigs.cs index cdcd4a0f..e42a60c7 100644 --- a/src/TeamCitySharp/ActionTypes/BuildConfigs.cs +++ b/src/TeamCitySharp/ActionTypes/BuildConfigs.cs @@ -80,11 +80,16 @@ public List ByProjectName(string projectName) return buildWrapper.BuildType; } - public BuildConfig CreateConfiguration(string projectName, string configurationName) + public BuildConfig CreateConfigurationByName(string projectName, string configurationName) { return _caller.PostFormat(configurationName, HttpContentTypes.TextPlain, HttpContentTypes.ApplicationJson, "/app/rest/projects/name:{0}/buildTypes", projectName); } + public BuildConfig CreateConfigurationById(string projectId, string configurationName) + { + return _caller.PostFormat(configurationName, HttpContentTypes.TextPlain, HttpContentTypes.ApplicationJson, "/app/rest/projects/id:{0}/buildTypes", projectId); + } + public void SetConfigurationSetting(BuildTypeLocator locator, string settingName, string settingValue) { _caller.PutFormat(settingValue, HttpContentTypes.TextPlain, "/app/rest/buildTypes/{0}/settings/{1}", locator, settingName); diff --git a/src/TeamCitySharp/ActionTypes/IBuildConfigs.cs b/src/TeamCitySharp/ActionTypes/IBuildConfigs.cs index 2829ec2d..7cda719e 100644 --- a/src/TeamCitySharp/ActionTypes/IBuildConfigs.cs +++ b/src/TeamCitySharp/ActionTypes/IBuildConfigs.cs @@ -17,7 +17,8 @@ public interface IBuildConfigs BuildConfig ByProjectIdAndConfigurationId(string projectId, string buildConfigId); List ByProjectId(string projectId); List ByProjectName(string projectName); - BuildConfig CreateConfiguration(string projectName, string configurationName); + BuildConfig CreateConfigurationByName(string projectName, string configurationName); + BuildConfig CreateConfigurationById(string projectId, string configurationName); void SetConfigurationSetting(BuildTypeLocator locator, string settingName, string settingValue); bool GetConfigurationPauseStatus(BuildTypeLocator locator); @@ -88,5 +89,6 @@ public interface IBuildConfigs void PutAllBuildTypeParameters(BuildTypeLocator locator, IDictionary parameters); void DownloadConfiguration(BuildTypeLocator locator, Action downloadHandler); + } } \ No newline at end of file diff --git a/src/TeamCitySharp/TeamCitySharp.csproj b/src/TeamCitySharp/TeamCitySharp.csproj index 2e7df5aa..1a71295e 100644 --- a/src/TeamCitySharp/TeamCitySharp.csproj +++ b/src/TeamCitySharp/TeamCitySharp.csproj @@ -42,6 +42,7 @@ +