Skip to content

Commit

Permalink
Remove interface and applied tenantIds to the IActiveJobsCommandStep3…
Browse files Browse the repository at this point in the history
… builder.
  • Loading branch information
ShawnAbshire committed Nov 7, 2023
1 parent 097450a commit b4d1825
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 39 deletions.
2 changes: 1 addition & 1 deletion Client.UnitTests/ActivateJobTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 17 additions & 1 deletion Client/Api/Commands/IActivateJobsCommandStep1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

namespace Zeebe.Client.Api.Commands
{
public interface IActivateJobsCommandStep1 : ITenantIdsCommandStep<IActivateJobsCommandStep1>
public interface IActivateJobsCommandStep1
{
/// <summary>
/// Set the type of jobs to work on.
Expand Down Expand Up @@ -104,5 +104,21 @@ public interface IActivateJobsCommandStep3 : IFinalCommandWithRetryStep<IActivat
/// it to the broker.
/// </returns>
IActivateJobsCommandStep3 FetchVariables(params string[] fetchVariables);

/// <summary>
/// Set a lit of tenantIds to associate to this resource.
/// </summary>
/// <param name="tenantIds">the tenant to associate to this resource.</param>
/// <returns>The builder for this command. Call <see cref="IFinalCommandStep{T}.Send"/> to complete the command and send it
/// to the broker.</returns>
IActivateJobsCommandStep3 AddTenantIds(IList<string> tenantIds);

/// <summary>
/// Set a list of tenantIds to associate to this resource.
/// </summary>
/// <param name="tenantIds">the tenant to associate to this resource.</param>
/// <returns>The builder for this command. Call <see cref="IFinalCommandStep{T}.Send"/> to complete the command and send it
/// to the broker.</returns>
IActivateJobsCommandStep3 AddTenantIds(params string[] tenantIds);
}
}
23 changes: 0 additions & 23 deletions Client/Api/Commands/ITenantIdsCommandStep.cs

This file was deleted.

28 changes: 14 additions & 14 deletions Client/Impl/Commands/ActivateJobsCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,6 @@ public IActivateJobsCommandStep2 JobType(string jobType)
return this;
}

public IActivateJobsCommandStep1 AddTenantIds(IList<string> 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;
Expand Down Expand Up @@ -79,6 +65,20 @@ public IActivateJobsCommandStep3 WorkerName(string workerName)
return this;
}

public IActivateJobsCommandStep3 AddTenantIds(IList<string> tenantIds)
{
Request.TenantIds.AddRange(tenantIds);

return this;
}

public IActivateJobsCommandStep3 AddTenantIds(params string[] tenantIds)
{
Request.TenantIds.AddRange(tenantIds);

return this;
}

public async Task<IActivateJobsResponse> Send(TimeSpan? timeout = null, CancellationToken token = default)
{
var activateJobsResponses = new Responses.ActivateJobsResponses();
Expand Down

0 comments on commit b4d1825

Please sign in to comment.