Table of Contents

Class TerminalInputOutput

Namespace
OneImlx.Terminal.Shared
Assembly
OneImlx.Terminal.Shared.dll

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

string

Count

Gets the number of requests.

[JsonIgnore]
public int Count { get; }

Property Value

int

IsBatch

Gets a value indicating whether the input is a batch.

[JsonIgnore]
public bool IsBatch { get; }

Property Value

bool

this[int]

Gets or sets the TerminalRequest at the specified index.

public TerminalRequest this[int index] { get; set; }

Parameters

index int

The index.

Property Value

TerminalRequest

Requests

The requests in the input.

[JsonPropertyName("requests")]
[JsonInclude]
public TerminalRequest[] Requests { get; }

Property Value

TerminalRequest[]

SenderEndpoint

The sender endpoint if known. This is typically set automatically by the router.

[JsonPropertyName("sender_endpoint")]
public string? SenderEndpoint { get; set; }

Property Value

string

SenderId

The sender identifier if known. This is typically set automatically by the router.

[JsonPropertyName("sender_id")]
public string? SenderId { get; set; }

Property Value

string

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

batchId string

The batch identifier.

requests TerminalRequest[]

The array of TerminalRequest objects.

senderId string

The sender id.

senderEndpoint string

The 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

batchId string

The batch identifier.

ids string[]

The command identifiers.

raws string[]

The raw commands.

senderId string

The sender id.

senderEndpoint string

The 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

index int

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

id string

The command identifier.

raw string

The raw command.

senderId string

The sender id.

senderEndpoint string

The sender endpoint.

Returns

TerminalInputOutput

A new TerminalInputOutput instance.