Add only one 5GC scenario (call-flow)

This commit is contained in:
Sukchan Lee 2020-06-17 01:22:28 -04:00
parent 20008b6a13
commit dbee687a75
1415 changed files with 86635 additions and 5877 deletions

View file

@ -6,7 +6,6 @@ api/**
include/apiClient.h
src/apiClient.c
src/binary.c
unit-test/**

View file

@ -4,7 +4,7 @@
OpenAPI_map_t *OpenAPI_map_create(char *key, void *value)
{
OpenAPI_map_t *OpenAPI_map = ogs_malloc(sizeof(OpenAPI_map_t));
OpenAPI_map_t *OpenAPI_map = ogs_malloc(sizeof(OpenAPI_map_t));
OpenAPI_map->key = key;
OpenAPI_map->value = value;
return OpenAPI_map;

View file

@ -7,7 +7,7 @@
OpenAPI_binary_t *OpenAPI_instantiate_binary_t(char *data, int len)
{
binary_t* ret = malloc(sizeof(struct binary_t));
OpenAPI_binary_t* ret = malloc(sizeof(OpenAPI_binary_t));
ret->len=len;
ret->data = malloc(len);
@ -35,7 +35,7 @@ char *OpenAPI_base64encode(const void *b64_encode_this,
(*mem_bio_mem_ptr).data[(*mem_bio_mem_ptr).length] = '\0'; //Adds null-terminator to tail.
return (*mem_bio_mem_ptr).data; //Returns base-64 encoded data. (See: "buf_mem_st" struct).
#else // OPENSSL
#warning Data will not be encoded. If you want to use function "base64encode", please define "-DOPENSSL" when building the library.
//#warning Data will not be encoded. If you want to use function "base64encode", please define "-DOPENSSL" when building the library.
return NULL;
#endif // OPENSSL
}
@ -59,7 +59,7 @@ char *OpenAPI_base64decode(const void *b64_decode_this,
*decoded_bytes = decoded_byte_index;
return base64_decoded; //Returns base-64 decoded data with trailing null terminator.
#else // OPENSSL
#warning Data will not be decoded. If you want to use function "base64decode", please define "-DOPENSSL" when building the library.
//#warning Data will not be decoded. If you want to use function "base64decode", please define "-DOPENSSL" when building the library.
return NULL;
#endif // OPENSSL
}

View file

@ -8,8 +8,8 @@ extern "C" {
#endif
typedef struct OpenAPI_binary_s {
uint8_t* data;
unsigned int len;
char* data;
int len;
} OpenAPI_binary_t;
OpenAPI_binary_t *OpenAPI_instantiate_binary_t(char *data, int len);

View file

@ -236,12 +236,7 @@ cJSON *OpenAPI_{{classname}}_convertToJSON(OpenAPI_{{classname}}_t *{{classname}
{{/isBoolean}}
{{/required}}
{{^required}}
{{#isBoolean}}
if ({{{classname}}}->{{{name}}} >= 0) {
{{/isBoolean}}
{{^isBoolean}}
if ({{{classname}}}->{{{name}}}) {
{{/isBoolean}}
if ({{{classname}}}->{{{name}}}) {
{{/required}}
{{^isContainer}}
{{#isPrimitiveType}}
@ -522,7 +517,7 @@ OpenAPI_{{classname}}_t *OpenAPI_{{classname}}_parseFromJSON(cJSON *{{classname}
}
{{/isByteArray}}
{{#isBinary}}
OpenAPI_binary_t* decoded_str_{{{name}}} = OpenAPI_malloc(sizeof(struct binary_t));
OpenAPI_binary_t* decoded_str_{{{name}}} = OpenAPI_malloc(sizeof(OpenAPI_binary_t));
{{^required}}if ({{{name}}}) { {{/required}}
if (!cJSON_IsString({{{name}}})) {
ogs_error("OpenAPI_{{classname}}_parseFromJSON() failed [{{{name}}}]");
@ -789,5 +784,39 @@ OpenAPI_{{classname}}_t *OpenAPI_{{classname}}_parseFromJSON(cJSON *{{classname}
end:
return NULL;
}
OpenAPI_{{classname}}_t *OpenAPI_{{classname}}_copy(OpenAPI_{{classname}}_t *dst, OpenAPI_{{classname}}_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_{{classname}}_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_{{classname}}_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_{{classname}}_free(dst);
dst = OpenAPI_{{classname}}_parseFromJSON(item);
cJSON_Delete(item);
return dst;
}
{{/isEnum}}
{{/model}}{{/models}}

View file

@ -171,6 +171,7 @@ OpenAPI_{{classname}}_t *OpenAPI_{{classname}}_create(
void OpenAPI_{{classname}}_free(OpenAPI_{{classname}}_t *{{classname}});
OpenAPI_{{classname}}_t *OpenAPI_{{classname}}_parseFromJSON(cJSON *{{classname}}JSON);
cJSON *OpenAPI_{{classname}}_convertToJSON(OpenAPI_{{classname}}_t *{{classname}});
OpenAPI_{{classname}}_t *OpenAPI_{{classname}}_copy(OpenAPI_{{classname}}_t *dst, OpenAPI_{{classname}}_t *src);
{{/isEnum}}
#ifdef __cplusplus

View file

@ -8,8 +8,8 @@ extern "C" {
#endif
typedef struct OpenAPI_binary_s {
uint8_t* data;
unsigned int len;
char* data;
int len;
} OpenAPI_binary_t;
OpenAPI_binary_t *OpenAPI_instantiate_binary_t(char *data, int len);

View file

@ -18,6 +18,7 @@
libsbi_openapi_sources = files('''
src/list.c
src/apiKey.c
src/binary.c
external/cJSON.c
model/object.c
model/access_type.c
@ -463,6 +464,185 @@ libsbi_openapi_sources = files('''
model/usage_threshold.c
model/v2x_rat_type.c
model/additional_qos_flow_info.c
model/apn_rate_status.c
model/cause.c
model/cn_assisted_ran_para.c
model/ddn_failure_subs.c
model/dnai_information.c
model/dnn_selection_mode.c
model/dynamic5_qi.c
model/ebi_arp_mapping.c
model/eps_bearer_info.c
model/eps_interworking_indication.c
model/eps_pdn_cnx_info.c
model/exemption_ind.c
model/gbr_qos_flow_information.c
model/ho_state.c
model/hsmf_update_data.c
model/hsmf_update_error.c
model/hsmf_updated_data.c
model/indirect_data_forwarding_tunnel_info.c
model/inline_object.c
model/inline_object_1.c
model/inline_object_2.c
model/inline_object_3.c
model/inline_object_4.c
model/ma_release_indication.c
model/max_integrity_protected_data_rate.c
model/mme_capabilities.c
model/mo_exception_data_flag.c
model/mo_exp_data_counter.c
model/n2_sm_info_type.c
model/n4_information.c
model/n4_message_type.c
model/ng_ap_cause.c
model/ng_ran_target_id.c
model/non_dynamic5_qi.c
model/notification_cause.c
model/notification_control.c
model/partial_record_method.c
model/pdu_session_create_data.c
model/pdu_session_create_error.c
model/pdu_session_created_data.c
model/pdu_session_notify_item.c
model/psa_indication.c
model/psa_information.c
model/qos_flow_access_type.c
model/qos_flow_add_modify_request_item.c
model/qos_flow_item.c
model/qos_flow_notify_item.c
model/qos_flow_profile.c
model/qos_flow_release_request_item.c
model/qos_flow_setup_item.c
model/qos_flow_usage_report.c
model/qos_resource_type.c
model/ref_to_binary_data.c
model/reflective_qo_s_attribute.c
model/release_data.c
model/released_data.c
model/request_indication.c
model/request_type.c
model/resource_status.c
model/roaming_charging_profile.c
model/secondary_rat_usage_info.c
model/secondary_rat_usage_report.c
model/send_mo_data_req_data.c
model/sm_context.c
model/sm_context_create_data.c
model/sm_context_create_error.c
model/sm_context_created_data.c
model/sm_context_release_data.c
model/sm_context_released_data.c
model/sm_context_retrieve_data.c
model/sm_context_retrieved_data.c
model/sm_context_status_notification.c
model/sm_context_type.c
model/sm_context_update_data.c
model/sm_context_update_error.c
model/sm_context_updated_data.c
model/small_data_rate_status.c
model/status_info.c
model/status_notification.c
model/transfer_mo_data_req_data.c
model/transfer_mt_data_add_info.c
model/transfer_mt_data_error.c
model/transfer_mt_data_req_data.c
model/trigger.c
model/trigger_category.c
model/trigger_type.c
model/tunnel_info.c
model/ulcl_bp_information.c
model/unavailable_access_indication.c
model/up_cnx_state.c
model/volume_timed_report.c
model/vplmn_qos.c
model/vsmf_update_data.c
model/vsmf_update_error.c
model/vsmf_updated_data.c
model/allowed_nssai.c
model/allowed_snssai.c
model/amf_event.c
model/amf_event_area.c
model/amf_event_mode.c
model/amf_event_subscription.c
model/amf_event_trigger.c
model/amf_event_type.c
model/amf_status_change_notification.c
model/amf_status_change_subscription_data.c
model/amf_status_info.c
model/area_of_validity.c
model/assign_ebi_data.c
model/assign_ebi_error.c
model/assign_ebi_failed.c
model/assigned_ebi_data.c
model/ciphering_algorithm.c
model/configured_snssai.c
model/expected_ue_behavior.c
model/integrity_algorithm.c
model/key_amf.c
model/key_amf_type.c
model/ladn_info.c
model/location_filter.c
model/mm_context.c
model/n1_message_container.c
model/n1_message_notification.c
model/n1_n2_message_transfer_cause.c
model/n1_n2_message_transfer_error.c
model/n1_n2_message_transfer_req_data.c
model/n1_n2_message_transfer_rsp_data.c
model/n1_n2_msg_txfr_err_detail.c
model/n1_n2_msg_txfr_failure_notification.c
model/n2_info_container.c
model/n2_info_content.c
model/n2_info_notification_rsp_data.c
model/n2_info_notify_reason.c
model/n2_information_notification.c
model/n2_information_transfer_error.c
model/n2_information_transfer_req_data.c
model/n2_information_transfer_result.c
model/n2_information_transfer_rsp_data.c
model/n2_ran_information.c
model/n2_sm_information.c
model/nas_security_mode.c
model/ng_ksi.c
model/ngap_ie_type.c
model/non_ue_n2_info_subscription_create_data.c
model/non_ue_n2_info_subscription_created_data.c
model/nrppa_information.c
model/nsi_information.c
model/nssai_mapping.c
model/pdu_session_context.c
model/policy_req_trigger.c
model/pws_error_data.c
model/pws_information.c
model/pws_response_data.c
model/rat_selector.c
model/registration_context_container.c
model/sbi_binding_level.c
model/sc_type.c
model/seaf_data.c
model/small_data_rate_status_info.c
model/smf_change_indication.c
model/smf_change_info.c
model/status_change.c
model/traffic_descriptor.c
model/transfer_reason.c
model/ue_context.c
model/ue_context_create_data.c
model/ue_context_create_error.c
model/ue_context_created_data.c
model/ue_context_release.c
model/ue_context_transfer_req_data.c
model/ue_context_transfer_rsp_data.c
model/ue_context_transfer_status.c
model/ue_n1_n2_info_subscription_create_data.c
model/ue_n1_n2_info_subscription_created_data.c
model/ue_reg_status_update_req_data.c
model/ue_reg_status_update_rsp_data.c
model/v2x_context.c
'''.split())
libsbi_openapi_inc = include_directories('.')

View file

@ -16,7 +16,7 @@ OpenAPI_access_and_mobility_data_t *OpenAPI_access_and_mobility_data_create(
char *conn_states_ts,
OpenAPI_ue_reachability_t *reachability_status,
char *reachability_status_ts,
OpenAPI_sms_support_t *sms_over_nas_status,
OpenAPI_sms_support_e sms_over_nas_status,
char *sms_over_nas_status_ts,
int roaming_status,
char *roaming_status_ts,
@ -75,14 +75,10 @@ void OpenAPI_access_and_mobility_data_free(OpenAPI_access_and_mobility_data_t *a
ogs_free(access_and_mobility_data->conn_states_ts);
OpenAPI_ue_reachability_free(access_and_mobility_data->reachability_status);
ogs_free(access_and_mobility_data->reachability_status_ts);
OpenAPI_sms_support_free(access_and_mobility_data->sms_over_nas_status);
ogs_free(access_and_mobility_data->sms_over_nas_status_ts);
ogs_free(access_and_mobility_data->roaming_status_ts);
OpenAPI_plmn_id_free(access_and_mobility_data->current_plmn);
ogs_free(access_and_mobility_data->current_plmn_ts);
OpenAPI_list_for_each(access_and_mobility_data->rat_type, node) {
OpenAPI_rat_type_free(node->data);
}
OpenAPI_list_free(access_and_mobility_data->rat_type);
ogs_free(access_and_mobility_data->rat_types_ts);
ogs_free(access_and_mobility_data);
@ -214,13 +210,7 @@ cJSON *OpenAPI_access_and_mobility_data_convertToJSON(OpenAPI_access_and_mobilit
}
if (access_and_mobility_data->sms_over_nas_status) {
cJSON *sms_over_nas_status_local_JSON = OpenAPI_sms_support_convertToJSON(access_and_mobility_data->sms_over_nas_status);
if (sms_over_nas_status_local_JSON == NULL) {
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [sms_over_nas_status]");
goto end;
}
cJSON_AddItemToObject(item, "smsOverNasStatus", sms_over_nas_status_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "smsOverNasStatus", OpenAPI_sms_support_ToString(access_and_mobility_data->sms_over_nas_status)) == NULL) {
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [sms_over_nas_status]");
goto end;
}
@ -233,7 +223,7 @@ cJSON *OpenAPI_access_and_mobility_data_convertToJSON(OpenAPI_access_and_mobilit
}
}
if (access_and_mobility_data->roaming_status >= 0) {
if (access_and_mobility_data->roaming_status) {
if (cJSON_AddBoolToObject(item, "roamingStatus", access_and_mobility_data->roaming_status) == NULL) {
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [roaming_status]");
goto end;
@ -268,21 +258,16 @@ cJSON *OpenAPI_access_and_mobility_data_convertToJSON(OpenAPI_access_and_mobilit
}
if (access_and_mobility_data->rat_type) {
cJSON *rat_typeList = cJSON_AddArrayToObject(item, "ratType");
if (rat_typeList == NULL) {
cJSON *rat_type = cJSON_AddArrayToObject(item, "ratType");
if (rat_type == NULL) {
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [rat_type]");
goto end;
}
OpenAPI_lnode_t *rat_type_node;
if (access_and_mobility_data->rat_type) {
OpenAPI_list_for_each(access_and_mobility_data->rat_type, rat_type_node) {
cJSON *itemLocal = OpenAPI_rat_type_convertToJSON(rat_type_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [rat_type]");
goto end;
}
cJSON_AddItemToArray(rat_typeList, itemLocal);
OpenAPI_list_for_each(access_and_mobility_data->rat_type, rat_type_node) {
if (cJSON_AddStringToObject(rat_type, "", OpenAPI_rat_type_ToString((OpenAPI_rat_type_e)rat_type_node->data)) == NULL) {
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed [rat_type]");
goto end;
}
}
}
@ -428,9 +413,13 @@ OpenAPI_access_and_mobility_data_t *OpenAPI_access_and_mobility_data_parseFromJS
cJSON *sms_over_nas_status = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "smsOverNasStatus");
OpenAPI_sms_support_t *sms_over_nas_status_local_nonprim = NULL;
OpenAPI_sms_support_e sms_over_nas_statusVariable;
if (sms_over_nas_status) {
sms_over_nas_status_local_nonprim = OpenAPI_sms_support_parseFromJSON(sms_over_nas_status);
if (!cJSON_IsString(sms_over_nas_status)) {
ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [sms_over_nas_status]");
goto end;
}
sms_over_nas_statusVariable = OpenAPI_sms_support_FromString(sms_over_nas_status->valuestring);
}
cJSON *sms_over_nas_status_ts = cJSON_GetObjectItemCaseSensitive(access_and_mobility_dataJSON, "smsOverNasStatusTs");
@ -489,13 +478,12 @@ OpenAPI_access_and_mobility_data_t *OpenAPI_access_and_mobility_data_parseFromJS
rat_typeList = OpenAPI_list_create();
cJSON_ArrayForEach(rat_type_local_nonprimitive, rat_type ) {
if (!cJSON_IsObject(rat_type_local_nonprimitive)) {
if (!cJSON_IsString(rat_type_local_nonprimitive)) {
ogs_error("OpenAPI_access_and_mobility_data_parseFromJSON() failed [rat_type]");
goto end;
}
OpenAPI_rat_type_t *rat_typeItem = OpenAPI_rat_type_parseFromJSON(rat_type_local_nonprimitive);
OpenAPI_list_add(rat_typeList, rat_typeItem);
OpenAPI_list_add(rat_typeList, (void *)OpenAPI_rat_type_FromString(rat_type_local_nonprimitive->valuestring));
}
}
@ -520,7 +508,7 @@ OpenAPI_access_and_mobility_data_t *OpenAPI_access_and_mobility_data_parseFromJS
conn_states_ts ? ogs_strdup(conn_states_ts->valuestring) : NULL,
reachability_status ? reachability_status_local_nonprim : NULL,
reachability_status_ts ? ogs_strdup(reachability_status_ts->valuestring) : NULL,
sms_over_nas_status ? sms_over_nas_status_local_nonprim : NULL,
sms_over_nas_status ? sms_over_nas_statusVariable : 0,
sms_over_nas_status_ts ? ogs_strdup(sms_over_nas_status_ts->valuestring) : NULL,
roaming_status ? roaming_status->valueint : 0,
roaming_status_ts ? ogs_strdup(roaming_status_ts->valuestring) : NULL,
@ -535,3 +523,37 @@ end:
return NULL;
}
OpenAPI_access_and_mobility_data_t *OpenAPI_access_and_mobility_data_copy(OpenAPI_access_and_mobility_data_t *dst, OpenAPI_access_and_mobility_data_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_access_and_mobility_data_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_access_and_mobility_data_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_access_and_mobility_data_free(dst);
dst = OpenAPI_access_and_mobility_data_parseFromJSON(item);
cJSON_Delete(item);
return dst;
}

View file

@ -38,7 +38,7 @@ typedef struct OpenAPI_access_and_mobility_data_s {
char *conn_states_ts;
struct OpenAPI_ue_reachability_s *reachability_status;
char *reachability_status_ts;
struct OpenAPI_sms_support_s *sms_over_nas_status;
OpenAPI_sms_support_e sms_over_nas_status;
char *sms_over_nas_status_ts;
int roaming_status;
char *roaming_status_ts;
@ -60,7 +60,7 @@ OpenAPI_access_and_mobility_data_t *OpenAPI_access_and_mobility_data_create(
char *conn_states_ts,
OpenAPI_ue_reachability_t *reachability_status,
char *reachability_status_ts,
OpenAPI_sms_support_t *sms_over_nas_status,
OpenAPI_sms_support_e sms_over_nas_status,
char *sms_over_nas_status_ts,
int roaming_status,
char *roaming_status_ts,
@ -72,6 +72,7 @@ OpenAPI_access_and_mobility_data_t *OpenAPI_access_and_mobility_data_create(
void OpenAPI_access_and_mobility_data_free(OpenAPI_access_and_mobility_data_t *access_and_mobility_data);
OpenAPI_access_and_mobility_data_t *OpenAPI_access_and_mobility_data_parseFromJSON(cJSON *access_and_mobility_dataJSON);
cJSON *OpenAPI_access_and_mobility_data_convertToJSON(OpenAPI_access_and_mobility_data_t *access_and_mobility_data);
OpenAPI_access_and_mobility_data_t *OpenAPI_access_and_mobility_data_copy(OpenAPI_access_and_mobility_data_t *dst, OpenAPI_access_and_mobility_data_t *src);
#ifdef __cplusplus
}

View file

@ -142,9 +142,6 @@ void OpenAPI_access_and_mobility_subscription_data_free(OpenAPI_access_and_mobil
OpenAPI_list_free(access_and_mobility_subscription_data->shared_vn_group_data_ids);
OpenAPI_ambr_rm_free(access_and_mobility_subscription_data->subscribed_ue_ambr);
OpenAPI_nssai_free(access_and_mobility_subscription_data->nssai);
OpenAPI_list_for_each(access_and_mobility_subscription_data->rat_restrictions, node) {
OpenAPI_rat_type_free(node->data);
}
OpenAPI_list_free(access_and_mobility_subscription_data->rat_restrictions);
OpenAPI_list_for_each(access_and_mobility_subscription_data->forbidden_areas, node) {
OpenAPI_area_free(node->data);
@ -182,13 +179,7 @@ void OpenAPI_access_and_mobility_subscription_data_free(OpenAPI_access_and_mobil
OpenAPI_maximum_latency_free(node->data);
}
OpenAPI_list_free(access_and_mobility_subscription_data->maximum_latency_list);
OpenAPI_list_for_each(access_and_mobility_subscription_data->primary_rat_restrictions, node) {
OpenAPI_rat_type_free(node->data);
}
OpenAPI_list_free(access_and_mobility_subscription_data->primary_rat_restrictions);
OpenAPI_list_for_each(access_and_mobility_subscription_data->secondary_rat_restrictions, node) {
OpenAPI_rat_type_free(node->data);
}
OpenAPI_list_free(access_and_mobility_subscription_data->secondary_rat_restrictions);
OpenAPI_list_for_each(access_and_mobility_subscription_data->edrx_parameters_list, node) {
OpenAPI_edrx_parameters_free(node->data);
@ -317,21 +308,16 @@ cJSON *OpenAPI_access_and_mobility_subscription_data_convertToJSON(OpenAPI_acces
}
if (access_and_mobility_subscription_data->rat_restrictions) {
cJSON *rat_restrictionsList = cJSON_AddArrayToObject(item, "ratRestrictions");
if (rat_restrictionsList == NULL) {
cJSON *rat_restrictions = cJSON_AddArrayToObject(item, "ratRestrictions");
if (rat_restrictions == NULL) {
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [rat_restrictions]");
goto end;
}
OpenAPI_lnode_t *rat_restrictions_node;
if (access_and_mobility_subscription_data->rat_restrictions) {
OpenAPI_list_for_each(access_and_mobility_subscription_data->rat_restrictions, rat_restrictions_node) {
cJSON *itemLocal = OpenAPI_rat_type_convertToJSON(rat_restrictions_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [rat_restrictions]");
goto end;
}
cJSON_AddItemToArray(rat_restrictionsList, itemLocal);
OpenAPI_list_for_each(access_and_mobility_subscription_data->rat_restrictions, rat_restrictions_node) {
if (cJSON_AddStringToObject(rat_restrictions, "", OpenAPI_rat_type_ToString((OpenAPI_rat_type_e)rat_restrictions_node->data)) == NULL) {
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [rat_restrictions]");
goto end;
}
}
}
@ -410,14 +396,14 @@ cJSON *OpenAPI_access_and_mobility_subscription_data_convertToJSON(OpenAPI_acces
}
}
if (access_and_mobility_subscription_data->mps_priority >= 0) {
if (access_and_mobility_subscription_data->mps_priority) {
if (cJSON_AddBoolToObject(item, "mpsPriority", access_and_mobility_subscription_data->mps_priority) == NULL) {
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [mps_priority]");
goto end;
}
}
if (access_and_mobility_subscription_data->mcs_priority >= 0) {
if (access_and_mobility_subscription_data->mcs_priority) {
if (cJSON_AddBoolToObject(item, "mcsPriority", access_and_mobility_subscription_data->mcs_priority) == NULL) {
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [mcs_priority]");
goto end;
@ -451,14 +437,14 @@ cJSON *OpenAPI_access_and_mobility_subscription_data_convertToJSON(OpenAPI_acces
}
}
if (access_and_mobility_subscription_data->sor_info_expect_ind >= 0) {
if (access_and_mobility_subscription_data->sor_info_expect_ind) {
if (cJSON_AddBoolToObject(item, "sorInfoExpectInd", access_and_mobility_subscription_data->sor_info_expect_ind) == NULL) {
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [sor_info_expect_ind]");
goto end;
}
}
if (access_and_mobility_subscription_data->soraf_retrieval >= 0) {
if (access_and_mobility_subscription_data->soraf_retrieval) {
if (cJSON_AddBoolToObject(item, "sorafRetrieval", access_and_mobility_subscription_data->soraf_retrieval) == NULL) {
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [soraf_retrieval]");
goto end;
@ -493,7 +479,7 @@ cJSON *OpenAPI_access_and_mobility_subscription_data_convertToJSON(OpenAPI_acces
}
}
if (access_and_mobility_subscription_data->mico_allowed >= 0) {
if (access_and_mobility_subscription_data->mico_allowed) {
if (cJSON_AddBoolToObject(item, "micoAllowed", access_and_mobility_subscription_data->mico_allowed) == NULL) {
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [mico_allowed]");
goto end;
@ -599,7 +585,7 @@ cJSON *OpenAPI_access_and_mobility_subscription_data_convertToJSON(OpenAPI_acces
}
}
if (access_and_mobility_subscription_data->nssai_inclusion_allowed >= 0) {
if (access_and_mobility_subscription_data->nssai_inclusion_allowed) {
if (cJSON_AddBoolToObject(item, "nssaiInclusionAllowed", access_and_mobility_subscription_data->nssai_inclusion_allowed) == NULL) {
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [nssai_inclusion_allowed]");
goto end;
@ -693,41 +679,31 @@ cJSON *OpenAPI_access_and_mobility_subscription_data_convertToJSON(OpenAPI_acces
}
if (access_and_mobility_subscription_data->primary_rat_restrictions) {
cJSON *primary_rat_restrictionsList = cJSON_AddArrayToObject(item, "primaryRatRestrictions");
if (primary_rat_restrictionsList == NULL) {
cJSON *primary_rat_restrictions = cJSON_AddArrayToObject(item, "primaryRatRestrictions");
if (primary_rat_restrictions == NULL) {
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [primary_rat_restrictions]");
goto end;
}
OpenAPI_lnode_t *primary_rat_restrictions_node;
if (access_and_mobility_subscription_data->primary_rat_restrictions) {
OpenAPI_list_for_each(access_and_mobility_subscription_data->primary_rat_restrictions, primary_rat_restrictions_node) {
cJSON *itemLocal = OpenAPI_rat_type_convertToJSON(primary_rat_restrictions_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [primary_rat_restrictions]");
goto end;
}
cJSON_AddItemToArray(primary_rat_restrictionsList, itemLocal);
OpenAPI_list_for_each(access_and_mobility_subscription_data->primary_rat_restrictions, primary_rat_restrictions_node) {
if (cJSON_AddStringToObject(primary_rat_restrictions, "", OpenAPI_rat_type_ToString((OpenAPI_rat_type_e)primary_rat_restrictions_node->data)) == NULL) {
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [primary_rat_restrictions]");
goto end;
}
}
}
if (access_and_mobility_subscription_data->secondary_rat_restrictions) {
cJSON *secondary_rat_restrictionsList = cJSON_AddArrayToObject(item, "secondaryRatRestrictions");
if (secondary_rat_restrictionsList == NULL) {
cJSON *secondary_rat_restrictions = cJSON_AddArrayToObject(item, "secondaryRatRestrictions");
if (secondary_rat_restrictions == NULL) {
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [secondary_rat_restrictions]");
goto end;
}
OpenAPI_lnode_t *secondary_rat_restrictions_node;
if (access_and_mobility_subscription_data->secondary_rat_restrictions) {
OpenAPI_list_for_each(access_and_mobility_subscription_data->secondary_rat_restrictions, secondary_rat_restrictions_node) {
cJSON *itemLocal = OpenAPI_rat_type_convertToJSON(secondary_rat_restrictions_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [secondary_rat_restrictions]");
goto end;
}
cJSON_AddItemToArray(secondary_rat_restrictionsList, itemLocal);
OpenAPI_list_for_each(access_and_mobility_subscription_data->secondary_rat_restrictions, secondary_rat_restrictions_node) {
if (cJSON_AddStringToObject(secondary_rat_restrictions, "", OpenAPI_rat_type_ToString((OpenAPI_rat_type_e)secondary_rat_restrictions_node->data)) == NULL) {
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [secondary_rat_restrictions]");
goto end;
}
}
}
@ -772,7 +748,7 @@ cJSON *OpenAPI_access_and_mobility_subscription_data_convertToJSON(OpenAPI_acces
}
}
if (access_and_mobility_subscription_data->iab_operation_allowed >= 0) {
if (access_and_mobility_subscription_data->iab_operation_allowed) {
if (cJSON_AddBoolToObject(item, "iabOperationAllowed", access_and_mobility_subscription_data->iab_operation_allowed) == NULL) {
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed [iab_operation_allowed]");
goto end;
@ -942,13 +918,12 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub
rat_restrictionsList = OpenAPI_list_create();
cJSON_ArrayForEach(rat_restrictions_local_nonprimitive, rat_restrictions ) {
if (!cJSON_IsObject(rat_restrictions_local_nonprimitive)) {
if (!cJSON_IsString(rat_restrictions_local_nonprimitive)) {
ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [rat_restrictions]");
goto end;
}
OpenAPI_rat_type_t *rat_restrictionsItem = OpenAPI_rat_type_parseFromJSON(rat_restrictions_local_nonprimitive);
OpenAPI_list_add(rat_restrictionsList, rat_restrictionsItem);
OpenAPI_list_add(rat_restrictionsList, (void *)OpenAPI_rat_type_FromString(rat_restrictions_local_nonprimitive->valuestring));
}
}
@ -1326,13 +1301,12 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub
primary_rat_restrictionsList = OpenAPI_list_create();
cJSON_ArrayForEach(primary_rat_restrictions_local_nonprimitive, primary_rat_restrictions ) {
if (!cJSON_IsObject(primary_rat_restrictions_local_nonprimitive)) {
if (!cJSON_IsString(primary_rat_restrictions_local_nonprimitive)) {
ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [primary_rat_restrictions]");
goto end;
}
OpenAPI_rat_type_t *primary_rat_restrictionsItem = OpenAPI_rat_type_parseFromJSON(primary_rat_restrictions_local_nonprimitive);
OpenAPI_list_add(primary_rat_restrictionsList, primary_rat_restrictionsItem);
OpenAPI_list_add(primary_rat_restrictionsList, (void *)OpenAPI_rat_type_FromString(primary_rat_restrictions_local_nonprimitive->valuestring));
}
}
@ -1349,13 +1323,12 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub
secondary_rat_restrictionsList = OpenAPI_list_create();
cJSON_ArrayForEach(secondary_rat_restrictions_local_nonprimitive, secondary_rat_restrictions ) {
if (!cJSON_IsObject(secondary_rat_restrictions_local_nonprimitive)) {
if (!cJSON_IsString(secondary_rat_restrictions_local_nonprimitive)) {
ogs_error("OpenAPI_access_and_mobility_subscription_data_parseFromJSON() failed [secondary_rat_restrictions]");
goto end;
}
OpenAPI_rat_type_t *secondary_rat_restrictionsItem = OpenAPI_rat_type_parseFromJSON(secondary_rat_restrictions_local_nonprimitive);
OpenAPI_list_add(secondary_rat_restrictionsList, secondary_rat_restrictionsItem);
OpenAPI_list_add(secondary_rat_restrictionsList, (void *)OpenAPI_rat_type_FromString(secondary_rat_restrictions_local_nonprimitive->valuestring));
}
}
@ -1503,3 +1476,37 @@ end:
return NULL;
}
OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_subscription_data_copy(OpenAPI_access_and_mobility_subscription_data_t *dst, OpenAPI_access_and_mobility_subscription_data_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_access_and_mobility_subscription_data_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_access_and_mobility_subscription_data_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_access_and_mobility_subscription_data_free(dst);
dst = OpenAPI_access_and_mobility_subscription_data_parseFromJSON(item);
cJSON_Delete(item);
return dst;
}

View file

@ -146,6 +146,7 @@ OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_sub
void OpenAPI_access_and_mobility_subscription_data_free(OpenAPI_access_and_mobility_subscription_data_t *access_and_mobility_subscription_data);
OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_subscription_data_parseFromJSON(cJSON *access_and_mobility_subscription_dataJSON);
cJSON *OpenAPI_access_and_mobility_subscription_data_convertToJSON(OpenAPI_access_and_mobility_subscription_data_t *access_and_mobility_subscription_data);
OpenAPI_access_and_mobility_subscription_data_t *OpenAPI_access_and_mobility_subscription_data_copy(OpenAPI_access_and_mobility_subscription_data_t *dst, OpenAPI_access_and_mobility_subscription_data_t *src);
#ifdef __cplusplus
}

View file

@ -49,3 +49,37 @@ end:
return NULL;
}
OpenAPI_access_right_status_t *OpenAPI_access_right_status_copy(OpenAPI_access_right_status_t *dst, OpenAPI_access_right_status_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_access_right_status_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_access_right_status_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_access_right_status_free(dst);
dst = OpenAPI_access_right_status_parseFromJSON(item);
cJSON_Delete(item);
return dst;
}

View file

@ -26,6 +26,7 @@ OpenAPI_access_right_status_t *OpenAPI_access_right_status_create(
void OpenAPI_access_right_status_free(OpenAPI_access_right_status_t *access_right_status);
OpenAPI_access_right_status_t *OpenAPI_access_right_status_parseFromJSON(cJSON *access_right_statusJSON);
cJSON *OpenAPI_access_right_status_convertToJSON(OpenAPI_access_right_status_t *access_right_status);
OpenAPI_access_right_status_t *OpenAPI_access_right_status_copy(OpenAPI_access_right_status_t *dst, OpenAPI_access_right_status_t *src);
#ifdef __cplusplus
}

View file

@ -49,3 +49,37 @@ end:
return NULL;
}
OpenAPI_access_tech_t *OpenAPI_access_tech_copy(OpenAPI_access_tech_t *dst, OpenAPI_access_tech_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_access_tech_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_access_tech_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_access_tech_free(dst);
dst = OpenAPI_access_tech_parseFromJSON(item);
cJSON_Delete(item);
return dst;
}

View file

@ -26,6 +26,7 @@ OpenAPI_access_tech_t *OpenAPI_access_tech_create(
void OpenAPI_access_tech_free(OpenAPI_access_tech_t *access_tech);
OpenAPI_access_tech_t *OpenAPI_access_tech_parseFromJSON(cJSON *access_techJSON);
cJSON *OpenAPI_access_tech_convertToJSON(OpenAPI_access_tech_t *access_tech);
OpenAPI_access_tech_t *OpenAPI_access_tech_copy(OpenAPI_access_tech_t *dst, OpenAPI_access_tech_t *src);
#ifdef __cplusplus
}

View file

@ -134,3 +134,37 @@ end:
return NULL;
}
OpenAPI_acknowledge_info_t *OpenAPI_acknowledge_info_copy(OpenAPI_acknowledge_info_t *dst, OpenAPI_acknowledge_info_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_acknowledge_info_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_acknowledge_info_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_acknowledge_info_free(dst);
dst = OpenAPI_acknowledge_info_parseFromJSON(item);
cJSON_Delete(item);
return dst;
}

View file

@ -34,6 +34,7 @@ OpenAPI_acknowledge_info_t *OpenAPI_acknowledge_info_create(
void OpenAPI_acknowledge_info_free(OpenAPI_acknowledge_info_t *acknowledge_info);
OpenAPI_acknowledge_info_t *OpenAPI_acknowledge_info_parseFromJSON(cJSON *acknowledge_infoJSON);
cJSON *OpenAPI_acknowledge_info_convertToJSON(OpenAPI_acknowledge_info_t *acknowledge_info);
OpenAPI_acknowledge_info_t *OpenAPI_acknowledge_info_copy(OpenAPI_acknowledge_info_t *dst, OpenAPI_acknowledge_info_t *src);
#ifdef __cplusplus
}

View file

@ -109,3 +109,37 @@ end:
return NULL;
}
OpenAPI_acs_info_t *OpenAPI_acs_info_copy(OpenAPI_acs_info_t *dst, OpenAPI_acs_info_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_acs_info_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_acs_info_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_acs_info_free(dst);
dst = OpenAPI_acs_info_parseFromJSON(item);
cJSON_Delete(item);
return dst;
}

View file

@ -32,6 +32,7 @@ OpenAPI_acs_info_t *OpenAPI_acs_info_create(
void OpenAPI_acs_info_free(OpenAPI_acs_info_t *acs_info);
OpenAPI_acs_info_t *OpenAPI_acs_info_parseFromJSON(cJSON *acs_infoJSON);
cJSON *OpenAPI_acs_info_convertToJSON(OpenAPI_acs_info_t *acs_info);
OpenAPI_acs_info_t *OpenAPI_acs_info_copy(OpenAPI_acs_info_t *dst, OpenAPI_acs_info_t *src);
#ifdef __cplusplus
}

View file

@ -109,3 +109,37 @@ end:
return NULL;
}
OpenAPI_acs_info_rm_t *OpenAPI_acs_info_rm_copy(OpenAPI_acs_info_rm_t *dst, OpenAPI_acs_info_rm_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_acs_info_rm_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_acs_info_rm_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_acs_info_rm_free(dst);
dst = OpenAPI_acs_info_rm_parseFromJSON(item);
cJSON_Delete(item);
return dst;
}

View file

@ -34,6 +34,7 @@ OpenAPI_acs_info_rm_t *OpenAPI_acs_info_rm_create(
void OpenAPI_acs_info_rm_free(OpenAPI_acs_info_rm_t *acs_info_rm);
OpenAPI_acs_info_rm_t *OpenAPI_acs_info_rm_parseFromJSON(cJSON *acs_info_rmJSON);
cJSON *OpenAPI_acs_info_rm_convertToJSON(OpenAPI_acs_info_rm_t *acs_info_rm);
OpenAPI_acs_info_rm_t *OpenAPI_acs_info_rm_copy(OpenAPI_acs_info_rm_t *dst, OpenAPI_acs_info_rm_t *src);
#ifdef __cplusplus
}

View file

@ -0,0 +1,85 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "additional_qos_flow_info.h"
OpenAPI_additional_qos_flow_info_t *OpenAPI_additional_qos_flow_info_create(
)
{
OpenAPI_additional_qos_flow_info_t *additional_qos_flow_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_additional_qos_flow_info_t));
if (!additional_qos_flow_info_local_var) {
return NULL;
}
return additional_qos_flow_info_local_var;
}
void OpenAPI_additional_qos_flow_info_free(OpenAPI_additional_qos_flow_info_t *additional_qos_flow_info)
{
if (NULL == additional_qos_flow_info) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(additional_qos_flow_info);
}
cJSON *OpenAPI_additional_qos_flow_info_convertToJSON(OpenAPI_additional_qos_flow_info_t *additional_qos_flow_info)
{
cJSON *item = NULL;
if (additional_qos_flow_info == NULL) {
ogs_error("OpenAPI_additional_qos_flow_info_convertToJSON() failed [AdditionalQosFlowInfo]");
return NULL;
}
item = cJSON_CreateObject();
end:
return item;
}
OpenAPI_additional_qos_flow_info_t *OpenAPI_additional_qos_flow_info_parseFromJSON(cJSON *additional_qos_flow_infoJSON)
{
OpenAPI_additional_qos_flow_info_t *additional_qos_flow_info_local_var = NULL;
additional_qos_flow_info_local_var = OpenAPI_additional_qos_flow_info_create (
);
return additional_qos_flow_info_local_var;
end:
return NULL;
}
OpenAPI_additional_qos_flow_info_t *OpenAPI_additional_qos_flow_info_copy(OpenAPI_additional_qos_flow_info_t *dst, OpenAPI_additional_qos_flow_info_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_additional_qos_flow_info_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_additional_qos_flow_info_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_additional_qos_flow_info_free(dst);
dst = OpenAPI_additional_qos_flow_info_parseFromJSON(item);
cJSON_Delete(item);
return dst;
}

View file

@ -0,0 +1,37 @@
/*
* additional_qos_flow_info.h
*
*
*/
#ifndef _OpenAPI_additional_qos_flow_info_H_
#define _OpenAPI_additional_qos_flow_info_H_
#include <string.h>
#include "../external/cJSON.h"
#include "../include/list.h"
#include "../include/keyValuePair.h"
#include "../include/binary.h"
#include "null_value.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct OpenAPI_additional_qos_flow_info_s OpenAPI_additional_qos_flow_info_t;
typedef struct OpenAPI_additional_qos_flow_info_s {
} OpenAPI_additional_qos_flow_info_t;
OpenAPI_additional_qos_flow_info_t *OpenAPI_additional_qos_flow_info_create(
);
void OpenAPI_additional_qos_flow_info_free(OpenAPI_additional_qos_flow_info_t *additional_qos_flow_info);
OpenAPI_additional_qos_flow_info_t *OpenAPI_additional_qos_flow_info_parseFromJSON(cJSON *additional_qos_flow_infoJSON);
cJSON *OpenAPI_additional_qos_flow_info_convertToJSON(OpenAPI_additional_qos_flow_info_t *additional_qos_flow_info);
OpenAPI_additional_qos_flow_info_t *OpenAPI_additional_qos_flow_info_copy(OpenAPI_additional_qos_flow_info_t *dst, OpenAPI_additional_qos_flow_info_t *src);
#ifdef __cplusplus
}
#endif
#endif /* _OpenAPI_additional_qos_flow_info_H_ */

View file

@ -36,7 +36,7 @@ cJSON *OpenAPI_additional_snssai_data_convertToJSON(OpenAPI_additional_snssai_da
}
item = cJSON_CreateObject();
if (additional_snssai_data->required_authn_authz >= 0) {
if (additional_snssai_data->required_authn_authz) {
if (cJSON_AddBoolToObject(item, "requiredAuthnAuthz", additional_snssai_data->required_authn_authz) == NULL) {
ogs_error("OpenAPI_additional_snssai_data_convertToJSON() failed [required_authn_authz]");
goto end;
@ -68,3 +68,37 @@ end:
return NULL;
}
OpenAPI_additional_snssai_data_t *OpenAPI_additional_snssai_data_copy(OpenAPI_additional_snssai_data_t *dst, OpenAPI_additional_snssai_data_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_additional_snssai_data_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_additional_snssai_data_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_additional_snssai_data_free(dst);
dst = OpenAPI_additional_snssai_data_parseFromJSON(item);
cJSON_Delete(item);
return dst;
}

View file

@ -28,6 +28,7 @@ OpenAPI_additional_snssai_data_t *OpenAPI_additional_snssai_data_create(
void OpenAPI_additional_snssai_data_free(OpenAPI_additional_snssai_data_t *additional_snssai_data);
OpenAPI_additional_snssai_data_t *OpenAPI_additional_snssai_data_parseFromJSON(cJSON *additional_snssai_dataJSON);
cJSON *OpenAPI_additional_snssai_data_convertToJSON(OpenAPI_additional_snssai_data_t *additional_snssai_data);
OpenAPI_additional_snssai_data_t *OpenAPI_additional_snssai_data_copy(OpenAPI_additional_snssai_data_t *dst, OpenAPI_additional_snssai_data_t *src);
#ifdef __cplusplus
}

View file

@ -49,3 +49,37 @@ end:
return NULL;
}
OpenAPI_af_event_t *OpenAPI_af_event_copy(OpenAPI_af_event_t *dst, OpenAPI_af_event_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_af_event_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_af_event_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_af_event_free(dst);
dst = OpenAPI_af_event_parseFromJSON(item);
cJSON_Delete(item);
return dst;
}

View file

@ -26,6 +26,7 @@ OpenAPI_af_event_t *OpenAPI_af_event_create(
void OpenAPI_af_event_free(OpenAPI_af_event_t *af_event);
OpenAPI_af_event_t *OpenAPI_af_event_parseFromJSON(cJSON *af_eventJSON);
cJSON *OpenAPI_af_event_convertToJSON(OpenAPI_af_event_t *af_event);
OpenAPI_af_event_t *OpenAPI_af_event_copy(OpenAPI_af_event_t *dst, OpenAPI_af_event_t *src);
#ifdef __cplusplus
}

View file

@ -190,3 +190,37 @@ end:
return NULL;
}
OpenAPI_af_event_exposure_data_t *OpenAPI_af_event_exposure_data_copy(OpenAPI_af_event_exposure_data_t *dst, OpenAPI_af_event_exposure_data_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_af_event_exposure_data_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_af_event_exposure_data_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_af_event_exposure_data_free(dst);
dst = OpenAPI_af_event_exposure_data_parseFromJSON(item);
cJSON_Delete(item);
return dst;
}

View file

@ -33,6 +33,7 @@ OpenAPI_af_event_exposure_data_t *OpenAPI_af_event_exposure_data_create(
void OpenAPI_af_event_exposure_data_free(OpenAPI_af_event_exposure_data_t *af_event_exposure_data);
OpenAPI_af_event_exposure_data_t *OpenAPI_af_event_exposure_data_parseFromJSON(cJSON *af_event_exposure_dataJSON);
cJSON *OpenAPI_af_event_exposure_data_convertToJSON(OpenAPI_af_event_exposure_data_t *af_event_exposure_data);
OpenAPI_af_event_exposure_data_t *OpenAPI_af_event_exposure_data_copy(OpenAPI_af_event_exposure_data_t *dst, OpenAPI_af_event_exposure_data_t *src);
#ifdef __cplusplus
}

View file

@ -164,3 +164,37 @@ end:
return NULL;
}
OpenAPI_af_external_t *OpenAPI_af_external_copy(OpenAPI_af_external_t *dst, OpenAPI_af_external_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_af_external_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_af_external_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_af_external_free(dst);
dst = OpenAPI_af_external_parseFromJSON(item);
cJSON_Delete(item);
return dst;
}

View file

@ -37,6 +37,7 @@ OpenAPI_af_external_t *OpenAPI_af_external_create(
void OpenAPI_af_external_free(OpenAPI_af_external_t *af_external);
OpenAPI_af_external_t *OpenAPI_af_external_parseFromJSON(cJSON *af_externalJSON);
cJSON *OpenAPI_af_external_convertToJSON(OpenAPI_af_external_t *af_external);
OpenAPI_af_external_t *OpenAPI_af_external_copy(OpenAPI_af_external_t *dst, OpenAPI_af_external_t *src);
#ifdef __cplusplus
}

View file

@ -190,3 +190,37 @@ end:
return NULL;
}
OpenAPI_af_non_external_t *OpenAPI_af_non_external_copy(OpenAPI_af_non_external_t *dst, OpenAPI_af_non_external_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_af_non_external_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_af_non_external_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_af_non_external_free(dst);
dst = OpenAPI_af_non_external_parseFromJSON(item);
cJSON_Delete(item);
return dst;
}

View file

@ -40,6 +40,7 @@ OpenAPI_af_non_external_t *OpenAPI_af_non_external_create(
void OpenAPI_af_non_external_free(OpenAPI_af_non_external_t *af_non_external);
OpenAPI_af_non_external_t *OpenAPI_af_non_external_parseFromJSON(cJSON *af_non_externalJSON);
cJSON *OpenAPI_af_non_external_convertToJSON(OpenAPI_af_non_external_t *af_non_external);
OpenAPI_af_non_external_t *OpenAPI_af_non_external_copy(OpenAPI_af_non_external_t *dst, OpenAPI_af_non_external_t *src);
#ifdef __cplusplus
}

View file

@ -0,0 +1,166 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "allowed_nssai.h"
OpenAPI_allowed_nssai_t *OpenAPI_allowed_nssai_create(
OpenAPI_list_t *allowed_snssai_list,
OpenAPI_access_type_e access_type
)
{
OpenAPI_allowed_nssai_t *allowed_nssai_local_var = OpenAPI_malloc(sizeof(OpenAPI_allowed_nssai_t));
if (!allowed_nssai_local_var) {
return NULL;
}
allowed_nssai_local_var->allowed_snssai_list = allowed_snssai_list;
allowed_nssai_local_var->access_type = access_type;
return allowed_nssai_local_var;
}
void OpenAPI_allowed_nssai_free(OpenAPI_allowed_nssai_t *allowed_nssai)
{
if (NULL == allowed_nssai) {
return;
}
OpenAPI_lnode_t *node;
OpenAPI_list_for_each(allowed_nssai->allowed_snssai_list, node) {
OpenAPI_allowed_snssai_free(node->data);
}
OpenAPI_list_free(allowed_nssai->allowed_snssai_list);
ogs_free(allowed_nssai);
}
cJSON *OpenAPI_allowed_nssai_convertToJSON(OpenAPI_allowed_nssai_t *allowed_nssai)
{
cJSON *item = NULL;
if (allowed_nssai == NULL) {
ogs_error("OpenAPI_allowed_nssai_convertToJSON() failed [AllowedNssai]");
return NULL;
}
item = cJSON_CreateObject();
if (!allowed_nssai->allowed_snssai_list) {
ogs_error("OpenAPI_allowed_nssai_convertToJSON() failed [allowed_snssai_list]");
goto end;
}
cJSON *allowed_snssai_listList = cJSON_AddArrayToObject(item, "allowedSnssaiList");
if (allowed_snssai_listList == NULL) {
ogs_error("OpenAPI_allowed_nssai_convertToJSON() failed [allowed_snssai_list]");
goto end;
}
OpenAPI_lnode_t *allowed_snssai_list_node;
if (allowed_nssai->allowed_snssai_list) {
OpenAPI_list_for_each(allowed_nssai->allowed_snssai_list, allowed_snssai_list_node) {
cJSON *itemLocal = OpenAPI_allowed_snssai_convertToJSON(allowed_snssai_list_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_allowed_nssai_convertToJSON() failed [allowed_snssai_list]");
goto end;
}
cJSON_AddItemToArray(allowed_snssai_listList, itemLocal);
}
}
if (!allowed_nssai->access_type) {
ogs_error("OpenAPI_allowed_nssai_convertToJSON() failed [access_type]");
goto end;
}
if (cJSON_AddStringToObject(item, "accessType", OpenAPI_access_type_ToString(allowed_nssai->access_type)) == NULL) {
ogs_error("OpenAPI_allowed_nssai_convertToJSON() failed [access_type]");
goto end;
}
end:
return item;
}
OpenAPI_allowed_nssai_t *OpenAPI_allowed_nssai_parseFromJSON(cJSON *allowed_nssaiJSON)
{
OpenAPI_allowed_nssai_t *allowed_nssai_local_var = NULL;
cJSON *allowed_snssai_list = cJSON_GetObjectItemCaseSensitive(allowed_nssaiJSON, "allowedSnssaiList");
if (!allowed_snssai_list) {
ogs_error("OpenAPI_allowed_nssai_parseFromJSON() failed [allowed_snssai_list]");
goto end;
}
OpenAPI_list_t *allowed_snssai_listList;
cJSON *allowed_snssai_list_local_nonprimitive;
if (!cJSON_IsArray(allowed_snssai_list)) {
ogs_error("OpenAPI_allowed_nssai_parseFromJSON() failed [allowed_snssai_list]");
goto end;
}
allowed_snssai_listList = OpenAPI_list_create();
cJSON_ArrayForEach(allowed_snssai_list_local_nonprimitive, allowed_snssai_list ) {
if (!cJSON_IsObject(allowed_snssai_list_local_nonprimitive)) {
ogs_error("OpenAPI_allowed_nssai_parseFromJSON() failed [allowed_snssai_list]");
goto end;
}
OpenAPI_allowed_snssai_t *allowed_snssai_listItem = OpenAPI_allowed_snssai_parseFromJSON(allowed_snssai_list_local_nonprimitive);
OpenAPI_list_add(allowed_snssai_listList, allowed_snssai_listItem);
}
cJSON *access_type = cJSON_GetObjectItemCaseSensitive(allowed_nssaiJSON, "accessType");
if (!access_type) {
ogs_error("OpenAPI_allowed_nssai_parseFromJSON() failed [access_type]");
goto end;
}
OpenAPI_access_type_e access_typeVariable;
if (!cJSON_IsString(access_type)) {
ogs_error("OpenAPI_allowed_nssai_parseFromJSON() failed [access_type]");
goto end;
}
access_typeVariable = OpenAPI_access_type_FromString(access_type->valuestring);
allowed_nssai_local_var = OpenAPI_allowed_nssai_create (
allowed_snssai_listList,
access_typeVariable
);
return allowed_nssai_local_var;
end:
return NULL;
}
OpenAPI_allowed_nssai_t *OpenAPI_allowed_nssai_copy(OpenAPI_allowed_nssai_t *dst, OpenAPI_allowed_nssai_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_allowed_nssai_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_allowed_nssai_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_allowed_nssai_free(dst);
dst = OpenAPI_allowed_nssai_parseFromJSON(item);
cJSON_Delete(item);
return dst;
}

View file

@ -0,0 +1,42 @@
/*
* allowed_nssai.h
*
*
*/
#ifndef _OpenAPI_allowed_nssai_H_
#define _OpenAPI_allowed_nssai_H_
#include <string.h>
#include "../external/cJSON.h"
#include "../include/list.h"
#include "../include/keyValuePair.h"
#include "../include/binary.h"
#include "access_type.h"
#include "allowed_snssai.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct OpenAPI_allowed_nssai_s OpenAPI_allowed_nssai_t;
typedef struct OpenAPI_allowed_nssai_s {
OpenAPI_list_t *allowed_snssai_list;
OpenAPI_access_type_e access_type;
} OpenAPI_allowed_nssai_t;
OpenAPI_allowed_nssai_t *OpenAPI_allowed_nssai_create(
OpenAPI_list_t *allowed_snssai_list,
OpenAPI_access_type_e access_type
);
void OpenAPI_allowed_nssai_free(OpenAPI_allowed_nssai_t *allowed_nssai);
OpenAPI_allowed_nssai_t *OpenAPI_allowed_nssai_parseFromJSON(cJSON *allowed_nssaiJSON);
cJSON *OpenAPI_allowed_nssai_convertToJSON(OpenAPI_allowed_nssai_t *allowed_nssai);
OpenAPI_allowed_nssai_t *OpenAPI_allowed_nssai_copy(OpenAPI_allowed_nssai_t *dst, OpenAPI_allowed_nssai_t *src);
#ifdef __cplusplus
}
#endif
#endif /* _OpenAPI_allowed_nssai_H_ */

View file

@ -0,0 +1,188 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "allowed_snssai.h"
OpenAPI_allowed_snssai_t *OpenAPI_allowed_snssai_create(
OpenAPI_snssai_t *allowed_snssai,
OpenAPI_list_t *nsi_information_list,
OpenAPI_snssai_t *mapped_home_snssai
)
{
OpenAPI_allowed_snssai_t *allowed_snssai_local_var = OpenAPI_malloc(sizeof(OpenAPI_allowed_snssai_t));
if (!allowed_snssai_local_var) {
return NULL;
}
allowed_snssai_local_var->allowed_snssai = allowed_snssai;
allowed_snssai_local_var->nsi_information_list = nsi_information_list;
allowed_snssai_local_var->mapped_home_snssai = mapped_home_snssai;
return allowed_snssai_local_var;
}
void OpenAPI_allowed_snssai_free(OpenAPI_allowed_snssai_t *allowed_snssai)
{
if (NULL == allowed_snssai) {
return;
}
OpenAPI_lnode_t *node;
OpenAPI_snssai_free(allowed_snssai->allowed_snssai);
OpenAPI_list_for_each(allowed_snssai->nsi_information_list, node) {
OpenAPI_nsi_information_free(node->data);
}
OpenAPI_list_free(allowed_snssai->nsi_information_list);
OpenAPI_snssai_free(allowed_snssai->mapped_home_snssai);
ogs_free(allowed_snssai);
}
cJSON *OpenAPI_allowed_snssai_convertToJSON(OpenAPI_allowed_snssai_t *allowed_snssai)
{
cJSON *item = NULL;
if (allowed_snssai == NULL) {
ogs_error("OpenAPI_allowed_snssai_convertToJSON() failed [AllowedSnssai]");
return NULL;
}
item = cJSON_CreateObject();
if (!allowed_snssai->allowed_snssai) {
ogs_error("OpenAPI_allowed_snssai_convertToJSON() failed [allowed_snssai]");
goto end;
}
cJSON *allowed_snssai_local_JSON = OpenAPI_snssai_convertToJSON(allowed_snssai->allowed_snssai);
if (allowed_snssai_local_JSON == NULL) {
ogs_error("OpenAPI_allowed_snssai_convertToJSON() failed [allowed_snssai]");
goto end;
}
cJSON_AddItemToObject(item, "allowedSnssai", allowed_snssai_local_JSON);
if (item->child == NULL) {
ogs_error("OpenAPI_allowed_snssai_convertToJSON() failed [allowed_snssai]");
goto end;
}
if (allowed_snssai->nsi_information_list) {
cJSON *nsi_information_listList = cJSON_AddArrayToObject(item, "nsiInformationList");
if (nsi_information_listList == NULL) {
ogs_error("OpenAPI_allowed_snssai_convertToJSON() failed [nsi_information_list]");
goto end;
}
OpenAPI_lnode_t *nsi_information_list_node;
if (allowed_snssai->nsi_information_list) {
OpenAPI_list_for_each(allowed_snssai->nsi_information_list, nsi_information_list_node) {
cJSON *itemLocal = OpenAPI_nsi_information_convertToJSON(nsi_information_list_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_allowed_snssai_convertToJSON() failed [nsi_information_list]");
goto end;
}
cJSON_AddItemToArray(nsi_information_listList, itemLocal);
}
}
}
if (allowed_snssai->mapped_home_snssai) {
cJSON *mapped_home_snssai_local_JSON = OpenAPI_snssai_convertToJSON(allowed_snssai->mapped_home_snssai);
if (mapped_home_snssai_local_JSON == NULL) {
ogs_error("OpenAPI_allowed_snssai_convertToJSON() failed [mapped_home_snssai]");
goto end;
}
cJSON_AddItemToObject(item, "mappedHomeSnssai", mapped_home_snssai_local_JSON);
if (item->child == NULL) {
ogs_error("OpenAPI_allowed_snssai_convertToJSON() failed [mapped_home_snssai]");
goto end;
}
}
end:
return item;
}
OpenAPI_allowed_snssai_t *OpenAPI_allowed_snssai_parseFromJSON(cJSON *allowed_snssaiJSON)
{
OpenAPI_allowed_snssai_t *allowed_snssai_local_var = NULL;
cJSON *allowed_snssai = cJSON_GetObjectItemCaseSensitive(allowed_snssaiJSON, "allowedSnssai");
if (!allowed_snssai) {
ogs_error("OpenAPI_allowed_snssai_parseFromJSON() failed [allowed_snssai]");
goto end;
}
OpenAPI_snssai_t *allowed_snssai_local_nonprim = NULL;
allowed_snssai_local_nonprim = OpenAPI_snssai_parseFromJSON(allowed_snssai);
cJSON *nsi_information_list = cJSON_GetObjectItemCaseSensitive(allowed_snssaiJSON, "nsiInformationList");
OpenAPI_list_t *nsi_information_listList;
if (nsi_information_list) {
cJSON *nsi_information_list_local_nonprimitive;
if (!cJSON_IsArray(nsi_information_list)) {
ogs_error("OpenAPI_allowed_snssai_parseFromJSON() failed [nsi_information_list]");
goto end;
}
nsi_information_listList = OpenAPI_list_create();
cJSON_ArrayForEach(nsi_information_list_local_nonprimitive, nsi_information_list ) {
if (!cJSON_IsObject(nsi_information_list_local_nonprimitive)) {
ogs_error("OpenAPI_allowed_snssai_parseFromJSON() failed [nsi_information_list]");
goto end;
}
OpenAPI_nsi_information_t *nsi_information_listItem = OpenAPI_nsi_information_parseFromJSON(nsi_information_list_local_nonprimitive);
OpenAPI_list_add(nsi_information_listList, nsi_information_listItem);
}
}
cJSON *mapped_home_snssai = cJSON_GetObjectItemCaseSensitive(allowed_snssaiJSON, "mappedHomeSnssai");
OpenAPI_snssai_t *mapped_home_snssai_local_nonprim = NULL;
if (mapped_home_snssai) {
mapped_home_snssai_local_nonprim = OpenAPI_snssai_parseFromJSON(mapped_home_snssai);
}
allowed_snssai_local_var = OpenAPI_allowed_snssai_create (
allowed_snssai_local_nonprim,
nsi_information_list ? nsi_information_listList : NULL,
mapped_home_snssai ? mapped_home_snssai_local_nonprim : NULL
);
return allowed_snssai_local_var;
end:
return NULL;
}
OpenAPI_allowed_snssai_t *OpenAPI_allowed_snssai_copy(OpenAPI_allowed_snssai_t *dst, OpenAPI_allowed_snssai_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_allowed_snssai_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_allowed_snssai_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_allowed_snssai_free(dst);
dst = OpenAPI_allowed_snssai_parseFromJSON(item);
cJSON_Delete(item);
return dst;
}

View file

@ -0,0 +1,44 @@
/*
* allowed_snssai.h
*
*
*/
#ifndef _OpenAPI_allowed_snssai_H_
#define _OpenAPI_allowed_snssai_H_
#include <string.h>
#include "../external/cJSON.h"
#include "../include/list.h"
#include "../include/keyValuePair.h"
#include "../include/binary.h"
#include "nsi_information.h"
#include "snssai.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct OpenAPI_allowed_snssai_s OpenAPI_allowed_snssai_t;
typedef struct OpenAPI_allowed_snssai_s {
struct OpenAPI_snssai_s *allowed_snssai;
OpenAPI_list_t *nsi_information_list;
struct OpenAPI_snssai_s *mapped_home_snssai;
} OpenAPI_allowed_snssai_t;
OpenAPI_allowed_snssai_t *OpenAPI_allowed_snssai_create(
OpenAPI_snssai_t *allowed_snssai,
OpenAPI_list_t *nsi_information_list,
OpenAPI_snssai_t *mapped_home_snssai
);
void OpenAPI_allowed_snssai_free(OpenAPI_allowed_snssai_t *allowed_snssai);
OpenAPI_allowed_snssai_t *OpenAPI_allowed_snssai_parseFromJSON(cJSON *allowed_snssaiJSON);
cJSON *OpenAPI_allowed_snssai_convertToJSON(OpenAPI_allowed_snssai_t *allowed_snssai);
OpenAPI_allowed_snssai_t *OpenAPI_allowed_snssai_copy(OpenAPI_allowed_snssai_t *dst, OpenAPI_allowed_snssai_t *src);
#ifdef __cplusplus
}
#endif
#endif /* _OpenAPI_allowed_snssai_H_ */

View file

@ -145,3 +145,37 @@ end:
return NULL;
}
OpenAPI_am_policy_data_t *OpenAPI_am_policy_data_copy(OpenAPI_am_policy_data_t *dst, OpenAPI_am_policy_data_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_am_policy_data_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_am_policy_data_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_am_policy_data_free(dst);
dst = OpenAPI_am_policy_data_parseFromJSON(item);
cJSON_Delete(item);
return dst;
}

View file

@ -31,6 +31,7 @@ OpenAPI_am_policy_data_t *OpenAPI_am_policy_data_create(
void OpenAPI_am_policy_data_free(OpenAPI_am_policy_data_t *am_policy_data);
OpenAPI_am_policy_data_t *OpenAPI_am_policy_data_parseFromJSON(cJSON *am_policy_dataJSON);
cJSON *OpenAPI_am_policy_data_convertToJSON(OpenAPI_am_policy_data_t *am_policy_data);
OpenAPI_am_policy_data_t *OpenAPI_am_policy_data_copy(OpenAPI_am_policy_data_t *dst, OpenAPI_am_policy_data_t *src);
#ifdef __cplusplus
}

View file

@ -99,3 +99,37 @@ end:
return NULL;
}
OpenAPI_ambr_t *OpenAPI_ambr_copy(OpenAPI_ambr_t *dst, OpenAPI_ambr_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_ambr_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_ambr_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_ambr_free(dst);
dst = OpenAPI_ambr_parseFromJSON(item);
cJSON_Delete(item);
return dst;
}

View file

@ -30,6 +30,7 @@ OpenAPI_ambr_t *OpenAPI_ambr_create(
void OpenAPI_ambr_free(OpenAPI_ambr_t *ambr);
OpenAPI_ambr_t *OpenAPI_ambr_parseFromJSON(cJSON *ambrJSON);
cJSON *OpenAPI_ambr_convertToJSON(OpenAPI_ambr_t *ambr);
OpenAPI_ambr_t *OpenAPI_ambr_copy(OpenAPI_ambr_t *dst, OpenAPI_ambr_t *src);
#ifdef __cplusplus
}

View file

@ -99,3 +99,37 @@ end:
return NULL;
}
OpenAPI_ambr_rm_t *OpenAPI_ambr_rm_copy(OpenAPI_ambr_rm_t *dst, OpenAPI_ambr_rm_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_ambr_rm_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_ambr_rm_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_ambr_rm_free(dst);
dst = OpenAPI_ambr_rm_parseFromJSON(item);
cJSON_Delete(item);
return dst;
}

View file

@ -30,6 +30,7 @@ OpenAPI_ambr_rm_t *OpenAPI_ambr_rm_create(
void OpenAPI_ambr_rm_free(OpenAPI_ambr_rm_t *ambr_rm);
OpenAPI_ambr_rm_t *OpenAPI_ambr_rm_parseFromJSON(cJSON *ambr_rmJSON);
cJSON *OpenAPI_ambr_rm_convertToJSON(OpenAPI_ambr_rm_t *ambr_rm);
OpenAPI_ambr_rm_t *OpenAPI_ambr_rm_copy(OpenAPI_ambr_rm_t *dst, OpenAPI_ambr_rm_t *src);
#ifdef __cplusplus
}

View file

@ -18,7 +18,7 @@ OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_cre
OpenAPI_guami_t *guami,
OpenAPI_list_t *backup_amf_info,
int dr_flag,
OpenAPI_rat_type_t *rat_type,
OpenAPI_rat_type_e rat_type,
int urrp_indicator,
char *amf_ee_subscription_id,
int ue_srvcc_capability,
@ -78,7 +78,6 @@ void OpenAPI_amf3_gpp_access_registration_free(OpenAPI_amf3_gpp_access_registrat
OpenAPI_backup_amf_info_free(node->data);
}
OpenAPI_list_free(amf3_gpp_access_registration->backup_amf_info);
OpenAPI_rat_type_free(amf3_gpp_access_registration->rat_type);
ogs_free(amf3_gpp_access_registration->amf_ee_subscription_id);
ogs_free(amf3_gpp_access_registration->nid);
ogs_free(amf3_gpp_access_registration->registration_time);
@ -114,7 +113,7 @@ cJSON *OpenAPI_amf3_gpp_access_registration_convertToJSON(OpenAPI_amf3_gpp_acces
}
}
if (amf3_gpp_access_registration->purge_flag >= 0) {
if (amf3_gpp_access_registration->purge_flag) {
if (cJSON_AddBoolToObject(item, "purgeFlag", amf3_gpp_access_registration->purge_flag) == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [purge_flag]");
goto end;
@ -171,7 +170,7 @@ cJSON *OpenAPI_amf3_gpp_access_registration_convertToJSON(OpenAPI_amf3_gpp_acces
}
}
if (amf3_gpp_access_registration->initial_registration_ind >= 0) {
if (amf3_gpp_access_registration->initial_registration_ind) {
if (cJSON_AddBoolToObject(item, "initialRegistrationInd", amf3_gpp_access_registration->initial_registration_ind) == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [initial_registration_ind]");
goto end;
@ -213,7 +212,7 @@ cJSON *OpenAPI_amf3_gpp_access_registration_convertToJSON(OpenAPI_amf3_gpp_acces
}
}
if (amf3_gpp_access_registration->dr_flag >= 0) {
if (amf3_gpp_access_registration->dr_flag) {
if (cJSON_AddBoolToObject(item, "drFlag", amf3_gpp_access_registration->dr_flag) == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [dr_flag]");
goto end;
@ -224,18 +223,12 @@ cJSON *OpenAPI_amf3_gpp_access_registration_convertToJSON(OpenAPI_amf3_gpp_acces
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [rat_type]");
goto end;
}
cJSON *rat_type_local_JSON = OpenAPI_rat_type_convertToJSON(amf3_gpp_access_registration->rat_type);
if (rat_type_local_JSON == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [rat_type]");
goto end;
}
cJSON_AddItemToObject(item, "ratType", rat_type_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "ratType", OpenAPI_rat_type_ToString(amf3_gpp_access_registration->rat_type)) == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [rat_type]");
goto end;
}
if (amf3_gpp_access_registration->urrp_indicator >= 0) {
if (amf3_gpp_access_registration->urrp_indicator) {
if (cJSON_AddBoolToObject(item, "urrpIndicator", amf3_gpp_access_registration->urrp_indicator) == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [urrp_indicator]");
goto end;
@ -249,7 +242,7 @@ cJSON *OpenAPI_amf3_gpp_access_registration_convertToJSON(OpenAPI_amf3_gpp_acces
}
}
if (amf3_gpp_access_registration->ue_srvcc_capability >= 0) {
if (amf3_gpp_access_registration->ue_srvcc_capability) {
if (cJSON_AddBoolToObject(item, "ueSrvccCapability", amf3_gpp_access_registration->ue_srvcc_capability) == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed [ue_srvcc_capability]");
goto end;
@ -440,9 +433,13 @@ OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_par
goto end;
}
OpenAPI_rat_type_t *rat_type_local_nonprim = NULL;
OpenAPI_rat_type_e rat_typeVariable;
rat_type_local_nonprim = OpenAPI_rat_type_parseFromJSON(rat_type);
if (!cJSON_IsString(rat_type)) {
ogs_error("OpenAPI_amf3_gpp_access_registration_parseFromJSON() failed [rat_type]");
goto end;
}
rat_typeVariable = OpenAPI_rat_type_FromString(rat_type->valuestring);
cJSON *urrp_indicator = cJSON_GetObjectItemCaseSensitive(amf3_gpp_access_registrationJSON, "urrpIndicator");
@ -530,7 +527,7 @@ OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_par
guami_local_nonprim,
backup_amf_info ? backup_amf_infoList : NULL,
dr_flag ? dr_flag->valueint : 0,
rat_type_local_nonprim,
rat_typeVariable,
urrp_indicator ? urrp_indicator->valueint : 0,
amf_ee_subscription_id ? ogs_strdup(amf_ee_subscription_id->valuestring) : NULL,
ue_srvcc_capability ? ue_srvcc_capability->valueint : 0,
@ -546,3 +543,37 @@ end:
return NULL;
}
OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_copy(OpenAPI_amf3_gpp_access_registration_t *dst, OpenAPI_amf3_gpp_access_registration_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_amf3_gpp_access_registration_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_amf3_gpp_access_registration_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_amf3_gpp_access_registration_free(dst);
dst = OpenAPI_amf3_gpp_access_registration_parseFromJSON(item);
cJSON_Delete(item);
return dst;
}

View file

@ -36,7 +36,7 @@ typedef struct OpenAPI_amf3_gpp_access_registration_s {
struct OpenAPI_guami_s *guami;
OpenAPI_list_t *backup_amf_info;
int dr_flag;
struct OpenAPI_rat_type_s *rat_type;
OpenAPI_rat_type_e rat_type;
int urrp_indicator;
char *amf_ee_subscription_id;
int ue_srvcc_capability;
@ -61,7 +61,7 @@ OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_cre
OpenAPI_guami_t *guami,
OpenAPI_list_t *backup_amf_info,
int dr_flag,
OpenAPI_rat_type_t *rat_type,
OpenAPI_rat_type_e rat_type,
int urrp_indicator,
char *amf_ee_subscription_id,
int ue_srvcc_capability,
@ -74,6 +74,7 @@ OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_cre
void OpenAPI_amf3_gpp_access_registration_free(OpenAPI_amf3_gpp_access_registration_t *amf3_gpp_access_registration);
OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_parseFromJSON(cJSON *amf3_gpp_access_registrationJSON);
cJSON *OpenAPI_amf3_gpp_access_registration_convertToJSON(OpenAPI_amf3_gpp_access_registration_t *amf3_gpp_access_registration);
OpenAPI_amf3_gpp_access_registration_t *OpenAPI_amf3_gpp_access_registration_copy(OpenAPI_amf3_gpp_access_registration_t *dst, OpenAPI_amf3_gpp_access_registration_t *src);
#ifdef __cplusplus
}

View file

@ -71,7 +71,7 @@ cJSON *OpenAPI_amf3_gpp_access_registration_modification_convertToJSON(OpenAPI_a
goto end;
}
if (amf3_gpp_access_registration_modification->purge_flag >= 0) {
if (amf3_gpp_access_registration_modification->purge_flag) {
if (cJSON_AddBoolToObject(item, "purgeFlag", amf3_gpp_access_registration_modification->purge_flag) == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_modification_convertToJSON() failed [purge_flag]");
goto end;
@ -131,7 +131,7 @@ cJSON *OpenAPI_amf3_gpp_access_registration_modification_convertToJSON(OpenAPI_a
}
}
if (amf3_gpp_access_registration_modification->ue_srvcc_capability >= 0) {
if (amf3_gpp_access_registration_modification->ue_srvcc_capability) {
if (cJSON_AddBoolToObject(item, "ueSrvccCapability", amf3_gpp_access_registration_modification->ue_srvcc_capability) == NULL) {
ogs_error("OpenAPI_amf3_gpp_access_registration_modification_convertToJSON() failed [ue_srvcc_capability]");
goto end;
@ -234,3 +234,37 @@ end:
return NULL;
}
OpenAPI_amf3_gpp_access_registration_modification_t *OpenAPI_amf3_gpp_access_registration_modification_copy(OpenAPI_amf3_gpp_access_registration_modification_t *dst, OpenAPI_amf3_gpp_access_registration_modification_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_amf3_gpp_access_registration_modification_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_amf3_gpp_access_registration_modification_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_amf3_gpp_access_registration_modification_free(dst);
dst = OpenAPI_amf3_gpp_access_registration_modification_parseFromJSON(item);
cJSON_Delete(item);
return dst;
}

View file

@ -44,6 +44,7 @@ OpenAPI_amf3_gpp_access_registration_modification_t *OpenAPI_amf3_gpp_access_reg
void OpenAPI_amf3_gpp_access_registration_modification_free(OpenAPI_amf3_gpp_access_registration_modification_t *amf3_gpp_access_registration_modification);
OpenAPI_amf3_gpp_access_registration_modification_t *OpenAPI_amf3_gpp_access_registration_modification_parseFromJSON(cJSON *amf3_gpp_access_registration_modificationJSON);
cJSON *OpenAPI_amf3_gpp_access_registration_modification_convertToJSON(OpenAPI_amf3_gpp_access_registration_modification_t *amf3_gpp_access_registration_modification);
OpenAPI_amf3_gpp_access_registration_modification_t *OpenAPI_amf3_gpp_access_registration_modification_copy(OpenAPI_amf3_gpp_access_registration_modification_t *dst, OpenAPI_amf3_gpp_access_registration_modification_t *src);
#ifdef __cplusplus
}

View file

@ -89,3 +89,37 @@ end:
return NULL;
}
OpenAPI_amf_cond_t *OpenAPI_amf_cond_copy(OpenAPI_amf_cond_t *dst, OpenAPI_amf_cond_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_amf_cond_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_amf_cond_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_amf_cond_free(dst);
dst = OpenAPI_amf_cond_parseFromJSON(item);
cJSON_Delete(item);
return dst;
}

View file

@ -30,6 +30,7 @@ OpenAPI_amf_cond_t *OpenAPI_amf_cond_create(
void OpenAPI_amf_cond_free(OpenAPI_amf_cond_t *amf_cond);
OpenAPI_amf_cond_t *OpenAPI_amf_cond_parseFromJSON(cJSON *amf_condJSON);
cJSON *OpenAPI_amf_cond_convertToJSON(OpenAPI_amf_cond_t *amf_cond);
OpenAPI_amf_cond_t *OpenAPI_amf_cond_copy(OpenAPI_amf_cond_t *dst, OpenAPI_amf_cond_t *src);
#ifdef __cplusplus
}

View file

@ -78,3 +78,37 @@ end:
return NULL;
}
OpenAPI_amf_dereg_info_t *OpenAPI_amf_dereg_info_copy(OpenAPI_amf_dereg_info_t *dst, OpenAPI_amf_dereg_info_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_amf_dereg_info_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_amf_dereg_info_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_amf_dereg_info_free(dst);
dst = OpenAPI_amf_dereg_info_parseFromJSON(item);
cJSON_Delete(item);
return dst;
}

View file

@ -29,6 +29,7 @@ OpenAPI_amf_dereg_info_t *OpenAPI_amf_dereg_info_create(
void OpenAPI_amf_dereg_info_free(OpenAPI_amf_dereg_info_t *amf_dereg_info);
OpenAPI_amf_dereg_info_t *OpenAPI_amf_dereg_info_parseFromJSON(cJSON *amf_dereg_infoJSON);
cJSON *OpenAPI_amf_dereg_info_convertToJSON(OpenAPI_amf_dereg_info_t *amf_dereg_info);
OpenAPI_amf_dereg_info_t *OpenAPI_amf_dereg_info_copy(OpenAPI_amf_dereg_info_t *dst, OpenAPI_amf_dereg_info_t *src);
#ifdef __cplusplus
}

View file

@ -0,0 +1,302 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "amf_event.h"
OpenAPI_amf_event_t *OpenAPI_amf_event_create(
OpenAPI_amf_event_type_t *type,
int immediate_flag,
OpenAPI_list_t *area_list,
OpenAPI_list_t *location_filter_list,
int ref_id,
OpenAPI_list_t *traffic_descriptor_list
)
{
OpenAPI_amf_event_t *amf_event_local_var = OpenAPI_malloc(sizeof(OpenAPI_amf_event_t));
if (!amf_event_local_var) {
return NULL;
}
amf_event_local_var->type = type;
amf_event_local_var->immediate_flag = immediate_flag;
amf_event_local_var->area_list = area_list;
amf_event_local_var->location_filter_list = location_filter_list;
amf_event_local_var->ref_id = ref_id;
amf_event_local_var->traffic_descriptor_list = traffic_descriptor_list;
return amf_event_local_var;
}
void OpenAPI_amf_event_free(OpenAPI_amf_event_t *amf_event)
{
if (NULL == amf_event) {
return;
}
OpenAPI_lnode_t *node;
OpenAPI_amf_event_type_free(amf_event->type);
OpenAPI_list_for_each(amf_event->area_list, node) {
OpenAPI_amf_event_area_free(node->data);
}
OpenAPI_list_free(amf_event->area_list);
OpenAPI_list_for_each(amf_event->location_filter_list, node) {
OpenAPI_location_filter_free(node->data);
}
OpenAPI_list_free(amf_event->location_filter_list);
OpenAPI_list_for_each(amf_event->traffic_descriptor_list, node) {
OpenAPI_traffic_descriptor_free(node->data);
}
OpenAPI_list_free(amf_event->traffic_descriptor_list);
ogs_free(amf_event);
}
cJSON *OpenAPI_amf_event_convertToJSON(OpenAPI_amf_event_t *amf_event)
{
cJSON *item = NULL;
if (amf_event == NULL) {
ogs_error("OpenAPI_amf_event_convertToJSON() failed [AmfEvent]");
return NULL;
}
item = cJSON_CreateObject();
if (!amf_event->type) {
ogs_error("OpenAPI_amf_event_convertToJSON() failed [type]");
goto end;
}
cJSON *type_local_JSON = OpenAPI_amf_event_type_convertToJSON(amf_event->type);
if (type_local_JSON == NULL) {
ogs_error("OpenAPI_amf_event_convertToJSON() failed [type]");
goto end;
}
cJSON_AddItemToObject(item, "type", type_local_JSON);
if (item->child == NULL) {
ogs_error("OpenAPI_amf_event_convertToJSON() failed [type]");
goto end;
}
if (amf_event->immediate_flag) {
if (cJSON_AddBoolToObject(item, "immediateFlag", amf_event->immediate_flag) == NULL) {
ogs_error("OpenAPI_amf_event_convertToJSON() failed [immediate_flag]");
goto end;
}
}
if (amf_event->area_list) {
cJSON *area_listList = cJSON_AddArrayToObject(item, "areaList");
if (area_listList == NULL) {
ogs_error("OpenAPI_amf_event_convertToJSON() failed [area_list]");
goto end;
}
OpenAPI_lnode_t *area_list_node;
if (amf_event->area_list) {
OpenAPI_list_for_each(amf_event->area_list, area_list_node) {
cJSON *itemLocal = OpenAPI_amf_event_area_convertToJSON(area_list_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_amf_event_convertToJSON() failed [area_list]");
goto end;
}
cJSON_AddItemToArray(area_listList, itemLocal);
}
}
}
if (amf_event->location_filter_list) {
cJSON *location_filter_listList = cJSON_AddArrayToObject(item, "locationFilterList");
if (location_filter_listList == NULL) {
ogs_error("OpenAPI_amf_event_convertToJSON() failed [location_filter_list]");
goto end;
}
OpenAPI_lnode_t *location_filter_list_node;
if (amf_event->location_filter_list) {
OpenAPI_list_for_each(amf_event->location_filter_list, location_filter_list_node) {
cJSON *itemLocal = OpenAPI_location_filter_convertToJSON(location_filter_list_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_amf_event_convertToJSON() failed [location_filter_list]");
goto end;
}
cJSON_AddItemToArray(location_filter_listList, itemLocal);
}
}
}
if (amf_event->ref_id) {
if (cJSON_AddNumberToObject(item, "refId", amf_event->ref_id) == NULL) {
ogs_error("OpenAPI_amf_event_convertToJSON() failed [ref_id]");
goto end;
}
}
if (amf_event->traffic_descriptor_list) {
cJSON *traffic_descriptor_listList = cJSON_AddArrayToObject(item, "trafficDescriptorList");
if (traffic_descriptor_listList == NULL) {
ogs_error("OpenAPI_amf_event_convertToJSON() failed [traffic_descriptor_list]");
goto end;
}
OpenAPI_lnode_t *traffic_descriptor_list_node;
if (amf_event->traffic_descriptor_list) {
OpenAPI_list_for_each(amf_event->traffic_descriptor_list, traffic_descriptor_list_node) {
cJSON *itemLocal = OpenAPI_traffic_descriptor_convertToJSON(traffic_descriptor_list_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_amf_event_convertToJSON() failed [traffic_descriptor_list]");
goto end;
}
cJSON_AddItemToArray(traffic_descriptor_listList, itemLocal);
}
}
}
end:
return item;
}
OpenAPI_amf_event_t *OpenAPI_amf_event_parseFromJSON(cJSON *amf_eventJSON)
{
OpenAPI_amf_event_t *amf_event_local_var = NULL;
cJSON *type = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "type");
if (!type) {
ogs_error("OpenAPI_amf_event_parseFromJSON() failed [type]");
goto end;
}
OpenAPI_amf_event_type_t *type_local_nonprim = NULL;
type_local_nonprim = OpenAPI_amf_event_type_parseFromJSON(type);
cJSON *immediate_flag = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "immediateFlag");
if (immediate_flag) {
if (!cJSON_IsBool(immediate_flag)) {
ogs_error("OpenAPI_amf_event_parseFromJSON() failed [immediate_flag]");
goto end;
}
}
cJSON *area_list = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "areaList");
OpenAPI_list_t *area_listList;
if (area_list) {
cJSON *area_list_local_nonprimitive;
if (!cJSON_IsArray(area_list)) {
ogs_error("OpenAPI_amf_event_parseFromJSON() failed [area_list]");
goto end;
}
area_listList = OpenAPI_list_create();
cJSON_ArrayForEach(area_list_local_nonprimitive, area_list ) {
if (!cJSON_IsObject(area_list_local_nonprimitive)) {
ogs_error("OpenAPI_amf_event_parseFromJSON() failed [area_list]");
goto end;
}
OpenAPI_amf_event_area_t *area_listItem = OpenAPI_amf_event_area_parseFromJSON(area_list_local_nonprimitive);
OpenAPI_list_add(area_listList, area_listItem);
}
}
cJSON *location_filter_list = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "locationFilterList");
OpenAPI_list_t *location_filter_listList;
if (location_filter_list) {
cJSON *location_filter_list_local_nonprimitive;
if (!cJSON_IsArray(location_filter_list)) {
ogs_error("OpenAPI_amf_event_parseFromJSON() failed [location_filter_list]");
goto end;
}
location_filter_listList = OpenAPI_list_create();
cJSON_ArrayForEach(location_filter_list_local_nonprimitive, location_filter_list ) {
if (!cJSON_IsObject(location_filter_list_local_nonprimitive)) {
ogs_error("OpenAPI_amf_event_parseFromJSON() failed [location_filter_list]");
goto end;
}
OpenAPI_location_filter_t *location_filter_listItem = OpenAPI_location_filter_parseFromJSON(location_filter_list_local_nonprimitive);
OpenAPI_list_add(location_filter_listList, location_filter_listItem);
}
}
cJSON *ref_id = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "refId");
if (ref_id) {
if (!cJSON_IsNumber(ref_id)) {
ogs_error("OpenAPI_amf_event_parseFromJSON() failed [ref_id]");
goto end;
}
}
cJSON *traffic_descriptor_list = cJSON_GetObjectItemCaseSensitive(amf_eventJSON, "trafficDescriptorList");
OpenAPI_list_t *traffic_descriptor_listList;
if (traffic_descriptor_list) {
cJSON *traffic_descriptor_list_local_nonprimitive;
if (!cJSON_IsArray(traffic_descriptor_list)) {
ogs_error("OpenAPI_amf_event_parseFromJSON() failed [traffic_descriptor_list]");
goto end;
}
traffic_descriptor_listList = OpenAPI_list_create();
cJSON_ArrayForEach(traffic_descriptor_list_local_nonprimitive, traffic_descriptor_list ) {
if (!cJSON_IsObject(traffic_descriptor_list_local_nonprimitive)) {
ogs_error("OpenAPI_amf_event_parseFromJSON() failed [traffic_descriptor_list]");
goto end;
}
OpenAPI_traffic_descriptor_t *traffic_descriptor_listItem = OpenAPI_traffic_descriptor_parseFromJSON(traffic_descriptor_list_local_nonprimitive);
OpenAPI_list_add(traffic_descriptor_listList, traffic_descriptor_listItem);
}
}
amf_event_local_var = OpenAPI_amf_event_create (
type_local_nonprim,
immediate_flag ? immediate_flag->valueint : 0,
area_list ? area_listList : NULL,
location_filter_list ? location_filter_listList : NULL,
ref_id ? ref_id->valuedouble : 0,
traffic_descriptor_list ? traffic_descriptor_listList : NULL
);
return amf_event_local_var;
end:
return NULL;
}
OpenAPI_amf_event_t *OpenAPI_amf_event_copy(OpenAPI_amf_event_t *dst, OpenAPI_amf_event_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_amf_event_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_amf_event_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_amf_event_free(dst);
dst = OpenAPI_amf_event_parseFromJSON(item);
cJSON_Delete(item);
return dst;
}

View file

@ -0,0 +1,52 @@
/*
* amf_event.h
*
*
*/
#ifndef _OpenAPI_amf_event_H_
#define _OpenAPI_amf_event_H_
#include <string.h>
#include "../external/cJSON.h"
#include "../include/list.h"
#include "../include/keyValuePair.h"
#include "../include/binary.h"
#include "amf_event_area.h"
#include "amf_event_type.h"
#include "location_filter.h"
#include "traffic_descriptor.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct OpenAPI_amf_event_s OpenAPI_amf_event_t;
typedef struct OpenAPI_amf_event_s {
struct OpenAPI_amf_event_type_s *type;
int immediate_flag;
OpenAPI_list_t *area_list;
OpenAPI_list_t *location_filter_list;
int ref_id;
OpenAPI_list_t *traffic_descriptor_list;
} OpenAPI_amf_event_t;
OpenAPI_amf_event_t *OpenAPI_amf_event_create(
OpenAPI_amf_event_type_t *type,
int immediate_flag,
OpenAPI_list_t *area_list,
OpenAPI_list_t *location_filter_list,
int ref_id,
OpenAPI_list_t *traffic_descriptor_list
);
void OpenAPI_amf_event_free(OpenAPI_amf_event_t *amf_event);
OpenAPI_amf_event_t *OpenAPI_amf_event_parseFromJSON(cJSON *amf_eventJSON);
cJSON *OpenAPI_amf_event_convertToJSON(OpenAPI_amf_event_t *amf_event);
OpenAPI_amf_event_t *OpenAPI_amf_event_copy(OpenAPI_amf_event_t *dst, OpenAPI_amf_event_t *src);
#ifdef __cplusplus
}
#endif
#endif /* _OpenAPI_amf_event_H_ */

View file

@ -0,0 +1,133 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "amf_event_area.h"
OpenAPI_amf_event_area_t *OpenAPI_amf_event_area_create(
OpenAPI_presence_info_t *presence_info,
OpenAPI_ladn_info_t *ladn_info
)
{
OpenAPI_amf_event_area_t *amf_event_area_local_var = OpenAPI_malloc(sizeof(OpenAPI_amf_event_area_t));
if (!amf_event_area_local_var) {
return NULL;
}
amf_event_area_local_var->presence_info = presence_info;
amf_event_area_local_var->ladn_info = ladn_info;
return amf_event_area_local_var;
}
void OpenAPI_amf_event_area_free(OpenAPI_amf_event_area_t *amf_event_area)
{
if (NULL == amf_event_area) {
return;
}
OpenAPI_lnode_t *node;
OpenAPI_presence_info_free(amf_event_area->presence_info);
OpenAPI_ladn_info_free(amf_event_area->ladn_info);
ogs_free(amf_event_area);
}
cJSON *OpenAPI_amf_event_area_convertToJSON(OpenAPI_amf_event_area_t *amf_event_area)
{
cJSON *item = NULL;
if (amf_event_area == NULL) {
ogs_error("OpenAPI_amf_event_area_convertToJSON() failed [AmfEventArea]");
return NULL;
}
item = cJSON_CreateObject();
if (amf_event_area->presence_info) {
cJSON *presence_info_local_JSON = OpenAPI_presence_info_convertToJSON(amf_event_area->presence_info);
if (presence_info_local_JSON == NULL) {
ogs_error("OpenAPI_amf_event_area_convertToJSON() failed [presence_info]");
goto end;
}
cJSON_AddItemToObject(item, "presenceInfo", presence_info_local_JSON);
if (item->child == NULL) {
ogs_error("OpenAPI_amf_event_area_convertToJSON() failed [presence_info]");
goto end;
}
}
if (amf_event_area->ladn_info) {
cJSON *ladn_info_local_JSON = OpenAPI_ladn_info_convertToJSON(amf_event_area->ladn_info);
if (ladn_info_local_JSON == NULL) {
ogs_error("OpenAPI_amf_event_area_convertToJSON() failed [ladn_info]");
goto end;
}
cJSON_AddItemToObject(item, "ladnInfo", ladn_info_local_JSON);
if (item->child == NULL) {
ogs_error("OpenAPI_amf_event_area_convertToJSON() failed [ladn_info]");
goto end;
}
}
end:
return item;
}
OpenAPI_amf_event_area_t *OpenAPI_amf_event_area_parseFromJSON(cJSON *amf_event_areaJSON)
{
OpenAPI_amf_event_area_t *amf_event_area_local_var = NULL;
cJSON *presence_info = cJSON_GetObjectItemCaseSensitive(amf_event_areaJSON, "presenceInfo");
OpenAPI_presence_info_t *presence_info_local_nonprim = NULL;
if (presence_info) {
presence_info_local_nonprim = OpenAPI_presence_info_parseFromJSON(presence_info);
}
cJSON *ladn_info = cJSON_GetObjectItemCaseSensitive(amf_event_areaJSON, "ladnInfo");
OpenAPI_ladn_info_t *ladn_info_local_nonprim = NULL;
if (ladn_info) {
ladn_info_local_nonprim = OpenAPI_ladn_info_parseFromJSON(ladn_info);
}
amf_event_area_local_var = OpenAPI_amf_event_area_create (
presence_info ? presence_info_local_nonprim : NULL,
ladn_info ? ladn_info_local_nonprim : NULL
);
return amf_event_area_local_var;
end:
return NULL;
}
OpenAPI_amf_event_area_t *OpenAPI_amf_event_area_copy(OpenAPI_amf_event_area_t *dst, OpenAPI_amf_event_area_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_amf_event_area_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_amf_event_area_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_amf_event_area_free(dst);
dst = OpenAPI_amf_event_area_parseFromJSON(item);
cJSON_Delete(item);
return dst;
}

View file

@ -0,0 +1,42 @@
/*
* amf_event_area.h
*
*
*/
#ifndef _OpenAPI_amf_event_area_H_
#define _OpenAPI_amf_event_area_H_
#include <string.h>
#include "../external/cJSON.h"
#include "../include/list.h"
#include "../include/keyValuePair.h"
#include "../include/binary.h"
#include "ladn_info.h"
#include "presence_info.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct OpenAPI_amf_event_area_s OpenAPI_amf_event_area_t;
typedef struct OpenAPI_amf_event_area_s {
struct OpenAPI_presence_info_s *presence_info;
struct OpenAPI_ladn_info_s *ladn_info;
} OpenAPI_amf_event_area_t;
OpenAPI_amf_event_area_t *OpenAPI_amf_event_area_create(
OpenAPI_presence_info_t *presence_info,
OpenAPI_ladn_info_t *ladn_info
);
void OpenAPI_amf_event_area_free(OpenAPI_amf_event_area_t *amf_event_area);
OpenAPI_amf_event_area_t *OpenAPI_amf_event_area_parseFromJSON(cJSON *amf_event_areaJSON);
cJSON *OpenAPI_amf_event_area_convertToJSON(OpenAPI_amf_event_area_t *amf_event_area);
OpenAPI_amf_event_area_t *OpenAPI_amf_event_area_copy(OpenAPI_amf_event_area_t *dst, OpenAPI_amf_event_area_t *src);
#ifdef __cplusplus
}
#endif
#endif /* _OpenAPI_amf_event_area_H_ */

View file

@ -0,0 +1,153 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "amf_event_mode.h"
OpenAPI_amf_event_mode_t *OpenAPI_amf_event_mode_create(
OpenAPI_amf_event_trigger_t *trigger,
int max_reports,
char *expiry
)
{
OpenAPI_amf_event_mode_t *amf_event_mode_local_var = OpenAPI_malloc(sizeof(OpenAPI_amf_event_mode_t));
if (!amf_event_mode_local_var) {
return NULL;
}
amf_event_mode_local_var->trigger = trigger;
amf_event_mode_local_var->max_reports = max_reports;
amf_event_mode_local_var->expiry = expiry;
return amf_event_mode_local_var;
}
void OpenAPI_amf_event_mode_free(OpenAPI_amf_event_mode_t *amf_event_mode)
{
if (NULL == amf_event_mode) {
return;
}
OpenAPI_lnode_t *node;
OpenAPI_amf_event_trigger_free(amf_event_mode->trigger);
ogs_free(amf_event_mode->expiry);
ogs_free(amf_event_mode);
}
cJSON *OpenAPI_amf_event_mode_convertToJSON(OpenAPI_amf_event_mode_t *amf_event_mode)
{
cJSON *item = NULL;
if (amf_event_mode == NULL) {
ogs_error("OpenAPI_amf_event_mode_convertToJSON() failed [AmfEventMode]");
return NULL;
}
item = cJSON_CreateObject();
if (!amf_event_mode->trigger) {
ogs_error("OpenAPI_amf_event_mode_convertToJSON() failed [trigger]");
goto end;
}
cJSON *trigger_local_JSON = OpenAPI_amf_event_trigger_convertToJSON(amf_event_mode->trigger);
if (trigger_local_JSON == NULL) {
ogs_error("OpenAPI_amf_event_mode_convertToJSON() failed [trigger]");
goto end;
}
cJSON_AddItemToObject(item, "trigger", trigger_local_JSON);
if (item->child == NULL) {
ogs_error("OpenAPI_amf_event_mode_convertToJSON() failed [trigger]");
goto end;
}
if (amf_event_mode->max_reports) {
if (cJSON_AddNumberToObject(item, "maxReports", amf_event_mode->max_reports) == NULL) {
ogs_error("OpenAPI_amf_event_mode_convertToJSON() failed [max_reports]");
goto end;
}
}
if (amf_event_mode->expiry) {
if (cJSON_AddStringToObject(item, "expiry", amf_event_mode->expiry) == NULL) {
ogs_error("OpenAPI_amf_event_mode_convertToJSON() failed [expiry]");
goto end;
}
}
end:
return item;
}
OpenAPI_amf_event_mode_t *OpenAPI_amf_event_mode_parseFromJSON(cJSON *amf_event_modeJSON)
{
OpenAPI_amf_event_mode_t *amf_event_mode_local_var = NULL;
cJSON *trigger = cJSON_GetObjectItemCaseSensitive(amf_event_modeJSON, "trigger");
if (!trigger) {
ogs_error("OpenAPI_amf_event_mode_parseFromJSON() failed [trigger]");
goto end;
}
OpenAPI_amf_event_trigger_t *trigger_local_nonprim = NULL;
trigger_local_nonprim = OpenAPI_amf_event_trigger_parseFromJSON(trigger);
cJSON *max_reports = cJSON_GetObjectItemCaseSensitive(amf_event_modeJSON, "maxReports");
if (max_reports) {
if (!cJSON_IsNumber(max_reports)) {
ogs_error("OpenAPI_amf_event_mode_parseFromJSON() failed [max_reports]");
goto end;
}
}
cJSON *expiry = cJSON_GetObjectItemCaseSensitive(amf_event_modeJSON, "expiry");
if (expiry) {
if (!cJSON_IsString(expiry)) {
ogs_error("OpenAPI_amf_event_mode_parseFromJSON() failed [expiry]");
goto end;
}
}
amf_event_mode_local_var = OpenAPI_amf_event_mode_create (
trigger_local_nonprim,
max_reports ? max_reports->valuedouble : 0,
expiry ? ogs_strdup(expiry->valuestring) : NULL
);
return amf_event_mode_local_var;
end:
return NULL;
}
OpenAPI_amf_event_mode_t *OpenAPI_amf_event_mode_copy(OpenAPI_amf_event_mode_t *dst, OpenAPI_amf_event_mode_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_amf_event_mode_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_amf_event_mode_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_amf_event_mode_free(dst);
dst = OpenAPI_amf_event_mode_parseFromJSON(item);
cJSON_Delete(item);
return dst;
}

View file

@ -0,0 +1,43 @@
/*
* amf_event_mode.h
*
*
*/
#ifndef _OpenAPI_amf_event_mode_H_
#define _OpenAPI_amf_event_mode_H_
#include <string.h>
#include "../external/cJSON.h"
#include "../include/list.h"
#include "../include/keyValuePair.h"
#include "../include/binary.h"
#include "amf_event_trigger.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct OpenAPI_amf_event_mode_s OpenAPI_amf_event_mode_t;
typedef struct OpenAPI_amf_event_mode_s {
struct OpenAPI_amf_event_trigger_s *trigger;
int max_reports;
char *expiry;
} OpenAPI_amf_event_mode_t;
OpenAPI_amf_event_mode_t *OpenAPI_amf_event_mode_create(
OpenAPI_amf_event_trigger_t *trigger,
int max_reports,
char *expiry
);
void OpenAPI_amf_event_mode_free(OpenAPI_amf_event_mode_t *amf_event_mode);
OpenAPI_amf_event_mode_t *OpenAPI_amf_event_mode_parseFromJSON(cJSON *amf_event_modeJSON);
cJSON *OpenAPI_amf_event_mode_convertToJSON(OpenAPI_amf_event_mode_t *amf_event_mode);
OpenAPI_amf_event_mode_t *OpenAPI_amf_event_mode_copy(OpenAPI_amf_event_mode_t *dst, OpenAPI_amf_event_mode_t *src);
#ifdef __cplusplus
}
#endif
#endif /* _OpenAPI_amf_event_mode_H_ */

View file

@ -0,0 +1,378 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "amf_event_subscription.h"
OpenAPI_amf_event_subscription_t *OpenAPI_amf_event_subscription_create(
OpenAPI_list_t *event_list,
char *event_notify_uri,
char *notify_correlation_id,
char *nf_id,
char *subs_change_notify_uri,
char *subs_change_notify_correlation_id,
char *supi,
char *group_id,
char *gpsi,
char *pei,
int any_ue,
OpenAPI_amf_event_mode_t *options
)
{
OpenAPI_amf_event_subscription_t *amf_event_subscription_local_var = OpenAPI_malloc(sizeof(OpenAPI_amf_event_subscription_t));
if (!amf_event_subscription_local_var) {
return NULL;
}
amf_event_subscription_local_var->event_list = event_list;
amf_event_subscription_local_var->event_notify_uri = event_notify_uri;
amf_event_subscription_local_var->notify_correlation_id = notify_correlation_id;
amf_event_subscription_local_var->nf_id = nf_id;
amf_event_subscription_local_var->subs_change_notify_uri = subs_change_notify_uri;
amf_event_subscription_local_var->subs_change_notify_correlation_id = subs_change_notify_correlation_id;
amf_event_subscription_local_var->supi = supi;
amf_event_subscription_local_var->group_id = group_id;
amf_event_subscription_local_var->gpsi = gpsi;
amf_event_subscription_local_var->pei = pei;
amf_event_subscription_local_var->any_ue = any_ue;
amf_event_subscription_local_var->options = options;
return amf_event_subscription_local_var;
}
void OpenAPI_amf_event_subscription_free(OpenAPI_amf_event_subscription_t *amf_event_subscription)
{
if (NULL == amf_event_subscription) {
return;
}
OpenAPI_lnode_t *node;
OpenAPI_list_for_each(amf_event_subscription->event_list, node) {
OpenAPI_amf_event_free(node->data);
}
OpenAPI_list_free(amf_event_subscription->event_list);
ogs_free(amf_event_subscription->event_notify_uri);
ogs_free(amf_event_subscription->notify_correlation_id);
ogs_free(amf_event_subscription->nf_id);
ogs_free(amf_event_subscription->subs_change_notify_uri);
ogs_free(amf_event_subscription->subs_change_notify_correlation_id);
ogs_free(amf_event_subscription->supi);
ogs_free(amf_event_subscription->group_id);
ogs_free(amf_event_subscription->gpsi);
ogs_free(amf_event_subscription->pei);
OpenAPI_amf_event_mode_free(amf_event_subscription->options);
ogs_free(amf_event_subscription);
}
cJSON *OpenAPI_amf_event_subscription_convertToJSON(OpenAPI_amf_event_subscription_t *amf_event_subscription)
{
cJSON *item = NULL;
if (amf_event_subscription == NULL) {
ogs_error("OpenAPI_amf_event_subscription_convertToJSON() failed [AmfEventSubscription]");
return NULL;
}
item = cJSON_CreateObject();
if (!amf_event_subscription->event_list) {
ogs_error("OpenAPI_amf_event_subscription_convertToJSON() failed [event_list]");
goto end;
}
cJSON *event_listList = cJSON_AddArrayToObject(item, "eventList");
if (event_listList == NULL) {
ogs_error("OpenAPI_amf_event_subscription_convertToJSON() failed [event_list]");
goto end;
}
OpenAPI_lnode_t *event_list_node;
if (amf_event_subscription->event_list) {
OpenAPI_list_for_each(amf_event_subscription->event_list, event_list_node) {
cJSON *itemLocal = OpenAPI_amf_event_convertToJSON(event_list_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_amf_event_subscription_convertToJSON() failed [event_list]");
goto end;
}
cJSON_AddItemToArray(event_listList, itemLocal);
}
}
if (!amf_event_subscription->event_notify_uri) {
ogs_error("OpenAPI_amf_event_subscription_convertToJSON() failed [event_notify_uri]");
goto end;
}
if (cJSON_AddStringToObject(item, "eventNotifyUri", amf_event_subscription->event_notify_uri) == NULL) {
ogs_error("OpenAPI_amf_event_subscription_convertToJSON() failed [event_notify_uri]");
goto end;
}
if (!amf_event_subscription->notify_correlation_id) {
ogs_error("OpenAPI_amf_event_subscription_convertToJSON() failed [notify_correlation_id]");
goto end;
}
if (cJSON_AddStringToObject(item, "notifyCorrelationId", amf_event_subscription->notify_correlation_id) == NULL) {
ogs_error("OpenAPI_amf_event_subscription_convertToJSON() failed [notify_correlation_id]");
goto end;
}
if (!amf_event_subscription->nf_id) {
ogs_error("OpenAPI_amf_event_subscription_convertToJSON() failed [nf_id]");
goto end;
}
if (cJSON_AddStringToObject(item, "nfId", amf_event_subscription->nf_id) == NULL) {
ogs_error("OpenAPI_amf_event_subscription_convertToJSON() failed [nf_id]");
goto end;
}
if (amf_event_subscription->subs_change_notify_uri) {
if (cJSON_AddStringToObject(item, "subsChangeNotifyUri", amf_event_subscription->subs_change_notify_uri) == NULL) {
ogs_error("OpenAPI_amf_event_subscription_convertToJSON() failed [subs_change_notify_uri]");
goto end;
}
}
if (amf_event_subscription->subs_change_notify_correlation_id) {
if (cJSON_AddStringToObject(item, "subsChangeNotifyCorrelationId", amf_event_subscription->subs_change_notify_correlation_id) == NULL) {
ogs_error("OpenAPI_amf_event_subscription_convertToJSON() failed [subs_change_notify_correlation_id]");
goto end;
}
}
if (amf_event_subscription->supi) {
if (cJSON_AddStringToObject(item, "supi", amf_event_subscription->supi) == NULL) {
ogs_error("OpenAPI_amf_event_subscription_convertToJSON() failed [supi]");
goto end;
}
}
if (amf_event_subscription->group_id) {
if (cJSON_AddStringToObject(item, "groupId", amf_event_subscription->group_id) == NULL) {
ogs_error("OpenAPI_amf_event_subscription_convertToJSON() failed [group_id]");
goto end;
}
}
if (amf_event_subscription->gpsi) {
if (cJSON_AddStringToObject(item, "gpsi", amf_event_subscription->gpsi) == NULL) {
ogs_error("OpenAPI_amf_event_subscription_convertToJSON() failed [gpsi]");
goto end;
}
}
if (amf_event_subscription->pei) {
if (cJSON_AddStringToObject(item, "pei", amf_event_subscription->pei) == NULL) {
ogs_error("OpenAPI_amf_event_subscription_convertToJSON() failed [pei]");
goto end;
}
}
if (amf_event_subscription->any_ue) {
if (cJSON_AddBoolToObject(item, "anyUE", amf_event_subscription->any_ue) == NULL) {
ogs_error("OpenAPI_amf_event_subscription_convertToJSON() failed [any_ue]");
goto end;
}
}
if (amf_event_subscription->options) {
cJSON *options_local_JSON = OpenAPI_amf_event_mode_convertToJSON(amf_event_subscription->options);
if (options_local_JSON == NULL) {
ogs_error("OpenAPI_amf_event_subscription_convertToJSON() failed [options]");
goto end;
}
cJSON_AddItemToObject(item, "options", options_local_JSON);
if (item->child == NULL) {
ogs_error("OpenAPI_amf_event_subscription_convertToJSON() failed [options]");
goto end;
}
}
end:
return item;
}
OpenAPI_amf_event_subscription_t *OpenAPI_amf_event_subscription_parseFromJSON(cJSON *amf_event_subscriptionJSON)
{
OpenAPI_amf_event_subscription_t *amf_event_subscription_local_var = NULL;
cJSON *event_list = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "eventList");
if (!event_list) {
ogs_error("OpenAPI_amf_event_subscription_parseFromJSON() failed [event_list]");
goto end;
}
OpenAPI_list_t *event_listList;
cJSON *event_list_local_nonprimitive;
if (!cJSON_IsArray(event_list)) {
ogs_error("OpenAPI_amf_event_subscription_parseFromJSON() failed [event_list]");
goto end;
}
event_listList = OpenAPI_list_create();
cJSON_ArrayForEach(event_list_local_nonprimitive, event_list ) {
if (!cJSON_IsObject(event_list_local_nonprimitive)) {
ogs_error("OpenAPI_amf_event_subscription_parseFromJSON() failed [event_list]");
goto end;
}
OpenAPI_amf_event_t *event_listItem = OpenAPI_amf_event_parseFromJSON(event_list_local_nonprimitive);
OpenAPI_list_add(event_listList, event_listItem);
}
cJSON *event_notify_uri = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "eventNotifyUri");
if (!event_notify_uri) {
ogs_error("OpenAPI_amf_event_subscription_parseFromJSON() failed [event_notify_uri]");
goto end;
}
if (!cJSON_IsString(event_notify_uri)) {
ogs_error("OpenAPI_amf_event_subscription_parseFromJSON() failed [event_notify_uri]");
goto end;
}
cJSON *notify_correlation_id = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "notifyCorrelationId");
if (!notify_correlation_id) {
ogs_error("OpenAPI_amf_event_subscription_parseFromJSON() failed [notify_correlation_id]");
goto end;
}
if (!cJSON_IsString(notify_correlation_id)) {
ogs_error("OpenAPI_amf_event_subscription_parseFromJSON() failed [notify_correlation_id]");
goto end;
}
cJSON *nf_id = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "nfId");
if (!nf_id) {
ogs_error("OpenAPI_amf_event_subscription_parseFromJSON() failed [nf_id]");
goto end;
}
if (!cJSON_IsString(nf_id)) {
ogs_error("OpenAPI_amf_event_subscription_parseFromJSON() failed [nf_id]");
goto end;
}
cJSON *subs_change_notify_uri = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "subsChangeNotifyUri");
if (subs_change_notify_uri) {
if (!cJSON_IsString(subs_change_notify_uri)) {
ogs_error("OpenAPI_amf_event_subscription_parseFromJSON() failed [subs_change_notify_uri]");
goto end;
}
}
cJSON *subs_change_notify_correlation_id = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "subsChangeNotifyCorrelationId");
if (subs_change_notify_correlation_id) {
if (!cJSON_IsString(subs_change_notify_correlation_id)) {
ogs_error("OpenAPI_amf_event_subscription_parseFromJSON() failed [subs_change_notify_correlation_id]");
goto end;
}
}
cJSON *supi = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "supi");
if (supi) {
if (!cJSON_IsString(supi)) {
ogs_error("OpenAPI_amf_event_subscription_parseFromJSON() failed [supi]");
goto end;
}
}
cJSON *group_id = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "groupId");
if (group_id) {
if (!cJSON_IsString(group_id)) {
ogs_error("OpenAPI_amf_event_subscription_parseFromJSON() failed [group_id]");
goto end;
}
}
cJSON *gpsi = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "gpsi");
if (gpsi) {
if (!cJSON_IsString(gpsi)) {
ogs_error("OpenAPI_amf_event_subscription_parseFromJSON() failed [gpsi]");
goto end;
}
}
cJSON *pei = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "pei");
if (pei) {
if (!cJSON_IsString(pei)) {
ogs_error("OpenAPI_amf_event_subscription_parseFromJSON() failed [pei]");
goto end;
}
}
cJSON *any_ue = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "anyUE");
if (any_ue) {
if (!cJSON_IsBool(any_ue)) {
ogs_error("OpenAPI_amf_event_subscription_parseFromJSON() failed [any_ue]");
goto end;
}
}
cJSON *options = cJSON_GetObjectItemCaseSensitive(amf_event_subscriptionJSON, "options");
OpenAPI_amf_event_mode_t *options_local_nonprim = NULL;
if (options) {
options_local_nonprim = OpenAPI_amf_event_mode_parseFromJSON(options);
}
amf_event_subscription_local_var = OpenAPI_amf_event_subscription_create (
event_listList,
ogs_strdup(event_notify_uri->valuestring),
ogs_strdup(notify_correlation_id->valuestring),
ogs_strdup(nf_id->valuestring),
subs_change_notify_uri ? ogs_strdup(subs_change_notify_uri->valuestring) : NULL,
subs_change_notify_correlation_id ? ogs_strdup(subs_change_notify_correlation_id->valuestring) : NULL,
supi ? ogs_strdup(supi->valuestring) : NULL,
group_id ? ogs_strdup(group_id->valuestring) : NULL,
gpsi ? ogs_strdup(gpsi->valuestring) : NULL,
pei ? ogs_strdup(pei->valuestring) : NULL,
any_ue ? any_ue->valueint : 0,
options ? options_local_nonprim : NULL
);
return amf_event_subscription_local_var;
end:
return NULL;
}
OpenAPI_amf_event_subscription_t *OpenAPI_amf_event_subscription_copy(OpenAPI_amf_event_subscription_t *dst, OpenAPI_amf_event_subscription_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_amf_event_subscription_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_amf_event_subscription_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_amf_event_subscription_free(dst);
dst = OpenAPI_amf_event_subscription_parseFromJSON(item);
cJSON_Delete(item);
return dst;
}

View file

@ -0,0 +1,62 @@
/*
* amf_event_subscription.h
*
*
*/
#ifndef _OpenAPI_amf_event_subscription_H_
#define _OpenAPI_amf_event_subscription_H_
#include <string.h>
#include "../external/cJSON.h"
#include "../include/list.h"
#include "../include/keyValuePair.h"
#include "../include/binary.h"
#include "amf_event.h"
#include "amf_event_mode.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct OpenAPI_amf_event_subscription_s OpenAPI_amf_event_subscription_t;
typedef struct OpenAPI_amf_event_subscription_s {
OpenAPI_list_t *event_list;
char *event_notify_uri;
char *notify_correlation_id;
char *nf_id;
char *subs_change_notify_uri;
char *subs_change_notify_correlation_id;
char *supi;
char *group_id;
char *gpsi;
char *pei;
int any_ue;
struct OpenAPI_amf_event_mode_s *options;
} OpenAPI_amf_event_subscription_t;
OpenAPI_amf_event_subscription_t *OpenAPI_amf_event_subscription_create(
OpenAPI_list_t *event_list,
char *event_notify_uri,
char *notify_correlation_id,
char *nf_id,
char *subs_change_notify_uri,
char *subs_change_notify_correlation_id,
char *supi,
char *group_id,
char *gpsi,
char *pei,
int any_ue,
OpenAPI_amf_event_mode_t *options
);
void OpenAPI_amf_event_subscription_free(OpenAPI_amf_event_subscription_t *amf_event_subscription);
OpenAPI_amf_event_subscription_t *OpenAPI_amf_event_subscription_parseFromJSON(cJSON *amf_event_subscriptionJSON);
cJSON *OpenAPI_amf_event_subscription_convertToJSON(OpenAPI_amf_event_subscription_t *amf_event_subscription);
OpenAPI_amf_event_subscription_t *OpenAPI_amf_event_subscription_copy(OpenAPI_amf_event_subscription_t *dst, OpenAPI_amf_event_subscription_t *src);
#ifdef __cplusplus
}
#endif
#endif /* _OpenAPI_amf_event_subscription_H_ */

View file

@ -0,0 +1,85 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "amf_event_trigger.h"
OpenAPI_amf_event_trigger_t *OpenAPI_amf_event_trigger_create(
)
{
OpenAPI_amf_event_trigger_t *amf_event_trigger_local_var = OpenAPI_malloc(sizeof(OpenAPI_amf_event_trigger_t));
if (!amf_event_trigger_local_var) {
return NULL;
}
return amf_event_trigger_local_var;
}
void OpenAPI_amf_event_trigger_free(OpenAPI_amf_event_trigger_t *amf_event_trigger)
{
if (NULL == amf_event_trigger) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(amf_event_trigger);
}
cJSON *OpenAPI_amf_event_trigger_convertToJSON(OpenAPI_amf_event_trigger_t *amf_event_trigger)
{
cJSON *item = NULL;
if (amf_event_trigger == NULL) {
ogs_error("OpenAPI_amf_event_trigger_convertToJSON() failed [AmfEventTrigger]");
return NULL;
}
item = cJSON_CreateObject();
end:
return item;
}
OpenAPI_amf_event_trigger_t *OpenAPI_amf_event_trigger_parseFromJSON(cJSON *amf_event_triggerJSON)
{
OpenAPI_amf_event_trigger_t *amf_event_trigger_local_var = NULL;
amf_event_trigger_local_var = OpenAPI_amf_event_trigger_create (
);
return amf_event_trigger_local_var;
end:
return NULL;
}
OpenAPI_amf_event_trigger_t *OpenAPI_amf_event_trigger_copy(OpenAPI_amf_event_trigger_t *dst, OpenAPI_amf_event_trigger_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_amf_event_trigger_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_amf_event_trigger_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_amf_event_trigger_free(dst);
dst = OpenAPI_amf_event_trigger_parseFromJSON(item);
cJSON_Delete(item);
return dst;
}

View file

@ -0,0 +1,36 @@
/*
* amf_event_trigger.h
*
*
*/
#ifndef _OpenAPI_amf_event_trigger_H_
#define _OpenAPI_amf_event_trigger_H_
#include <string.h>
#include "../external/cJSON.h"
#include "../include/list.h"
#include "../include/keyValuePair.h"
#include "../include/binary.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct OpenAPI_amf_event_trigger_s OpenAPI_amf_event_trigger_t;
typedef struct OpenAPI_amf_event_trigger_s {
} OpenAPI_amf_event_trigger_t;
OpenAPI_amf_event_trigger_t *OpenAPI_amf_event_trigger_create(
);
void OpenAPI_amf_event_trigger_free(OpenAPI_amf_event_trigger_t *amf_event_trigger);
OpenAPI_amf_event_trigger_t *OpenAPI_amf_event_trigger_parseFromJSON(cJSON *amf_event_triggerJSON);
cJSON *OpenAPI_amf_event_trigger_convertToJSON(OpenAPI_amf_event_trigger_t *amf_event_trigger);
OpenAPI_amf_event_trigger_t *OpenAPI_amf_event_trigger_copy(OpenAPI_amf_event_trigger_t *dst, OpenAPI_amf_event_trigger_t *src);
#ifdef __cplusplus
}
#endif
#endif /* _OpenAPI_amf_event_trigger_H_ */

View file

@ -0,0 +1,85 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "amf_event_type.h"
OpenAPI_amf_event_type_t *OpenAPI_amf_event_type_create(
)
{
OpenAPI_amf_event_type_t *amf_event_type_local_var = OpenAPI_malloc(sizeof(OpenAPI_amf_event_type_t));
if (!amf_event_type_local_var) {
return NULL;
}
return amf_event_type_local_var;
}
void OpenAPI_amf_event_type_free(OpenAPI_amf_event_type_t *amf_event_type)
{
if (NULL == amf_event_type) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(amf_event_type);
}
cJSON *OpenAPI_amf_event_type_convertToJSON(OpenAPI_amf_event_type_t *amf_event_type)
{
cJSON *item = NULL;
if (amf_event_type == NULL) {
ogs_error("OpenAPI_amf_event_type_convertToJSON() failed [AmfEventType]");
return NULL;
}
item = cJSON_CreateObject();
end:
return item;
}
OpenAPI_amf_event_type_t *OpenAPI_amf_event_type_parseFromJSON(cJSON *amf_event_typeJSON)
{
OpenAPI_amf_event_type_t *amf_event_type_local_var = NULL;
amf_event_type_local_var = OpenAPI_amf_event_type_create (
);
return amf_event_type_local_var;
end:
return NULL;
}
OpenAPI_amf_event_type_t *OpenAPI_amf_event_type_copy(OpenAPI_amf_event_type_t *dst, OpenAPI_amf_event_type_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_amf_event_type_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_amf_event_type_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_amf_event_type_free(dst);
dst = OpenAPI_amf_event_type_parseFromJSON(item);
cJSON_Delete(item);
return dst;
}

View file

@ -0,0 +1,36 @@
/*
* amf_event_type.h
*
*
*/
#ifndef _OpenAPI_amf_event_type_H_
#define _OpenAPI_amf_event_type_H_
#include <string.h>
#include "../external/cJSON.h"
#include "../include/list.h"
#include "../include/keyValuePair.h"
#include "../include/binary.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct OpenAPI_amf_event_type_s OpenAPI_amf_event_type_t;
typedef struct OpenAPI_amf_event_type_s {
} OpenAPI_amf_event_type_t;
OpenAPI_amf_event_type_t *OpenAPI_amf_event_type_create(
);
void OpenAPI_amf_event_type_free(OpenAPI_amf_event_type_t *amf_event_type);
OpenAPI_amf_event_type_t *OpenAPI_amf_event_type_parseFromJSON(cJSON *amf_event_typeJSON);
cJSON *OpenAPI_amf_event_type_convertToJSON(OpenAPI_amf_event_type_t *amf_event_type);
OpenAPI_amf_event_type_t *OpenAPI_amf_event_type_copy(OpenAPI_amf_event_type_t *dst, OpenAPI_amf_event_type_t *src);
#ifdef __cplusplus
}
#endif
#endif /* _OpenAPI_amf_event_type_H_ */

View file

@ -378,3 +378,37 @@ end:
return NULL;
}
OpenAPI_amf_info_t *OpenAPI_amf_info_copy(OpenAPI_amf_info_t *dst, OpenAPI_amf_info_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_amf_info_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_amf_info_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_amf_info_free(dst);
dst = OpenAPI_amf_info_parseFromJSON(item);
cJSON_Delete(item);
return dst;
}

View file

@ -46,6 +46,7 @@ OpenAPI_amf_info_t *OpenAPI_amf_info_create(
void OpenAPI_amf_info_free(OpenAPI_amf_info_t *amf_info);
OpenAPI_amf_info_t *OpenAPI_amf_info_parseFromJSON(cJSON *amf_infoJSON);
cJSON *OpenAPI_amf_info_convertToJSON(OpenAPI_amf_info_t *amf_info);
OpenAPI_amf_info_t *OpenAPI_amf_info_copy(OpenAPI_amf_info_t *dst, OpenAPI_amf_info_t *src);
#ifdef __cplusplus
}

View file

@ -16,7 +16,7 @@ OpenAPI_amf_non3_gpp_access_registration_t *OpenAPI_amf_non3_gpp_access_registra
char *amf_service_name_pcscf_rest,
OpenAPI_guami_t *guami,
OpenAPI_list_t *backup_amf_info,
OpenAPI_rat_type_t *rat_type,
OpenAPI_rat_type_e rat_type,
int urrp_indicator,
char *amf_ee_subscription_id,
char *nid,
@ -72,7 +72,6 @@ void OpenAPI_amf_non3_gpp_access_registration_free(OpenAPI_amf_non3_gpp_access_r
OpenAPI_backup_amf_info_free(node->data);
}
OpenAPI_list_free(amf_non3_gpp_access_registration->backup_amf_info);
OpenAPI_rat_type_free(amf_non3_gpp_access_registration->rat_type);
ogs_free(amf_non3_gpp_access_registration->amf_ee_subscription_id);
ogs_free(amf_non3_gpp_access_registration->nid);
ogs_free(amf_non3_gpp_access_registration->registration_time);
@ -108,7 +107,7 @@ cJSON *OpenAPI_amf_non3_gpp_access_registration_convertToJSON(OpenAPI_amf_non3_g
}
}
if (amf_non3_gpp_access_registration->purge_flag >= 0) {
if (amf_non3_gpp_access_registration->purge_flag) {
if (cJSON_AddBoolToObject(item, "purgeFlag", amf_non3_gpp_access_registration->purge_flag) == NULL) {
ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [purge_flag]");
goto end;
@ -206,18 +205,12 @@ cJSON *OpenAPI_amf_non3_gpp_access_registration_convertToJSON(OpenAPI_amf_non3_g
ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [rat_type]");
goto end;
}
cJSON *rat_type_local_JSON = OpenAPI_rat_type_convertToJSON(amf_non3_gpp_access_registration->rat_type);
if (rat_type_local_JSON == NULL) {
ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [rat_type]");
goto end;
}
cJSON_AddItemToObject(item, "ratType", rat_type_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "ratType", OpenAPI_rat_type_ToString(amf_non3_gpp_access_registration->rat_type)) == NULL) {
ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [rat_type]");
goto end;
}
if (amf_non3_gpp_access_registration->urrp_indicator >= 0) {
if (amf_non3_gpp_access_registration->urrp_indicator) {
if (cJSON_AddBoolToObject(item, "urrpIndicator", amf_non3_gpp_access_registration->urrp_indicator) == NULL) {
ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed [urrp_indicator]");
goto end;
@ -400,9 +393,13 @@ OpenAPI_amf_non3_gpp_access_registration_t *OpenAPI_amf_non3_gpp_access_registra
goto end;
}
OpenAPI_rat_type_t *rat_type_local_nonprim = NULL;
OpenAPI_rat_type_e rat_typeVariable;
rat_type_local_nonprim = OpenAPI_rat_type_parseFromJSON(rat_type);
if (!cJSON_IsString(rat_type)) {
ogs_error("OpenAPI_amf_non3_gpp_access_registration_parseFromJSON() failed [rat_type]");
goto end;
}
rat_typeVariable = OpenAPI_rat_type_FromString(rat_type->valuestring);
cJSON *urrp_indicator = cJSON_GetObjectItemCaseSensitive(amf_non3_gpp_access_registrationJSON, "urrpIndicator");
@ -479,7 +476,7 @@ OpenAPI_amf_non3_gpp_access_registration_t *OpenAPI_amf_non3_gpp_access_registra
amf_service_name_pcscf_rest ? ogs_strdup(amf_service_name_pcscf_rest->valuestring) : NULL,
guami_local_nonprim,
backup_amf_info ? backup_amf_infoList : NULL,
rat_type_local_nonprim,
rat_typeVariable,
urrp_indicator ? urrp_indicator->valueint : 0,
amf_ee_subscription_id ? ogs_strdup(amf_ee_subscription_id->valuestring) : NULL,
nid ? ogs_strdup(nid->valuestring) : NULL,
@ -494,3 +491,37 @@ end:
return NULL;
}
OpenAPI_amf_non3_gpp_access_registration_t *OpenAPI_amf_non3_gpp_access_registration_copy(OpenAPI_amf_non3_gpp_access_registration_t *dst, OpenAPI_amf_non3_gpp_access_registration_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_amf_non3_gpp_access_registration_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_amf_non3_gpp_access_registration_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_amf_non3_gpp_access_registration_free(dst);
dst = OpenAPI_amf_non3_gpp_access_registration_parseFromJSON(item);
cJSON_Delete(item);
return dst;
}

View file

@ -34,7 +34,7 @@ typedef struct OpenAPI_amf_non3_gpp_access_registration_s {
char *amf_service_name_pcscf_rest;
struct OpenAPI_guami_s *guami;
OpenAPI_list_t *backup_amf_info;
struct OpenAPI_rat_type_s *rat_type;
OpenAPI_rat_type_e rat_type;
int urrp_indicator;
char *amf_ee_subscription_id;
char *nid;
@ -56,7 +56,7 @@ OpenAPI_amf_non3_gpp_access_registration_t *OpenAPI_amf_non3_gpp_access_registra
char *amf_service_name_pcscf_rest,
OpenAPI_guami_t *guami,
OpenAPI_list_t *backup_amf_info,
OpenAPI_rat_type_t *rat_type,
OpenAPI_rat_type_e rat_type,
int urrp_indicator,
char *amf_ee_subscription_id,
char *nid,
@ -68,6 +68,7 @@ OpenAPI_amf_non3_gpp_access_registration_t *OpenAPI_amf_non3_gpp_access_registra
void OpenAPI_amf_non3_gpp_access_registration_free(OpenAPI_amf_non3_gpp_access_registration_t *amf_non3_gpp_access_registration);
OpenAPI_amf_non3_gpp_access_registration_t *OpenAPI_amf_non3_gpp_access_registration_parseFromJSON(cJSON *amf_non3_gpp_access_registrationJSON);
cJSON *OpenAPI_amf_non3_gpp_access_registration_convertToJSON(OpenAPI_amf_non3_gpp_access_registration_t *amf_non3_gpp_access_registration);
OpenAPI_amf_non3_gpp_access_registration_t *OpenAPI_amf_non3_gpp_access_registration_copy(OpenAPI_amf_non3_gpp_access_registration_t *dst, OpenAPI_amf_non3_gpp_access_registration_t *src);
#ifdef __cplusplus
}

View file

@ -66,7 +66,7 @@ cJSON *OpenAPI_amf_non3_gpp_access_registration_modification_convertToJSON(OpenA
goto end;
}
if (amf_non3_gpp_access_registration_modification->purge_flag >= 0) {
if (amf_non3_gpp_access_registration_modification->purge_flag) {
if (cJSON_AddBoolToObject(item, "purgeFlag", amf_non3_gpp_access_registration_modification->purge_flag) == NULL) {
ogs_error("OpenAPI_amf_non3_gpp_access_registration_modification_convertToJSON() failed [purge_flag]");
goto end;
@ -191,3 +191,37 @@ end:
return NULL;
}
OpenAPI_amf_non3_gpp_access_registration_modification_t *OpenAPI_amf_non3_gpp_access_registration_modification_copy(OpenAPI_amf_non3_gpp_access_registration_modification_t *dst, OpenAPI_amf_non3_gpp_access_registration_modification_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_amf_non3_gpp_access_registration_modification_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_amf_non3_gpp_access_registration_modification_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_amf_non3_gpp_access_registration_modification_free(dst);
dst = OpenAPI_amf_non3_gpp_access_registration_modification_parseFromJSON(item);
cJSON_Delete(item);
return dst;
}

View file

@ -39,6 +39,7 @@ OpenAPI_amf_non3_gpp_access_registration_modification_t *OpenAPI_amf_non3_gpp_ac
void OpenAPI_amf_non3_gpp_access_registration_modification_free(OpenAPI_amf_non3_gpp_access_registration_modification_t *amf_non3_gpp_access_registration_modification);
OpenAPI_amf_non3_gpp_access_registration_modification_t *OpenAPI_amf_non3_gpp_access_registration_modification_parseFromJSON(cJSON *amf_non3_gpp_access_registration_modificationJSON);
cJSON *OpenAPI_amf_non3_gpp_access_registration_modification_convertToJSON(OpenAPI_amf_non3_gpp_access_registration_modification_t *amf_non3_gpp_access_registration_modification);
OpenAPI_amf_non3_gpp_access_registration_modification_t *OpenAPI_amf_non3_gpp_access_registration_modification_copy(OpenAPI_amf_non3_gpp_access_registration_modification_t *dst, OpenAPI_amf_non3_gpp_access_registration_modification_t *src);
#ifdef __cplusplus
}

View file

@ -0,0 +1,140 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "amf_status_change_notification.h"
OpenAPI_amf_status_change_notification_t *OpenAPI_amf_status_change_notification_create(
OpenAPI_list_t *amf_status_info_list
)
{
OpenAPI_amf_status_change_notification_t *amf_status_change_notification_local_var = OpenAPI_malloc(sizeof(OpenAPI_amf_status_change_notification_t));
if (!amf_status_change_notification_local_var) {
return NULL;
}
amf_status_change_notification_local_var->amf_status_info_list = amf_status_info_list;
return amf_status_change_notification_local_var;
}
void OpenAPI_amf_status_change_notification_free(OpenAPI_amf_status_change_notification_t *amf_status_change_notification)
{
if (NULL == amf_status_change_notification) {
return;
}
OpenAPI_lnode_t *node;
OpenAPI_list_for_each(amf_status_change_notification->amf_status_info_list, node) {
OpenAPI_amf_status_info_free(node->data);
}
OpenAPI_list_free(amf_status_change_notification->amf_status_info_list);
ogs_free(amf_status_change_notification);
}
cJSON *OpenAPI_amf_status_change_notification_convertToJSON(OpenAPI_amf_status_change_notification_t *amf_status_change_notification)
{
cJSON *item = NULL;
if (amf_status_change_notification == NULL) {
ogs_error("OpenAPI_amf_status_change_notification_convertToJSON() failed [AmfStatusChangeNotification]");
return NULL;
}
item = cJSON_CreateObject();
if (!amf_status_change_notification->amf_status_info_list) {
ogs_error("OpenAPI_amf_status_change_notification_convertToJSON() failed [amf_status_info_list]");
goto end;
}
cJSON *amf_status_info_listList = cJSON_AddArrayToObject(item, "amfStatusInfoList");
if (amf_status_info_listList == NULL) {
ogs_error("OpenAPI_amf_status_change_notification_convertToJSON() failed [amf_status_info_list]");
goto end;
}
OpenAPI_lnode_t *amf_status_info_list_node;
if (amf_status_change_notification->amf_status_info_list) {
OpenAPI_list_for_each(amf_status_change_notification->amf_status_info_list, amf_status_info_list_node) {
cJSON *itemLocal = OpenAPI_amf_status_info_convertToJSON(amf_status_info_list_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_amf_status_change_notification_convertToJSON() failed [amf_status_info_list]");
goto end;
}
cJSON_AddItemToArray(amf_status_info_listList, itemLocal);
}
}
end:
return item;
}
OpenAPI_amf_status_change_notification_t *OpenAPI_amf_status_change_notification_parseFromJSON(cJSON *amf_status_change_notificationJSON)
{
OpenAPI_amf_status_change_notification_t *amf_status_change_notification_local_var = NULL;
cJSON *amf_status_info_list = cJSON_GetObjectItemCaseSensitive(amf_status_change_notificationJSON, "amfStatusInfoList");
if (!amf_status_info_list) {
ogs_error("OpenAPI_amf_status_change_notification_parseFromJSON() failed [amf_status_info_list]");
goto end;
}
OpenAPI_list_t *amf_status_info_listList;
cJSON *amf_status_info_list_local_nonprimitive;
if (!cJSON_IsArray(amf_status_info_list)) {
ogs_error("OpenAPI_amf_status_change_notification_parseFromJSON() failed [amf_status_info_list]");
goto end;
}
amf_status_info_listList = OpenAPI_list_create();
cJSON_ArrayForEach(amf_status_info_list_local_nonprimitive, amf_status_info_list ) {
if (!cJSON_IsObject(amf_status_info_list_local_nonprimitive)) {
ogs_error("OpenAPI_amf_status_change_notification_parseFromJSON() failed [amf_status_info_list]");
goto end;
}
OpenAPI_amf_status_info_t *amf_status_info_listItem = OpenAPI_amf_status_info_parseFromJSON(amf_status_info_list_local_nonprimitive);
OpenAPI_list_add(amf_status_info_listList, amf_status_info_listItem);
}
amf_status_change_notification_local_var = OpenAPI_amf_status_change_notification_create (
amf_status_info_listList
);
return amf_status_change_notification_local_var;
end:
return NULL;
}
OpenAPI_amf_status_change_notification_t *OpenAPI_amf_status_change_notification_copy(OpenAPI_amf_status_change_notification_t *dst, OpenAPI_amf_status_change_notification_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_amf_status_change_notification_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_amf_status_change_notification_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_amf_status_change_notification_free(dst);
dst = OpenAPI_amf_status_change_notification_parseFromJSON(item);
cJSON_Delete(item);
return dst;
}

View file

@ -0,0 +1,39 @@
/*
* amf_status_change_notification.h
*
*
*/
#ifndef _OpenAPI_amf_status_change_notification_H_
#define _OpenAPI_amf_status_change_notification_H_
#include <string.h>
#include "../external/cJSON.h"
#include "../include/list.h"
#include "../include/keyValuePair.h"
#include "../include/binary.h"
#include "amf_status_info.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct OpenAPI_amf_status_change_notification_s OpenAPI_amf_status_change_notification_t;
typedef struct OpenAPI_amf_status_change_notification_s {
OpenAPI_list_t *amf_status_info_list;
} OpenAPI_amf_status_change_notification_t;
OpenAPI_amf_status_change_notification_t *OpenAPI_amf_status_change_notification_create(
OpenAPI_list_t *amf_status_info_list
);
void OpenAPI_amf_status_change_notification_free(OpenAPI_amf_status_change_notification_t *amf_status_change_notification);
OpenAPI_amf_status_change_notification_t *OpenAPI_amf_status_change_notification_parseFromJSON(cJSON *amf_status_change_notificationJSON);
cJSON *OpenAPI_amf_status_change_notification_convertToJSON(OpenAPI_amf_status_change_notification_t *amf_status_change_notification);
OpenAPI_amf_status_change_notification_t *OpenAPI_amf_status_change_notification_copy(OpenAPI_amf_status_change_notification_t *dst, OpenAPI_amf_status_change_notification_t *src);
#ifdef __cplusplus
}
#endif
#endif /* _OpenAPI_amf_status_change_notification_H_ */

View file

@ -0,0 +1,160 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "amf_status_change_subscription_data.h"
OpenAPI_amf_status_change_subscription_data_t *OpenAPI_amf_status_change_subscription_data_create(
char *amf_status_uri,
OpenAPI_list_t *guami_list
)
{
OpenAPI_amf_status_change_subscription_data_t *amf_status_change_subscription_data_local_var = OpenAPI_malloc(sizeof(OpenAPI_amf_status_change_subscription_data_t));
if (!amf_status_change_subscription_data_local_var) {
return NULL;
}
amf_status_change_subscription_data_local_var->amf_status_uri = amf_status_uri;
amf_status_change_subscription_data_local_var->guami_list = guami_list;
return amf_status_change_subscription_data_local_var;
}
void OpenAPI_amf_status_change_subscription_data_free(OpenAPI_amf_status_change_subscription_data_t *amf_status_change_subscription_data)
{
if (NULL == amf_status_change_subscription_data) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(amf_status_change_subscription_data->amf_status_uri);
OpenAPI_list_for_each(amf_status_change_subscription_data->guami_list, node) {
OpenAPI_guami_free(node->data);
}
OpenAPI_list_free(amf_status_change_subscription_data->guami_list);
ogs_free(amf_status_change_subscription_data);
}
cJSON *OpenAPI_amf_status_change_subscription_data_convertToJSON(OpenAPI_amf_status_change_subscription_data_t *amf_status_change_subscription_data)
{
cJSON *item = NULL;
if (amf_status_change_subscription_data == NULL) {
ogs_error("OpenAPI_amf_status_change_subscription_data_convertToJSON() failed [AMFStatusChangeSubscriptionData]");
return NULL;
}
item = cJSON_CreateObject();
if (!amf_status_change_subscription_data->amf_status_uri) {
ogs_error("OpenAPI_amf_status_change_subscription_data_convertToJSON() failed [amf_status_uri]");
goto end;
}
if (cJSON_AddStringToObject(item, "amfStatusUri", amf_status_change_subscription_data->amf_status_uri) == NULL) {
ogs_error("OpenAPI_amf_status_change_subscription_data_convertToJSON() failed [amf_status_uri]");
goto end;
}
if (amf_status_change_subscription_data->guami_list) {
cJSON *guami_listList = cJSON_AddArrayToObject(item, "guamiList");
if (guami_listList == NULL) {
ogs_error("OpenAPI_amf_status_change_subscription_data_convertToJSON() failed [guami_list]");
goto end;
}
OpenAPI_lnode_t *guami_list_node;
if (amf_status_change_subscription_data->guami_list) {
OpenAPI_list_for_each(amf_status_change_subscription_data->guami_list, guami_list_node) {
cJSON *itemLocal = OpenAPI_guami_convertToJSON(guami_list_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_amf_status_change_subscription_data_convertToJSON() failed [guami_list]");
goto end;
}
cJSON_AddItemToArray(guami_listList, itemLocal);
}
}
}
end:
return item;
}
OpenAPI_amf_status_change_subscription_data_t *OpenAPI_amf_status_change_subscription_data_parseFromJSON(cJSON *amf_status_change_subscription_dataJSON)
{
OpenAPI_amf_status_change_subscription_data_t *amf_status_change_subscription_data_local_var = NULL;
cJSON *amf_status_uri = cJSON_GetObjectItemCaseSensitive(amf_status_change_subscription_dataJSON, "amfStatusUri");
if (!amf_status_uri) {
ogs_error("OpenAPI_amf_status_change_subscription_data_parseFromJSON() failed [amf_status_uri]");
goto end;
}
if (!cJSON_IsString(amf_status_uri)) {
ogs_error("OpenAPI_amf_status_change_subscription_data_parseFromJSON() failed [amf_status_uri]");
goto end;
}
cJSON *guami_list = cJSON_GetObjectItemCaseSensitive(amf_status_change_subscription_dataJSON, "guamiList");
OpenAPI_list_t *guami_listList;
if (guami_list) {
cJSON *guami_list_local_nonprimitive;
if (!cJSON_IsArray(guami_list)) {
ogs_error("OpenAPI_amf_status_change_subscription_data_parseFromJSON() failed [guami_list]");
goto end;
}
guami_listList = OpenAPI_list_create();
cJSON_ArrayForEach(guami_list_local_nonprimitive, guami_list ) {
if (!cJSON_IsObject(guami_list_local_nonprimitive)) {
ogs_error("OpenAPI_amf_status_change_subscription_data_parseFromJSON() failed [guami_list]");
goto end;
}
OpenAPI_guami_t *guami_listItem = OpenAPI_guami_parseFromJSON(guami_list_local_nonprimitive);
OpenAPI_list_add(guami_listList, guami_listItem);
}
}
amf_status_change_subscription_data_local_var = OpenAPI_amf_status_change_subscription_data_create (
ogs_strdup(amf_status_uri->valuestring),
guami_list ? guami_listList : NULL
);
return amf_status_change_subscription_data_local_var;
end:
return NULL;
}
OpenAPI_amf_status_change_subscription_data_t *OpenAPI_amf_status_change_subscription_data_copy(OpenAPI_amf_status_change_subscription_data_t *dst, OpenAPI_amf_status_change_subscription_data_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_amf_status_change_subscription_data_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_amf_status_change_subscription_data_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_amf_status_change_subscription_data_free(dst);
dst = OpenAPI_amf_status_change_subscription_data_parseFromJSON(item);
cJSON_Delete(item);
return dst;
}

View file

@ -0,0 +1,41 @@
/*
* amf_status_change_subscription_data.h
*
*
*/
#ifndef _OpenAPI_amf_status_change_subscription_data_H_
#define _OpenAPI_amf_status_change_subscription_data_H_
#include <string.h>
#include "../external/cJSON.h"
#include "../include/list.h"
#include "../include/keyValuePair.h"
#include "../include/binary.h"
#include "guami.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct OpenAPI_amf_status_change_subscription_data_s OpenAPI_amf_status_change_subscription_data_t;
typedef struct OpenAPI_amf_status_change_subscription_data_s {
char *amf_status_uri;
OpenAPI_list_t *guami_list;
} OpenAPI_amf_status_change_subscription_data_t;
OpenAPI_amf_status_change_subscription_data_t *OpenAPI_amf_status_change_subscription_data_create(
char *amf_status_uri,
OpenAPI_list_t *guami_list
);
void OpenAPI_amf_status_change_subscription_data_free(OpenAPI_amf_status_change_subscription_data_t *amf_status_change_subscription_data);
OpenAPI_amf_status_change_subscription_data_t *OpenAPI_amf_status_change_subscription_data_parseFromJSON(cJSON *amf_status_change_subscription_dataJSON);
cJSON *OpenAPI_amf_status_change_subscription_data_convertToJSON(OpenAPI_amf_status_change_subscription_data_t *amf_status_change_subscription_data);
OpenAPI_amf_status_change_subscription_data_t *OpenAPI_amf_status_change_subscription_data_copy(OpenAPI_amf_status_change_subscription_data_t *dst, OpenAPI_amf_status_change_subscription_data_t *src);
#ifdef __cplusplus
}
#endif
#endif /* _OpenAPI_amf_status_change_subscription_data_H_ */

View file

@ -0,0 +1,206 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "amf_status_info.h"
OpenAPI_amf_status_info_t *OpenAPI_amf_status_info_create(
OpenAPI_list_t *guami_list,
OpenAPI_status_change_e status_change,
char *target_amf_removal,
char *target_amf_failure
)
{
OpenAPI_amf_status_info_t *amf_status_info_local_var = OpenAPI_malloc(sizeof(OpenAPI_amf_status_info_t));
if (!amf_status_info_local_var) {
return NULL;
}
amf_status_info_local_var->guami_list = guami_list;
amf_status_info_local_var->status_change = status_change;
amf_status_info_local_var->target_amf_removal = target_amf_removal;
amf_status_info_local_var->target_amf_failure = target_amf_failure;
return amf_status_info_local_var;
}
void OpenAPI_amf_status_info_free(OpenAPI_amf_status_info_t *amf_status_info)
{
if (NULL == amf_status_info) {
return;
}
OpenAPI_lnode_t *node;
OpenAPI_list_for_each(amf_status_info->guami_list, node) {
OpenAPI_guami_free(node->data);
}
OpenAPI_list_free(amf_status_info->guami_list);
ogs_free(amf_status_info->target_amf_removal);
ogs_free(amf_status_info->target_amf_failure);
ogs_free(amf_status_info);
}
cJSON *OpenAPI_amf_status_info_convertToJSON(OpenAPI_amf_status_info_t *amf_status_info)
{
cJSON *item = NULL;
if (amf_status_info == NULL) {
ogs_error("OpenAPI_amf_status_info_convertToJSON() failed [AmfStatusInfo]");
return NULL;
}
item = cJSON_CreateObject();
if (!amf_status_info->guami_list) {
ogs_error("OpenAPI_amf_status_info_convertToJSON() failed [guami_list]");
goto end;
}
cJSON *guami_listList = cJSON_AddArrayToObject(item, "guamiList");
if (guami_listList == NULL) {
ogs_error("OpenAPI_amf_status_info_convertToJSON() failed [guami_list]");
goto end;
}
OpenAPI_lnode_t *guami_list_node;
if (amf_status_info->guami_list) {
OpenAPI_list_for_each(amf_status_info->guami_list, guami_list_node) {
cJSON *itemLocal = OpenAPI_guami_convertToJSON(guami_list_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_amf_status_info_convertToJSON() failed [guami_list]");
goto end;
}
cJSON_AddItemToArray(guami_listList, itemLocal);
}
}
if (!amf_status_info->status_change) {
ogs_error("OpenAPI_amf_status_info_convertToJSON() failed [status_change]");
goto end;
}
if (cJSON_AddStringToObject(item, "statusChange", OpenAPI_status_change_ToString(amf_status_info->status_change)) == NULL) {
ogs_error("OpenAPI_amf_status_info_convertToJSON() failed [status_change]");
goto end;
}
if (amf_status_info->target_amf_removal) {
if (cJSON_AddStringToObject(item, "targetAmfRemoval", amf_status_info->target_amf_removal) == NULL) {
ogs_error("OpenAPI_amf_status_info_convertToJSON() failed [target_amf_removal]");
goto end;
}
}
if (amf_status_info->target_amf_failure) {
if (cJSON_AddStringToObject(item, "targetAmfFailure", amf_status_info->target_amf_failure) == NULL) {
ogs_error("OpenAPI_amf_status_info_convertToJSON() failed [target_amf_failure]");
goto end;
}
}
end:
return item;
}
OpenAPI_amf_status_info_t *OpenAPI_amf_status_info_parseFromJSON(cJSON *amf_status_infoJSON)
{
OpenAPI_amf_status_info_t *amf_status_info_local_var = NULL;
cJSON *guami_list = cJSON_GetObjectItemCaseSensitive(amf_status_infoJSON, "guamiList");
if (!guami_list) {
ogs_error("OpenAPI_amf_status_info_parseFromJSON() failed [guami_list]");
goto end;
}
OpenAPI_list_t *guami_listList;
cJSON *guami_list_local_nonprimitive;
if (!cJSON_IsArray(guami_list)) {
ogs_error("OpenAPI_amf_status_info_parseFromJSON() failed [guami_list]");
goto end;
}
guami_listList = OpenAPI_list_create();
cJSON_ArrayForEach(guami_list_local_nonprimitive, guami_list ) {
if (!cJSON_IsObject(guami_list_local_nonprimitive)) {
ogs_error("OpenAPI_amf_status_info_parseFromJSON() failed [guami_list]");
goto end;
}
OpenAPI_guami_t *guami_listItem = OpenAPI_guami_parseFromJSON(guami_list_local_nonprimitive);
OpenAPI_list_add(guami_listList, guami_listItem);
}
cJSON *status_change = cJSON_GetObjectItemCaseSensitive(amf_status_infoJSON, "statusChange");
if (!status_change) {
ogs_error("OpenAPI_amf_status_info_parseFromJSON() failed [status_change]");
goto end;
}
OpenAPI_status_change_e status_changeVariable;
if (!cJSON_IsString(status_change)) {
ogs_error("OpenAPI_amf_status_info_parseFromJSON() failed [status_change]");
goto end;
}
status_changeVariable = OpenAPI_status_change_FromString(status_change->valuestring);
cJSON *target_amf_removal = cJSON_GetObjectItemCaseSensitive(amf_status_infoJSON, "targetAmfRemoval");
if (target_amf_removal) {
if (!cJSON_IsString(target_amf_removal)) {
ogs_error("OpenAPI_amf_status_info_parseFromJSON() failed [target_amf_removal]");
goto end;
}
}
cJSON *target_amf_failure = cJSON_GetObjectItemCaseSensitive(amf_status_infoJSON, "targetAmfFailure");
if (target_amf_failure) {
if (!cJSON_IsString(target_amf_failure)) {
ogs_error("OpenAPI_amf_status_info_parseFromJSON() failed [target_amf_failure]");
goto end;
}
}
amf_status_info_local_var = OpenAPI_amf_status_info_create (
guami_listList,
status_changeVariable,
target_amf_removal ? ogs_strdup(target_amf_removal->valuestring) : NULL,
target_amf_failure ? ogs_strdup(target_amf_failure->valuestring) : NULL
);
return amf_status_info_local_var;
end:
return NULL;
}
OpenAPI_amf_status_info_t *OpenAPI_amf_status_info_copy(OpenAPI_amf_status_info_t *dst, OpenAPI_amf_status_info_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_amf_status_info_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_amf_status_info_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_amf_status_info_free(dst);
dst = OpenAPI_amf_status_info_parseFromJSON(item);
cJSON_Delete(item);
return dst;
}

View file

@ -0,0 +1,46 @@
/*
* amf_status_info.h
*
*
*/
#ifndef _OpenAPI_amf_status_info_H_
#define _OpenAPI_amf_status_info_H_
#include <string.h>
#include "../external/cJSON.h"
#include "../include/list.h"
#include "../include/keyValuePair.h"
#include "../include/binary.h"
#include "guami.h"
#include "status_change.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct OpenAPI_amf_status_info_s OpenAPI_amf_status_info_t;
typedef struct OpenAPI_amf_status_info_s {
OpenAPI_list_t *guami_list;
OpenAPI_status_change_e status_change;
char *target_amf_removal;
char *target_amf_failure;
} OpenAPI_amf_status_info_t;
OpenAPI_amf_status_info_t *OpenAPI_amf_status_info_create(
OpenAPI_list_t *guami_list,
OpenAPI_status_change_e status_change,
char *target_amf_removal,
char *target_amf_failure
);
void OpenAPI_amf_status_info_free(OpenAPI_amf_status_info_t *amf_status_info);
OpenAPI_amf_status_info_t *OpenAPI_amf_status_info_parseFromJSON(cJSON *amf_status_infoJSON);
cJSON *OpenAPI_amf_status_info_convertToJSON(OpenAPI_amf_status_info_t *amf_status_info);
OpenAPI_amf_status_info_t *OpenAPI_amf_status_info_copy(OpenAPI_amf_status_info_t *dst, OpenAPI_amf_status_info_t *src);
#ifdef __cplusplus
}
#endif
#endif /* _OpenAPI_amf_status_info_H_ */

View file

@ -119,3 +119,37 @@ end:
return NULL;
}
OpenAPI_amf_subscription_info_t *OpenAPI_amf_subscription_info_copy(OpenAPI_amf_subscription_info_t *dst, OpenAPI_amf_subscription_info_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_amf_subscription_info_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_amf_subscription_info_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_amf_subscription_info_free(dst);
dst = OpenAPI_amf_subscription_info_parseFromJSON(item);
cJSON_Delete(item);
return dst;
}

View file

@ -32,6 +32,7 @@ OpenAPI_amf_subscription_info_t *OpenAPI_amf_subscription_info_create(
void OpenAPI_amf_subscription_info_free(OpenAPI_amf_subscription_info_t *amf_subscription_info);
OpenAPI_amf_subscription_info_t *OpenAPI_amf_subscription_info_parseFromJSON(cJSON *amf_subscription_infoJSON);
cJSON *OpenAPI_amf_subscription_info_convertToJSON(OpenAPI_amf_subscription_info_t *amf_subscription_info);
OpenAPI_amf_subscription_info_t *OpenAPI_amf_subscription_info_copy(OpenAPI_amf_subscription_info_t *dst, OpenAPI_amf_subscription_info_t *src);
#ifdef __cplusplus
}

View file

@ -49,3 +49,37 @@ end:
return NULL;
}
OpenAPI_an_node_type_t *OpenAPI_an_node_type_copy(OpenAPI_an_node_type_t *dst, OpenAPI_an_node_type_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_an_node_type_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_an_node_type_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_an_node_type_free(dst);
dst = OpenAPI_an_node_type_parseFromJSON(item);
cJSON_Delete(item);
return dst;
}

View file

@ -26,6 +26,7 @@ OpenAPI_an_node_type_t *OpenAPI_an_node_type_create(
void OpenAPI_an_node_type_free(OpenAPI_an_node_type_t *an_node_type);
OpenAPI_an_node_type_t *OpenAPI_an_node_type_parseFromJSON(cJSON *an_node_typeJSON);
cJSON *OpenAPI_an_node_type_convertToJSON(OpenAPI_an_node_type_t *an_node_type);
OpenAPI_an_node_type_t *OpenAPI_an_node_type_copy(OpenAPI_an_node_type_t *dst, OpenAPI_an_node_type_t *src);
#ifdef __cplusplus
}

View file

@ -0,0 +1,181 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "apn_rate_status.h"
OpenAPI_apn_rate_status_t *OpenAPI_apn_rate_status_create(
int remain_packets_ul,
int remain_packets_dl,
char *validity_time,
int remain_ex_reports_ul,
int remain_ex_reports_dl
)
{
OpenAPI_apn_rate_status_t *apn_rate_status_local_var = OpenAPI_malloc(sizeof(OpenAPI_apn_rate_status_t));
if (!apn_rate_status_local_var) {
return NULL;
}
apn_rate_status_local_var->remain_packets_ul = remain_packets_ul;
apn_rate_status_local_var->remain_packets_dl = remain_packets_dl;
apn_rate_status_local_var->validity_time = validity_time;
apn_rate_status_local_var->remain_ex_reports_ul = remain_ex_reports_ul;
apn_rate_status_local_var->remain_ex_reports_dl = remain_ex_reports_dl;
return apn_rate_status_local_var;
}
void OpenAPI_apn_rate_status_free(OpenAPI_apn_rate_status_t *apn_rate_status)
{
if (NULL == apn_rate_status) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(apn_rate_status->validity_time);
ogs_free(apn_rate_status);
}
cJSON *OpenAPI_apn_rate_status_convertToJSON(OpenAPI_apn_rate_status_t *apn_rate_status)
{
cJSON *item = NULL;
if (apn_rate_status == NULL) {
ogs_error("OpenAPI_apn_rate_status_convertToJSON() failed [ApnRateStatus]");
return NULL;
}
item = cJSON_CreateObject();
if (apn_rate_status->remain_packets_ul) {
if (cJSON_AddNumberToObject(item, "remainPacketsUl", apn_rate_status->remain_packets_ul) == NULL) {
ogs_error("OpenAPI_apn_rate_status_convertToJSON() failed [remain_packets_ul]");
goto end;
}
}
if (apn_rate_status->remain_packets_dl) {
if (cJSON_AddNumberToObject(item, "remainPacketsDl", apn_rate_status->remain_packets_dl) == NULL) {
ogs_error("OpenAPI_apn_rate_status_convertToJSON() failed [remain_packets_dl]");
goto end;
}
}
if (apn_rate_status->validity_time) {
if (cJSON_AddStringToObject(item, "validityTime", apn_rate_status->validity_time) == NULL) {
ogs_error("OpenAPI_apn_rate_status_convertToJSON() failed [validity_time]");
goto end;
}
}
if (apn_rate_status->remain_ex_reports_ul) {
if (cJSON_AddNumberToObject(item, "remainExReportsUl", apn_rate_status->remain_ex_reports_ul) == NULL) {
ogs_error("OpenAPI_apn_rate_status_convertToJSON() failed [remain_ex_reports_ul]");
goto end;
}
}
if (apn_rate_status->remain_ex_reports_dl) {
if (cJSON_AddNumberToObject(item, "remainExReportsDl", apn_rate_status->remain_ex_reports_dl) == NULL) {
ogs_error("OpenAPI_apn_rate_status_convertToJSON() failed [remain_ex_reports_dl]");
goto end;
}
}
end:
return item;
}
OpenAPI_apn_rate_status_t *OpenAPI_apn_rate_status_parseFromJSON(cJSON *apn_rate_statusJSON)
{
OpenAPI_apn_rate_status_t *apn_rate_status_local_var = NULL;
cJSON *remain_packets_ul = cJSON_GetObjectItemCaseSensitive(apn_rate_statusJSON, "remainPacketsUl");
if (remain_packets_ul) {
if (!cJSON_IsNumber(remain_packets_ul)) {
ogs_error("OpenAPI_apn_rate_status_parseFromJSON() failed [remain_packets_ul]");
goto end;
}
}
cJSON *remain_packets_dl = cJSON_GetObjectItemCaseSensitive(apn_rate_statusJSON, "remainPacketsDl");
if (remain_packets_dl) {
if (!cJSON_IsNumber(remain_packets_dl)) {
ogs_error("OpenAPI_apn_rate_status_parseFromJSON() failed [remain_packets_dl]");
goto end;
}
}
cJSON *validity_time = cJSON_GetObjectItemCaseSensitive(apn_rate_statusJSON, "validityTime");
if (validity_time) {
if (!cJSON_IsString(validity_time)) {
ogs_error("OpenAPI_apn_rate_status_parseFromJSON() failed [validity_time]");
goto end;
}
}
cJSON *remain_ex_reports_ul = cJSON_GetObjectItemCaseSensitive(apn_rate_statusJSON, "remainExReportsUl");
if (remain_ex_reports_ul) {
if (!cJSON_IsNumber(remain_ex_reports_ul)) {
ogs_error("OpenAPI_apn_rate_status_parseFromJSON() failed [remain_ex_reports_ul]");
goto end;
}
}
cJSON *remain_ex_reports_dl = cJSON_GetObjectItemCaseSensitive(apn_rate_statusJSON, "remainExReportsDl");
if (remain_ex_reports_dl) {
if (!cJSON_IsNumber(remain_ex_reports_dl)) {
ogs_error("OpenAPI_apn_rate_status_parseFromJSON() failed [remain_ex_reports_dl]");
goto end;
}
}
apn_rate_status_local_var = OpenAPI_apn_rate_status_create (
remain_packets_ul ? remain_packets_ul->valuedouble : 0,
remain_packets_dl ? remain_packets_dl->valuedouble : 0,
validity_time ? ogs_strdup(validity_time->valuestring) : NULL,
remain_ex_reports_ul ? remain_ex_reports_ul->valuedouble : 0,
remain_ex_reports_dl ? remain_ex_reports_dl->valuedouble : 0
);
return apn_rate_status_local_var;
end:
return NULL;
}
OpenAPI_apn_rate_status_t *OpenAPI_apn_rate_status_copy(OpenAPI_apn_rate_status_t *dst, OpenAPI_apn_rate_status_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_apn_rate_status_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_apn_rate_status_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_apn_rate_status_free(dst);
dst = OpenAPI_apn_rate_status_parseFromJSON(item);
cJSON_Delete(item);
return dst;
}

View file

@ -0,0 +1,46 @@
/*
* apn_rate_status.h
*
*
*/
#ifndef _OpenAPI_apn_rate_status_H_
#define _OpenAPI_apn_rate_status_H_
#include <string.h>
#include "../external/cJSON.h"
#include "../include/list.h"
#include "../include/keyValuePair.h"
#include "../include/binary.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct OpenAPI_apn_rate_status_s OpenAPI_apn_rate_status_t;
typedef struct OpenAPI_apn_rate_status_s {
int remain_packets_ul;
int remain_packets_dl;
char *validity_time;
int remain_ex_reports_ul;
int remain_ex_reports_dl;
} OpenAPI_apn_rate_status_t;
OpenAPI_apn_rate_status_t *OpenAPI_apn_rate_status_create(
int remain_packets_ul,
int remain_packets_dl,
char *validity_time,
int remain_ex_reports_ul,
int remain_ex_reports_dl
);
void OpenAPI_apn_rate_status_free(OpenAPI_apn_rate_status_t *apn_rate_status);
OpenAPI_apn_rate_status_t *OpenAPI_apn_rate_status_parseFromJSON(cJSON *apn_rate_statusJSON);
cJSON *OpenAPI_apn_rate_status_convertToJSON(OpenAPI_apn_rate_status_t *apn_rate_status);
OpenAPI_apn_rate_status_t *OpenAPI_apn_rate_status_copy(OpenAPI_apn_rate_status_t *dst, OpenAPI_apn_rate_status_t *src);
#ifdef __cplusplus
}
#endif
#endif /* _OpenAPI_apn_rate_status_H_ */

View file

@ -89,3 +89,37 @@ end:
return NULL;
}
OpenAPI_app_descriptor_t *OpenAPI_app_descriptor_copy(OpenAPI_app_descriptor_t *dst, OpenAPI_app_descriptor_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_app_descriptor_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_app_descriptor_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_app_descriptor_free(dst);
dst = OpenAPI_app_descriptor_parseFromJSON(item);
cJSON_Delete(item);
return dst;
}

View file

@ -30,6 +30,7 @@ OpenAPI_app_descriptor_t *OpenAPI_app_descriptor_create(
void OpenAPI_app_descriptor_free(OpenAPI_app_descriptor_t *app_descriptor);
OpenAPI_app_descriptor_t *OpenAPI_app_descriptor_parseFromJSON(cJSON *app_descriptorJSON);
cJSON *OpenAPI_app_descriptor_convertToJSON(OpenAPI_app_descriptor_t *app_descriptor);
OpenAPI_app_descriptor_t *OpenAPI_app_descriptor_copy(OpenAPI_app_descriptor_t *dst, OpenAPI_app_descriptor_t *src);
#ifdef __cplusplus
}

View file

@ -87,3 +87,37 @@ end:
return NULL;
}
OpenAPI_app_port_id_t *OpenAPI_app_port_id_copy(OpenAPI_app_port_id_t *dst, OpenAPI_app_port_id_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_app_port_id_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_app_port_id_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_app_port_id_free(dst);
dst = OpenAPI_app_port_id_parseFromJSON(item);
cJSON_Delete(item);
return dst;
}

View file

@ -30,6 +30,7 @@ OpenAPI_app_port_id_t *OpenAPI_app_port_id_create(
void OpenAPI_app_port_id_free(OpenAPI_app_port_id_t *app_port_id);
OpenAPI_app_port_id_t *OpenAPI_app_port_id_parseFromJSON(cJSON *app_port_idJSON);
cJSON *OpenAPI_app_port_id_convertToJSON(OpenAPI_app_port_id_t *app_port_id);
OpenAPI_app_port_id_t *OpenAPI_app_port_id_copy(OpenAPI_app_port_id_t *dst, OpenAPI_app_port_id_t *src);
#ifdef __cplusplus
}

View file

@ -170,3 +170,37 @@ end:
return NULL;
}
OpenAPI_application_data_change_notif_t *OpenAPI_application_data_change_notif_copy(OpenAPI_application_data_change_notif_t *dst, OpenAPI_application_data_change_notif_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_application_data_change_notif_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_application_data_change_notif_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_application_data_change_notif_free(dst);
dst = OpenAPI_application_data_change_notif_parseFromJSON(item);
cJSON_Delete(item);
return dst;
}

View file

@ -40,6 +40,7 @@ OpenAPI_application_data_change_notif_t *OpenAPI_application_data_change_notif_c
void OpenAPI_application_data_change_notif_free(OpenAPI_application_data_change_notif_t *application_data_change_notif);
OpenAPI_application_data_change_notif_t *OpenAPI_application_data_change_notif_parseFromJSON(cJSON *application_data_change_notifJSON);
cJSON *OpenAPI_application_data_change_notif_convertToJSON(OpenAPI_application_data_change_notif_t *application_data_change_notif);
OpenAPI_application_data_change_notif_t *OpenAPI_application_data_change_notif_copy(OpenAPI_application_data_change_notif_t *dst, OpenAPI_application_data_change_notif_t *src);
#ifdef __cplusplus
}

View file

@ -164,3 +164,37 @@ end:
return NULL;
}
OpenAPI_application_data_subs_t *OpenAPI_application_data_subs_copy(OpenAPI_application_data_subs_t *dst, OpenAPI_application_data_subs_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_application_data_subs_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_application_data_subs_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_application_data_subs_free(dst);
dst = OpenAPI_application_data_subs_parseFromJSON(item);
cJSON_Delete(item);
return dst;
}

View file

@ -35,6 +35,7 @@ OpenAPI_application_data_subs_t *OpenAPI_application_data_subs_create(
void OpenAPI_application_data_subs_free(OpenAPI_application_data_subs_t *application_data_subs);
OpenAPI_application_data_subs_t *OpenAPI_application_data_subs_parseFromJSON(cJSON *application_data_subsJSON);
cJSON *OpenAPI_application_data_subs_convertToJSON(OpenAPI_application_data_subs_t *application_data_subs);
OpenAPI_application_data_subs_t *OpenAPI_application_data_subs_copy(OpenAPI_application_data_subs_t *dst, OpenAPI_application_data_subs_t *src);
#ifdef __cplusplus
}

View file

@ -112,3 +112,37 @@ end:
return NULL;
}
OpenAPI_area_t *OpenAPI_area_copy(OpenAPI_area_t *dst, OpenAPI_area_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_area_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_area_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_area_free(dst);
dst = OpenAPI_area_parseFromJSON(item);
cJSON_Delete(item);
return dst;
}

View file

@ -30,6 +30,7 @@ OpenAPI_area_t *OpenAPI_area_create(
void OpenAPI_area_free(OpenAPI_area_t *area);
OpenAPI_area_t *OpenAPI_area_parseFromJSON(cJSON *areaJSON);
cJSON *OpenAPI_area_convertToJSON(OpenAPI_area_t *area);
OpenAPI_area_t *OpenAPI_area_copy(OpenAPI_area_t *dst, OpenAPI_area_t *src);
#ifdef __cplusplus
}

View file

@ -0,0 +1,140 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "area_of_validity.h"
OpenAPI_area_of_validity_t *OpenAPI_area_of_validity_create(
OpenAPI_list_t *tai_list
)
{
OpenAPI_area_of_validity_t *area_of_validity_local_var = OpenAPI_malloc(sizeof(OpenAPI_area_of_validity_t));
if (!area_of_validity_local_var) {
return NULL;
}
area_of_validity_local_var->tai_list = tai_list;
return area_of_validity_local_var;
}
void OpenAPI_area_of_validity_free(OpenAPI_area_of_validity_t *area_of_validity)
{
if (NULL == area_of_validity) {
return;
}
OpenAPI_lnode_t *node;
OpenAPI_list_for_each(area_of_validity->tai_list, node) {
OpenAPI_tai_free(node->data);
}
OpenAPI_list_free(area_of_validity->tai_list);
ogs_free(area_of_validity);
}
cJSON *OpenAPI_area_of_validity_convertToJSON(OpenAPI_area_of_validity_t *area_of_validity)
{
cJSON *item = NULL;
if (area_of_validity == NULL) {
ogs_error("OpenAPI_area_of_validity_convertToJSON() failed [AreaOfValidity]");
return NULL;
}
item = cJSON_CreateObject();
if (!area_of_validity->tai_list) {
ogs_error("OpenAPI_area_of_validity_convertToJSON() failed [tai_list]");
goto end;
}
cJSON *tai_listList = cJSON_AddArrayToObject(item, "taiList");
if (tai_listList == NULL) {
ogs_error("OpenAPI_area_of_validity_convertToJSON() failed [tai_list]");
goto end;
}
OpenAPI_lnode_t *tai_list_node;
if (area_of_validity->tai_list) {
OpenAPI_list_for_each(area_of_validity->tai_list, tai_list_node) {
cJSON *itemLocal = OpenAPI_tai_convertToJSON(tai_list_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_area_of_validity_convertToJSON() failed [tai_list]");
goto end;
}
cJSON_AddItemToArray(tai_listList, itemLocal);
}
}
end:
return item;
}
OpenAPI_area_of_validity_t *OpenAPI_area_of_validity_parseFromJSON(cJSON *area_of_validityJSON)
{
OpenAPI_area_of_validity_t *area_of_validity_local_var = NULL;
cJSON *tai_list = cJSON_GetObjectItemCaseSensitive(area_of_validityJSON, "taiList");
if (!tai_list) {
ogs_error("OpenAPI_area_of_validity_parseFromJSON() failed [tai_list]");
goto end;
}
OpenAPI_list_t *tai_listList;
cJSON *tai_list_local_nonprimitive;
if (!cJSON_IsArray(tai_list)) {
ogs_error("OpenAPI_area_of_validity_parseFromJSON() failed [tai_list]");
goto end;
}
tai_listList = OpenAPI_list_create();
cJSON_ArrayForEach(tai_list_local_nonprimitive, tai_list ) {
if (!cJSON_IsObject(tai_list_local_nonprimitive)) {
ogs_error("OpenAPI_area_of_validity_parseFromJSON() failed [tai_list]");
goto end;
}
OpenAPI_tai_t *tai_listItem = OpenAPI_tai_parseFromJSON(tai_list_local_nonprimitive);
OpenAPI_list_add(tai_listList, tai_listItem);
}
area_of_validity_local_var = OpenAPI_area_of_validity_create (
tai_listList
);
return area_of_validity_local_var;
end:
return NULL;
}
OpenAPI_area_of_validity_t *OpenAPI_area_of_validity_copy(OpenAPI_area_of_validity_t *dst, OpenAPI_area_of_validity_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_area_of_validity_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_area_of_validity_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_area_of_validity_free(dst);
dst = OpenAPI_area_of_validity_parseFromJSON(item);
cJSON_Delete(item);
return dst;
}

View file

@ -0,0 +1,39 @@
/*
* area_of_validity.h
*
*
*/
#ifndef _OpenAPI_area_of_validity_H_
#define _OpenAPI_area_of_validity_H_
#include <string.h>
#include "../external/cJSON.h"
#include "../include/list.h"
#include "../include/keyValuePair.h"
#include "../include/binary.h"
#include "tai.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct OpenAPI_area_of_validity_s OpenAPI_area_of_validity_t;
typedef struct OpenAPI_area_of_validity_s {
OpenAPI_list_t *tai_list;
} OpenAPI_area_of_validity_t;
OpenAPI_area_of_validity_t *OpenAPI_area_of_validity_create(
OpenAPI_list_t *tai_list
);
void OpenAPI_area_of_validity_free(OpenAPI_area_of_validity_t *area_of_validity);
OpenAPI_area_of_validity_t *OpenAPI_area_of_validity_parseFromJSON(cJSON *area_of_validityJSON);
cJSON *OpenAPI_area_of_validity_convertToJSON(OpenAPI_area_of_validity_t *area_of_validity);
OpenAPI_area_of_validity_t *OpenAPI_area_of_validity_copy(OpenAPI_area_of_validity_t *dst, OpenAPI_area_of_validity_t *src);
#ifdef __cplusplus
}
#endif
#endif /* _OpenAPI_area_of_validity_H_ */

View file

@ -6,8 +6,8 @@
OpenAPI_arp_t *OpenAPI_arp_create(
int priority_level,
OpenAPI_preemption_capability_t *preempt_cap,
OpenAPI_preemption_vulnerability_t *preempt_vuln
OpenAPI_preemption_capability_e preempt_cap,
OpenAPI_preemption_vulnerability_e preempt_vuln
)
{
OpenAPI_arp_t *arp_local_var = OpenAPI_malloc(sizeof(OpenAPI_arp_t));
@ -27,8 +27,6 @@ void OpenAPI_arp_free(OpenAPI_arp_t *arp)
return;
}
OpenAPI_lnode_t *node;
OpenAPI_preemption_capability_free(arp->preempt_cap);
OpenAPI_preemption_vulnerability_free(arp->preempt_vuln);
ogs_free(arp);
}
@ -55,13 +53,7 @@ cJSON *OpenAPI_arp_convertToJSON(OpenAPI_arp_t *arp)
ogs_error("OpenAPI_arp_convertToJSON() failed [preempt_cap]");
goto end;
}
cJSON *preempt_cap_local_JSON = OpenAPI_preemption_capability_convertToJSON(arp->preempt_cap);
if (preempt_cap_local_JSON == NULL) {
ogs_error("OpenAPI_arp_convertToJSON() failed [preempt_cap]");
goto end;
}
cJSON_AddItemToObject(item, "preemptCap", preempt_cap_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "preemptCap", OpenAPI_preemption_capability_ToString(arp->preempt_cap)) == NULL) {
ogs_error("OpenAPI_arp_convertToJSON() failed [preempt_cap]");
goto end;
}
@ -70,13 +62,7 @@ cJSON *OpenAPI_arp_convertToJSON(OpenAPI_arp_t *arp)
ogs_error("OpenAPI_arp_convertToJSON() failed [preempt_vuln]");
goto end;
}
cJSON *preempt_vuln_local_JSON = OpenAPI_preemption_vulnerability_convertToJSON(arp->preempt_vuln);
if (preempt_vuln_local_JSON == NULL) {
ogs_error("OpenAPI_arp_convertToJSON() failed [preempt_vuln]");
goto end;
}
cJSON_AddItemToObject(item, "preemptVuln", preempt_vuln_local_JSON);
if (item->child == NULL) {
if (cJSON_AddStringToObject(item, "preemptVuln", OpenAPI_preemption_vulnerability_ToString(arp->preempt_vuln)) == NULL) {
ogs_error("OpenAPI_arp_convertToJSON() failed [preempt_vuln]");
goto end;
}
@ -106,9 +92,13 @@ OpenAPI_arp_t *OpenAPI_arp_parseFromJSON(cJSON *arpJSON)
goto end;
}
OpenAPI_preemption_capability_t *preempt_cap_local_nonprim = NULL;
OpenAPI_preemption_capability_e preempt_capVariable;
preempt_cap_local_nonprim = OpenAPI_preemption_capability_parseFromJSON(preempt_cap);
if (!cJSON_IsString(preempt_cap)) {
ogs_error("OpenAPI_arp_parseFromJSON() failed [preempt_cap]");
goto end;
}
preempt_capVariable = OpenAPI_preemption_capability_FromString(preempt_cap->valuestring);
cJSON *preempt_vuln = cJSON_GetObjectItemCaseSensitive(arpJSON, "preemptVuln");
if (!preempt_vuln) {
@ -116,14 +106,18 @@ OpenAPI_arp_t *OpenAPI_arp_parseFromJSON(cJSON *arpJSON)
goto end;
}
OpenAPI_preemption_vulnerability_t *preempt_vuln_local_nonprim = NULL;
OpenAPI_preemption_vulnerability_e preempt_vulnVariable;
preempt_vuln_local_nonprim = OpenAPI_preemption_vulnerability_parseFromJSON(preempt_vuln);
if (!cJSON_IsString(preempt_vuln)) {
ogs_error("OpenAPI_arp_parseFromJSON() failed [preempt_vuln]");
goto end;
}
preempt_vulnVariable = OpenAPI_preemption_vulnerability_FromString(preempt_vuln->valuestring);
arp_local_var = OpenAPI_arp_create (
priority_level->valuedouble,
preempt_cap_local_nonprim,
preempt_vuln_local_nonprim
preempt_capVariable,
preempt_vulnVariable
);
return arp_local_var;
@ -131,3 +125,37 @@ end:
return NULL;
}
OpenAPI_arp_t *OpenAPI_arp_copy(OpenAPI_arp_t *dst, OpenAPI_arp_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_arp_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_arp_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_arp_free(dst);
dst = OpenAPI_arp_parseFromJSON(item);
cJSON_Delete(item);
return dst;
}

View file

@ -22,18 +22,19 @@ extern "C" {
typedef struct OpenAPI_arp_s OpenAPI_arp_t;
typedef struct OpenAPI_arp_s {
int priority_level;
struct OpenAPI_preemption_capability_s *preempt_cap;
struct OpenAPI_preemption_vulnerability_s *preempt_vuln;
OpenAPI_preemption_capability_e preempt_cap;
OpenAPI_preemption_vulnerability_e preempt_vuln;
} OpenAPI_arp_t;
OpenAPI_arp_t *OpenAPI_arp_create(
int priority_level,
OpenAPI_preemption_capability_t *preempt_cap,
OpenAPI_preemption_vulnerability_t *preempt_vuln
OpenAPI_preemption_capability_e preempt_cap,
OpenAPI_preemption_vulnerability_e preempt_vuln
);
void OpenAPI_arp_free(OpenAPI_arp_t *arp);
OpenAPI_arp_t *OpenAPI_arp_parseFromJSON(cJSON *arpJSON);
cJSON *OpenAPI_arp_convertToJSON(OpenAPI_arp_t *arp);
OpenAPI_arp_t *OpenAPI_arp_copy(OpenAPI_arp_t *dst, OpenAPI_arp_t *src);
#ifdef __cplusplus
}

View file

@ -0,0 +1,226 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "assign_ebi_data.h"
OpenAPI_assign_ebi_data_t *OpenAPI_assign_ebi_data_create(
int pdu_session_id,
OpenAPI_list_t *arp_list,
OpenAPI_list_t *released_ebi_list,
OpenAPI_guami_t *old_guami
)
{
OpenAPI_assign_ebi_data_t *assign_ebi_data_local_var = OpenAPI_malloc(sizeof(OpenAPI_assign_ebi_data_t));
if (!assign_ebi_data_local_var) {
return NULL;
}
assign_ebi_data_local_var->pdu_session_id = pdu_session_id;
assign_ebi_data_local_var->arp_list = arp_list;
assign_ebi_data_local_var->released_ebi_list = released_ebi_list;
assign_ebi_data_local_var->old_guami = old_guami;
return assign_ebi_data_local_var;
}
void OpenAPI_assign_ebi_data_free(OpenAPI_assign_ebi_data_t *assign_ebi_data)
{
if (NULL == assign_ebi_data) {
return;
}
OpenAPI_lnode_t *node;
OpenAPI_list_for_each(assign_ebi_data->arp_list, node) {
OpenAPI_arp_free(node->data);
}
OpenAPI_list_free(assign_ebi_data->arp_list);
OpenAPI_list_for_each(assign_ebi_data->released_ebi_list, node) {
ogs_free(node->data);
}
OpenAPI_list_free(assign_ebi_data->released_ebi_list);
OpenAPI_guami_free(assign_ebi_data->old_guami);
ogs_free(assign_ebi_data);
}
cJSON *OpenAPI_assign_ebi_data_convertToJSON(OpenAPI_assign_ebi_data_t *assign_ebi_data)
{
cJSON *item = NULL;
if (assign_ebi_data == NULL) {
ogs_error("OpenAPI_assign_ebi_data_convertToJSON() failed [AssignEbiData]");
return NULL;
}
item = cJSON_CreateObject();
if (!assign_ebi_data->pdu_session_id) {
ogs_error("OpenAPI_assign_ebi_data_convertToJSON() failed [pdu_session_id]");
goto end;
}
if (cJSON_AddNumberToObject(item, "pduSessionId", assign_ebi_data->pdu_session_id) == NULL) {
ogs_error("OpenAPI_assign_ebi_data_convertToJSON() failed [pdu_session_id]");
goto end;
}
if (assign_ebi_data->arp_list) {
cJSON *arp_listList = cJSON_AddArrayToObject(item, "arpList");
if (arp_listList == NULL) {
ogs_error("OpenAPI_assign_ebi_data_convertToJSON() failed [arp_list]");
goto end;
}
OpenAPI_lnode_t *arp_list_node;
if (assign_ebi_data->arp_list) {
OpenAPI_list_for_each(assign_ebi_data->arp_list, arp_list_node) {
cJSON *itemLocal = OpenAPI_arp_convertToJSON(arp_list_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_assign_ebi_data_convertToJSON() failed [arp_list]");
goto end;
}
cJSON_AddItemToArray(arp_listList, itemLocal);
}
}
}
if (assign_ebi_data->released_ebi_list) {
cJSON *released_ebi_list = cJSON_AddArrayToObject(item, "releasedEbiList");
if (released_ebi_list == NULL) {
ogs_error("OpenAPI_assign_ebi_data_convertToJSON() failed [released_ebi_list]");
goto end;
}
OpenAPI_lnode_t *released_ebi_list_node;
OpenAPI_list_for_each(assign_ebi_data->released_ebi_list, released_ebi_list_node) {
if (cJSON_AddNumberToObject(released_ebi_list, "", *(double *)released_ebi_list_node->data) == NULL) {
ogs_error("OpenAPI_assign_ebi_data_convertToJSON() failed [released_ebi_list]");
goto end;
}
}
}
if (assign_ebi_data->old_guami) {
cJSON *old_guami_local_JSON = OpenAPI_guami_convertToJSON(assign_ebi_data->old_guami);
if (old_guami_local_JSON == NULL) {
ogs_error("OpenAPI_assign_ebi_data_convertToJSON() failed [old_guami]");
goto end;
}
cJSON_AddItemToObject(item, "oldGuami", old_guami_local_JSON);
if (item->child == NULL) {
ogs_error("OpenAPI_assign_ebi_data_convertToJSON() failed [old_guami]");
goto end;
}
}
end:
return item;
}
OpenAPI_assign_ebi_data_t *OpenAPI_assign_ebi_data_parseFromJSON(cJSON *assign_ebi_dataJSON)
{
OpenAPI_assign_ebi_data_t *assign_ebi_data_local_var = NULL;
cJSON *pdu_session_id = cJSON_GetObjectItemCaseSensitive(assign_ebi_dataJSON, "pduSessionId");
if (!pdu_session_id) {
ogs_error("OpenAPI_assign_ebi_data_parseFromJSON() failed [pdu_session_id]");
goto end;
}
if (!cJSON_IsNumber(pdu_session_id)) {
ogs_error("OpenAPI_assign_ebi_data_parseFromJSON() failed [pdu_session_id]");
goto end;
}
cJSON *arp_list = cJSON_GetObjectItemCaseSensitive(assign_ebi_dataJSON, "arpList");
OpenAPI_list_t *arp_listList;
if (arp_list) {
cJSON *arp_list_local_nonprimitive;
if (!cJSON_IsArray(arp_list)) {
ogs_error("OpenAPI_assign_ebi_data_parseFromJSON() failed [arp_list]");
goto end;
}
arp_listList = OpenAPI_list_create();
cJSON_ArrayForEach(arp_list_local_nonprimitive, arp_list ) {
if (!cJSON_IsObject(arp_list_local_nonprimitive)) {
ogs_error("OpenAPI_assign_ebi_data_parseFromJSON() failed [arp_list]");
goto end;
}
OpenAPI_arp_t *arp_listItem = OpenAPI_arp_parseFromJSON(arp_list_local_nonprimitive);
OpenAPI_list_add(arp_listList, arp_listItem);
}
}
cJSON *released_ebi_list = cJSON_GetObjectItemCaseSensitive(assign_ebi_dataJSON, "releasedEbiList");
OpenAPI_list_t *released_ebi_listList;
if (released_ebi_list) {
cJSON *released_ebi_list_local;
if (!cJSON_IsArray(released_ebi_list)) {
ogs_error("OpenAPI_assign_ebi_data_parseFromJSON() failed [released_ebi_list]");
goto end;
}
released_ebi_listList = OpenAPI_list_create();
cJSON_ArrayForEach(released_ebi_list_local, released_ebi_list) {
if (!cJSON_IsNumber(released_ebi_list_local)) {
ogs_error("OpenAPI_assign_ebi_data_parseFromJSON() failed [released_ebi_list]");
goto end;
}
OpenAPI_list_add(released_ebi_listList, &released_ebi_list_local->valuedouble);
}
}
cJSON *old_guami = cJSON_GetObjectItemCaseSensitive(assign_ebi_dataJSON, "oldGuami");
OpenAPI_guami_t *old_guami_local_nonprim = NULL;
if (old_guami) {
old_guami_local_nonprim = OpenAPI_guami_parseFromJSON(old_guami);
}
assign_ebi_data_local_var = OpenAPI_assign_ebi_data_create (
pdu_session_id->valuedouble,
arp_list ? arp_listList : NULL,
released_ebi_list ? released_ebi_listList : NULL,
old_guami ? old_guami_local_nonprim : NULL
);
return assign_ebi_data_local_var;
end:
return NULL;
}
OpenAPI_assign_ebi_data_t *OpenAPI_assign_ebi_data_copy(OpenAPI_assign_ebi_data_t *dst, OpenAPI_assign_ebi_data_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_assign_ebi_data_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_assign_ebi_data_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_assign_ebi_data_free(dst);
dst = OpenAPI_assign_ebi_data_parseFromJSON(item);
cJSON_Delete(item);
return dst;
}

View file

@ -0,0 +1,46 @@
/*
* assign_ebi_data.h
*
*
*/
#ifndef _OpenAPI_assign_ebi_data_H_
#define _OpenAPI_assign_ebi_data_H_
#include <string.h>
#include "../external/cJSON.h"
#include "../include/list.h"
#include "../include/keyValuePair.h"
#include "../include/binary.h"
#include "arp.h"
#include "guami.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct OpenAPI_assign_ebi_data_s OpenAPI_assign_ebi_data_t;
typedef struct OpenAPI_assign_ebi_data_s {
int pdu_session_id;
OpenAPI_list_t *arp_list;
OpenAPI_list_t *released_ebi_list;
struct OpenAPI_guami_s *old_guami;
} OpenAPI_assign_ebi_data_t;
OpenAPI_assign_ebi_data_t *OpenAPI_assign_ebi_data_create(
int pdu_session_id,
OpenAPI_list_t *arp_list,
OpenAPI_list_t *released_ebi_list,
OpenAPI_guami_t *old_guami
);
void OpenAPI_assign_ebi_data_free(OpenAPI_assign_ebi_data_t *assign_ebi_data);
OpenAPI_assign_ebi_data_t *OpenAPI_assign_ebi_data_parseFromJSON(cJSON *assign_ebi_dataJSON);
cJSON *OpenAPI_assign_ebi_data_convertToJSON(OpenAPI_assign_ebi_data_t *assign_ebi_data);
OpenAPI_assign_ebi_data_t *OpenAPI_assign_ebi_data_copy(OpenAPI_assign_ebi_data_t *dst, OpenAPI_assign_ebi_data_t *src);
#ifdef __cplusplus
}
#endif
#endif /* _OpenAPI_assign_ebi_data_H_ */

View file

@ -0,0 +1,143 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "assign_ebi_error.h"
OpenAPI_assign_ebi_error_t *OpenAPI_assign_ebi_error_create(
OpenAPI_problem_details_t *error,
OpenAPI_assign_ebi_failed_t *failure_details
)
{
OpenAPI_assign_ebi_error_t *assign_ebi_error_local_var = OpenAPI_malloc(sizeof(OpenAPI_assign_ebi_error_t));
if (!assign_ebi_error_local_var) {
return NULL;
}
assign_ebi_error_local_var->error = error;
assign_ebi_error_local_var->failure_details = failure_details;
return assign_ebi_error_local_var;
}
void OpenAPI_assign_ebi_error_free(OpenAPI_assign_ebi_error_t *assign_ebi_error)
{
if (NULL == assign_ebi_error) {
return;
}
OpenAPI_lnode_t *node;
OpenAPI_problem_details_free(assign_ebi_error->error);
OpenAPI_assign_ebi_failed_free(assign_ebi_error->failure_details);
ogs_free(assign_ebi_error);
}
cJSON *OpenAPI_assign_ebi_error_convertToJSON(OpenAPI_assign_ebi_error_t *assign_ebi_error)
{
cJSON *item = NULL;
if (assign_ebi_error == NULL) {
ogs_error("OpenAPI_assign_ebi_error_convertToJSON() failed [AssignEbiError]");
return NULL;
}
item = cJSON_CreateObject();
if (!assign_ebi_error->error) {
ogs_error("OpenAPI_assign_ebi_error_convertToJSON() failed [error]");
goto end;
}
cJSON *error_local_JSON = OpenAPI_problem_details_convertToJSON(assign_ebi_error->error);
if (error_local_JSON == NULL) {
ogs_error("OpenAPI_assign_ebi_error_convertToJSON() failed [error]");
goto end;
}
cJSON_AddItemToObject(item, "error", error_local_JSON);
if (item->child == NULL) {
ogs_error("OpenAPI_assign_ebi_error_convertToJSON() failed [error]");
goto end;
}
if (!assign_ebi_error->failure_details) {
ogs_error("OpenAPI_assign_ebi_error_convertToJSON() failed [failure_details]");
goto end;
}
cJSON *failure_details_local_JSON = OpenAPI_assign_ebi_failed_convertToJSON(assign_ebi_error->failure_details);
if (failure_details_local_JSON == NULL) {
ogs_error("OpenAPI_assign_ebi_error_convertToJSON() failed [failure_details]");
goto end;
}
cJSON_AddItemToObject(item, "failureDetails", failure_details_local_JSON);
if (item->child == NULL) {
ogs_error("OpenAPI_assign_ebi_error_convertToJSON() failed [failure_details]");
goto end;
}
end:
return item;
}
OpenAPI_assign_ebi_error_t *OpenAPI_assign_ebi_error_parseFromJSON(cJSON *assign_ebi_errorJSON)
{
OpenAPI_assign_ebi_error_t *assign_ebi_error_local_var = NULL;
cJSON *error = cJSON_GetObjectItemCaseSensitive(assign_ebi_errorJSON, "error");
if (!error) {
ogs_error("OpenAPI_assign_ebi_error_parseFromJSON() failed [error]");
goto end;
}
OpenAPI_problem_details_t *error_local_nonprim = NULL;
error_local_nonprim = OpenAPI_problem_details_parseFromJSON(error);
cJSON *failure_details = cJSON_GetObjectItemCaseSensitive(assign_ebi_errorJSON, "failureDetails");
if (!failure_details) {
ogs_error("OpenAPI_assign_ebi_error_parseFromJSON() failed [failure_details]");
goto end;
}
OpenAPI_assign_ebi_failed_t *failure_details_local_nonprim = NULL;
failure_details_local_nonprim = OpenAPI_assign_ebi_failed_parseFromJSON(failure_details);
assign_ebi_error_local_var = OpenAPI_assign_ebi_error_create (
error_local_nonprim,
failure_details_local_nonprim
);
return assign_ebi_error_local_var;
end:
return NULL;
}
OpenAPI_assign_ebi_error_t *OpenAPI_assign_ebi_error_copy(OpenAPI_assign_ebi_error_t *dst, OpenAPI_assign_ebi_error_t *src)
{
cJSON *item = NULL;
char *content = NULL;
ogs_assert(src);
item = OpenAPI_assign_ebi_error_convertToJSON(src);
if (!item) {
ogs_error("OpenAPI_assign_ebi_error_convertToJSON() failed");
return NULL;
}
content = cJSON_Print(item);
cJSON_Delete(item);
if (!content) {
ogs_error("cJSON_Print() failed");
return NULL;
}
item = cJSON_Parse(content);
ogs_free(content);
if (!item) {
ogs_error("cJSON_Parse() failed");
return NULL;
}
OpenAPI_assign_ebi_error_free(dst);
dst = OpenAPI_assign_ebi_error_parseFromJSON(item);
cJSON_Delete(item);
return dst;
}

View file

@ -0,0 +1,42 @@
/*
* assign_ebi_error.h
*
*
*/
#ifndef _OpenAPI_assign_ebi_error_H_
#define _OpenAPI_assign_ebi_error_H_
#include <string.h>
#include "../external/cJSON.h"
#include "../include/list.h"
#include "../include/keyValuePair.h"
#include "../include/binary.h"
#include "assign_ebi_failed.h"
#include "problem_details.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct OpenAPI_assign_ebi_error_s OpenAPI_assign_ebi_error_t;
typedef struct OpenAPI_assign_ebi_error_s {
struct OpenAPI_problem_details_s *error;
struct OpenAPI_assign_ebi_failed_s *failure_details;
} OpenAPI_assign_ebi_error_t;
OpenAPI_assign_ebi_error_t *OpenAPI_assign_ebi_error_create(
OpenAPI_problem_details_t *error,
OpenAPI_assign_ebi_failed_t *failure_details
);
void OpenAPI_assign_ebi_error_free(OpenAPI_assign_ebi_error_t *assign_ebi_error);
OpenAPI_assign_ebi_error_t *OpenAPI_assign_ebi_error_parseFromJSON(cJSON *assign_ebi_errorJSON);
cJSON *OpenAPI_assign_ebi_error_convertToJSON(OpenAPI_assign_ebi_error_t *assign_ebi_error);
OpenAPI_assign_ebi_error_t *OpenAPI_assign_ebi_error_copy(OpenAPI_assign_ebi_error_t *dst, OpenAPI_assign_ebi_error_t *src);
#ifdef __cplusplus
}
#endif
#endif /* _OpenAPI_assign_ebi_error_H_ */

Some files were not shown because too many files have changed in this diff Show more