Class ProfileResponse
Abstracts Neon Profile Service named pipe command responses.
Implements
Namespace: Neon.Deployment
Assembly: Neon.Deployment.dll
Syntax
public class ProfileResponse : IProfileResponse
Properties
Error
Returns the error message for failed requests.
Declaration
public string Error { get; }
Property Value
Type | Description |
---|---|
string |
JObject
Returns the JObject for JSON responses.
Declaration
public JObject JObject { get; }
Property Value
Type | Description |
---|---|
JObject |
Status
One of the ProfileStatus values. This defaults to OK.
Declaration
public string Status { get; }
Property Value
Type | Description |
---|---|
string |
Success
Returns true
for successful requests, false
for failed ones.
Declaration
public bool Success { get; }
Property Value
Type | Description |
---|---|
bool |
Value
Returns the simply response string (for non-JSON responses).
Declaration
public string Value { get; }
Property Value
Type | Description |
---|---|
string |
Methods
Create(JObject)
Creates a successful command response with with a JSON value.
Declaration
public static ProfileResponse Create(JObject jObject)
Parameters
Type | Name | Description |
---|---|---|
JObject | jObject | The JSON value. |
Returns
Type | Description |
---|---|
ProfileResponse | The ProfileResponse. |
Create(string)
Creates a successful command response with with a simple string value.
Declaration
public static ProfileResponse Create(string value)
Parameters
Type | Name | Description |
---|---|---|
string | value | The optional command arguments. |
Returns
Type | Description |
---|---|
ProfileResponse | The ProfileResponse. |
CreateError(string, string)
Creates a failed command response with an error message.
Declaration
public static ProfileResponse CreateError(string status, string message)
Parameters
Type | Name | Description |
---|---|---|
string | status | The status code (one of the ProfileStatus values). |
string | message | The error message. |
Returns
Type | Description |
---|---|
ProfileResponse | The ProfileResponse. |
Parse(string)
Parses a request from a line of text read from the named pipe.
Declaration
public static ProfileResponse Parse(string responseLine)
Parameters
Type | Name | Description |
---|---|---|
string | responseLine | The response line. |
Returns
Type | Description |
---|---|
ProfileResponse | The ProfileResponse. |
Exceptions
Type | Condition |
---|---|
FormatException | Thrown for invalid response lines. |
ToString()
Returns a string that represents the current object.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | A string that represents the current object. |