Repository navigation
Expand file tree
/
Copy pathKeyLoadClient.cs
More file actions
23 lines (21 loc) · 1.55 KB
/
Copy pathKeyLoadClient.cs
File metadata and controls
23 lines (21 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
using ManagedCode.Communication;
namespace KeyLoad.Client;
public sealed partial class KeyLoadClient
{
/// <summary>Submits one atomic command using its stable idempotency identifier.</summary>
/// <param name="command">Typed command and caller-owned stable command identifier.</param>
/// <param name="cancellationToken">Token that cancels the HTTP operation.</param>
/// <returns>The committed receipt or a classified transport/server problem.</returns>
public Task<Result<CommitReceipt>> CommitAsync(CommandRequest command, CancellationToken cancellationToken = default)
{
ArgumentNullException.ThrowIfNull(command) /* KLD0041: BCL null validation accepts the command CommandRequest reference through its object parameter. */;
return Send<CommitReceipt, CommandRequest>(ApiRoutes.Commands, command, true, command.CommandId, cancellationToken);
}
/// <summary>Creates or updates a persisted resource definition.</summary>
/// <param name="commandId">Stable command identifier for the write.</param>
/// <param name="request">Resource schema and authorization policy.</param>
/// <param name="cancellationToken">Token that cancels the HTTP operation.</param>
/// <returns>The resulting resource definition.</returns>
public Task<Result<ResourceDefinition>> ConfigureResourceAsync(Guid commandId, ConfigureResourceRequest request, CancellationToken cancellationToken = default)
=> Send<ResourceDefinition, ConfigureResourceRequest>(ApiRoutes.ResourcesConfigure, request, true, commandId, cancellationToken);
}