gobj_delete_resource()
#
gobj_delete_resource()
deletes a resource associated with a given hgobj
.
Prototype
int gobj_delete_resource(
hgobj gobj,
const char *resource,
json_t *record,
json_t *jn_options
);
Parameters
Key |
Type |
Description |
---|---|---|
|
|
The |
|
|
The name of the resource to be deleted. |
|
|
A JSON object containing the record to be deleted. This parameter is owned and must be freed by the function. |
|
|
A JSON object containing additional options for deletion. This parameter is owned and must be freed by the function. |
Return Value
Returns 0
on success, or -1
if an error occurs.
Notes
If gobj
is NULL
or destroyed, an error is logged and -1
is returned.
If record
is NULL
, an error is logged and -1
is returned.
If the gobj
’s class does not implement mt_delete_resource
, an error is logged and -1
is returned.
The function ensures that record
and jn_options
are properly freed before returning.
Prototype
// Not applicable in JS
Prototype
# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples