Show / Hide Table of Contents

Class CommandResponse

Message sent in response to a Command by an petabridge.cmd host.

Inheritance
object
CommandResponse
ErroredCommandResponse
Implements
INoSerializationVerificationNeeded
Inherited Members
object.Equals(object, object)
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
Namespace: Petabridge.Cmd
Assembly: Petabridge.Cmd.Common.dll
Syntax
public class CommandResponse : INoSerializationVerificationNeeded

Constructors

CommandResponse(string, bool, IReadOnlyDictionary<string, string[]>)

Creates a new command response object.

Declaration
public CommandResponse(string msg, bool final = true, IReadOnlyDictionary<string, string[]> structuredData = null)
Parameters
Type Name Description
string msg

The message from the server.

bool final

If true, indicates that the server is done sending responses for this particular request.

IReadOnlyDictionary<string, string[]> structuredData

Semantic data that can be used by the client for other types of rich response formatting.

CommandResponse(string, long, bool, IReadOnlyDictionary<string, string[]>)

Creates a new command response object.

Declaration
public CommandResponse(string msg, long sessionId, bool final = true, IReadOnlyDictionary<string, string[]> structuredData = null)
Parameters
Type Name Description
string msg

The message from the server.

long sessionId

The id of the client session this request is correlated to.

bool final

If true, indicates that the server is done sending responses for this particular request.

IReadOnlyDictionary<string, string[]> structuredData

Semantic data that can be used by the client for other types of rich response formatting.

Fields

Empty

Special case. Used to terminate a response stream.

Declaration
public static readonly CommandResponse Empty
Field Value
Type Description
CommandResponse

EmptyStructuredData

A default, empty value for structured data.

Declaration
public static readonly Dictionary<string, string[]> EmptyStructuredData
Field Value
Type Description
Dictionary<string, string[]>

Properties

CommandType

Defines the schema used for the formatting of this command

Declaration
public CommandType CommandType { get; }
Property Value
Type Description
CommandType

Final

For streaming responses, indicates that this is the final message in the stream

Declaration
public bool Final { get; }
Property Value
Type Description
bool

IsError

Indicates that this is an error message

Declaration
public virtual bool IsError { get; }
Property Value
Type Description
bool

Msg

The raw message that will be printed back onto the console

Declaration
public string Msg { get; }
Property Value
Type Description
string

SessionId

The id of the client session correlated with this response.

Declaration
public long SessionId { get; }
Property Value
Type Description
long

StructuredData

Optional. A string dictionary containing structured data that can be formatted and used by clients in more semantically-friendly ways.

Declaration
public IReadOnlyDictionary<string, string[]> StructuredData { get; }
Property Value
Type Description
IReadOnlyDictionary<string, string[]>

Methods

Equals(CommandResponse)

Declaration
protected bool Equals(CommandResponse other)
Parameters
Type Name Description
CommandResponse other
Returns
Type Description
bool

Equals(object)

Declaration
public override bool Equals(object obj)
Parameters
Type Name Description
object obj
Returns
Type Description
bool
Overrides
object.Equals(object)

FromValidationErrors(IEnumerable<ValidationError>)

Declaration
public static CommandResponse FromValidationErrors(IEnumerable<ValidationError> errors)
Parameters
Type Name Description
IEnumerable<ValidationError> errors
Returns
Type Description
CommandResponse

FromValidationErrors(IEnumerable<ValidationError>, long)

Declaration
public static CommandResponse FromValidationErrors(IEnumerable<ValidationError> errors, long sessionId)
Parameters
Type Name Description
IEnumerable<ValidationError> errors
long sessionId
Returns
Type Description
CommandResponse

GetHashCode()

Declaration
public override int GetHashCode()
Returns
Type Description
int
Overrides
object.GetHashCode()

ToString()

Declaration
public override string ToString()
Returns
Type Description
string
Overrides
object.ToString()

WithSessionId(long)

Creates a new copy of this CommandResponse with a new SessionId.

Declaration
public virtual CommandResponse WithSessionId(long sessionId)
Parameters
Type Name Description
long sessionId
Returns
Type Description
CommandResponse

Implements

INoSerializationVerificationNeeded
In this article
Back to top Generated by DocFX