mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-30 16:39:21 +01:00
Change DreamMaker and Job listing clients to use EntityId
This commit is contained in:
@@ -38,7 +38,7 @@ namespace Tgstation.Server.Client.Components
|
||||
public Task<CompileJob> GetCompileJob(CompileJob compileJob, CancellationToken cancellationToken) => apiClient.Read<CompileJob>(Routes.SetID(Routes.DreamMaker, compileJob?.Id ?? throw new ArgumentNullException(nameof(compileJob))), instance.Id, cancellationToken);
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<IReadOnlyList<CompileJob>> GetJobIds(CancellationToken cancellationToken) => apiClient.Read<IReadOnlyList<CompileJob>>(Routes.ListRoute(Routes.DreamMaker), instance.Id, cancellationToken);
|
||||
public Task<IReadOnlyList<EntityId>> GetJobIds(CancellationToken cancellationToken) => apiClient.Read<IReadOnlyList<EntityId>>(Routes.ListRoute(Routes.DreamMaker), instance.Id, cancellationToken);
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<DreamMaker> Read(CancellationToken cancellationToken) => apiClient.Read<DreamMaker>(Routes.DreamMaker, instance.Id, cancellationToken);
|
||||
|
||||
@@ -33,11 +33,11 @@ namespace Tgstation.Server.Client.Components
|
||||
Task<Job> Compile(CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the <see cref="Api.Models.Internal.CompileJob.Id"/>s of all <see cref="CompileJob"/>s for the instance
|
||||
/// Gets the <see cref="EntityId"/>s of all <see cref="CompileJob"/>s for the instance
|
||||
/// </summary>
|
||||
/// <param name="cancellationToken">The <see cref="CancellationToken"/> for the operation</param>
|
||||
/// <returns>A <see cref="Task{TResult}"/> resulting in a <see cref="IReadOnlyList{T}"/> of <see cref="CompileJob"/>s with only the <see cref="Api.Models.Internal.CompileJob.Id"/> field populated</returns>
|
||||
Task<IReadOnlyList<CompileJob>> GetJobIds(CancellationToken cancellationToken);
|
||||
/// <returns>A <see cref="Task{TResult}"/> resulting in a <see cref="IReadOnlyList{T}"/> of <see cref="CompileJob"/> <see cref="EntityId"/>s.</returns>
|
||||
Task<IReadOnlyList<EntityId>> GetJobIds(CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Get a <paramref name="compileJob"/>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Tgstation.Server.Api.Models;
|
||||
@@ -12,11 +11,11 @@ namespace Tgstation.Server.Client.Components
|
||||
public interface IJobsClient
|
||||
{
|
||||
/// <summary>
|
||||
/// List the <see cref="Api.Models.Internal.Job.Id"/>s in the <see cref="Instance"/>
|
||||
/// List the <see cref="Job"/> <see cref="EntityId"/>s in the <see cref="Instance"/>
|
||||
/// </summary>
|
||||
/// <param name="cancellationToken">The <see cref="CancellationToken"/> for the operation</param>
|
||||
/// <returns>A <see cref="Task{TResult}"/> resulting in a <see cref="IReadOnlyList{T}"/> of the <see cref="Api.Models.Internal.Job.Id"/>s in the <see cref="Instance"/></returns>
|
||||
Task<IReadOnlyList<Job>> List(CancellationToken cancellationToken);
|
||||
/// <returns>A <see cref="Task{TResult}"/> resulting in a <see cref="IReadOnlyList{T}"/> of the <see cref="Job"/> <see cref="EntityId"/>s in the <see cref="Instance"/></returns>
|
||||
Task<IReadOnlyList<EntityId>> List(CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// List the active <see cref="Job"/>s in the <see cref="Instance"/>
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace Tgstation.Server.Client.Components
|
||||
public Task Cancel(Job job, CancellationToken cancellationToken) => apiClient.Delete(Routes.SetID(Routes.Jobs, job?.Id ?? throw new ArgumentNullException(nameof(job))), instance.Id, cancellationToken);
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<IReadOnlyList<Job>> List(CancellationToken cancellationToken) => apiClient.Read<IReadOnlyList<Job>>(Routes.ListRoute(Routes.Jobs), instance.Id, cancellationToken);
|
||||
public Task<IReadOnlyList<EntityId>> List(CancellationToken cancellationToken) => apiClient.Read<IReadOnlyList<EntityId>>(Routes.ListRoute(Routes.Jobs), instance.Id, cancellationToken);
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<IReadOnlyList<Job>> ListActive(CancellationToken cancellationToken) => apiClient.Read<IReadOnlyList<Job>>(Routes.Jobs, instance.Id, cancellationToken);
|
||||
|
||||
Reference in New Issue
Block a user