diff --git a/source/Octopus.Client.Tests/PublicSurfaceAreaFixture.ThePublicSurfaceAreaShouldNotRegress..NETCore.approved.txt b/source/Octopus.Client.Tests/PublicSurfaceAreaFixture.ThePublicSurfaceAreaShouldNotRegress..NETCore.approved.txt index cb2c99f1..336cd727 100644 --- a/source/Octopus.Client.Tests/PublicSurfaceAreaFixture.ThePublicSurfaceAreaShouldNotRegress..NETCore.approved.txt +++ b/source/Octopus.Client.Tests/PublicSurfaceAreaFixture.ThePublicSurfaceAreaShouldNotRegress..NETCore.approved.txt @@ -986,7 +986,7 @@ Octopus.Client.Editors Octopus.Client.Editors.TenantEditor ClearTags() Octopus.Client.Editors.TenantEditor ConnectToProjectAndEnvironments(Octopus.Client.Model.ProjectResource, Octopus.Client.Model.EnvironmentResource[]) Octopus.Client.Editors.TenantEditor CreateOrModify(String) - Octopus.Client.Editors.TenantEditor CreateOrModify(String, String, String) + Octopus.Client.Editors.TenantEditor CreateOrModify(String, String, String, Boolean) Octopus.Client.Editors.TenantEditor Customize(Action) Octopus.Client.Editors.TenantEditor Save() Octopus.Client.Editors.TenantEditor SetLogo(String) @@ -8474,6 +8474,7 @@ Octopus.Client.Repositories Octopus.Client.Editors.TenantEditor CreateOrModify(String) Octopus.Client.Editors.TenantEditor CreateOrModify(String, String) Octopus.Client.Editors.TenantEditor CreateOrModify(String, String, String) + Octopus.Client.Editors.TenantEditor CreateOrModify(String, String, String, Boolean) List FindAll(String, String[], Int32) List GetMissingVariables(String, String, String) Octopus.Client.Model.TenantVariableResource GetVariables(Octopus.Client.Model.TenantResource) diff --git a/source/Octopus.Client.Tests/PublicSurfaceAreaFixture.ThePublicSurfaceAreaShouldNotRegress..NETFramework.approved.txt b/source/Octopus.Client.Tests/PublicSurfaceAreaFixture.ThePublicSurfaceAreaShouldNotRegress..NETFramework.approved.txt index a9f3d230..0dbd40e1 100644 --- a/source/Octopus.Client.Tests/PublicSurfaceAreaFixture.ThePublicSurfaceAreaShouldNotRegress..NETFramework.approved.txt +++ b/source/Octopus.Client.Tests/PublicSurfaceAreaFixture.ThePublicSurfaceAreaShouldNotRegress..NETFramework.approved.txt @@ -987,7 +987,7 @@ Octopus.Client.Editors Octopus.Client.Editors.TenantEditor ClearTags() Octopus.Client.Editors.TenantEditor ConnectToProjectAndEnvironments(Octopus.Client.Model.ProjectResource, Octopus.Client.Model.EnvironmentResource[]) Octopus.Client.Editors.TenantEditor CreateOrModify(String) - Octopus.Client.Editors.TenantEditor CreateOrModify(String, String, String) + Octopus.Client.Editors.TenantEditor CreateOrModify(String, String, String, Boolean) Octopus.Client.Editors.TenantEditor Customize(Action) Octopus.Client.Editors.TenantEditor Save() Octopus.Client.Editors.TenantEditor SetLogo(String) @@ -8499,6 +8499,7 @@ Octopus.Client.Repositories Octopus.Client.Editors.TenantEditor CreateOrModify(String) Octopus.Client.Editors.TenantEditor CreateOrModify(String, String) Octopus.Client.Editors.TenantEditor CreateOrModify(String, String, String) + Octopus.Client.Editors.TenantEditor CreateOrModify(String, String, String, Boolean) List FindAll(String, String[], Int32) List GetMissingVariables(String, String, String) Octopus.Client.Model.TenantVariableResource GetVariables(Octopus.Client.Model.TenantResource) diff --git a/source/Octopus.Server.Client/Editors/TenantEditor.cs b/source/Octopus.Server.Client/Editors/TenantEditor.cs index a36d914a..f58fbc0b 100644 --- a/source/Octopus.Server.Client/Editors/TenantEditor.cs +++ b/source/Octopus.Server.Client/Editors/TenantEditor.cs @@ -47,8 +47,9 @@ public TenantEditor CreateOrModify(string name) /// The Tenant's name /// The Tenant's description /// If provided, the Id of the Tenant that you want to clone + /// The Tenant's enabled/disabled state /// - public TenantEditor CreateOrModify(string name, string description, string cloneId = null) + public TenantEditor CreateOrModify(string name, string description, string cloneId = null, bool isDisabled = false) { if (!(repository as TenantRepository).Repository.HasLinkParameter("Tenants", "clone")) throw new OperationNotSupportedByOctopusServerException(cloneId == null @@ -62,12 +63,14 @@ public TenantEditor CreateOrModify(string name, string description, string clone { Name = name, Description = description, + IsDisabled = isDisabled, }, new { clone = cloneId }); } else { existing.Name = name; existing.Description = description; + existing.IsDisabled = isDisabled; Instance = repository.Modify(existing); } diff --git a/source/Octopus.Server.Client/Model/TenantResource.cs b/source/Octopus.Server.Client/Model/TenantResource.cs index e72e8e6e..fb1e7f15 100644 --- a/source/Octopus.Server.Client/Model/TenantResource.cs +++ b/source/Octopus.Server.Client/Model/TenantResource.cs @@ -72,6 +72,7 @@ public TenantResource ClearProjects() public string Slug { get; set; } + [Writeable] public bool IsDisabled { get; set; } public IconResource Icon { get; set; } diff --git a/source/Octopus.Server.Client/Repositories/TenantRepository.cs b/source/Octopus.Server.Client/Repositories/TenantRepository.cs index a61bcf45..e83cd8bf 100644 --- a/source/Octopus.Server.Client/Repositories/TenantRepository.cs +++ b/source/Octopus.Server.Client/Repositories/TenantRepository.cs @@ -17,6 +17,7 @@ public interface ITenantRepository : IFindBySlug, ICreate, ITenantRepository @@ -82,5 +83,10 @@ public TenantEditor CreateOrModify(string name, string description, string clone { return new TenantEditor(this).CreateOrModify(name, description, cloneId); } + + public TenantEditor CreateOrModify(string name, string description, string cloneId, bool isDisabled) + { + return new TenantEditor(this).CreateOrModify(name, description, cloneId, isDisabled); + } } } \ No newline at end of file