tgstation-server 6.12.0
The /tg/station 13 server suite
Loading...
Searching...
No Matches
AuthorityResponse.cs
Go to the documentation of this file.
1using System;
2using System.Diagnostics.CodeAnalysis;
3
5
7{
11 public class AuthorityResponse
12 {
16 [MemberNotNullWhen(false, nameof(ErrorMessage))]
17 [MemberNotNullWhen(false, nameof(FailureResponse))]
18 public virtual bool Success => ErrorMessage == null;
19
24
29
34 {
35 }
36
42 public AuthorityResponse(ErrorMessageResponse errorMessage, HttpFailureResponse failureResponse)
43 {
44 ErrorMessage = errorMessage ?? throw new ArgumentNullException(nameof(errorMessage));
45 FailureResponse = failureResponse;
46 }
47 }
48}
Represents an error message returned by the server.
virtual bool Success
Checks if the AuthorityResponse was successful.
ErrorMessageResponse? ErrorMessage
Gets the associated ErrorMessageResponse. Must only be used if Success is false.
HttpFailureResponse? FailureResponse
The HttpFailureResponse.
AuthorityResponse(ErrorMessageResponse errorMessage, HttpFailureResponse failureResponse)
Initializes a new instance of the AuthorityResponse class.
AuthorityResponse()
Initializes a new instance of the AuthorityResponse class.
HttpFailureResponse
Indicates the type of HTTP status code an failing AuthorityResponse should generate.