77#include " vxcore/vxcore.h"
88
99VXCORE_API VxCoreError vxcore_notebook_create (VxCoreContextHandle context, const char *path,
10- const char *properties_json , VxCoreNotebookType type,
10+ const char *config_json , VxCoreNotebookType type,
1111 char **out_notebook_id) {
1212 if (!context || !path || !out_notebook_id) {
1313 return VXCORE_ERR_NULL_POINTER;
@@ -19,11 +19,11 @@ VXCORE_API VxCoreError vxcore_notebook_create(VxCoreContextHandle context, const
1919 vxcore::NotebookType notebook_type =
2020 (type == VXCORE_NOTEBOOK_RAW) ? vxcore::NotebookType::Raw : vxcore::NotebookType::Bundled;
2121
22- std::string properties_str = properties_json ? properties_json : " " ;
22+ std::string config_str = config_json ? config_json : " " ;
2323 std::string notebook_id;
2424
2525 VxCoreError err =
26- ctx->notebook_manager ->CreateNotebook (path, notebook_type, properties_str , notebook_id);
26+ ctx->notebook_manager ->CreateNotebook (path, notebook_type, config_str , notebook_id);
2727
2828 if (err != VXCORE_OK) {
2929 ctx->last_error = " Failed to create notebook" ;
@@ -122,55 +122,54 @@ VXCORE_API VxCoreError vxcore_notebook_list(VxCoreContextHandle context,
122122 }
123123}
124124
125- VXCORE_API VxCoreError vxcore_notebook_get_properties (VxCoreContextHandle context,
126- const char *notebook_id,
127- char **out_properties_json) {
128- if (!context || !notebook_id || !out_properties_json) {
125+ VXCORE_API VxCoreError vxcore_notebook_get_config (VxCoreContextHandle context,
126+ const char *notebook_id, char **out_config_json) {
127+ if (!context || !notebook_id || !out_config_json) {
129128 return VXCORE_ERR_NULL_POINTER;
130129 }
131130
132131 auto *ctx = reinterpret_cast <vxcore::VxCoreContext *>(context);
133132
134133 try {
135- std::string properties_json ;
136- VxCoreError err = ctx->notebook_manager ->GetNotebookProperties (notebook_id, properties_json );
134+ std::string config_json ;
135+ VxCoreError err = ctx->notebook_manager ->GetNotebookConfig (notebook_id, config_json );
137136
138137 if (err != VXCORE_OK) {
139- ctx->last_error = " Failed to get notebook properties " ;
138+ ctx->last_error = " Failed to get notebook config " ;
140139 return err;
141140 }
142141
143- char *json_copy = vxcore_strdup (properties_json .c_str ());
142+ char *json_copy = vxcore_strdup (config_json .c_str ());
144143 if (!json_copy) {
145144 return VXCORE_ERR_OUT_OF_MEMORY;
146145 }
147146
148- *out_properties_json = json_copy;
147+ *out_config_json = json_copy;
149148 return VXCORE_OK;
150149 } catch (...) {
151- ctx->last_error = " Unknown error getting notebook properties " ;
150+ ctx->last_error = " Unknown error getting notebook config " ;
152151 return VXCORE_ERR_UNKNOWN;
153152 }
154153}
155154
156- VXCORE_API VxCoreError vxcore_notebook_set_properties (VxCoreContextHandle context,
157- const char *notebook_id,
158- const char *properties_json ) {
159- if (!context || !notebook_id || !properties_json ) {
155+ VXCORE_API VxCoreError vxcore_notebook_update_config (VxCoreContextHandle context,
156+ const char *notebook_id,
157+ const char *config_json ) {
158+ if (!context || !notebook_id || !config_json ) {
160159 return VXCORE_ERR_NULL_POINTER;
161160 }
162161
163162 auto *ctx = reinterpret_cast <vxcore::VxCoreContext *>(context);
164163
165164 try {
166- VxCoreError err = ctx->notebook_manager ->SetNotebookProperties (notebook_id, properties_json );
165+ VxCoreError err = ctx->notebook_manager ->UpdateNotebookConfig (notebook_id, config_json );
167166
168167 if (err != VXCORE_OK) {
169- ctx->last_error = " Failed to set notebook properties " ;
168+ ctx->last_error = " Failed to set notebook config " ;
170169 }
171170 return err;
172171 } catch (...) {
173- ctx->last_error = " Unknown error setting notebook properties " ;
172+ ctx->last_error = " Unknown error setting notebook config " ;
174173 return VXCORE_ERR_UNKNOWN;
175174 }
176175}
0 commit comments