Skip to content

DataResponse ​

A response to a DataRequest block.

Kind: Class

Namespace: CrowdControl.Common

Inheritance: ResponseBlock → IEquatable\<CrowdControlBlock\>

Public Constructors

DataResponse(string key, EffectStatus status, object value = null, SITimeSpan? timeRemaining = null, string message = "", Enum messageID = null, ErrorSource? errorSource = null, bool? abnormal = null)

Creates a new instance of the CrowdControl.Common.DataResponse class.

DataResponse(DataRequest request, EffectStatus status, object value = null, SITimeSpan? timeRemaining = null, string message = "", Enum messageID = null, ErrorSource? errorSource = null, bool? abnormal = null)

Creates a new instance of the CrowdControl.Common.DataResponse class.

Public Static Functions

DataResponse

SuccessIfDefined(string key, object value, string failMessage = "")

Creates a success response if the value is defined (not null or empty).

DataResponse

Success(string key, object value)

Creates a success response with the specified key and value.

DataResponse

Success<TValue>(string key, ReadOnlySpan value)

Creates a success response with the specified key and value.

DataResponse

FailTemporary(string key, string message = "")

Creates a failure response with the specified key and message.

DataResponse

FailPermanent(string key, string message = "")

Creates a failure response with the specified key and message.

DataResponse

DelayEstimated(string key, SITimeSpan delay = null, string message = "")

Creates a delay estimated response with the specified key and message.

Public Attributes

string

Key

The key corresponding to the requested value.

JToken

Value

The value returned by the client.

EffectStatus

Status

The status of the request.

SITimeSpan?

TimeRemaining

The due time of the request, if applicable.