Class ApiClientManager
- Namespace
- WitShells.WitClientApi
public class ApiClientManager : MonoSingleton<ApiClientManager>
- Inheritance
-
ApiClientManager
- Inherited Members
Fields
ApiConfig
public ApiConfig ApiConfig
Field Value
AvailableEndpoints
public string[] AvailableEndpoints
Field Value
- string[]
EndpointsResourcePath
public string EndpointsResourcePath
Field Value
VerboseLogging
public bool VerboseLogging
Field Value
_authService
protected IAuthService _authService
Field Value
_httpHandler
protected DefaultHttpHandler _httpHandler
Field Value
_reader
protected JsonEndpointReader _reader
Field Value
_responseParser
protected ResponseParser _responseParser
Field Value
_tokenStorage
protected ITokenStorage _tokenStorage
Field Value
Properties
ResponseParser
public ResponseParser ResponseParser { get; }
Property Value
Methods
Awake()
Unity lifecycle: assigns the singleton instance and optionally marks it persistent. Destroys duplicate GameObjects and warns in the console if more than one exists.
public override void Awake()
CallEndpoint(string, object, Dictionary<string, string>, UnityAction<object>, UnityAction<string>)
public void CallEndpoint(string key, object parameters, Dictionary<string, string> customHeaders, UnityAction<object> onSuccess, UnityAction<string> onFail)
Parameters
keystringparametersobjectcustomHeadersDictionary<string, string>onSuccessUnityAction<object>onFailUnityAction<string>
CallEndpoint(string, object, UnityAction<object>, UnityAction<string>)
public void CallEndpoint(string key, object parameters, UnityAction<object> onSuccess, UnityAction<string> onFail)
Parameters
CallEndpoint<TRequest, TResponse>(string, TRequest, Dictionary<string, string>, UnityAction<TResponse>, UnityAction<string>)
public void CallEndpoint<TRequest, TResponse>(string key, TRequest dto, Dictionary<string, string> customHeaders, UnityAction<TResponse> onSuccess, UnityAction<string> onFail)
Parameters
keystringdtoTRequestcustomHeadersDictionary<string, string>onSuccessUnityAction<TResponse>onFailUnityAction<string>
Type Parameters
TRequestTResponse
CallEndpoint<TRequest, TResponse>(string, TRequest, UnityAction<TResponse>, UnityAction<string>)
public void CallEndpoint<TRequest, TResponse>(string key, TRequest dto, UnityAction<TResponse> onSuccess, UnityAction<string> onFail)
Parameters
Type Parameters
TRequestTResponse
InitializeServices()
protected virtual void InitializeServices()
OnDestroy()
Unity lifecycle: clears the static instance reference when this object is destroyed.
protected override void OnDestroy()