Companion

object Companion

Properties

Link copied to clipboard

DEFAULT_CONNECTION_ERROR_MESSAGE the message to send when an error during the communication with the backend occurred

Link copied to clipboard

RESPONSE_DATA_KEY the key for the "response" field

Link copied to clipboard

RESPONSE_STATUS_KEY the key for the "status" field

Link copied to clipboard

USER_IDENTIFIER_KEY the key for the user "id" field

Link copied to clipboard

USER_TOKEN_KEY the key for the user "token" field

Functions

Link copied to clipboard
private fun isSuccessfulResponse(response: JSONObject?): SocketManager.StandardResponseCode

Method to get whether the request has been successful or not

Link copied to clipboard
fun <T> JsonHelper.responseData(): T

Extension Method to get directly the response data from the request response

Link copied to clipboard
fun <R : Requester, T> R.sendPaginatedRequest(request: R.() -> JSONObject, supplier: (JSONObject) -> T, onSuccess: (PaginatedResponse<T>) -> Unit, onFailure: (JsonHelper) -> Unit, onConnectionError: (JsonHelper) -> Unit? = null)

Method to execute and manage the paginated response of a request

Link copied to clipboard
fun <R : Requester> R.sendRequest(request: R.() -> JSONObject, onResponse: (JsonHelper) -> Unit, onConnectionError: (JsonHelper) -> Unit? = null)
fun <R : Requester> R.sendRequest(request: R.() -> JSONObject, onSuccess: (JsonHelper) -> Unit, onFailure: (JsonHelper) -> Unit, onConnectionError: (JsonHelper) -> Unit? = null)

Method to execute and manage the response of a request