mirror of
https://github.com/open5gs/open5gs.git
synced 2026-05-04 14:20:09 +00:00
Add AUSF, UDM, and UDR
This commit is contained in:
parent
0c0241d5e5
commit
72370ff0b2
1151 changed files with 140173 additions and 24799 deletions
76
lib/sbi/openapi/model/bdt_policy_data_patch.c
Normal file
76
lib/sbi/openapi/model/bdt_policy_data_patch.c
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "bdt_policy_data_patch.h"
|
||||
|
||||
OpenAPI_bdt_policy_data_patch_t *OpenAPI_bdt_policy_data_patch_create(
|
||||
char *bdt_ref_id
|
||||
)
|
||||
{
|
||||
OpenAPI_bdt_policy_data_patch_t *bdt_policy_data_patch_local_var = OpenAPI_malloc(sizeof(OpenAPI_bdt_policy_data_patch_t));
|
||||
if (!bdt_policy_data_patch_local_var) {
|
||||
return NULL;
|
||||
}
|
||||
bdt_policy_data_patch_local_var->bdt_ref_id = bdt_ref_id;
|
||||
|
||||
return bdt_policy_data_patch_local_var;
|
||||
}
|
||||
|
||||
void OpenAPI_bdt_policy_data_patch_free(OpenAPI_bdt_policy_data_patch_t *bdt_policy_data_patch)
|
||||
{
|
||||
if (NULL == bdt_policy_data_patch) {
|
||||
return;
|
||||
}
|
||||
OpenAPI_lnode_t *node;
|
||||
ogs_free(bdt_policy_data_patch->bdt_ref_id);
|
||||
ogs_free(bdt_policy_data_patch);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_bdt_policy_data_patch_convertToJSON(OpenAPI_bdt_policy_data_patch_t *bdt_policy_data_patch)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
|
||||
if (bdt_policy_data_patch == NULL) {
|
||||
ogs_error("OpenAPI_bdt_policy_data_patch_convertToJSON() failed [BdtPolicyDataPatch]");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
if (!bdt_policy_data_patch->bdt_ref_id) {
|
||||
ogs_error("OpenAPI_bdt_policy_data_patch_convertToJSON() failed [bdt_ref_id]");
|
||||
goto end;
|
||||
}
|
||||
if (cJSON_AddStringToObject(item, "bdtRefId", bdt_policy_data_patch->bdt_ref_id) == NULL) {
|
||||
ogs_error("OpenAPI_bdt_policy_data_patch_convertToJSON() failed [bdt_ref_id]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
end:
|
||||
return item;
|
||||
}
|
||||
|
||||
OpenAPI_bdt_policy_data_patch_t *OpenAPI_bdt_policy_data_patch_parseFromJSON(cJSON *bdt_policy_data_patchJSON)
|
||||
{
|
||||
OpenAPI_bdt_policy_data_patch_t *bdt_policy_data_patch_local_var = NULL;
|
||||
cJSON *bdt_ref_id = cJSON_GetObjectItemCaseSensitive(bdt_policy_data_patchJSON, "bdtRefId");
|
||||
if (!bdt_ref_id) {
|
||||
ogs_error("OpenAPI_bdt_policy_data_patch_parseFromJSON() failed [bdt_ref_id]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
|
||||
if (!cJSON_IsString(bdt_ref_id)) {
|
||||
ogs_error("OpenAPI_bdt_policy_data_patch_parseFromJSON() failed [bdt_ref_id]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
bdt_policy_data_patch_local_var = OpenAPI_bdt_policy_data_patch_create (
|
||||
ogs_strdup(bdt_ref_id->valuestring)
|
||||
);
|
||||
|
||||
return bdt_policy_data_patch_local_var;
|
||||
end:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue