Table of Contents

Class ApiClientManager

public class ApiClientManager : MonoSingleton<ApiClientManager>
Inheritance
ApiClientManager
Inherited Members

Fields

ApiConfig

public ApiConfig ApiConfig

Field Value

ApiConfig

AvailableEndpoints

public string[] AvailableEndpoints

Field Value

string[]

EndpointsResourcePath

public string EndpointsResourcePath

Field Value

string

VerboseLogging

public bool VerboseLogging

Field Value

bool

_authService

protected IAuthService _authService

Field Value

IAuthService

_httpHandler

protected DefaultHttpHandler _httpHandler

Field Value

DefaultHttpHandler

_reader

protected JsonEndpointReader _reader

Field Value

JsonEndpointReader

_responseParser

protected ResponseParser _responseParser

Field Value

ResponseParser

_tokenStorage

protected ITokenStorage _tokenStorage

Field Value

ITokenStorage

Properties

ResponseParser

public ResponseParser ResponseParser { get; }

Property Value

ResponseParser

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

key string
parameters object
customHeaders Dictionary<string, string>
onSuccess UnityAction<object>
onFail UnityAction<string>

CallEndpoint(string, object, UnityAction<object>, UnityAction<string>)

public void CallEndpoint(string key, object parameters, UnityAction<object> onSuccess, UnityAction<string> onFail)

Parameters

key string
parameters object
onSuccess UnityAction<object>
onFail UnityAction<string>

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

key string
dto TRequest
customHeaders Dictionary<string, string>
onSuccess UnityAction<TResponse>
onFail UnityAction<string>

Type Parameters

TRequest
TResponse

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

key string
dto TRequest
onSuccess UnityAction<TResponse>
onFail UnityAction<string>

Type Parameters

TRequest
TResponse

InitializeServices()

protected virtual void InitializeServices()

OnDestroy()

Unity lifecycle: clears the static instance reference when this object is destroyed.

protected override void OnDestroy()