Class CRUDClient<TSelf>
- Namespace
- Glitch9.IO.Networking.RESTApi
REST API client for performing CRUD operations.
public abstract class CRUDClient<TSelf> : RESTClient where TSelf : CRUDClient<TSelf>
Type Parameters
TSelf
- Inheritance
-
CRUDClient<TSelf>
- Derived
- Inherited Members
- Extension Methods
Constructors
CRUDClient(CRUDClientSettings)
protected CRUDClient(CRUDClientSettings clientSettings)
Parameters
clientSettingsCRUDClientSettings
Properties
BaseUrl
public string BaseUrl { get; }
Property Value
BetaVersion
The beta version of the API if available.
public string BetaVersion { get; }
Property Value
CRUDLogger
Special logger for logging CRUD operations.
public CRUDLogger CRUDLogger { get; }
Property Value
Name
The name of the API.
public string Name { get; }
Property Value
OnException
Event invoked when an error occurs during an API request.
public CRUDClient<TSelf>.ExceptionHandler OnException { get; set; }
Property Value
- CRUDClient<TSelf>.ExceptionHandler
Version
The version of the API.
public string Version { get; }
Property Value
Methods
FormatErrorMessage(string)
Parses the error res from the API. Override this method to customize the error message parsing logic.
protected abstract string FormatErrorMessage(string errorJson)
Parameters
errorJsonstring
Returns
- string
The error message.
GetApiKey()
public string GetApiKey()
Returns
HandleException(Exception)
public void HandleException(Exception exception)
Parameters
exceptionException
IsDeletedPredicate(RESTResponse)
Override this method to handle the status of a Delete operation.
protected abstract bool IsDeletedPredicate(RESTResponse res)
Parameters
resRESTResponse