tgstation-server 6.12.3
The /tg/station 13 server suite
Loading...
Searching...
No Matches
IRestServerClientFactory.cs
Go to the documentation of this file.
1using System;
2using System.Collections.Generic;
3using System.Threading;
4using System.Threading.Tasks;
5
8
10{
14 public interface IRestServerClientFactory
15 {
24 ValueTask<ServerInformationResponse> GetServerInformation(
25 Uri host,
26 IEnumerable<IRequestLogger>? requestLoggers = null,
27 TimeSpan? timeout = null,
28 CancellationToken cancellationToken = default);
29
41 ValueTask<IRestServerClient> CreateFromLogin(
42 Uri host,
43 string username,
44 string password,
45 IEnumerable<IRequestLogger>? requestLoggers = null,
46 TimeSpan? timeout = null,
47 bool attemptLoginRefresh = true,
48 CancellationToken cancellationToken = default);
49
60 ValueTask<IRestServerClient> CreateFromOAuth(
61 Uri host,
62 string oAuthCode,
63 OAuthProvider oAuthProvider,
64 IEnumerable<IRequestLogger>? requestLoggers = null,
65 TimeSpan? timeout = null,
66 CancellationToken cancellationToken = default);
67
75 Uri host,
76 TokenResponse token);
77 }
78}
Represents a JWT returned by the API.
ValueTask< IRestServerClient > CreateFromOAuth(Uri host, string oAuthCode, OAuthProvider oAuthProvider, IEnumerable< IRequestLogger >? requestLoggers=null, TimeSpan? timeout=null, CancellationToken cancellationToken=default)
Create a IRestServerClient using an OAuth login.
ValueTask< IRestServerClient > CreateFromLogin(Uri host, string username, string password, IEnumerable< IRequestLogger >? requestLoggers=null, TimeSpan? timeout=null, bool attemptLoginRefresh=true, CancellationToken cancellationToken=default)
Create a IRestServerClient using a password login.
IRestServerClient CreateFromToken(Uri host, TokenResponse token)
Create a IRestServerClient.
ValueTask< ServerInformationResponse > GetServerInformation(Uri host, IEnumerable< IRequestLogger >? requestLoggers=null, TimeSpan? timeout=null, CancellationToken cancellationToken=default)
Gets the ServerInformationResponse for a given host .
Main client for communicating with a server.
OAuthProvider
List of OAuth providers supported by TGS.