tgstation-server 6.12.0
The /tg/station 13 server suite
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | List of all members
Tgstation.Server.Client.InstanceManagerClient Class Referencesealed

More...

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

Public Member Functions

 InstanceManagerClient (IApiClient apiClient)
 Initializes a new instance of the InstanceManagerClient class.
 
ValueTask< InstanceResponseCreateOrAttach (InstanceCreateRequest instance, CancellationToken cancellationToken)
 Create or attach an instance .
Parameters
instanceThe InstanceCreateRequest.
cancellationTokenThe CancellationToken for the operation.
Returns
A ValueTask<TResult> resulting in the created or attached Instance.

 
ValueTask Detach (EntityId instance, CancellationToken cancellationToken)
 Deletes an instance .
Parameters
instanceThe EntityId of the Instance to delete.
cancellationTokenThe CancellationToken for the operation.
Returns
A ValueTask representing the running operation.

 
ValueTask< List< InstanceResponse > > List (PaginationSettings? paginationSettings, CancellationToken cancellationToken)
 Get all IInstanceClients for Instances the user can view.
Parameters
paginationSettingsThe optional PaginationSettings for the operation.
cancellationTokenThe CancellationToken for the operation.
Returns
A ValueTask<TResult> resulting in a List<T> of all Instances the user can view.

 
ValueTask< InstanceResponseUpdate (InstanceUpdateRequest instance, CancellationToken cancellationToken)
 Relocates, renamed, and/or on/offlines an instance .
Parameters
instanceThe InstanceUpdateRequest.
cancellationTokenThe CancellationToken for the operation.
Returns
A ValueTask<TResult> resulting in the updated Instance.

 
ValueTask< InstanceResponseGetId (EntityId instance, CancellationToken cancellationToken)
 Get a specific instance .
Parameters
instanceThe Instance to get.
cancellationTokenThe CancellationToken for the operation.
Returns
A ValueTask<TResult> resulting in the Instance.

 
ValueTask GrantPermissions (EntityId instance, CancellationToken cancellationToken)
 Gives the user full permissions on an instance .
Parameters
instanceThe EntityId of the Instance to grant permissions on.
cancellationTokenThe CancellationToken for the operation.
Returns
A ValueTask representing the running operation.

 
IInstanceClient CreateClient (Instance instance)
 Create an IInstanceClient for a given Instance.
Parameters
instanceThe EntityId of the Instance to create an IInstanceClient for.
Returns
A new IInstanceClient.

 
- Public Member Functions inherited from Tgstation.Server.Client.PaginatedClient
 PaginatedClient (IApiClient apiClient)
 Initializes a new instance of the PaginatedClient class.
 

Private Member Functions

ValueTask< InstanceResponseInstanceResponse (Routes.InstanceManager, instance ?? throw new ArgumentNullException(nameof(instance)), cancellationToken)
 
ValueTask< InstanceResponseInstanceResponse (Routes.InstanceManager, instance ?? throw new ArgumentNullException(nameof(instance)), cancellationToken)
 

Additional Inherited Members

- Protected Member Functions inherited from Tgstation.Server.Client.PaginatedClient
async ValueTask< List< TModel > > ReadPaged< TModel > (PaginationSettings? paginationSettings, string route, long? instanceId, CancellationToken cancellationToken)
 Reads a given route with paged results.
 
- Properties inherited from Tgstation.Server.Client.PaginatedClient
IApiClient ApiClient [get]
 The IApiClient for the PaginatedClient.
 

Detailed Description

Definition at line 15 of file InstanceManagerClient.cs.

Constructor & Destructor Documentation

◆ InstanceManagerClient()

Tgstation.Server.Client.InstanceManagerClient.InstanceManagerClient ( IApiClient  apiClient)

Initializes a new instance of the InstanceManagerClient class.

Parameters
apiClientThe IApiClient for the PaginatedClient.

Definition at line 21 of file InstanceManagerClient.cs.

22 : base(apiClient)
23 {
24 }
ValueTask< List< InstanceResponse > > List(PaginationSettings? paginationSettings, CancellationToken cancellationToken)
Get all IInstanceClients for Instances the user can view.A ValueTask<TResult> resulting in a List<T> ...

Member Function Documentation

◆ CreateClient()

IInstanceClient Tgstation.Server.Client.InstanceManagerClient.CreateClient ( Instance  instance)

Create an IInstanceClient for a given Instance.

Parameters
instanceThe EntityId of the Instance to create an IInstanceClient for.
Returns
A new IInstanceClient.

Implements Tgstation.Server.Client.IInstanceManagerClient.

Definition at line 46 of file InstanceManagerClient.cs.

47 {
48 if (instance == null)
49 throw new ArgumentNullException(nameof(instance));
50
51 if (!instance.Id.HasValue)
52 throw new ArgumentException("Instance missing Id!", nameof(instance));
53
54 return new InstanceClient(
56 instance);
57 }
virtual ? long Id
The ID of the entity.
Definition EntityId.cs:13
IApiClient ApiClient
The IApiClient for the PaginatedClient.

References Tgstation.Server.Api.Models.EntityId.Id, and Tgstation.Server.Client.InstanceManagerClient.List().

Here is the call graph for this function:

◆ CreateOrAttach()

ValueTask< InstanceResponse > Tgstation.Server.Client.InstanceManagerClient.CreateOrAttach ( InstanceCreateRequest  instance,
CancellationToken  cancellationToken 
)

Create or attach an instance .

Parameters
instanceThe InstanceCreateRequest.
cancellationTokenThe CancellationToken for the operation.
Returns
A ValueTask<TResult> resulting in the created or attached Instance.

Implements Tgstation.Server.Client.IInstanceManagerClient.

◆ Detach()

ValueTask Tgstation.Server.Client.InstanceManagerClient.Detach ( EntityId  instance,
CancellationToken  cancellationToken 
)

Deletes an instance .

Parameters
instanceThe EntityId of the Instance to delete.
cancellationTokenThe CancellationToken for the operation.
Returns
A ValueTask representing the running operation.

Implements Tgstation.Server.Client.IInstanceManagerClient.

◆ GetId()

ValueTask< InstanceResponse > Tgstation.Server.Client.InstanceManagerClient.GetId ( EntityId  instance,
CancellationToken  cancellationToken 
)

Get a specific instance .

Parameters
instanceThe Instance to get.
cancellationTokenThe CancellationToken for the operation.
Returns
A ValueTask<TResult> resulting in the Instance.

Implements Tgstation.Server.Client.IInstanceManagerClient.

◆ GrantPermissions()

ValueTask Tgstation.Server.Client.InstanceManagerClient.GrantPermissions ( EntityId  instance,
CancellationToken  cancellationToken 
)

Gives the user full permissions on an instance .

Parameters
instanceThe EntityId of the Instance to grant permissions on.
cancellationTokenThe CancellationToken for the operation.
Returns
A ValueTask representing the running operation.

Implements Tgstation.Server.Client.IInstanceManagerClient.

◆ InstanceResponse() [1/2]

ValueTask< InstanceResponse > Tgstation.Server.Client.InstanceManagerClient.InstanceResponse ( Routes.  InstanceManager,
instance ?? throw new   ArgumentNullExceptionnameof(instance),
cancellationToken   
)
private

◆ InstanceResponse() [2/2]

ValueTask< InstanceResponse > Tgstation.Server.Client.InstanceManagerClient.InstanceResponse ( Routes.  InstanceManager,
instance ?? throw new   ArgumentNullExceptionnameof(instance),
cancellationToken   
)
private

◆ List()

ValueTask< List< InstanceResponse > > Tgstation.Server.Client.InstanceManagerClient.List ( PaginationSettings paginationSettings,
CancellationToken  cancellationToken 
)

Get all IInstanceClients for Instances the user can view.

Parameters
paginationSettingsThe optional PaginationSettings for the operation.
cancellationTokenThe CancellationToken for the operation.
Returns
A ValueTask<TResult> resulting in a List<T> of all Instances the user can view.

Implements Tgstation.Server.Client.IInstanceManagerClient.

Referenced by Tgstation.Server.Client.InstanceManagerClient.CreateClient().

Here is the caller graph for this function:

◆ Update()

ValueTask< InstanceResponse > Tgstation.Server.Client.InstanceManagerClient.Update ( InstanceUpdateRequest  instance,
CancellationToken  cancellationToken 
)

Relocates, renamed, and/or on/offlines an instance .

Parameters
instanceThe InstanceUpdateRequest.
cancellationTokenThe CancellationToken for the operation.
Returns
A ValueTask<TResult> resulting in the updated Instance.

Implements Tgstation.Server.Client.IInstanceManagerClient.


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