tgstation-server 6.12.3
The /tg/station 13 server suite
Loading...
Searching...
No Matches
Public Member Functions | Properties | List of all members
Tgstation.Server.Client.IApiClient Interface Reference

Web interface for the API. More...

Inheritance diagram for Tgstation.Server.Client.IApiClient:
Inheritance graph
[legend]
Collaboration diagram for Tgstation.Server.Client.IApiClient:
Collaboration graph
[legend]

Public Member Functions

void AddRequestLogger (IRequestLogger requestLogger)
 Adds a requestLogger to the request pipeline.
 
ValueTask< IAsyncDisposableCreateHubConnection< THubImplementation > (THubImplementation hubImplementation, IRetryPolicy? retryPolicy, Action< ILoggingBuilder >? loggingConfigureAction, CancellationToken cancellationToken)
 Subscribe to all job updates available to the IRestServerClient.
 
ValueTask< TResult > Create< TBody, TResult > (string route, TBody body, CancellationToken cancellationToken)
 Run an HTTP PUT request.
 
ValueTask< TResult > Create< TResult > (string route, CancellationToken cancellationToken)
 Run an HTTP PUT request.
 
ValueTask< TResult > Read< TResult > (string route, CancellationToken cancellationToken)
 Run an HTTP GET request.
 
ValueTask< TResult > Update< TBody, TResult > (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 Update< TBody > (string route, TBody body, CancellationToken cancellationToken)
 Run an HTTP POST request.
 
ValueTask Patch (string route, CancellationToken cancellationToken)
 Run an HTTP PATCH request.
 
ValueTask Delete (string route, CancellationToken cancellationToken)
 Run an HTTP DELETE request.
 
ValueTask< TResult > Create< TBody, TResult > (string route, TBody body, long instanceId, CancellationToken cancellationToken)
 Run an HTTP PUT request.
 
ValueTask< TResult > Create< TResult > (string route, long instanceId, CancellationToken cancellationToken)
 Run an HTTP PUT request.
 
ValueTask< TResult > Patch< TResult > (string route, long instanceId, CancellationToken cancellationToken)
 Run an HTTP PATCH request.
 
ValueTask< TResult > Read< TResult > (string route, long instanceId, CancellationToken cancellationToken)
 Run an HTTP GET request.
 
ValueTask< TResult > Update< TBody, TResult > (string route, TBody body, long instanceId, CancellationToken cancellationToken)
 Run an HTTP POST request.
 
ValueTask Delete (string route, long instanceId, CancellationToken cancellationToken)
 Run an HTTP DELETE request.
 
ValueTask Delete< TBody > (string route, TBody body, long instanceId, CancellationToken cancellationToken)
 Run an HTTP DELETE 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.
 
- Public Member Functions inherited from Tgstation.Server.Client.ITransferClient
ValueTask< StreamDownload (FileTicketResponse ticket, CancellationToken cancellationToken)
 Downloads a file Stream for a given ticket .
 
ValueTask Upload (FileTicketResponse ticket, Stream? uploadStream, CancellationToken cancellationToken)
 Uploads a given uploadStream for a given ticket .
 

Properties

ApiHeaders Headers [get, set]
 The ApiHeaders the IApiClient uses.
 
Uri Url [get]
 The Uri pointing the tgstation-server.
 
TimeSpan Timeout [get, set]
 The request timeout.
 

Detailed Description

Web interface for the API.

Definition at line 16 of file IApiClient.cs.

Member Function Documentation

◆ AddRequestLogger()

void Tgstation.Server.Client.IApiClient.AddRequestLogger ( IRequestLogger  requestLogger)

Adds a requestLogger to the request pipeline.

Parameters
requestLoggerThe IRequestLogger to add.

Implemented in Tgstation.Server.Client.ApiClient.

Referenced by Tgstation.Server.Client.RestServerClientFactory.GetServerInformation().

Here is the caller graph for this function:

◆ Create< TBody, TResult >() [1/2]

ValueTask< TResult > Tgstation.Server.Client.IApiClient.Create< TBody, TResult > ( string  route,
TBody  body,
CancellationToken  cancellationToken 
)

Run an HTTP PUT request.

Template Parameters
TBodyThe type to of the request body.
TResultThe type of the response body.
Parameters
routeThe server route to make the request to.
bodyThe request body.
cancellationTokenThe CancellationToken for the operation.
Returns
A ValueTask<TResult> resulting in the response body as a TResult .

Implemented in Tgstation.Server.Client.ApiClient.

Type Constraints
TBody :class 

◆ Create< TBody, TResult >() [2/2]

ValueTask< TResult > Tgstation.Server.Client.IApiClient.Create< TBody, TResult > ( string  route,
TBody  body,
long  instanceId,
CancellationToken  cancellationToken 
)

Run an HTTP PUT request.

Template Parameters
TBodyThe type to of the request body.
TResultThe type of the response body.
Parameters
routeThe server route to make the request to.
bodyThe request body.
instanceIdThe instance EntityId.Id to make the request to.
cancellationTokenThe CancellationToken for the operation.
Returns
A ValueTask<TResult> resulting in the response body as a TResult .

Implemented in Tgstation.Server.Client.ApiClient.

Type Constraints
TBody :class 

◆ Create< TResult >() [1/2]

ValueTask< TResult > Tgstation.Server.Client.IApiClient.Create< TResult > ( string  route,
CancellationToken  cancellationToken 
)

Run an HTTP PUT request.

Template Parameters
TResultThe type of the response body.
Parameters
routeThe server route to make the request to.
cancellationTokenThe CancellationToken for the operation.
Returns
A ValueTask<TResult> resulting in the response body as a TResult .

Implemented in Tgstation.Server.Client.ApiClient.

◆ Create< TResult >() [2/2]

ValueTask< TResult > Tgstation.Server.Client.IApiClient.Create< TResult > ( string  route,
long  instanceId,
CancellationToken  cancellationToken 
)

Run an HTTP PUT request.

Template Parameters
TResultThe type of the response body.
Parameters
routeThe server route to make the request to.
instanceIdThe instance EntityId.Id to make the request to.
cancellationTokenThe CancellationToken for the operation.
Returns
A ValueTask<TResult> resulting in the response body as a TResult .

Implemented in Tgstation.Server.Client.ApiClient.

◆ CreateHubConnection< THubImplementation >()

ValueTask< IAsyncDisposable > Tgstation.Server.Client.IApiClient.CreateHubConnection< THubImplementation > ( THubImplementation  hubImplementation,
IRetryPolicy retryPolicy,
Action< ILoggingBuilder >?  loggingConfigureAction,
CancellationToken  cancellationToken 
)

Subscribe to all job updates available to the IRestServerClient.

Template Parameters
THubImplementationThe Type of the hub being implemented.
Parameters
hubImplementationThe THubImplementation to use for proxying the methods of the hub connection.
retryPolicyThe optional IRetryPolicy to use for the backing connection. The default retry policy waits for 1, 2, 4, 8, and 16 seconds, then 30s repeatedly.
loggingConfigureActionThe optional Action<T1> used to configure a ILoggingBuilder.
cancellationTokenThe CancellationToken for the operation.
Returns
An IAsyncDisposable representing the lifetime of the subscription.

Implemented in Tgstation.Server.Client.ApiClient.

Type Constraints
THubImplementation :class 

◆ Delete() [1/2]

ValueTask Tgstation.Server.Client.IApiClient.Delete ( string  route,
CancellationToken  cancellationToken 
)

Run an HTTP DELETE request.

Parameters
routeThe server route to make the request to.
cancellationTokenThe CancellationToken for the operation.
Returns
A ValueTask representing the running operation.

Implemented in Tgstation.Server.Client.ApiClient.

◆ Delete() [2/2]

ValueTask Tgstation.Server.Client.IApiClient.Delete ( string  route,
long  instanceId,
CancellationToken  cancellationToken 
)

Run an HTTP DELETE request.

Parameters
routeThe server route to make the request to.
instanceIdThe instance EntityId.Id to make the request to.
cancellationTokenThe CancellationToken for the operation.
Returns
A ValueTask representing the running operation.

Implemented in Tgstation.Server.Client.ApiClient.

◆ Delete< TBody >()

ValueTask Tgstation.Server.Client.IApiClient.Delete< TBody > ( string  route,
TBody  body,
long  instanceId,
CancellationToken  cancellationToken 
)

Run an HTTP DELETE request.

Template Parameters
TBodyThe type to of the request body.
Parameters
routeThe server route to make the request to.
bodyThe request body.
instanceIdThe instance EntityId.Id to make the request to.
cancellationTokenThe CancellationToken for the operation.
Returns
A ValueTask representing the running operation.

Implemented in Tgstation.Server.Client.ApiClient.

Type Constraints
TBody :class 

◆ Delete< TBody, TResult >()

ValueTask< TResult > Tgstation.Server.Client.IApiClient.Delete< TBody, TResult > ( string  route,
TBody  body,
long  instanceId,
CancellationToken  cancellationToken 
)

Run an HTTP DELETE request.

Template Parameters
TBodyThe type to of the request body.
TResultThe type of the response body.
Parameters
routeThe server route to make the request to.
bodyThe request body.
instanceIdThe instance EntityId.Id to make the request to.
cancellationTokenThe CancellationToken for the operation.
Returns
A ValueTask representing the running operation.

Implemented in Tgstation.Server.Client.ApiClient.

Type Constraints
TBody :class 

◆ Delete< TResult >()

ValueTask< TResult > Tgstation.Server.Client.IApiClient.Delete< TResult > ( string  route,
long  instanceId,
CancellationToken  cancellationToken 
)

Run an HTTP DELETE request.

Template Parameters
TResultThe type of the response body.
Parameters
routeThe server route to make the request to.
instanceIdThe instance EntityId.Id to make the request to.
cancellationTokenThe CancellationToken for the operation.
Returns
A ValueTask<TResult> resulting in the response body as a TResult .

Implemented in Tgstation.Server.Client.ApiClient.

◆ Patch()

ValueTask Tgstation.Server.Client.IApiClient.Patch ( string  route,
CancellationToken  cancellationToken 
)

Run an HTTP PATCH request.

Parameters
routeThe server route to make the request to.
cancellationTokenThe CancellationToken for the operation.
Returns
A ValueTask representing the running operation.

Implemented in Tgstation.Server.Client.ApiClient.

◆ Patch< TResult >()

ValueTask< TResult > Tgstation.Server.Client.IApiClient.Patch< TResult > ( string  route,
long  instanceId,
CancellationToken  cancellationToken 
)

Run an HTTP PATCH request.

Template Parameters
TResultThe type of the response body.
Parameters
routeThe server route to make the request to.
instanceIdThe instance EntityId.Id to make the request to.
cancellationTokenThe CancellationToken for the operation.
Returns
A ValueTask<TResult> resulting in the response body as a TResult .

Implemented in Tgstation.Server.Client.ApiClient.

◆ Read< TResult >() [1/2]

ValueTask< TResult > Tgstation.Server.Client.IApiClient.Read< TResult > ( string  route,
CancellationToken  cancellationToken 
)

Run an HTTP GET request.

Template Parameters
TResultThe type of the response body.
Parameters
routeThe server route to make the request to.
cancellationTokenThe CancellationToken for the operation.
Returns
A ValueTask<TResult> resulting in the response body as a TResult .

Implemented in Tgstation.Server.Client.ApiClient.

◆ Read< TResult >() [2/2]

ValueTask< TResult > Tgstation.Server.Client.IApiClient.Read< TResult > ( string  route,
long  instanceId,
CancellationToken  cancellationToken 
)

Run an HTTP GET request.

Template Parameters
TResultThe type of the response body.
Parameters
routeThe server route to make the request to.
instanceIdThe instance EntityId.Id to make the request to.
cancellationTokenThe CancellationToken for the operation.
Returns
A ValueTask<TResult> resulting in the response body as a TResult .

Implemented in Tgstation.Server.Client.ApiClient.

◆ Update< TBody >()

ValueTask Tgstation.Server.Client.IApiClient.Update< TBody > ( string  route,
TBody  body,
CancellationToken  cancellationToken 
)

Run an HTTP POST request.

Template Parameters
TBodyThe type to of the request body.
Parameters
routeThe server route to make the request to.
bodyThe request body.
cancellationTokenThe CancellationToken for the operation.
Returns
A ValueTask representing the running operation.

Implemented in Tgstation.Server.Client.ApiClient.

Type Constraints
TBody :class 

◆ Update< TBody, TResult >() [1/2]

ValueTask< TResult > Tgstation.Server.Client.IApiClient.Update< TBody, TResult > ( string  route,
TBody  body,
CancellationToken  cancellationToken 
)

Run an HTTP POST request.

Template Parameters
TBodyThe type to of the request body.
TResultThe type of the response body.
Parameters
routeThe server route to make the request to.
bodyThe request body.
cancellationTokenThe CancellationToken for the operation.
Returns
A ValueTask<TResult> resulting in the response body as a TResult .

Implemented in Tgstation.Server.Client.ApiClient.

Type Constraints
TBody :class 

◆ Update< TBody, TResult >() [2/2]

ValueTask< TResult > Tgstation.Server.Client.IApiClient.Update< TBody, TResult > ( string  route,
TBody  body,
long  instanceId,
CancellationToken  cancellationToken 
)

Run an HTTP POST request.

Template Parameters
TBodyThe type to of the request body.
TResultThe type of the response body.
Parameters
routeThe server route to make the request to.
bodyThe request body.
instanceIdThe instance EntityId.Id to make the request to.
cancellationTokenThe CancellationToken for the operation.
Returns
A ValueTask<TResult> resulting in the response body as a TResult .

Implemented in Tgstation.Server.Client.ApiClient.

Type Constraints
TBody :class 

◆ Update< TResult >()

ValueTask< TResult > Tgstation.Server.Client.IApiClient.Update< TResult > ( string  route,
CancellationToken  cancellationToken 
)

Run an HTTP POST request.

Template Parameters
TResultThe type of the response body.
Parameters
routeThe server route to make the request to.
cancellationTokenThe CancellationToken for the operation.
Returns
A ValueTask<TResult> resulting in the response body as a TResult .

Implemented in Tgstation.Server.Client.ApiClient.

Property Documentation

◆ Headers

ApiHeaders Tgstation.Server.Client.IApiClient.Headers
getset

The ApiHeaders the IApiClient uses.

Implemented in Tgstation.Server.Client.ApiClient.

Definition at line 21 of file IApiClient.cs.

21{ get; set; }

◆ Timeout

TimeSpan Tgstation.Server.Client.IApiClient.Timeout
getset

The request timeout.

Implemented in Tgstation.Server.Client.ApiClient.

Definition at line 31 of file IApiClient.cs.

31{ get; set; }

◆ Url

Uri Tgstation.Server.Client.IApiClient.Url
get

The Uri pointing the tgstation-server.

Implemented in Tgstation.Server.Client.ApiClient.

Definition at line 26 of file IApiClient.cs.

26{ get; }

The documentation for this interface was generated from the following file: