diff --git a/Client.UnitTests/ActivateJobTest.cs b/Client.UnitTests/ActivateJobTest.cs index dc1ead8e..6edec8a8 100644 --- a/Client.UnitTests/ActivateJobTest.cs +++ b/Client.UnitTests/ActivateJobTest.cs @@ -183,12 +183,12 @@ public async Task ShouldSendRequestWithTenantIdsListReceiveResponseAsExpected() // when var response = await ZeebeClient.NewActivateJobsCommand() - .AddTenantIds(tenantIds) .JobType("foo") .MaxJobsToActivate(1) .Timeout(TimeSpan.FromSeconds(10)) .WorkerName("jobWorker") .PollingTimeout(TimeSpan.FromSeconds(5)) + .AddTenantIds(tenantIds) .Send(); // then diff --git a/Client/Api/Commands/IActivateJobsCommandStep1.cs b/Client/Api/Commands/IActivateJobsCommandStep1.cs index ce65bfb2..5ee5b19b 100644 --- a/Client/Api/Commands/IActivateJobsCommandStep1.cs +++ b/Client/Api/Commands/IActivateJobsCommandStep1.cs @@ -18,7 +18,7 @@ namespace Zeebe.Client.Api.Commands { - public interface IActivateJobsCommandStep1 : ITenantIdsCommandStep + public interface IActivateJobsCommandStep1 { /// /// Set the type of jobs to work on. @@ -104,5 +104,21 @@ public interface IActivateJobsCommandStep3 : IFinalCommandWithRetryStep IActivateJobsCommandStep3 FetchVariables(params string[] fetchVariables); + + /// + /// Set a lit of tenantIds to associate to this resource. + /// + /// the tenant to associate to this resource. + /// The builder for this command. Call to complete the command and send it + /// to the broker. + IActivateJobsCommandStep3 AddTenantIds(IList tenantIds); + + /// + /// Set a list of tenantIds to associate to this resource. + /// + /// the tenant to associate to this resource. + /// The builder for this command. Call to complete the command and send it + /// to the broker. + IActivateJobsCommandStep3 AddTenantIds(params string[] tenantIds); } } \ No newline at end of file diff --git a/Client/Api/Commands/ITenantIdsCommandStep.cs b/Client/Api/Commands/ITenantIdsCommandStep.cs deleted file mode 100644 index d9407354..00000000 --- a/Client/Api/Commands/ITenantIdsCommandStep.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.Collections.Generic; - -namespace Zeebe.Client.Api.Commands -{ - public interface ITenantIdsCommandStep - { - /// - /// Set a lit of tenantIds to associate to this resource. - /// - /// the tenant to associate to this resource. - /// The builder for this command. Call to complete the command and send it - /// to the broker. - T AddTenantIds(IList tenantIds); - - /// - /// Set a list of tenantIds to associate to this resource. - /// - /// the tenant to associate to this resource. - /// The builder for this command. Call to complete the command and send it - /// to the broker. - T AddTenantIds(params string[] tenantIds); - } -} \ No newline at end of file diff --git a/Client/Impl/Commands/ActivateJobsCommand.cs b/Client/Impl/Commands/ActivateJobsCommand.cs index 976428fa..bc6ea262 100644 --- a/Client/Impl/Commands/ActivateJobsCommand.cs +++ b/Client/Impl/Commands/ActivateJobsCommand.cs @@ -29,20 +29,6 @@ public IActivateJobsCommandStep2 JobType(string jobType) return this; } - public IActivateJobsCommandStep1 AddTenantIds(IList tenantIds) - { - Request.TenantIds.AddRange(tenantIds); - - return this; - } - - public IActivateJobsCommandStep1 AddTenantIds(params string[] tenantIds) - { - Request.TenantIds.AddRange(tenantIds); - - return this; - } - public IActivateJobsCommandStep3 MaxJobsToActivate(int maxJobsToActivate) { Request.MaxJobsToActivate = maxJobsToActivate; @@ -79,6 +65,20 @@ public IActivateJobsCommandStep3 WorkerName(string workerName) return this; } + public IActivateJobsCommandStep3 AddTenantIds(IList tenantIds) + { + Request.TenantIds.AddRange(tenantIds); + + return this; + } + + public IActivateJobsCommandStep3 AddTenantIds(params string[] tenantIds) + { + Request.TenantIds.AddRange(tenantIds); + + return this; + } + public async Task Send(TimeSpan? timeout = null, CancellationToken token = default) { var activateJobsResponses = new Responses.ActivateJobsResponses();