diff --git a/Client.UnitTests/ActivateJobTest.cs b/Client.UnitTests/ActivateJobTest.cs index dc1ead8e..e7a41611 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)) + .TenantIds(tenantIds) .Send(); // then diff --git a/Client/Api/Commands/IActivateJobsCommandStep1.cs b/Client/Api/Commands/IActivateJobsCommandStep1.cs index ce65bfb2..80e4b138 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. @@ -39,7 +39,7 @@ public interface IActivateJobsCommandStep2 IActivateJobsCommandStep3 MaxJobsToActivate(int maxJobsToActivate); } - public interface IActivateJobsCommandStep3 : IFinalCommandWithRetryStep + public interface IActivateJobsCommandStep3 : ITenantIdsCommandStep, IFinalCommandWithRetryStep { /// /// Set the time for how long a job is exclusively assigned for this subscription. diff --git a/Client/Api/Commands/ITenantIdsCommandStep.cs b/Client/Api/Commands/ITenantIdsCommandStep.cs index d9407354..fae77391 100644 --- a/Client/Api/Commands/ITenantIdsCommandStep.cs +++ b/Client/Api/Commands/ITenantIdsCommandStep.cs @@ -10,7 +10,7 @@ public interface ITenantIdsCommandStep /// 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); + T TenantIds(IList tenantIds); /// /// Set a list of tenantIds to associate to this resource. @@ -18,6 +18,6 @@ public interface ITenantIdsCommandStep /// 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); + T TenantIds(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..6890aa64 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 TenantIds(IList tenantIds) + { + Request.TenantIds.AddRange(tenantIds); + + return this; + } + + public IActivateJobsCommandStep3 TenantIds(params string[] tenantIds) + { + Request.TenantIds.AddRange(tenantIds); + + return this; + } + public async Task Send(TimeSpan? timeout = null, CancellationToken token = default) { var activateJobsResponses = new Responses.ActivateJobsResponses();