Diffusion C API 6.13.0
Loading...
Searching...
No Matches
topic-update.h File Reference

Data Structures

struct  diffusion_topic_update_params_s
 Structure describing a topic set request. More...
struct  diffusion_topic_update_add_and_set_params_s
 Structure describing a topic add and set request. More...
struct  diffusion_apply_json_patch_params_s
 Structure describing a JSON patch application request. More...

Typedefs

typedef int(* on_topic_update_set_success_cb) (void *context)
 Callback when a topic set is successful.
typedef int(* on_topic_update_topic_creation_cb) (DIFFUSION_TOPIC_CREATION_RESULT_T result, void *context)
 Callback when a topic add and set is successful.
typedef int(* on_json_patch_result_cb) (const DIFFUSION_JSON_PATCH_RESULT_T *result, void *context)
 Callback with the result of the JSON patch operation.
typedef struct diffusion_topic_update_params_s DIFFUSION_TOPIC_UPDATE_SET_PARAMS_T
 Structure describing a topic set request.
typedef struct diffusion_topic_update_add_and_set_params_s DIFFUSION_TOPIC_UPDATE_ADD_AND_SET_PARAMS_T
 Structure describing a topic add and set request.
typedef struct diffusion_apply_json_patch_params_s DIFFUSION_APPLY_JSON_PATCH_PARAMS_T
 Structure describing a JSON patch application request.

Functions

int diffusion_json_patch_result_get_first_failure (const DIFFUSION_JSON_PATCH_RESULT_T *result)
 Return the index of the first failure in the JSON patch.
void diffusion_topic_update_set (SESSION_T *session, DIFFUSION_TOPIC_UPDATE_SET_PARAMS_T params)
 Sets the topic to a specified value.
void diffusion_topic_update_set_with_constraint (SESSION_T *session, const DIFFUSION_TOPIC_UPDATE_CONSTRAINT_T *constraint, DIFFUSION_TOPIC_UPDATE_SET_PARAMS_T params)
 Sets the topic to a specified value.
void diffusion_topic_update_add_and_set (SESSION_T *session, DIFFUSION_TOPIC_UPDATE_ADD_AND_SET_PARAMS_T params)
 Sets the topic to a specified value.
void diffusion_topic_update_add_and_set_with_constraint (SESSION_T *session, const DIFFUSION_TOPIC_UPDATE_CONSTRAINT_T *constraint, DIFFUSION_TOPIC_UPDATE_ADD_AND_SET_PARAMS_T params)
 Sets the topic to a specified value.
bool diffusion_apply_json_patch (SESSION_T *session, DIFFUSION_APPLY_JSON_PATCH_PARAMS_T params, DIFFUSION_API_ERROR *api_error)
 Applies a JSON Patch to a JSON topic.
bool diffusion_apply_json_patch_with_constraint (SESSION_T *session, const DIFFUSION_TOPIC_UPDATE_CONSTRAINT_T *constraint, DIFFUSION_APPLY_JSON_PATCH_PARAMS_T params, DIFFUSION_API_ERROR *api_error)
 Applies a JSON Patch to a JSON topic.

Typedef Documentation

◆ on_json_patch_result_cb

typedef int(* on_json_patch_result_cb) (const DIFFUSION_JSON_PATCH_RESULT_T *result, void *context)

Callback with the result of the JSON patch operation.

Parameters
resultThe JSON patch result.
contextUser supplied context passed in from DIFFUSION_APPLY_JSON_PATCH_PARAMS_T
Returns
HANDLERS_SUCCESS or HANDLER_FAILURE.

◆ on_topic_update_set_success_cb

typedef int(* on_topic_update_set_success_cb) (void *context)

Callback when a topic set is successful.

Parameters
contextUser supplied context passed in from DIFFUSION_TOPIC_UPDATE_SET_PARAMS_T
Returns
HANDLERS_SUCCESS or HANDLER_FAILURE.

◆ on_topic_update_topic_creation_cb

typedef int(* on_topic_update_topic_creation_cb) (DIFFUSION_TOPIC_CREATION_RESULT_T result, void *context)

Callback when a topic add and set is successful.

Parameters
resultThe topic creation result of the add and set operation. Will be either TOPIC_CREATED showing that the topic was created and then updated. Or TOPIC_EXISTS showing that the topic already exists and was subsequently updated.
contextUser supplied context passed in from DIFFUSION_TOPIC_UPDATE_SET_PARAMS_T
Returns
HANDLERS_SUCCESS or HANDLER_FAILURE.

Function Documentation

◆ diffusion_json_patch_result_get_first_failure()

int diffusion_json_patch_result_get_first_failure ( const DIFFUSION_JSON_PATCH_RESULT_T * result)

Return the index of the first failure in the JSON patch.

Parameters
resultThe JSON patch result.
Returns
the index of the first failure in the JSON patch. -1 if there were no failures or result is NULL.