#include "../object.h" #include #include extern struct json_enum ap_object_type_enum[]; #define OBJ_TYPE struct ap_attachment struct json_object_field ap_attachment_layout[] = { JSON_FIELD_STRING( mediaType, false ), JSON_FIELD_STRING( name, false ), JSON_FIELD_STRING( value, false ), JSON_FIELD_STRING( url, false ), JSON_FIELD_ENUM( type, ap_object_type_enum, true ), JSON_FIELD_END }; #undef OBJ_TYPE void ap_attachment_free( struct ap_attachment* a ) { if( !a ) { return; } free(a->mediaType); free(a->name); free(a->url); free(a->value); free(a); } JSON_FIELD_TYPE_OBJECT_LAYOUT_WITH_DEFAULTS( ap_attachment );