Show / Hide Table of Contents

    Class CommandResponse

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

    Inheritance
    System.Object
    CommandResponse
    ErroredCommandResponse
    Namespace: Petabridge.Cmd
    Assembly: cs.temp.dll.dll
    Syntax
    public class CommandResponse : INoSerializationVerificationNeeded

    Constructors

    CommandResponse(String, Boolean, 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
    System.String msg

    The message from the server.

    System.Boolean final

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

    IReadOnlyDictionary<System.String, System.String[]> structuredData

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

    CommandResponse(String, Int64, Boolean, 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
    System.String msg

    The message from the server.

    System.Int64 sessionId

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

    System.Boolean final

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

    IReadOnlyDictionary<System.String, System.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<System.String, System.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
    System.Boolean

    IsError

    Indicates that this is an error message

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

    Msg

    The raw message that will be printed back onto the console

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

    SessionId

    The id of the client session correlated with this response.

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

    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<System.String, System.String[]>

    Methods

    Equals(CommandResponse)

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

    Equals(Object)

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    System.Object obj
    Returns
    Type Description
    System.Boolean

    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>, Int64)

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

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    System.Int32

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    System.String

    WithSessionId(Int64)

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

    Declaration
    public virtual CommandResponse WithSessionId(long sessionId)
    Parameters
    Type Name Description
    System.Int64 sessionId
    Returns
    Type Description
    CommandResponse
    Back to top Generated by DocFX