Commit ea5dbeaf authored by Raphael Defosseux's avatar Raphael Defosseux

Merge branch 'post-release-1-4-alignment' into 'develop'

style(clang-format): some files were not formatted during last merge request

See merge request oai/cn5g/oai-cn5g-amf!142
parents fc007600 4feffca8
# RELEASE NOTES: #
## v1.4.0 -- July 2022 ##
* Fix SCTP NG Shutdown issue
* Fix 100% CPU consumption issue
* Fix RAN UE ID display
* Fix issue for TMSI and GUTI value
* Fix for handling S-NSSAI
* Remove OPC value from AMF configuration
* Support for Ubuntu 20.04 bare-metal installation
* Official images produced by CI are pushed to `oaisoftwarealliance` Docker-Hub Team account
* Reduce image size
## v1.3.0 -- January 2022 ##
* Periodic Registration Update
......
......@@ -15,6 +15,7 @@ At the moment, it contains the following network elements:
* Unified Data Management (**UDM**)
* Unified Data Repository (**UDR**)
* User Plane Function (**UPF**)
* Network Slicing Selection Function (**NSSF**)
Each has its own repository: this repository (`oai-cn5g-amf`) is meant for AMF.
......
......@@ -205,4 +205,4 @@ echo "Nb Files that do NOT follow OAI rules: $NB_TO_FORMAT over $NB_TOTAL checke
echo "NB_FILES_FAILING_CHECK=$NB_TO_FORMAT" > ./oai_rules_result.txt
echo "NB_FILES_CHECKED=$NB_TOTAL" >> ./oai_rules_result.txt
exit 0
if [ $TO_FORMAT -ne 0 ]; then exit -1; else exit 0; fi
......@@ -195,7 +195,7 @@ class HtmlReport():
self.file.write(' <strong>All files in repository follow OAI rules. <span class="glyphicon glyphicon-ok-circle"></span> -> (' + nb_total.strip() + ' were checked)</strong>\n')
self.file.write(' </div>\n')
else:
self.file.write(' <div class="alert alert-warning">\n')
self.file.write(' <div class="alert alert-danger">\n')
if self.git_pull_request:
self.file.write(' <strong>' + nb_fail.strip() + ' modified files in Pull-Request DO NOT follow OAI rules. <span class="glyphicon glyphicon-warning-sign"></span> -> (' + nb_total.strip() + ' were checked)</strong>\n')
else:
......
......@@ -88,7 +88,7 @@ class amf_event {
bs2::connection subscribe_ue_loss_of_connectivity(
const ue_loss_of_connectivity_sig_t::slot_type& sig);
/*
/*
* Subscribe to UE Communication Failure Notification signal
* @param [const ue_communication_failure_sig_t::slot_type&] sig: slot_type
* parameter
......
......@@ -81,6 +81,5 @@ typedef bs2::signal_type<
// TODO: UEs-In-Area-Report
} // namespace amf_application
#endif
......@@ -166,7 +166,8 @@ amf_n1::amf_n1() {
// EventExposure: subscribe to UE Loss of Connectivity change
ee_ue_loss_of_connectivity_connection =
event_sub.subscribe_ue_loss_of_connectivity(boost::bind(
&amf_n1::handle_ue_loss_of_connectivity_change, this, _1, _2, _3, _4, _5));
&amf_n1::handle_ue_loss_of_connectivity_change, this, _1, _2, _3, _4,
_5));
// EventExposure: subscribe to UE Communication Failure Report
ee_ue_communication_failure_connection =
event_sub.subscribe_ue_communication_failure(boost::bind(
......@@ -892,10 +893,11 @@ void amf_n1::service_request_handle(
pdu_session_status =
(uint16_t) service_request_nas->getPduSessionStatus();
}
// Trigger UE Connectivity Status Notify
Logger::amf_n1().debug(
"Signal the UE Connectivity Status Event notification for SUPI %s",
"Signal the UE Connectivity Status Event notification for SUPI "
"%s",
supi.c_str());
event_sub.ue_connectivity_state(supi, CM_CONNECTED, 1);
} break;
......@@ -1638,18 +1640,20 @@ void amf_n1::send_registration_reject_msg(
// Trigger CommunicationFailure Report notify
oai::amf::model::CommunicationFailure comm_failure = {};
std::shared_ptr<ue_context> uc = {};
std::shared_ptr<ue_context> uc = {};
if (!find_ue_context(ran_ue_ngap_id, amf_ue_ngap_id, uc)) {
Logger::amf_n1().warn("Cannot find the UE context, unable to notify CommunicationFailure Report");
Logger::amf_n1().warn(
"Cannot find the UE context, unable to notify CommunicationFailure "
"Report");
return;
}
string supi = uc.get()->supi;
Logger::amf_n1().debug(
"Signal the UE CommunicationFailure Report Event notification for SUPI %s",
"Signal the UE CommunicationFailure Report Event notification for SUPI "
"%s",
supi.c_str());
comm_failure.setNasReleaseCode(std::to_string(cause_value));
event_sub.ue_communication_failure(supi, comm_failure, 1);
}
//------------------------------------------------------------------------------
......@@ -3099,13 +3103,15 @@ void amf_n1::ue_initiate_de_registration_handle(
Logger::amf_n1().debug(
"Signal the UE Loss of Connectivity Event notification for SUPI %s",
supi.c_str());
event_sub.ue_loss_of_connectivity(supi, DEREGISTERED, 1, ran_ue_ngap_id, amf_ue_ngap_id);
event_sub.ue_loss_of_connectivity(
supi, DEREGISTERED, 1, ran_ue_ngap_id, amf_ue_ngap_id);
// Trigger UE Loss of Connectivity Status Notify
Logger::amf_n1().debug(
"Signal the UE Loss of Connectivity Event notification for SUPI %s",
supi.c_str());
event_sub.ue_loss_of_connectivity(supi, PURGED, 1, ran_ue_ngap_id, amf_ue_ngap_id);
event_sub.ue_loss_of_connectivity(
supi, PURGED, 1, ran_ue_ngap_id, amf_ue_ngap_id);
if (nc.get()->is_stacs_available) {
stacs.update_5gmm_state(nc.get()->imsi, "5GMM-DEREGISTERED");
......@@ -3170,7 +3176,6 @@ void amf_n1::ue_initiate_de_registration_handle(
"Signal the UE Connectivity Status Event notification for SUPI %s",
supi.c_str());
event_sub.ue_connectivity_state(supi, CM_IDLE, 1);
}
//------------------------------------------------------------------------------
......@@ -3536,8 +3541,10 @@ void amf_n1::handle_ue_location_change(
for (auto i : subscriptions) {
// Avoid repeated notifications
// TODO: use the anyUE field from the subscription request
if (i.get()->supi_is_set && std::strcmp(i.get()->supi.c_str(), supi.c_str())) continue;
if (i.get()->supi_is_set &&
std::strcmp(i.get()->supi.c_str(), supi.c_str()))
continue;
event_notification ev_notif = {};
ev_notif.set_notify_correlation_id(i.get()->notify_correlation_id);
ev_notif.set_notify_uri(i.get()->notify_uri); // Direct subscription
......@@ -3595,7 +3602,9 @@ void amf_n1::handle_ue_reachability_status_change(
for (auto i : subscriptions) {
// Avoid repeated notifications
// TODO: use the anyUE field from the subscription request
if (i.get()->supi_is_set && std::strcmp(i.get()->supi.c_str(), supi.c_str())) continue;
if (i.get()->supi_is_set &&
std::strcmp(i.get()->supi.c_str(), supi.c_str()))
continue;
event_notification ev_notif = {};
ev_notif.set_notify_correlation_id(i.get()->notify_correlation_id);
......@@ -3659,7 +3668,9 @@ void amf_n1::handle_ue_registration_state_change(
for (auto i : subscriptions) {
// Avoid repeated notifications
// TODO: use the anyUE field from the subscription request
if (i.get()->supi_is_set && std::strcmp(i.get()->supi.c_str(), supi.c_str())) continue;
if (i.get()->supi_is_set &&
std::strcmp(i.get()->supi.c_str(), supi.c_str()))
continue;
event_notification ev_notif = {};
ev_notif.set_notify_correlation_id(i.get()->notify_correlation_id);
......@@ -3687,7 +3698,8 @@ void amf_n1::handle_ue_registration_state_change(
rm_info.setRmState(rm_state);
oai::amf::model::AccessType access_type = {};
access_type.setValue(AccessType::eAccessType::_3GPP_ACCESS); // hard-coded
access_type.setValue(
AccessType::eAccessType::_3GPP_ACCESS); // hard-coded
rm_info.setAccessType(access_type);
rm_infos.push_back(rm_info);
......@@ -3734,7 +3746,9 @@ void amf_n1::handle_ue_connectivity_state_change(
for (auto i : subscriptions) {
// Avoid repeated notifications
// TODO: use the anyUE field from the subscription request
if (i.get()->supi_is_set && std::strcmp(i.get()->supi.c_str(), supi.c_str())) continue;
if (i.get()->supi_is_set &&
std::strcmp(i.get()->supi.c_str(), supi.c_str()))
continue;
event_notification ev_notif = {};
ev_notif.set_notify_correlation_id(i.get()->notify_correlation_id);
......@@ -3761,7 +3775,8 @@ void amf_n1::handle_ue_connectivity_state_change(
cm_info.setCmState(cm_state);
oai::amf::model::AccessType access_type = {};
access_type.setValue(AccessType::eAccessType::_3GPP_ACCESS); // hard-coded
access_type.setValue(
AccessType::eAccessType::_3GPP_ACCESS); // hard-coded
cm_info.setAccessType(access_type);
cm_infos.push_back(cm_info);
event_report.setCmInfoList(cm_infos);
......@@ -3807,7 +3822,9 @@ void amf_n1::handle_ue_communication_failure_change(
for (auto i : subscriptions) {
// Avoid repeated notifications
// TODO: use the anyUE field from the subscription request
if (i.get()->supi_is_set && std::strcmp(i.get()->supi.c_str(), supi.c_str())) continue;
if (i.get()->supi_is_set &&
std::strcmp(i.get()->supi.c_str(), supi.c_str()))
continue;
event_notification ev_notif = {};
ev_notif.set_notify_correlation_id(i.get()->notify_correlation_id);
......@@ -3840,7 +3857,6 @@ void amf_n1::handle_ue_communication_failure_change(
}
}
//------------------------------------------------------------------------------
void amf_n1::handle_ue_loss_of_connectivity_change(
std::string supi, uint8_t status, uint8_t http_version,
......@@ -3879,8 +3895,9 @@ void amf_n1::handle_ue_loss_of_connectivity_change(
oai::amf::model::AmfEventState amf_event_state = {};
amf_event_state.setActive(true);
event_report.setState(amf_event_state);
oai::amf::model::LossOfConnectivityReason ue_loss_of_connectivity_reason = {};
oai::amf::model::LossOfConnectivityReason ue_loss_of_connectivity_reason =
{};
if (status == DEREGISTERED)
ue_loss_of_connectivity_reason.set_value("DEREGISTERED");
else if (status == MAX_DETECTION_TIME_EXPIRED)
......@@ -3906,8 +3923,6 @@ void amf_n1::handle_ue_loss_of_connectivity_change(
}
}
//------------------------------------------------------------------------------
void amf_n1::get_pdu_session_to_be_activated(
const uint16_t pdu_session_status,
......@@ -4094,7 +4109,9 @@ void amf_n1::mobile_reachable_timer_timeout(
Logger::amf_n1().debug(
"Signal the UE Loss of Connectivity Event notification for SUPI %s",
supi.c_str());
event_sub.ue_loss_of_connectivity(supi, MAX_DETECTION_TIME_EXPIRED, 1, nc.get()->ran_ue_ngap_id, amf_ue_ngap_id);
event_sub.ue_loss_of_connectivity(
supi, MAX_DETECTION_TIME_EXPIRED, 1, nc.get()->ran_ue_ngap_id,
amf_ue_ngap_id);
// TODO: Start the implicit de-registration timer
timer_id_t tid = itti_inst->timer_setup(
......@@ -4172,7 +4189,7 @@ void amf_n1::implicit_deregistration_timer_timeout(
}
// Trigger UE Connectivity Status Notify
string supi = "imsi-" + nc.get()->imsi;
string supi = "imsi-" + nc.get()->imsi;
Logger::amf_n1().debug(
"Signal the UE Connectivity Status Event notification for SUPI %s",
supi.c_str());
......
......@@ -820,15 +820,17 @@ class amf_n1 {
std::string supi, uint8_t status, uint8_t http_version,
uint32_t ran_ue_ngap_id, long amf_ue_ngap_id);
/*
* Handle the UE Communication Failure event to trigger the notification to the
* subscribed NFs
* Handle the UE Communication Failure event to trigger the notification to
* the subscribed NFs
* @param [std::string] supi: SUPI
* @param [oai::amf::model::CommunicationFailure] comm_failure: Communication Failure reason
* @param [oai::amf::model::CommunicationFailure] comm_failure: Communication
* Failure reason
* @param [uint8_t] http_version: HTTP version (for the notification)
* @return void
*/
void handle_ue_communication_failure_change(
std::string supi, oai::amf::model::CommunicationFailure, uint8_t http_version);
std::string supi, oai::amf::model::CommunicationFailure,
uint8_t http_version);
// for Event Handling
amf_event event_sub;
......@@ -839,7 +841,6 @@ class amf_n1 {
bs2::connection ee_ue_loss_of_connectivity_connection;
bs2::connection ee_ue_communication_failure_connection;
private:
/*
* Handle UE-initiated Deregistration Request message
......
......@@ -1335,7 +1335,7 @@ void amf_n2::handle_itti_message(itti_ue_context_release_command& itti_msg) {
ueCtxRelCmd->setCauseRadioNetwork(
(e_Ngap_CauseRadioNetwork) itti_msg.cause.getValue());
}
uint8_t buffer[BUFFER_SIZE_256];
int encoded_size = ueCtxRelCmd->encode2Buffer(buffer, BUFFER_SIZE_256);
......@@ -1353,10 +1353,9 @@ void amf_n2::handle_itti_message(itti_ue_context_release_command& itti_msg) {
else {
Logger::amf_n2().warn(
"Could not notify RAN caused CommunicationFailure."
"No existing nas_context with amf_ue_ngap_id(" AMF_UE_NGAP_ID_FMT
")",
"No existing nas_context with amf_ue_ngap_id(" AMF_UE_NGAP_ID_FMT ")",
itti_msg.amf_ue_ngap_id);
return;
return;
}
string supi = "imsi-" + nc.get()->imsi;
......@@ -1382,7 +1381,9 @@ void amf_n2::handle_itti_message(itti_ue_context_release_command& itti_msg) {
for (auto i : subscriptions) {
// Avoid repeated notifications
// TODO: use the anyUE field from the subscription request
if (i.get()->supi_is_set && std::strcmp(i.get()->supi.c_str(), supi.c_str())) continue;
if (i.get()->supi_is_set &&
std::strcmp(i.get()->supi.c_str(), supi.c_str()))
continue;
event_notification ev_notif = {};
ev_notif.set_notify_correlation_id(i.get()->notify_correlation_id);
......@@ -1420,7 +1421,6 @@ void amf_n2::handle_itti_message(itti_ue_context_release_command& itti_msg) {
itti_msg_ev->get_msg_name());
}
}
}
//------------------------------------------------------------------------------
......@@ -2364,8 +2364,8 @@ void amf_n2::remove_ue_context_with_ran_ue_ngap_id(
Logger::amf_n1().debug(
"Signal the UE Loss of Connectivity Event notification for SUPI %s",
supi.c_str());
amf_n1_inst->event_sub.ue_loss_of_connectivity(supi, DEREGISTERED, 1, ran_ue_ngap_id, unc.get()->amf_ue_ngap_id);
amf_n1_inst->event_sub.ue_loss_of_connectivity(
supi, DEREGISTERED, 1, ran_ue_ngap_id, unc.get()->amf_ue_ngap_id);
amf_n1_inst->remove_imsi_2_nas_context(supi);
// TODO: remove_guti_2_nas_context(guti);
......@@ -2446,7 +2446,8 @@ void amf_n2::remove_ue_context_with_amf_ue_ngap_id(
Logger::amf_n1().debug(
"Signal the UE Loss of Connectivity Event notification for SUPI %s",
supi.c_str());
amf_n1_inst->event_sub.ue_loss_of_connectivity(supi, DEREGISTERED, 1, nc.get()->ran_ue_ngap_id, amf_ue_ngap_id);
amf_n1_inst->event_sub.ue_loss_of_connectivity(
supi, DEREGISTERED, 1, nc.get()->ran_ue_ngap_id, amf_ue_ngap_id);
amf_n1_inst->remove_imsi_2_nas_context(supi);
// TODO: remove_guti_2_nas_context(guti);
......
......@@ -572,7 +572,8 @@ void amf_sbi::handle_itti_message(itti_sbi_notify_subscribed_event& itti_msg) {
report["supi"] = r.getSupi();
}
if (r.locationIsSet()) {
report["location"] = r.getLocation(); // get eutraLocation, nrLocation, n3gaLocation?
report["location"] =
r.getLocation(); // get eutraLocation, nrLocation, n3gaLocation?
}
if (r.rmInfoListIsSet()) {
report["rmInfoList"] = r.getRmInfoList();
......
......@@ -52,8 +52,8 @@ static const std::vector<std::string> _5gmm_state_e2str = {
typedef enum { CM_IDLE = 0, CM_CONNECTED } cm_state_t;
static const std::vector<std::string> cm_state_e2str = {
"CM_IDLE", "CM_CONNECTED"};
static const std::vector<std::string> cm_state_e2str = {"CM_IDLE",
"CM_CONNECTED"};
typedef enum {
DEREGISTERED = 0,
......@@ -62,10 +62,7 @@ typedef enum {
} loss_of_connectivity_status_t;
static const std::vector<std::string> loss_of_connectivity_status_e2str = {
"DEREGISTERED",
"MAX_DETECTION_TIME_EXPIRED",
"PURGED"
};
"DEREGISTERED", "MAX_DETECTION_TIME_EXPIRED", "PURGED"};
class nas_context {
public:
......
......@@ -19,34 +19,34 @@
namespace oai::amf::model {
AmfEventReport::AmfEventReport() {
m_TimeStamp = "";
m_SubscriptionId = "";
m_SubscriptionIdIsSet = false;
m_AnyUe = false;
m_AnyUeIsSet = false;
m_Supi = "";
m_SupiIsSet = false;
m_AreaListIsSet = false;
m_RefId = 0;
m_RefIdIsSet = false;
m_Gpsi = "";
m_GpsiIsSet = false;
m_Pei = "";
m_PeiIsSet = false;
m_LocationIsSet = false;
m_Timezone = "";
m_TimezoneIsSet = false;
m_AccessTypeListIsSet = false;
m_RmInfoListIsSet = false;
m_CmInfoListIsSet = false;
m_ReachabilityIsSet = false;
m_CommFailureIsSet = false;
m_TimeStamp = "";
m_SubscriptionId = "";
m_SubscriptionIdIsSet = false;
m_AnyUe = false;
m_AnyUeIsSet = false;
m_Supi = "";
m_SupiIsSet = false;
m_AreaListIsSet = false;
m_RefId = 0;
m_RefIdIsSet = false;
m_Gpsi = "";
m_GpsiIsSet = false;
m_Pei = "";
m_PeiIsSet = false;
m_LocationIsSet = false;
m_Timezone = "";
m_TimezoneIsSet = false;
m_AccessTypeListIsSet = false;
m_RmInfoListIsSet = false;
m_CmInfoListIsSet = false;
m_ReachabilityIsSet = false;
m_CommFailureIsSet = false;
m_LossOfConnectReasonIsSet = false;
m_RanUeNgapIdIsSet = false;
m_AmfUeNgapIdIsSet = false;
m_NumberOfUes = 0;
m_NumberOfUesIsSet = false;
m_r_5gsUserStateListIsSet = false;
m_RanUeNgapIdIsSet = false;
m_AmfUeNgapIdIsSet = false;
m_NumberOfUes = 0;
m_NumberOfUesIsSet = false;
m_r_5gsUserStateListIsSet = false;
}
void AmfEventReport::validate() const {
......@@ -308,7 +308,8 @@ void to_json(nlohmann::json& j, const AmfEventReport& o) {
j["cmInfoList"] = o.m_CmInfoList;
if (o.reachabilityIsSet()) j["reachability"] = o.m_Reachability;
if (o.commFailureIsSet()) j["commFailure"] = o.m_CommFailure;
if (o.lossOfConnectReasonIsSet()) j["lossOfConnectReason"] = o.m_LossOfConnectReason;
if (o.lossOfConnectReasonIsSet())
j["lossOfConnectReason"] = o.m_LossOfConnectReason;
if (o.ranUeNgapIdIsSet()) j["ranUeNgapId"] = o.m_RanUeNgapId;
if (o.amfUeNgapIdIsSet()) j["amfUeNgapId"] = o.m_AmfUeNgapId;
if (o.numberOfUesIsSet()) j["numberOfUes"] = o.m_NumberOfUes;
......@@ -599,17 +600,18 @@ void AmfEventReport::unsetCommFailure() {
m_CommFailureIsSet = false;
}
LossOfConnectivityReason AmfEventReport::getLossOfConnectReason() const {
return m_LossOfConnectReason;
return m_LossOfConnectReason;
}
void AmfEventReport::setLossOfConnectReason(LossOfConnectivityReason const& value) {
m_LossOfConnectReason = value;
m_LossOfConnectReasonIsSet = true;
void AmfEventReport::setLossOfConnectReason(
LossOfConnectivityReason const& value) {
m_LossOfConnectReason = value;
m_LossOfConnectReasonIsSet = true;
}
bool AmfEventReport::lossOfConnectReasonIsSet() const {
return m_LossOfConnectReasonIsSet;
return m_LossOfConnectReasonIsSet;
}
void AmfEventReport::unsetLossOfConnectReason() {
m_LossOfConnectReasonIsSet = false;
m_LossOfConnectReasonIsSet = false;
}
uint32_t AmfEventReport::getRanUeNgapId() const {
return m_RanUeNgapId;
......
......@@ -176,7 +176,7 @@ class AmfEventReport {
bool commFailureIsSet() const;
void unsetCommFailure();
/// <summary>
///
///
/// </summary>
LossOfConnectivityReason getLossOfConnectReason() const;
void setLossOfConnectReason(LossOfConnectivityReason const& value);
......
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* AMF Event Exposure Service © 2022, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.7
*
......@@ -9,8 +10,6 @@
* Do not edit the class manually.
*/
#include "LossOfConnectivityReason.h"
#include "Helpers.h"
......@@ -40,13 +39,15 @@ bool LossOfConnectivityReason::validate(
return success;
}
bool LossOfConnectivityReason::operator==(const LossOfConnectivityReason& rhs) const {
bool LossOfConnectivityReason::operator==(
const LossOfConnectivityReason& rhs) const {
return true; // TODO
;
}
bool LossOfConnectivityReason::operator!=(const LossOfConnectivityReason& rhs) const {
bool LossOfConnectivityReason::operator!=(
const LossOfConnectivityReason& rhs) const {
return !(*this == rhs);
}
......
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* AMF Event Exposure Service © 2022, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.7
*
......@@ -12,7 +13,7 @@
/*
* LossOfConnectivityReason.h
*
*
*
*/
#ifndef LossOfConnectivityReason_H_
......@@ -24,43 +25,43 @@
namespace oai::amf::model {
/// <summary>
///
///
/// </summary>
class LossOfConnectivityReason {
public:
LossOfConnectivityReason();
virtual ~LossOfConnectivityReason() = default;
class LossOfConnectivityReason {
public:
LossOfConnectivityReason();
virtual ~LossOfConnectivityReason() = default;
/// <summary>
/// Validate the current data in the model. Throws a ValidationException on
/// failure.
/// </summary>
void validate() const;
/// <summary>
/// Validate the current data in the model. Throws a ValidationException on
/// failure.
/// </summary>
void validate() const;
/// <summary>
/// Validate the current data in the model. Returns false on error and writes
/// an error message into the given stringstream.
/// </summary>
bool validate(std::stringstream& msg) const;
/// <summary>
/// Validate the current data in the model. Returns false on error and writes
/// an error message into the given stringstream.
/// </summary>
bool validate(std::stringstream& msg) const;
bool operator==(const LossOfConnectivityReason& rhs) const;
bool operator!=(const LossOfConnectivityReason& rhs) const;
bool operator==(const LossOfConnectivityReason& rhs) const;
bool operator!=(const LossOfConnectivityReason& rhs) const;
/////////////////////////////////////////////
/// LossOfConnectivityReason members
/////////////////////////////////////////////
/// LossOfConnectivityReason members
void set_value(std::string value);
void get_value(std::string& value) const;
std::string get_value() const;
void set_value(std::string value);
void get_value(std::string& value) const;
std::string get_value() const;
friend void to_json(nlohmann::json& j, const LossOfConnectivityReason& o);
friend void from_json(const nlohmann::json& j, LossOfConnectivityReason& o);
friend void to_json(nlohmann::json& j, const LossOfConnectivityReason& o);
friend void from_json(const nlohmann::json& j, LossOfConnectivityReason& o);
protected:
std::string value;
// Helper overload for validate. Used when one model stores another model and
// calls it's validate.
bool validate(std::stringstream& msg, const std::string& pathPrefix) const;
protected:
std::string value;
// Helper overload for validate. Used when one model stores another model and
// calls it's validate.
bool validate(std::stringstream& msg, const std::string& pathPrefix) const;
};
} // namespace oai::amf::model
......
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* AMF Event Exposure Service © 2022, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.7
*
......@@ -9,8 +10,6 @@
* Do not edit the class manually.
*/
#include "LossOfConnectivityReason_anyOf.h"
#include "Helpers.h"
#include <stdexcept>
......@@ -18,7 +17,6 @@
namespace oai::amf::model {
LossOfConnectivityReason_anyOf::LossOfConnectivityReason_anyOf() {}
void LossOfConnectivityReason_anyOf::validate() const {
......@@ -38,8 +36,9 @@ bool LossOfConnectivityReason_anyOf::validate(
const std::string _pathPrefix =
pathPrefix.empty() ? "LossOfConnectivityReason_anyOf" : pathPrefix;
if (m_value == LossOfConnectivityReason_anyOf::eLossOfConnectivityReason_anyOf::
INVALID_VALUE_OPENAPI_GENERATED) {
if (m_value ==
LossOfConnectivityReason_anyOf::eLossOfConnectivityReason_anyOf::
INVALID_VALUE_OPENAPI_GENERATED) {
success = false;
msg << _pathPrefix << ": has no value;";
}
......@@ -47,11 +46,13 @@ bool LossOfConnectivityReason_anyOf::validate(
return success;
}
bool LossOfConnectivityReason_anyOf::operator==(const LossOfConnectivityReason_anyOf& rhs) const {
bool LossOfConnectivityReason_anyOf::operator==(
const LossOfConnectivityReason_anyOf& rhs) const {
return getValue() == rhs.getValue();
}
bool LossOfConnectivityReason_anyOf::operator!=(const LossOfConnectivityReason_anyOf& rhs) const {
bool LossOfConnectivityReason_anyOf::operator!=(
const LossOfConnectivityReason_anyOf& rhs) const {
return !(*this == rhs);
}
......@@ -63,13 +64,16 @@ void to_json(nlohmann::json& j, const LossOfConnectivityReason_anyOf& o) {
INVALID_VALUE_OPENAPI_GENERATED:
j = "INVALID_VALUE_OPENAPI_GENERATED";
break;
case LossOfConnectivityReason_anyOf::eLossOfConnectivityReason_anyOf::DEREGISTERED:
case LossOfConnectivityReason_anyOf::eLossOfConnectivityReason_anyOf::
DEREGISTERED:
j = "DEREGISTERED";
break;
case LossOfConnectivityReason_anyOf::eLossOfConnectivityReason_anyOf::MAX_DETECTION_TIME_EXPIRED:
case LossOfConnectivityReason_anyOf::eLossOfConnectivityReason_anyOf::
MAX_DETECTION_TIME_EXPIRED:
j = "MAX_DETECTION_TIME_EXPIRED";
break;
case LossOfConnectivityReason_anyOf::eLossOfConnectivityReason_anyOf::PURGED:
case LossOfConnectivityReason_anyOf::eLossOfConnectivityReason_anyOf::
PURGED:
j = "PURGED";
break;
}
......@@ -78,11 +82,14 @@ void to_json(nlohmann::json& j, const LossOfConnectivityReason_anyOf& o) {
void from_json(const nlohmann::json& j, LossOfConnectivityReason_anyOf& o) {
auto s = j.get<std::string>();
if (s == "DEREGISTERED") {
o.setValue(LossOfConnectivityReason_anyOf::eLossOfConnectivityReason_anyOf::DEREGISTERED);
o.setValue(LossOfConnectivityReason_anyOf::eLossOfConnectivityReason_anyOf::
DEREGISTERED);
} else if (s == "MAX_DETECTION_TIME_EXPIRED") {
o.setValue(LossOfConnectivityReason_anyOf::eLossOfConnectivityReason_anyOf::MAX_DETECTION_TIME_EXPIRED);
o.setValue(LossOfConnectivityReason_anyOf::eLossOfConnectivityReason_anyOf::
MAX_DETECTION_TIME_EXPIRED);
} else if (s == "PURGED") {
o.setValue(LossOfConnectivityReason_anyOf::eLossOfConnectivityReason_anyOf::PURGED);
o.setValue(LossOfConnectivityReason_anyOf::eLossOfConnectivityReason_anyOf::
PURGED);
} else {
std::stringstream ss;
ss << "Unexpected value " << s << " in json"
......@@ -92,13 +99,13 @@ void from_json(const nlohmann::json& j, LossOfConnectivityReason_anyOf& o) {
}
}
LossOfConnectivityReason_anyOf::eLossOfConnectivityReason_anyOf LossOfConnectivityReason_anyOf::getValue()
const {
return m_value;
LossOfConnectivityReason_anyOf::eLossOfConnectivityReason_anyOf
LossOfConnectivityReason_anyOf::getValue() const {
return m_value;
}
void LossOfConnectivityReason_anyOf::setValue(
LossOfConnectivityReason_anyOf::eLossOfConnectivityReason_anyOf value) {
m_value = value;
m_value = value;
}
} // namespace oai::amf::model
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* AMF Event Exposure Service © 2022, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.7
*
......@@ -12,7 +13,7 @@
/*
* LossOfConnectivityReason_anyOf.h
*
*
*
*/
#ifndef LossOfConnectivityReason_anyOf_H_
......@@ -25,52 +26,57 @@ namespace oai::amf::model {
/// <summary>
///
/// </summary>
class LossOfConnectivityReason_anyOf {
public:
LossOfConnectivityReason_anyOf();
virtual ~LossOfConnectivityReason_anyOf() = default;
enum class eLossOfConnectivityReason_anyOf {
// To have a valid default value.
// Avoiding nameclashes with user defined
// enum values
INVALID_VALUE_OPENAPI_GENERATED = 0,
DEREGISTERED,
MAX_DETECTION_TIME_EXPIRED,
PURGED
};
/// <summary>
/// Validate the current data in the model. Throws a ValidationException on
/// failure.
/// </summary>
void validate() const;
/// <summary>
/// Validate the current data in the model. Returns false on error and writes
/// an error message into the given stringstream.
/// </summary>
bool validate(std::stringstream& msg) const;
bool operator==(const LossOfConnectivityReason_anyOf& rhs) const;
bool operator!=(const LossOfConnectivityReason_anyOf& rhs) const;
/////////////////////////////////////////////
/// LossOfConnectivityReason_anyOf members
LossOfConnectivityReason_anyOf::eLossOfConnectivityReason_anyOf getValue() const;
void setValue(LossOfConnectivityReason_anyOf::eLossOfConnectivityReason_anyOf value);
friend void to_json(nlohmann::json& j, const LossOfConnectivityReason_anyOf& o);
friend void from_json(const nlohmann::json& j, LossOfConnectivityReason_anyOf& o);
protected:
LossOfConnectivityReason_anyOf::eLossOfConnectivityReason_anyOf m_value = LossOfConnectivityReason_anyOf::
eLossOfConnectivityReason_anyOf::INVALID_VALUE_OPENAPI_GENERATED;
// Helper overload for validate. Used when one model stores another model and
// calls it's validate.
bool validate(std::stringstream& msg, const std::string& pathPrefix) const;
class LossOfConnectivityReason_anyOf {
public:
LossOfConnectivityReason_anyOf();
virtual ~LossOfConnectivityReason_anyOf() = default;
enum class eLossOfConnectivityReason_anyOf {
// To have a valid default value.
// Avoiding nameclashes with user defined
// enum values
INVALID_VALUE_OPENAPI_GENERATED = 0,
DEREGISTERED,
MAX_DETECTION_TIME_EXPIRED,
PURGED
};
/// <summary>
/// Validate the current data in the model. Throws a ValidationException on
/// failure.
/// </summary>
void validate() const;
/// <summary>
/// Validate the current data in the model. Returns false on error and writes
/// an error message into the given stringstream.
/// </summary>
bool validate(std::stringstream& msg) const;
bool operator==(const LossOfConnectivityReason_anyOf& rhs) const;
bool operator!=(const LossOfConnectivityReason_anyOf& rhs) const;
/////////////////////////////////////////////
/// LossOfConnectivityReason_anyOf members
LossOfConnectivityReason_anyOf::eLossOfConnectivityReason_anyOf getValue()
const;
void setValue(
LossOfConnectivityReason_anyOf::eLossOfConnectivityReason_anyOf value);
friend void to_json(
nlohmann::json& j, const LossOfConnectivityReason_anyOf& o);
friend void from_json(
const nlohmann::json& j, LossOfConnectivityReason_anyOf& o);
protected:
LossOfConnectivityReason_anyOf::eLossOfConnectivityReason_anyOf m_value =
LossOfConnectivityReason_anyOf::eLossOfConnectivityReason_anyOf::
INVALID_VALUE_OPENAPI_GENERATED;
// Helper overload for validate. Used when one model stores another model and
// calls it's validate.
bool validate(std::stringstream& msg, const std::string& pathPrefix) const;
};
} // namespace oai::amf::model
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment