executeSyncOperation

fun <T : OperationBodyRequestBase> executeSyncOperation(context: Context, operationSystemName: String, operationBody: T, onSuccess: (OperationResponse) -> Unit, onError: (MindboxError) -> Unit)

Creates and deliveries event synchronously with specified name and body.

Parameters

context

current context is used

operationSystemName

the name of synchronous operation

operationBody

T which extends OperationBodyRequestBase and will be send as event json body of operation.

onSuccess

Callback for response typed OperationResponse that will be invoked for success response to a given request.

onError

Callback for response typed MindboxError and will be invoked for error response to a given request.


fun <T : OperationBodyRequestBase, V : OperationResponseBase> executeSyncOperation(context: Context, operationSystemName: String, operationBody: T, classOfV: Class<V>, onSuccess: (V) -> Unit, onError: (MindboxError) -> Unit)

Creates and deliveries event synchronously with specified name and body.

Parameters

context

current context is used

operationSystemName

the name of synchronous operation

operationBody

T which extends OperationBodyRequestBase and will be send as event json body of operation.

classOfV

Class type for response object.

onSuccess

Callback for response typed V which extends OperationResponseBase that will be invoked for success response to a given request.

onError

Callback for response typed MindboxError and will be invoked for error response to a given request.


fun executeSyncOperation(context: Context, operationSystemName: String, operationBodyJson: String, onSuccess: (String) -> Unit, onError: (MindboxError) -> Unit)

Creates and deliveries event synchronously with specified name and body.

Parameters

context

current context is used

operationSystemName

the name of synchronous operation

operationBodyJson

event json body of operation.

onSuccess

Callback that will be invoked for success response to a given request.

onError

Callback for response typed MindboxError and will be invoked for error response to a given request.