[Release-17] Upgrade SBI to v17.x.0

This commit is contained in:
Sukchan Lee 2023-03-01 19:56:49 +09:00
parent 969c116e77
commit 4d44b1843e
1687 changed files with 121604 additions and 9310 deletions

View file

@ -11,7 +11,9 @@ OpenAPI_auth_event_t *OpenAPI_auth_event_create(
OpenAPI_auth_type_e auth_type,
char *serving_network_name,
bool is_auth_removal_ind,
int auth_removal_ind
int auth_removal_ind,
char *nf_set_id,
OpenAPI_list_t *reset_ids
)
{
OpenAPI_auth_event_t *auth_event_local_var = ogs_malloc(sizeof(OpenAPI_auth_event_t));
@ -24,6 +26,8 @@ OpenAPI_auth_event_t *OpenAPI_auth_event_create(
auth_event_local_var->serving_network_name = serving_network_name;
auth_event_local_var->is_auth_removal_ind = is_auth_removal_ind;
auth_event_local_var->auth_removal_ind = auth_removal_ind;
auth_event_local_var->nf_set_id = nf_set_id;
auth_event_local_var->reset_ids = reset_ids;
return auth_event_local_var;
}
@ -47,6 +51,17 @@ void OpenAPI_auth_event_free(OpenAPI_auth_event_t *auth_event)
ogs_free(auth_event->serving_network_name);
auth_event->serving_network_name = NULL;
}
if (auth_event->nf_set_id) {
ogs_free(auth_event->nf_set_id);
auth_event->nf_set_id = NULL;
}
if (auth_event->reset_ids) {
OpenAPI_list_for_each(auth_event->reset_ids, node) {
ogs_free(node->data);
}
OpenAPI_list_free(auth_event->reset_ids);
auth_event->reset_ids = NULL;
}
ogs_free(auth_event);
}
@ -109,6 +124,27 @@ cJSON *OpenAPI_auth_event_convertToJSON(OpenAPI_auth_event_t *auth_event)
}
}
if (auth_event->nf_set_id) {
if (cJSON_AddStringToObject(item, "nfSetId", auth_event->nf_set_id) == NULL) {
ogs_error("OpenAPI_auth_event_convertToJSON() failed [nf_set_id]");
goto end;
}
}
if (auth_event->reset_ids) {
cJSON *reset_idsList = cJSON_AddArrayToObject(item, "resetIds");
if (reset_idsList == NULL) {
ogs_error("OpenAPI_auth_event_convertToJSON() failed [reset_ids]");
goto end;
}
OpenAPI_list_for_each(auth_event->reset_ids, node) {
if (cJSON_AddStringToObject(reset_idsList, "", (char*)node->data) == NULL) {
ogs_error("OpenAPI_auth_event_convertToJSON() failed [reset_ids]");
goto end;
}
}
}
end:
return item;
}
@ -124,6 +160,9 @@ OpenAPI_auth_event_t *OpenAPI_auth_event_parseFromJSON(cJSON *auth_eventJSON)
OpenAPI_auth_type_e auth_typeVariable = 0;
cJSON *serving_network_name = NULL;
cJSON *auth_removal_ind = NULL;
cJSON *nf_set_id = NULL;
cJSON *reset_ids = NULL;
OpenAPI_list_t *reset_idsList = NULL;
nf_instance_id = cJSON_GetObjectItemCaseSensitive(auth_eventJSON, "nfInstanceId");
if (!nf_instance_id) {
ogs_error("OpenAPI_auth_event_parseFromJSON() failed [nf_instance_id]");
@ -183,6 +222,35 @@ OpenAPI_auth_event_t *OpenAPI_auth_event_parseFromJSON(cJSON *auth_eventJSON)
}
}
nf_set_id = cJSON_GetObjectItemCaseSensitive(auth_eventJSON, "nfSetId");
if (nf_set_id) {
if (!cJSON_IsString(nf_set_id) && !cJSON_IsNull(nf_set_id)) {
ogs_error("OpenAPI_auth_event_parseFromJSON() failed [nf_set_id]");
goto end;
}
}
reset_ids = cJSON_GetObjectItemCaseSensitive(auth_eventJSON, "resetIds");
if (reset_ids) {
cJSON *reset_ids_local = NULL;
if (!cJSON_IsArray(reset_ids)) {
ogs_error("OpenAPI_auth_event_parseFromJSON() failed [reset_ids]");
goto end;
}
reset_idsList = OpenAPI_list_create();
cJSON_ArrayForEach(reset_ids_local, reset_ids) {
double *localDouble = NULL;
int *localInt = NULL;
if (!cJSON_IsString(reset_ids_local)) {
ogs_error("OpenAPI_auth_event_parseFromJSON() failed [reset_ids]");
goto end;
}
OpenAPI_list_add(reset_idsList, ogs_strdup(reset_ids_local->valuestring));
}
}
auth_event_local_var = OpenAPI_auth_event_create (
ogs_strdup(nf_instance_id->valuestring),
@ -191,11 +259,20 @@ OpenAPI_auth_event_t *OpenAPI_auth_event_parseFromJSON(cJSON *auth_eventJSON)
auth_typeVariable,
ogs_strdup(serving_network_name->valuestring),
auth_removal_ind ? true : false,
auth_removal_ind ? auth_removal_ind->valueint : 0
auth_removal_ind ? auth_removal_ind->valueint : 0,
nf_set_id && !cJSON_IsNull(nf_set_id) ? ogs_strdup(nf_set_id->valuestring) : NULL,
reset_ids ? reset_idsList : NULL
);
return auth_event_local_var;
end:
if (reset_idsList) {
OpenAPI_list_for_each(reset_idsList, node) {
ogs_free(node->data);
}
OpenAPI_list_free(reset_idsList);
reset_idsList = NULL;
}
return NULL;
}