tgstation-server 6.12.3
The /tg/station 13 server suite
Loading...
Searching...
No Matches
IApiClient.cs
Go to the documentation of this file.
1using System;
2using System.Threading;
3using System.Threading.Tasks;
4
5using Microsoft.AspNetCore.SignalR.Client;
6using Microsoft.Extensions.Logging;
7
10
12{
17 {
21 ApiHeaders Headers { get; set; }
22
26 Uri Url { get; }
27
31 TimeSpan Timeout { get; set; }
32
37 void AddRequestLogger(IRequestLogger requestLogger);
38
48 ValueTask<IAsyncDisposable> CreateHubConnection<THubImplementation>(
49 THubImplementation hubImplementation,
50 IRetryPolicy? retryPolicy,
51 Action<ILoggingBuilder>? loggingConfigureAction,
52 CancellationToken cancellationToken)
53 where THubImplementation : class;
54
64 ValueTask<TResult> Create<TBody, TResult>(string route, TBody body, CancellationToken cancellationToken)
65 where TBody : class;
66
74 ValueTask<TResult> Create<TResult>(string route, CancellationToken cancellationToken);
75
83 ValueTask<TResult> Read<TResult>(string route, CancellationToken cancellationToken);
84
94 ValueTask<TResult> Update<TBody, TResult>(string route, TBody body, CancellationToken cancellationToken)
95 where TBody : class;
96
104 ValueTask<TResult> Update<TResult>(string route, CancellationToken cancellationToken);
105
114 ValueTask Update<TBody>(string route, TBody body, CancellationToken cancellationToken)
115 where TBody : class;
116
123 ValueTask Patch(string route, CancellationToken cancellationToken);
124
131 ValueTask Delete(string route, CancellationToken cancellationToken);
132
143 ValueTask<TResult> Create<TBody, TResult>(
144 string route,
145 TBody body,
146 long instanceId,
147 CancellationToken cancellationToken)
148 where TBody : class;
149
158 ValueTask<TResult> Create<TResult>(string route, long instanceId, CancellationToken cancellationToken);
159
168 ValueTask<TResult> Patch<TResult>(string route, long instanceId, CancellationToken cancellationToken);
169
178 ValueTask<TResult> Read<TResult>(string route, long instanceId, CancellationToken cancellationToken);
179
190 ValueTask<TResult> Update<TBody, TResult>(
191 string route,
192 TBody body,
193 long instanceId,
194 CancellationToken cancellationToken)
195 where TBody : class;
196
204 ValueTask Delete(string route, long instanceId, CancellationToken cancellationToken);
205
215 ValueTask Delete<TBody>(string route, TBody body, long instanceId, CancellationToken cancellationToken)
216 where TBody : class;
217
226 ValueTask<TResult> Delete<TResult>(string route, long instanceId, CancellationToken cancellationToken);
227
238 ValueTask<TResult> Delete<TBody, TResult>(string route, TBody body, long instanceId, CancellationToken cancellationToken)
239 where TBody : class;
240 }
241}
Represents the header that must be present for every server request.
Definition ApiHeaders.cs:25
Web interface for the API.
Definition IApiClient.cs:17
ValueTask< TResult > Create< TBody, TResult >(string route, TBody body, CancellationToken cancellationToken)
Run an HTTP PUT request.
Uri Url
The Uri pointing the tgstation-server.
Definition IApiClient.cs:26
ValueTask< IAsyncDisposable > CreateHubConnection< THubImplementation >(THubImplementation hubImplementation, IRetryPolicy? retryPolicy, Action< ILoggingBuilder >? loggingConfigureAction, CancellationToken cancellationToken)
Subscribe to all job updates available to the IRestServerClient.
ValueTask Update< TBody >(string route, TBody body, CancellationToken cancellationToken)
Run an HTTP POST request.
ValueTask< TResult > Update< TResult >(string route, CancellationToken cancellationToken)
Run an HTTP POST request.
ValueTask Patch(string route, CancellationToken cancellationToken)
Run an HTTP PATCH request.
ValueTask< TResult > Create< TResult >(string route, CancellationToken cancellationToken)
Run an HTTP PUT request.
void AddRequestLogger(IRequestLogger requestLogger)
Adds a requestLogger to the request pipeline.
ValueTask Delete(string route, CancellationToken cancellationToken)
Run an HTTP DELETE request.
ValueTask< TResult > Patch< TResult >(string route, long instanceId, CancellationToken cancellationToken)
Run an HTTP PATCH request.
ValueTask< TResult > Delete< TResult >(string route, long instanceId, CancellationToken cancellationToken)
Run an HTTP DELETE request.
ValueTask< TResult > Delete< TBody, TResult >(string route, TBody body, long instanceId, CancellationToken cancellationToken)
Run an HTTP DELETE request.
ValueTask< TResult > Read< TResult >(string route, CancellationToken cancellationToken)
Run an HTTP GET request.
TimeSpan Timeout
The request timeout.
Definition IApiClient.cs:31
ValueTask Delete< TBody >(string route, TBody body, long instanceId, CancellationToken cancellationToken)
Run an HTTP DELETE request.
ValueTask Delete(string route, long instanceId, CancellationToken cancellationToken)
Run an HTTP DELETE request.
ValueTask< TResult > Update< TBody, TResult >(string route, TBody body, CancellationToken cancellationToken)
Run an HTTP POST request.
ApiHeaders Headers
The ApiHeaders the IApiClient uses.
Definition IApiClient.cs:21
For logging HTTP requests and responses.
For transferring data Streams.