Class TerminalInputOutput
Represents the terminal IO class that is sent to the terminal server as an ordered collection of TerminalRequest.
public sealed class TerminalInputOutput
- Inheritance
-
TerminalInputOutput
- Inherited Members
Remarks
The requests in the TerminalInputOutput are executed by the router in the order they are added.
Constructors
TerminalInputOutput()
THIS METHOD IS RESERVED FOR OUR INTERNAL INFRASTRUCTURE USE ONLY. DO NOT USE IT IN YOUR APPLICATION. To create a new instance of TerminalInputOutput, use the Single(string, string, string?, string?) or Batch(string, TerminalRequest[], string?, string?) method.
public TerminalInputOutput()
- See Also
Properties
BatchId
The batch identifier.
[JsonPropertyName("batch_id")]
[JsonInclude]
public string? BatchId { get; }
Property Value
Count
Gets the number of requests.
[JsonIgnore]
public int Count { get; }
Property Value
IsBatch
Gets a value indicating whether the input is a batch.
[JsonIgnore]
public bool IsBatch { get; }
Property Value
this[int]
Gets or sets the TerminalRequest at the specified index.
public TerminalRequest this[int index] { get; set; }
Parameters
indexintThe index.
Property Value
Requests
The requests in the input.
[JsonPropertyName("requests")]
[JsonInclude]
public TerminalRequest[] Requests { get; }
Property Value
SenderEndpoint
The sender endpoint if known. This is typically set automatically by the router.
[JsonPropertyName("sender_endpoint")]
public string? SenderEndpoint { get; set; }
Property Value
SenderId
The sender identifier if known. This is typically set automatically by the router.
[JsonPropertyName("sender_id")]
public string? SenderId { get; set; }
Property Value
Methods
Batch(string, TerminalRequest[], string?, string?)
Creates a new TerminalInputOutput for a batch of requests.
public static TerminalInputOutput Batch(string batchId, TerminalRequest[] requests, string? senderId = null, string? senderEndpoint = null)
Parameters
batchIdstringThe batch identifier.
requestsTerminalRequest[]The array of TerminalRequest objects.
senderIdstringThe sender id.
senderEndpointstringThe sender endpoint.
Returns
- TerminalInputOutput
A new TerminalInputOutput instance.
Exceptions
- ArgumentException
Thrown if the number of requests is zero.
Batch(string, string[], string[], string?, string?)
Creates a new TerminalInputOutput for a batch of commands.
public static TerminalInputOutput Batch(string batchId, string[] ids, string[] raws, string? senderId = null, string? senderEndpoint = null)
Parameters
batchIdstringThe batch identifier.
idsstring[]The command identifiers.
rawsstring[]The raw commands.
senderIdstringThe sender id.
senderEndpointstringThe sender endpoint.
Returns
- TerminalInputOutput
A new TerminalInputOutput instance.
Exceptions
- ArgumentException
Thrown if the number of IDs does not match the number of raw commands.
GetDeserializedResult<T>(int)
Retrieves a result at a given index, converting it to the specified type if necessary.
public T GetDeserializedResult<T>(int index)
Parameters
indexint
Returns
- T
Type Parameters
T
Single(string, string, string?, string?)
Creates a new TerminalInputOutput for a single command.
public static TerminalInputOutput Single(string id, string raw, string? senderId = null, string? senderEndpoint = null)
Parameters
idstringThe command identifier.
rawstringThe raw command.
senderIdstringThe sender id.
senderEndpointstringThe sender endpoint.
Returns
- TerminalInputOutput
A new TerminalInputOutput instance.