Commit dc968a36 authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

Add new model data for EventExposure

parent 03470f22
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
#include "5GsUserState.h"
#include "Helpers.h"
#include <sstream>
namespace oai::amf::model {
_5GsUserState::_5GsUserState() {}
void _5GsUserState::validate() const {
std::stringstream msg;
if (!validate(msg)) {
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool _5GsUserState::validate(std::stringstream& msg) const {
return validate(msg, "");
}
bool _5GsUserState::validate(
std::stringstream& msg, const std::string& pathPrefix) const {
bool success = true;
const std::string _pathPrefix =
pathPrefix.empty() ? "5GsUserState" : pathPrefix;
if (!m_value.validate(msg)) {
success = false;
}
return success;
}
bool _5GsUserState::operator==(const _5GsUserState& rhs) const {
return
getValue() == rhs.getValue();
}
bool _5GsUserState::operator!=(const _5GsUserState& rhs) const {
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const _5GsUserState& o) {
j = nlohmann::json();
to_json(j, o.m_value);
}
void from_json(const nlohmann::json& j, _5GsUserState& o) {
from_json(j, o.m_value);
}
_5GsUserState_anyOf _5GsUserState::getValue() const {
return m_value;
}
void _5GsUserState::setValue(_5GsUserState_anyOf value) {
m_value = value;
}
_5GsUserState_anyOf::e_5GsUserState_anyOf _5GsUserState::getEnumValue() const {
return m_value.getValue();
}
void _5GsUserState::setEnumValue(
_5GsUserState_anyOf::e_5GsUserState_anyOf value) {
m_value.setValue(value);
}
} // namespace oai::amf::model
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
/*
* 5GsUserState.h
*
*
*/
#ifndef _5GsUserState_H_
#define _5GsUserState_H_
#include "_5GsUserState_anyOf.h"
#include <nlohmann/json.hpp>
namespace oai::amf::model {
/// <summary>
///
/// </summary>
class _5GsUserState {
public:
_5GsUserState();
virtual ~_5GsUserState() = 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. Returns false on error and writes
/// an error message into the given stringstream.
/// </summary>
bool validate(std::stringstream& msg) const;
/// <summary>
/// Helper overload for validate. Used when one model stores another model and
/// calls it's validate. Not meant to be called outside that case.
/// </summary>
bool validate(std::stringstream& msg, const std::string& pathPrefix) const;
bool operator==(const _5GsUserState& rhs) const;
bool operator!=(const _5GsUserState& rhs) const;
/////////////////////////////////////////////
/// 5GsUserState members
_5GsUserState_anyOf getValue() const;
void setValue(_5GsUserState_anyOf value);
_5GsUserState_anyOf::e_5GsUserState_anyOf getEnumValue() const;
void setEnumValue(_5GsUserState_anyOf::e_5GsUserState_anyOf value);
friend void to_json(nlohmann::json& j, const _5GsUserState& o);
friend void from_json(const nlohmann::json& j, _5GsUserState& o);
friend void to_json(nlohmann::json& j, const _5GsUserState_anyOf& o);
friend void from_json(const nlohmann::json& j, _5GsUserState_anyOf& o);
protected:
_5GsUserState_anyOf m_value;
};
} // namespace oai::amf::model
#endif /* 5GsUserState_H_ */
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
#include "5GsUserStateInfo.h"
#include "Helpers.h"
#include <sstream>
namespace oai::amf::model {
_5GsUserStateInfo::_5GsUserStateInfo() {}
void _5GsUserStateInfo::validate() const {
std::stringstream msg;
if (!validate(msg)) {
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool _5GsUserStateInfo::validate(std::stringstream& msg) const {
return validate(msg, "");
}
bool _5GsUserStateInfo::validate(
std::stringstream& msg, const std::string& pathPrefix) const {
bool success = true;
const std::string _pathPrefix =
pathPrefix.empty() ? "5GsUserStateInfo" : pathPrefix;
return success;
}
bool _5GsUserStateInfo::operator==(const _5GsUserStateInfo& rhs) const {
return
(getR5gsUserState() == rhs.getR5gsUserState()) &&
(getAccessType() == rhs.getAccessType())
;
}
bool _5GsUserStateInfo::operator!=(const _5GsUserStateInfo& rhs) const {
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const _5GsUserStateInfo& o) {
j = nlohmann::json();
j["5gsUserState"] = o.m_r_5gsUserState;
j["accessType"] = o.m_AccessType;
}
void from_json(const nlohmann::json& j, _5GsUserStateInfo& o) {
j.at("5gsUserState").get_to(o.m_r_5gsUserState);
j.at("accessType").get_to(o.m_AccessType);
}
_5GsUserState _5GsUserStateInfo::getR5gsUserState() const {
return m_r_5gsUserState;
}
void _5GsUserStateInfo::setR5gsUserState(_5GsUserState const& value) {
m_r_5gsUserState = value;
}
AccessType _5GsUserStateInfo::getAccessType() const {
return m_AccessType;
}
void _5GsUserStateInfo::setAccessType(AccessType const& value) {
m_AccessType = value;
}
} // namespace oai::amf::model
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
/*
* 5GsUserStateInfo.h
*
*
*/
#ifndef _5GsUserStateInfo_H_
#define _5GsUserStateInfo_H_
#include "5GsUserState.h"
#include "AccessType.h"
#include <nlohmann/json.hpp>
namespace oai::amf::model {
/// <summary>
///
/// </summary>
class _5GsUserStateInfo {
public:
_5GsUserStateInfo();
virtual ~_5GsUserStateInfo() = 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. Returns false on error and writes
/// an error message into the given stringstream.
/// </summary>
bool validate(std::stringstream& msg) const;
bool operator==(const _5GsUserStateInfo& rhs) const;
bool operator!=(const _5GsUserStateInfo& rhs) const;
/////////////////////////////////////////////
/// _5GsUserStateInfo members
/// <summary>
///
/// </summary>
_5GsUserState getR5gsUserState() const;
void setR5gsUserState(_5GsUserState const& value);
/// <summary>
///
/// </summary>
AccessType getAccessType() const;
void setAccessType(AccessType const& value);
friend void to_json(nlohmann::json& j, const _5GsUserStateInfo& o);
friend void from_json(const nlohmann::json& j, _5GsUserStateInfo& o);
// 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:
_5GsUserState m_r_5gsUserState;
AccessType m_AccessType;
};
} // namespace oai::amf::model
#endif /* _5GsUserStateInfo_H_ */
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
#include "AccessTokenErr.h"
#include "Helpers.h"
#include <sstream>
namespace oai::amf::model {
AccessTokenErr::AccessTokenErr() {
m_Error = "";
m_Error_description = "";
m_Error_descriptionIsSet = false;
m_Error_uri = "";
m_Error_uriIsSet = false;
}
void AccessTokenErr::validate() const {
std::stringstream msg;
if (!validate(msg)) {
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool AccessTokenErr::validate(std::stringstream& msg) const {
return validate(msg, "");
}
bool AccessTokenErr::validate(
std::stringstream& msg, const std::string& pathPrefix) const {
bool success = true;
const std::string _pathPrefix =
pathPrefix.empty() ? "AccessTokenErr" : pathPrefix;
return success;
}
bool AccessTokenErr::operator==(const AccessTokenErr& rhs) const {
return
(getError() == rhs.getError()) &&
((!errorDescriptionIsSet() && !rhs.errorDescriptionIsSet()) ||
(errorDescriptionIsSet() && rhs.errorDescriptionIsSet() &&
getErrorDescription() == rhs.getErrorDescription())) &&
((!errorUriIsSet() && !rhs.errorUriIsSet()) ||
(errorUriIsSet() && rhs.errorUriIsSet() &&
getErrorUri() == rhs.getErrorUri()))
;
}
bool AccessTokenErr::operator!=(const AccessTokenErr& rhs) const {
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const AccessTokenErr& o) {
j = nlohmann::json();
j["error"] = o.m_Error;
if (o.errorDescriptionIsSet()) j["error_description"] = o.m_Error_description;
if (o.errorUriIsSet()) j["error_uri"] = o.m_Error_uri;
}
void from_json(const nlohmann::json& j, AccessTokenErr& o) {
j.at("error").get_to(o.m_Error);
if (j.find("error_description") != j.end()) {
j.at("error_description").get_to(o.m_Error_description);
o.m_Error_descriptionIsSet = true;
}
if (j.find("error_uri") != j.end()) {
j.at("error_uri").get_to(o.m_Error_uri);
o.m_Error_uriIsSet = true;
}
}
std::string AccessTokenErr::getError() const {
return m_Error;
}
void AccessTokenErr::setError(std::string const& value) {
m_Error = value;
}
std::string AccessTokenErr::getErrorDescription() const {
return m_Error_description;
}
void AccessTokenErr::setErrorDescription(std::string const& value) {
m_Error_description = value;
m_Error_descriptionIsSet = true;
}
bool AccessTokenErr::errorDescriptionIsSet() const {
return m_Error_descriptionIsSet;
}
void AccessTokenErr::unsetError_description() {
m_Error_descriptionIsSet = false;
}
std::string AccessTokenErr::getErrorUri() const {
return m_Error_uri;
}
void AccessTokenErr::setErrorUri(std::string const& value) {
m_Error_uri = value;
m_Error_uriIsSet = true;
}
bool AccessTokenErr::errorUriIsSet() const {
return m_Error_uriIsSet;
}
void AccessTokenErr::unsetError_uri() {
m_Error_uriIsSet = false;
}
} // namespace oai::amf::model
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
/*
* AccessTokenErr.h
*
*
*/
#ifndef AccessTokenErr_H_
#define AccessTokenErr_H_
#include <string>
#include <nlohmann/json.hpp>
namespace oai::amf::model {
/// <summary>
///
/// </summary>
class AccessTokenErr {
public:
AccessTokenErr();
virtual ~AccessTokenErr() = 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. Returns false on error and writes
/// an error message into the given stringstream.
/// </summary>
bool validate(std::stringstream& msg) const;
bool operator==(const AccessTokenErr& rhs) const;
bool operator!=(const AccessTokenErr& rhs) const;
/////////////////////////////////////////////
/// AccessTokenErr members
/// <summary>
///
/// </summary>
std::string getError() const;
void setError(std::string const& value);
/// <summary>
///
/// </summary>
std::string getErrorDescription() const;
void setErrorDescription(std::string const& value);
bool errorDescriptionIsSet() const;
void unsetError_description();
/// <summary>
///
/// </summary>
std::string getErrorUri() const;
void setErrorUri(std::string const& value);
bool errorUriIsSet() const;
void unsetError_uri();
friend void to_json(nlohmann::json& j, const AccessTokenErr& o);
friend void from_json(const nlohmann::json& j, AccessTokenErr& o);
protected:
std::string m_Error;
std::string m_Error_description;
bool m_Error_descriptionIsSet;
std::string m_Error_uri;
bool m_Error_uriIsSet;
// 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
#endif /* AccessTokenErr_H_ */
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
#include "AccessTokenReq.h"
#include "Helpers.h"
#include <sstream>
namespace oai::amf::model {
using namespace oai::amf::model;
AccessTokenReq::AccessTokenReq() {
m_Grant_type = "";
m_NfInstanceId = "";
m_NfTypeIsSet = false;
m_TargetNfTypeIsSet = false;
m_Scope = "";
m_TargetNfInstanceId = "";
m_TargetNfInstanceIdIsSet = false;
m_RequesterPlmnIsSet = false;
m_TargetPlmnIsSet = false;
}
void AccessTokenReq::validate() const {
std::stringstream msg;
if (!validate(msg)) {
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool AccessTokenReq::validate(std::stringstream& msg) const {
return validate(msg, "");
}
bool AccessTokenReq::validate(
std::stringstream& msg, const std::string& pathPrefix) const {
bool success = true;
const std::string _pathPrefix =
pathPrefix.empty() ? "AccessTokenReq" : pathPrefix;
/* Scope */ {
const std::string& value = m_Scope;
const std::string currentValuePath = _pathPrefix + ".scope";
}
return success;
}
bool AccessTokenReq::operator==(const AccessTokenReq& rhs) const {
return
(getGrantType() == rhs.getGrantType()) &&
(getNfInstanceId() == rhs.getNfInstanceId()) &&
((!nfTypeIsSet() && !rhs.nfTypeIsSet()) ||
(nfTypeIsSet() && rhs.nfTypeIsSet() &&
getNfType() == rhs.getNfType())) &&
((!targetNfTypeIsSet() && !rhs.targetNfTypeIsSet()) ||
(targetNfTypeIsSet() && rhs.targetNfTypeIsSet() &&
getTargetNfType() == rhs.getTargetNfType())) &&
(getScope() == rhs.getScope()) &&
((!targetNfInstanceIdIsSet() && !rhs.targetNfInstanceIdIsSet()) ||
(targetNfInstanceIdIsSet() && rhs.targetNfInstanceIdIsSet() &&
getTargetNfInstanceId() == rhs.getTargetNfInstanceId())) &&
((!requesterPlmnIsSet() && !rhs.requesterPlmnIsSet()) ||
(requesterPlmnIsSet() && rhs.requesterPlmnIsSet() &&
getRequesterPlmn() == rhs.getRequesterPlmn())) &&
((!targetPlmnIsSet() && !rhs.targetPlmnIsSet()) ||
(targetPlmnIsSet() && rhs.targetPlmnIsSet() &&
getTargetPlmn() == rhs.getTargetPlmn()))
;
}
bool AccessTokenReq::operator!=(const AccessTokenReq& rhs) const {
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const AccessTokenReq& o) {
j = nlohmann::json();
j["grant_type"] = o.m_Grant_type;
j["nfInstanceId"] = o.m_NfInstanceId;
if (o.nfTypeIsSet()) j["nfType"] = o.m_NfType;
if (o.targetNfTypeIsSet()) j["targetNfType"] = o.m_TargetNfType;
j["scope"] = o.m_Scope;
if (o.targetNfInstanceIdIsSet())
j["targetNfInstanceId"] = o.m_TargetNfInstanceId;
if (o.requesterPlmnIsSet()) j["requesterPlmn"] = o.m_RequesterPlmn;
if (o.targetPlmnIsSet()) j["targetPlmn"] = o.m_TargetPlmn;
}
void from_json(const nlohmann::json& j, AccessTokenReq& o) {
j.at("grant_type").get_to(o.m_Grant_type);
j.at("nfInstanceId").get_to(o.m_NfInstanceId);
if (j.find("nfType") != j.end()) {
j.at("nfType").get_to(o.m_NfType);
o.m_NfTypeIsSet = true;
}
if (j.find("targetNfType") != j.end()) {
j.at("targetNfType").get_to(o.m_TargetNfType);
o.m_TargetNfTypeIsSet = true;
}
j.at("scope").get_to(o.m_Scope);
if (j.find("targetNfInstanceId") != j.end()) {
j.at("targetNfInstanceId").get_to(o.m_TargetNfInstanceId);
o.m_TargetNfInstanceIdIsSet = true;
}
if (j.find("requesterPlmn") != j.end()) {
j.at("requesterPlmn").get_to(o.m_RequesterPlmn);
o.m_RequesterPlmnIsSet = true;
}
if (j.find("targetPlmn") != j.end()) {
j.at("targetPlmn").get_to(o.m_TargetPlmn);
o.m_TargetPlmnIsSet = true;
}
}
std::string AccessTokenReq::getGrantType() const {
return m_Grant_type;
}
void AccessTokenReq::setGrantType(std::string const& value) {
m_Grant_type = value;
}
std::string AccessTokenReq::getNfInstanceId() const {
return m_NfInstanceId;
}
void AccessTokenReq::setNfInstanceId(std::string const& value) {
m_NfInstanceId = value;
}
NFType AccessTokenReq::getNfType() const {
return m_NfType;
}
void AccessTokenReq::setNfType(NFType const& value) {
m_NfType = value;
m_NfTypeIsSet = true;
}
bool AccessTokenReq::nfTypeIsSet() const {
return m_NfTypeIsSet;
}
void AccessTokenReq::unsetNfType() {
m_NfTypeIsSet = false;
}
NFType AccessTokenReq::getTargetNfType() const {
return m_TargetNfType;
}
void AccessTokenReq::setTargetNfType(NFType const& value) {
m_TargetNfType = value;
m_TargetNfTypeIsSet = true;
}
bool AccessTokenReq::targetNfTypeIsSet() const {
return m_TargetNfTypeIsSet;
}
void AccessTokenReq::unsetTargetNfType() {
m_TargetNfTypeIsSet = false;
}
std::string AccessTokenReq::getScope() const {
return m_Scope;
}
void AccessTokenReq::setScope(std::string const& value) {
m_Scope = value;
}
std::string AccessTokenReq::getTargetNfInstanceId() const {
return m_TargetNfInstanceId;
}
void AccessTokenReq::setTargetNfInstanceId(std::string const& value) {
m_TargetNfInstanceId = value;
m_TargetNfInstanceIdIsSet = true;
}
bool AccessTokenReq::targetNfInstanceIdIsSet() const {
return m_TargetNfInstanceIdIsSet;
}
void AccessTokenReq::unsetTargetNfInstanceId() {
m_TargetNfInstanceIdIsSet = false;
}
PlmnId AccessTokenReq::getRequesterPlmn() const {
return m_RequesterPlmn;
}
void AccessTokenReq::setRequesterPlmn(PlmnId const& value) {
m_RequesterPlmn = value;
m_RequesterPlmnIsSet = true;
}
bool AccessTokenReq::requesterPlmnIsSet() const {
return m_RequesterPlmnIsSet;
}
void AccessTokenReq::unsetRequesterPlmn() {
m_RequesterPlmnIsSet = false;
}
PlmnId AccessTokenReq::getTargetPlmn() const {
return m_TargetPlmn;
}
void AccessTokenReq::setTargetPlmn(PlmnId const& value) {
m_TargetPlmn = value;
m_TargetPlmnIsSet = true;
}
bool AccessTokenReq::targetPlmnIsSet() const {
return m_TargetPlmnIsSet;
}
void AccessTokenReq::unsetTargetPlmn() {
m_TargetPlmnIsSet = false;
}
} // namespace oai::amf::model
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
/*
* AccessTokenReq.h
*
*
*/
#ifndef AccessTokenReq_H_
#define AccessTokenReq_H_
#include "NFType.h"
#include <string>
#include "PlmnId.h"
#include <nlohmann/json.hpp>
namespace oai::amf::model {
/// <summary>
///
/// </summary>
class AccessTokenReq {
public:
AccessTokenReq();
virtual ~AccessTokenReq() = 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. Returns false on error and writes
/// an error message into the given stringstream.
/// </summary>
bool validate(std::stringstream& msg) const;
bool operator==(const AccessTokenReq& rhs) const;
bool operator!=(const AccessTokenReq& rhs) const;
/////////////////////////////////////////////
/// AccessTokenReq members
/// <summary>
///
/// </summary>
std::string getGrantType() const;
void setGrantType(std::string const& value);
/// <summary>
///
/// </summary>
std::string getNfInstanceId() const;
void setNfInstanceId(std::string const& value);
/// <summary>
///
/// </summary>
NFType getNfType() const;
void setNfType(NFType const& value);
bool nfTypeIsSet() const;
void unsetNfType();
/// <summary>
///
/// </summary>
NFType getTargetNfType() const;
void setTargetNfType(NFType const& value);
bool targetNfTypeIsSet() const;
void unsetTargetNfType();
/// <summary>
///
/// </summary>
std::string getScope() const;
void setScope(std::string const& value);
/// <summary>
///
/// </summary>
std::string getTargetNfInstanceId() const;
void setTargetNfInstanceId(std::string const& value);
bool targetNfInstanceIdIsSet() const;
void unsetTargetNfInstanceId();
/// <summary>
///
/// </summary>
PlmnId getRequesterPlmn() const;
void setRequesterPlmn(PlmnId const& value);
bool requesterPlmnIsSet() const;
void unsetRequesterPlmn();
/// <summary>
///
/// </summary>
PlmnId getTargetPlmn() const;
void setTargetPlmn(PlmnId const& value);
bool targetPlmnIsSet() const;
void unsetTargetPlmn();
friend void to_json(nlohmann::json& j, const AccessTokenReq& o);
friend void from_json(const nlohmann::json& j, AccessTokenReq& o);
protected:
std::string m_Grant_type;
std::string m_NfInstanceId;
NFType m_NfType;
bool m_NfTypeIsSet;
NFType m_TargetNfType;
bool m_TargetNfTypeIsSet;
std::string m_Scope;
std::string m_TargetNfInstanceId;
bool m_TargetNfInstanceIdIsSet;
PlmnId m_RequesterPlmn;
bool m_RequesterPlmnIsSet;
PlmnId m_TargetPlmn;
bool m_TargetPlmnIsSet;
// 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
#endif /* AccessTokenReq_H_ */
/** /**
* Namf_Communication * Namf_EventExposure
* AMF Communication Service © 2019, 3GPP Organizational Partners (ARIB, ATIS, * AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. * CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* *
* The version of the OpenAPI document: 1.1.0.alpha-1 * The version of the OpenAPI document: 1.1.0.alpha-1
...@@ -12,25 +12,85 @@ ...@@ -12,25 +12,85 @@
*/ */
#include "AccessType.h" #include "AccessType.h"
#include "Helpers.h"
#include <stdexcept>
#include <sstream>
namespace oai { namespace oai::amf::model {
namespace amf {
namespace model {
AccessType::AccessType() {} AccessType::AccessType() {}
AccessType::~AccessType() {} void AccessType::validate() const {
std::stringstream msg;
if (!validate(msg)) {
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool AccessType::validate(std::stringstream& msg) const {
return validate(msg, "");
}
bool AccessType::validate(
std::stringstream& msg, const std::string& pathPrefix) const {
bool success = true;
const std::string _pathPrefix =
pathPrefix.empty() ? "AccessType" : pathPrefix;
if (m_value == AccessType::eAccessType::INVALID_VALUE_OPENAPI_GENERATED) {
success = false;
msg << _pathPrefix << ": has no value;";
}
return success;
}
bool AccessType::operator==(const AccessType& rhs) const {
return getValue() == rhs.getValue()
void AccessType::validate() { ;
// TODO: implement validation }
bool AccessType::operator!=(const AccessType& rhs) const {
return !(*this == rhs);
} }
void to_json(nlohmann::json& j, const AccessType& o) { void to_json(nlohmann::json& j, const AccessType& o) {
j = nlohmann::json(); j = nlohmann::json();
switch (o.getValue()) {
case AccessType::eAccessType::INVALID_VALUE_OPENAPI_GENERATED:
j = "INVALID_VALUE_OPENAPI_GENERATED";
break;
case AccessType::eAccessType::_3GPP_ACCESS:
j = "3GPP_ACCESS";
break;
case AccessType::eAccessType::NON_3GPP_ACCESS:
j = "NON_3GPP_ACCESS";
break;
}
} }
void from_json(const nlohmann::json& j, AccessType& o) {} void from_json(const nlohmann::json& j, AccessType& o) {
auto s = j.get<std::string>();
if (s == "3GPP_ACCESS") {
o.setValue(AccessType::eAccessType::_3GPP_ACCESS);
} else if (s == "NON_3GPP_ACCESS") {
o.setValue(AccessType::eAccessType::NON_3GPP_ACCESS);
} else {
std::stringstream ss;
ss << "Unexpected value " << s << " in json"
<< " cannot be converted to enum of type"
<< " AccessType::eAccessType";
throw std::invalid_argument(ss.str());
}
}
AccessType::eAccessType AccessType::getValue() const {
return m_value;
}
void AccessType::setValue(AccessType::eAccessType value) {
m_value = value;
}
} // namespace model } // namespace oai::amf::model
} // namespace amf
} // namespace oai
/** /**
* Namf_Communication * Namf_EventExposure
* AMF Communication Service © 2019, 3GPP Organizational Partners (ARIB, ATIS, * AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. * CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* *
* The version of the OpenAPI document: 1.1.0.alpha-1 * The version of the OpenAPI document: 1.1.0.alpha-1
...@@ -21,9 +21,7 @@ ...@@ -21,9 +21,7 @@
#include <nlohmann/json.hpp> #include <nlohmann/json.hpp>
namespace oai { namespace oai::amf::model {
namespace amf {
namespace model {
/// <summary> /// <summary>
/// ///
...@@ -31,21 +29,50 @@ namespace model { ...@@ -31,21 +29,50 @@ namespace model {
class AccessType { class AccessType {
public: public:
AccessType(); AccessType();
virtual ~AccessType(); virtual ~AccessType() = default;
void validate(); enum class eAccessType {
// To have a valid default value.
// Avoiding nameclashes with user defined
// enum values
INVALID_VALUE_OPENAPI_GENERATED = 0,
_3GPP_ACCESS,
NON_3GPP_ACCESS
};
/// <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 AccessType& rhs) const;
bool operator!=(const AccessType& rhs) const;
///////////////////////////////////////////// /////////////////////////////////////////////
/// AccessType members /// AccessType members
AccessType::eAccessType getValue() const;
void setValue(AccessType::eAccessType value);
friend void to_json(nlohmann::json& j, const AccessType& o); friend void to_json(nlohmann::json& j, const AccessType& o);
friend void from_json(const nlohmann::json& j, AccessType& o); friend void from_json(const nlohmann::json& j, AccessType& o);
// 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: protected:
AccessType::eAccessType m_value =
AccessType::eAccessType::INVALID_VALUE_OPENAPI_GENERATED;
}; };
} // namespace model } // namespace oai::amf::model
} // namespace amf
} // namespace oai
#endif /* AccessType_H_ */ #endif /* AccessType_H_ */
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
#include "AmfCreateEventSubscription.h"
#include "Helpers.h"
#include <sstream>
namespace oai::amf::model {
AmfCreateEventSubscription::AmfCreateEventSubscription() {
m_SupportedFeatures = "";
m_SupportedFeaturesIsSet = false;
m_OldGuamiIsSet = false;
}
void AmfCreateEventSubscription::validate() const {
std::stringstream msg;
if (!validate(msg)) {
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool AmfCreateEventSubscription::validate(std::stringstream& msg) const {
return validate(msg, "");
}
bool AmfCreateEventSubscription::validate(
std::stringstream& msg, const std::string& pathPrefix) const {
bool success = true;
const std::string _pathPrefix =
pathPrefix.empty() ? "AmfCreateEventSubscription" : pathPrefix;
if (supportedFeaturesIsSet()) {
const std::string& value = m_SupportedFeatures;
const std::string currentValuePath = _pathPrefix + ".supportedFeatures";
}
return success;
}
bool AmfCreateEventSubscription::operator==(
const AmfCreateEventSubscription& rhs) const {
return
(getSubscription() == rhs.getSubscription()) &&
((!supportedFeaturesIsSet() && !rhs.supportedFeaturesIsSet()) ||
(supportedFeaturesIsSet() && rhs.supportedFeaturesIsSet() &&
getSupportedFeatures() == rhs.getSupportedFeatures())) &&
((!oldGuamiIsSet() && !rhs.oldGuamiIsSet()) ||
(oldGuamiIsSet() && rhs.oldGuamiIsSet() &&
getOldGuami() == rhs.getOldGuami()))
;
}
bool AmfCreateEventSubscription::operator!=(
const AmfCreateEventSubscription& rhs) const {
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const AmfCreateEventSubscription& o) {
j = nlohmann::json();
j["subscription"] = o.m_Subscription;
if (o.supportedFeaturesIsSet())
j["supportedFeatures"] = o.m_SupportedFeatures;
if (o.oldGuamiIsSet()) j["oldGuami"] = o.m_OldGuami;
}
void from_json(const nlohmann::json& j, AmfCreateEventSubscription& o) {
j.at("subscription").get_to(o.m_Subscription);
if (j.find("supportedFeatures") != j.end()) {
j.at("supportedFeatures").get_to(o.m_SupportedFeatures);
o.m_SupportedFeaturesIsSet = true;
}
if (j.find("oldGuami") != j.end()) {
j.at("oldGuami").get_to(o.m_OldGuami);
o.m_OldGuamiIsSet = true;
}
}
AmfEventSubscription AmfCreateEventSubscription::getSubscription() const {
return m_Subscription;
}
void AmfCreateEventSubscription::setSubscription(
AmfEventSubscription const& value) {
m_Subscription = value;
}
std::string AmfCreateEventSubscription::getSupportedFeatures() const {
return m_SupportedFeatures;
}
void AmfCreateEventSubscription::setSupportedFeatures(
std::string const& value) {
m_SupportedFeatures = value;
m_SupportedFeaturesIsSet = true;
}
bool AmfCreateEventSubscription::supportedFeaturesIsSet() const {
return m_SupportedFeaturesIsSet;
}
void AmfCreateEventSubscription::unsetSupportedFeatures() {
m_SupportedFeaturesIsSet = false;
}
Guami AmfCreateEventSubscription::getOldGuami() const {
return m_OldGuami;
}
void AmfCreateEventSubscription::setOldGuami(Guami const& value) {
m_OldGuami = value;
m_OldGuamiIsSet = true;
}
bool AmfCreateEventSubscription::oldGuamiIsSet() const {
return m_OldGuamiIsSet;
}
void AmfCreateEventSubscription::unsetOldGuami() {
m_OldGuamiIsSet = false;
}
} // namespace oai::amf::model
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
/*
* AmfCreateEventSubscription.h
*
*
*/
#ifndef AmfCreateEventSubscription_H_
#define AmfCreateEventSubscription_H_
#include <string>
#include "AmfEventSubscription.h"
#include "Guami.h"
#include <nlohmann/json.hpp>
namespace oai::amf::model {
/// <summary>
///
/// </summary>
class AmfCreateEventSubscription {
public:
AmfCreateEventSubscription();
virtual ~AmfCreateEventSubscription() = 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. Returns false on error and writes
/// an error message into the given stringstream.
/// </summary>
bool validate(std::stringstream& msg) const;
bool operator==(const AmfCreateEventSubscription& rhs) const;
bool operator!=(const AmfCreateEventSubscription& rhs) const;
/////////////////////////////////////////////
/// AmfCreateEventSubscription members
/// <summary>
///
/// </summary>
AmfEventSubscription getSubscription() const;
void setSubscription(AmfEventSubscription const& value);
/// <summary>
///
/// </summary>
std::string getSupportedFeatures() const;
void setSupportedFeatures(std::string const& value);
bool supportedFeaturesIsSet() const;
void unsetSupportedFeatures();
/// <summary>
///
/// </summary>
Guami getOldGuami() const;
void setOldGuami(Guami const& value);
bool oldGuamiIsSet() const;
void unsetOldGuami();
friend void to_json(nlohmann::json& j, const AmfCreateEventSubscription& o);
friend void from_json(const nlohmann::json& j, AmfCreateEventSubscription& o);
protected:
AmfEventSubscription m_Subscription;
std::string m_SupportedFeatures;
bool m_SupportedFeaturesIsSet;
Guami m_OldGuami;
bool m_OldGuamiIsSet;
// 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
#endif /* AmfCreateEventSubscription_H_ */
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
#include "AmfCreatedEventSubscription.h"
#include "Helpers.h"
#include <sstream>
namespace oai::amf::model {
AmfCreatedEventSubscription::AmfCreatedEventSubscription() {
m_SubscriptionId = "";
m_ReportListIsSet = false;
m_SupportedFeatures = "";
m_SupportedFeaturesIsSet = false;
}
void AmfCreatedEventSubscription::validate() const {
std::stringstream msg;
if (!validate(msg)) {
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool AmfCreatedEventSubscription::validate(std::stringstream& msg) const {
return validate(msg, "");
}
bool AmfCreatedEventSubscription::validate(
std::stringstream& msg, const std::string& pathPrefix) const {
bool success = true;
const std::string _pathPrefix =
pathPrefix.empty() ? "AmfCreatedEventSubscription" : pathPrefix;
if (reportListIsSet()) {
const std::vector<AmfEventReport>& value = m_ReportList;
const std::string currentValuePath = _pathPrefix + ".reportList";
if (value.size() < 1) {
success = false;
msg << currentValuePath << ": must have at least 1 elements;";
}
{ // Recursive validation of array elements
const std::string oldValuePath = currentValuePath;
int i = 0;
for (const AmfEventReport& value : value) {
const std::string currentValuePath =
oldValuePath + "[" + std::to_string(i) + "]";
success =
value.validate(msg, currentValuePath + ".reportList") && success;
i++;
}
}
}
if (supportedFeaturesIsSet()) {
const std::string& value = m_SupportedFeatures;
const std::string currentValuePath = _pathPrefix + ".supportedFeatures";
}
return success;
}
bool AmfCreatedEventSubscription::operator==(
const AmfCreatedEventSubscription& rhs) const {
return
(getSubscription() == rhs.getSubscription()) &&
(getSubscriptionId() == rhs.getSubscriptionId()) &&
((!reportListIsSet() && !rhs.reportListIsSet()) ||
(reportListIsSet() && rhs.reportListIsSet() &&
getReportList() == rhs.getReportList())) &&
((!supportedFeaturesIsSet() && !rhs.supportedFeaturesIsSet()) ||
(supportedFeaturesIsSet() && rhs.supportedFeaturesIsSet() &&
getSupportedFeatures() == rhs.getSupportedFeatures()))
;
}
bool AmfCreatedEventSubscription::operator!=(
const AmfCreatedEventSubscription& rhs) const {
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const AmfCreatedEventSubscription& o) {
j = nlohmann::json();
j["subscription"] = o.m_Subscription;
j["subscriptionId"] = o.m_SubscriptionId;
if (o.reportListIsSet() || !o.m_ReportList.empty())
j["reportList"] = o.m_ReportList;
if (o.supportedFeaturesIsSet())
j["supportedFeatures"] = o.m_SupportedFeatures;
}
void from_json(const nlohmann::json& j, AmfCreatedEventSubscription& o) {
j.at("subscription").get_to(o.m_Subscription);
j.at("subscriptionId").get_to(o.m_SubscriptionId);
if (j.find("reportList") != j.end()) {
j.at("reportList").get_to(o.m_ReportList);
o.m_ReportListIsSet = true;
}
if (j.find("supportedFeatures") != j.end()) {
j.at("supportedFeatures").get_to(o.m_SupportedFeatures);
o.m_SupportedFeaturesIsSet = true;
}
}
AmfEventSubscription AmfCreatedEventSubscription::getSubscription() const {
return m_Subscription;
}
void AmfCreatedEventSubscription::setSubscription(
AmfEventSubscription const& value) {
m_Subscription = value;
}
std::string AmfCreatedEventSubscription::getSubscriptionId() const {
return m_SubscriptionId;
}
void AmfCreatedEventSubscription::setSubscriptionId(std::string const& value) {
m_SubscriptionId = value;
}
std::vector<AmfEventReport> AmfCreatedEventSubscription::getReportList() const {
return m_ReportList;
}
void AmfCreatedEventSubscription::setReportList(
std::vector<AmfEventReport> const& value) {
m_ReportList = value;
m_ReportListIsSet = true;
}
bool AmfCreatedEventSubscription::reportListIsSet() const {
return m_ReportListIsSet;
}
void AmfCreatedEventSubscription::unsetReportList() {
m_ReportListIsSet = false;
}
std::string AmfCreatedEventSubscription::getSupportedFeatures() const {
return m_SupportedFeatures;
}
void AmfCreatedEventSubscription::setSupportedFeatures(
std::string const& value) {
m_SupportedFeatures = value;
m_SupportedFeaturesIsSet = true;
}
bool AmfCreatedEventSubscription::supportedFeaturesIsSet() const {
return m_SupportedFeaturesIsSet;
}
void AmfCreatedEventSubscription::unsetSupportedFeatures() {
m_SupportedFeaturesIsSet = false;
}
} // namespace oai::amf::model
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
/*
* AmfCreatedEventSubscription.h
*
*
*/
#ifndef AmfCreatedEventSubscription_H_
#define AmfCreatedEventSubscription_H_
#include "AmfEventReport.h"
#include <string>
#include "AmfEventSubscription.h"
#include <vector>
#include <nlohmann/json.hpp>
namespace oai::amf::model {
/// <summary>
///
/// </summary>
class AmfCreatedEventSubscription {
public:
AmfCreatedEventSubscription();
virtual ~AmfCreatedEventSubscription() = 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. Returns false on error and writes
/// an error message into the given stringstream.
/// </summary>
bool validate(std::stringstream& msg) const;
bool operator==(const AmfCreatedEventSubscription& rhs) const;
bool operator!=(const AmfCreatedEventSubscription& rhs) const;
/////////////////////////////////////////////
/// AmfCreatedEventSubscription members
/// <summary>
///
/// </summary>
AmfEventSubscription getSubscription() const;
void setSubscription(AmfEventSubscription const& value);
/// <summary>
///
/// </summary>
std::string getSubscriptionId() const;
void setSubscriptionId(std::string const& value);
/// <summary>
///
/// </summary>
std::vector<AmfEventReport> getReportList() const;
void setReportList(std::vector<AmfEventReport> const& value);
bool reportListIsSet() const;
void unsetReportList();
/// <summary>
///
/// </summary>
std::string getSupportedFeatures() const;
void setSupportedFeatures(std::string const& value);
bool supportedFeaturesIsSet() const;
void unsetSupportedFeatures();
friend void to_json(nlohmann::json& j, const AmfCreatedEventSubscription& o);
friend void from_json(
const nlohmann::json& j, AmfCreatedEventSubscription& o);
protected:
AmfEventSubscription m_Subscription;
std::string m_SubscriptionId;
std::vector<AmfEventReport> m_ReportList;
bool m_ReportListIsSet;
std::string m_SupportedFeatures;
bool m_SupportedFeaturesIsSet;
// 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
#endif /* AmfCreatedEventSubscription_H_ */
/** /**
* Namf_Communication * Namf_EventExposure
* AMF Communication Service © 2019, 3GPP Organizational Partners (ARIB, ATIS, * AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. * CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* *
* The version of the OpenAPI document: 1.1.0.alpha-1 * The version of the OpenAPI document: 1.1.0.alpha-1
...@@ -12,10 +12,11 @@ ...@@ -12,10 +12,11 @@
*/ */
#include "AmfEvent.h" #include "AmfEvent.h"
#include "Helpers.h"
namespace oai { #include <sstream>
namespace amf {
namespace model { namespace oai::amf::model {
AmfEvent::AmfEvent() { AmfEvent::AmfEvent() {
m_ImmediateFlag = false; m_ImmediateFlag = false;
...@@ -26,18 +27,105 @@ AmfEvent::AmfEvent() { ...@@ -26,18 +27,105 @@ AmfEvent::AmfEvent() {
m_RefIdIsSet = false; m_RefIdIsSet = false;
} }
AmfEvent::~AmfEvent() {} void AmfEvent::validate() const {
std::stringstream msg;
if (!validate(msg)) {
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool AmfEvent::validate(std::stringstream& msg) const {
return validate(msg, "");
}
bool AmfEvent::validate(
std::stringstream& msg, const std::string& pathPrefix) const {
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "AmfEvent" : pathPrefix;
if (areaListIsSet()) {
const std::vector<AmfEventArea>& value = m_AreaList;
const std::string currentValuePath = _pathPrefix + ".areaList";
if (value.size() < 1) {
success = false;
msg << currentValuePath << ": must have at least 1 elements;";
}
{ // Recursive validation of array elements
const std::string oldValuePath = currentValuePath;
int i = 0;
for (const AmfEventArea& value : value) {
const std::string currentValuePath =
oldValuePath + "[" + std::to_string(i) + "]";
success =
value.validate(msg, currentValuePath + ".areaList") && success;
i++;
}
}
}
if (locationFilterListIsSet()) {
const std::vector<LocationFilter>& value = m_LocationFilterList;
const std::string currentValuePath = _pathPrefix + ".locationFilterList";
if (value.size() < 1) {
success = false;
msg << currentValuePath << ": must have at least 1 elements;";
}
{ // Recursive validation of array elements
const std::string oldValuePath = currentValuePath;
int i = 0;
for (const LocationFilter& value : value) {
const std::string currentValuePath =
oldValuePath + "[" + std::to_string(i) + "]";
success =
value.validate(msg, currentValuePath + ".locationFilterList") &&
success;
i++;
}
}
}
return success;
}
bool AmfEvent::operator==(const AmfEvent& rhs) const {
return
((getType() == rhs.getType()) &&
void AmfEvent::validate() { ((!immediateFlagIsSet() && !rhs.immediateFlagIsSet()) ||
// TODO: implement validation (immediateFlagIsSet() && rhs.immediateFlagIsSet() &&
isImmediateFlag() == rhs.isImmediateFlag())) &&
((!areaListIsSet() && !rhs.areaListIsSet()) ||
(areaListIsSet() && rhs.areaListIsSet() &&
getAreaList() == rhs.getAreaList())) &&
((!locationFilterListIsSet() && !rhs.locationFilterListIsSet()) ||
(locationFilterListIsSet() && rhs.locationFilterListIsSet() &&
getLocationFilterList() == rhs.getLocationFilterList())) &&
((!refIdIsSet() && !rhs.refIdIsSet()) ||
(refIdIsSet() && rhs.refIdIsSet() && getRefId() == rhs.getRefId())))
;
}
bool AmfEvent::operator!=(const AmfEvent& rhs) const {
return !(*this == rhs);
} }
void to_json(nlohmann::json& j, const AmfEvent& o) { void to_json(nlohmann::json& j, const AmfEvent& o) {
j = nlohmann::json(); j = nlohmann::json();
j["type"] = o.m_Type; j["type"] = o.m_Type;
if (o.immediateFlagIsSet()) j["immediateFlag"] = o.m_ImmediateFlag; if (o.immediateFlagIsSet()) j["immediateFlag"] = o.m_ImmediateFlag;
if (o.areaListIsSet()) j["areaList"] = o.m_AreaList; if (o.areaListIsSet() || !o.m_AreaList.empty()) j["areaList"] = o.m_AreaList;
if (o.locationFilterListIsSet()) if (o.locationFilterListIsSet() || !o.m_LocationFilterList.empty())
j["locationFilterList"] = o.m_LocationFilterList; j["locationFilterList"] = o.m_LocationFilterList;
if (o.refIdIsSet()) j["refId"] = o.m_RefId; if (o.refIdIsSet()) j["refId"] = o.m_RefId;
} }
...@@ -81,18 +169,26 @@ bool AmfEvent::immediateFlagIsSet() const { ...@@ -81,18 +169,26 @@ bool AmfEvent::immediateFlagIsSet() const {
void AmfEvent::unsetImmediateFlag() { void AmfEvent::unsetImmediateFlag() {
m_ImmediateFlagIsSet = false; m_ImmediateFlagIsSet = false;
} }
std::vector<AmfEventArea>& AmfEvent::getAreaList() { std::vector<AmfEventArea> AmfEvent::getAreaList() const {
return m_AreaList; return m_AreaList;
} }
void AmfEvent::setAreaList(std::vector<AmfEventArea> const& value) {
m_AreaList = value;
m_AreaListIsSet = true;
}
bool AmfEvent::areaListIsSet() const { bool AmfEvent::areaListIsSet() const {
return m_AreaListIsSet; return m_AreaListIsSet;
} }
void AmfEvent::unsetAreaList() { void AmfEvent::unsetAreaList() {
m_AreaListIsSet = false; m_AreaListIsSet = false;
} }
std::vector<LocationFilter>& AmfEvent::getLocationFilterList() { std::vector<LocationFilter> AmfEvent::getLocationFilterList() const {
return m_LocationFilterList; return m_LocationFilterList;
} }
void AmfEvent::setLocationFilterList(std::vector<LocationFilter> const& value) {
m_LocationFilterList = value;
m_LocationFilterListIsSet = true;
}
bool AmfEvent::locationFilterListIsSet() const { bool AmfEvent::locationFilterListIsSet() const {
return m_LocationFilterListIsSet; return m_LocationFilterListIsSet;
} }
...@@ -113,6 +209,4 @@ void AmfEvent::unsetRefId() { ...@@ -113,6 +209,4 @@ void AmfEvent::unsetRefId() {
m_RefIdIsSet = false; m_RefIdIsSet = false;
} }
} // namespace model } // namespace oai::amf::model
} // namespace amf
} // namespace oai
/** /**
* Namf_Communication * Namf_EventExposure
* AMF Communication Service © 2019, 3GPP Organizational Partners (ARIB, ATIS, * AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. * CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* *
* The version of the OpenAPI document: 1.1.0.alpha-1 * The version of the OpenAPI document: 1.1.0.alpha-1
...@@ -25,19 +25,30 @@ ...@@ -25,19 +25,30 @@
#include "AmfEventType.h" #include "AmfEventType.h"
#include <nlohmann/json.hpp> #include <nlohmann/json.hpp>
namespace oai { namespace oai::amf::model {
namespace amf { using namespace oai::amf::model;
namespace model {
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
class AmfEvent { class AmfEvent {
public: public:
AmfEvent(); AmfEvent();
virtual ~AmfEvent(); virtual ~AmfEvent() = default;
/// <summary>
/// Validate the current data in the model. Throws a ValidationException on
/// failure.
/// </summary>
void validate() const;
void validate(); /// <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 AmfEvent& rhs) const;
bool operator!=(const AmfEvent& rhs) const;
///////////////////////////////////////////// /////////////////////////////////////////////
/// AmfEvent members /// AmfEvent members
...@@ -57,13 +68,15 @@ class AmfEvent { ...@@ -57,13 +68,15 @@ class AmfEvent {
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
std::vector<AmfEventArea>& getAreaList(); std::vector<AmfEventArea> getAreaList() const;
void setAreaList(std::vector<AmfEventArea> const& value);
bool areaListIsSet() const; bool areaListIsSet() const;
void unsetAreaList(); void unsetAreaList();
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
std::vector<LocationFilter>& getLocationFilterList(); std::vector<LocationFilter> getLocationFilterList() const;
void setLocationFilterList(std::vector<LocationFilter> const& value);
bool locationFilterListIsSet() const; bool locationFilterListIsSet() const;
void unsetLocationFilterList(); void unsetLocationFilterList();
/// <summary> /// <summary>
...@@ -77,6 +90,10 @@ class AmfEvent { ...@@ -77,6 +90,10 @@ class AmfEvent {
friend void to_json(nlohmann::json& j, const AmfEvent& o); friend void to_json(nlohmann::json& j, const AmfEvent& o);
friend void from_json(const nlohmann::json& j, AmfEvent& o); friend void from_json(const nlohmann::json& j, AmfEvent& o);
// 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: protected:
AmfEventType m_Type; AmfEventType m_Type;
...@@ -90,8 +107,6 @@ class AmfEvent { ...@@ -90,8 +107,6 @@ class AmfEvent {
bool m_RefIdIsSet; bool m_RefIdIsSet;
}; };
} // namespace model } // namespace oai::amf::model
} // namespace amf
} // namespace oai
#endif /* AmfEvent_H_ */ #endif /* AmfEvent_H_ */
/** /**
* Namf_Communication * Namf_EventExposure
* AMF Communication Service © 2019, 3GPP Organizational Partners (ARIB, ATIS, * AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. * CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* *
* The version of the OpenAPI document: 1.1.0.alpha-1 * The version of the OpenAPI document: 1.1.0.alpha-1
...@@ -12,20 +12,53 @@ ...@@ -12,20 +12,53 @@
*/ */
#include "AmfEventArea.h" #include "AmfEventArea.h"
#include "Helpers.h"
namespace oai { #include <sstream>
namespace amf {
namespace model { namespace oai::amf::model {
AmfEventArea::AmfEventArea() { AmfEventArea::AmfEventArea() {
m_PresenceInfoIsSet = false; m_PresenceInfoIsSet = false;
m_LadnInfoIsSet = false; m_LadnInfoIsSet = false;
} }
AmfEventArea::~AmfEventArea() {} void AmfEventArea::validate() const {
std::stringstream msg;
if (!validate(msg)) {
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool AmfEventArea::validate(std::stringstream& msg) const {
return validate(msg, "");
}
bool AmfEventArea::validate(
std::stringstream& msg, const std::string& pathPrefix) const {
bool success = true;
const std::string _pathPrefix =
pathPrefix.empty() ? "AmfEventArea" : pathPrefix;
return success;
}
bool AmfEventArea::operator==(const AmfEventArea& rhs) const {
return
((!presenceInfoIsSet() && !rhs.presenceInfoIsSet()) ||
(presenceInfoIsSet() && rhs.presenceInfoIsSet() &&
getPresenceInfo() == rhs.getPresenceInfo())) &&
((!ladnInfoIsSet() && !rhs.ladnInfoIsSet()) ||
(ladnInfoIsSet() && rhs.ladnInfoIsSet() &&
getLadnInfo() == rhs.getLadnInfo()))
;
}
void AmfEventArea::validate() { bool AmfEventArea::operator!=(const AmfEventArea& rhs) const {
// TODO: implement validation return !(*this == rhs);
} }
void to_json(nlohmann::json& j, const AmfEventArea& o) { void to_json(nlohmann::json& j, const AmfEventArea& o) {
...@@ -72,6 +105,4 @@ void AmfEventArea::unsetLadnInfo() { ...@@ -72,6 +105,4 @@ void AmfEventArea::unsetLadnInfo() {
m_LadnInfoIsSet = false; m_LadnInfoIsSet = false;
} }
} // namespace model } // namespace oai::amf::model
} // namespace amf
} // namespace oai
/** /**
* Namf_Communication * Namf_EventExposure
* AMF Communication Service © 2019, 3GPP Organizational Partners (ARIB, ATIS, * AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. * CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* *
* The version of the OpenAPI document: 1.1.0.alpha-1 * The version of the OpenAPI document: 1.1.0.alpha-1
...@@ -23,9 +23,7 @@ ...@@ -23,9 +23,7 @@
#include "LadnInfo.h" #include "LadnInfo.h"
#include <nlohmann/json.hpp> #include <nlohmann/json.hpp>
namespace oai { namespace oai::amf::model {
namespace amf {
namespace model {
/// <summary> /// <summary>
/// ///
...@@ -33,9 +31,22 @@ namespace model { ...@@ -33,9 +31,22 @@ namespace model {
class AmfEventArea { class AmfEventArea {
public: public:
AmfEventArea(); AmfEventArea();
virtual ~AmfEventArea(); virtual ~AmfEventArea() = default;
void validate(); /// <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 AmfEventArea& rhs) const;
bool operator!=(const AmfEventArea& rhs) const;
///////////////////////////////////////////// /////////////////////////////////////////////
/// AmfEventArea members /// AmfEventArea members
...@@ -57,6 +68,9 @@ class AmfEventArea { ...@@ -57,6 +68,9 @@ class AmfEventArea {
friend void to_json(nlohmann::json& j, const AmfEventArea& o); friend void to_json(nlohmann::json& j, const AmfEventArea& o);
friend void from_json(const nlohmann::json& j, AmfEventArea& o); friend void from_json(const nlohmann::json& j, AmfEventArea& o);
// 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: protected:
PresenceInfo m_PresenceInfo; PresenceInfo m_PresenceInfo;
...@@ -65,8 +79,6 @@ class AmfEventArea { ...@@ -65,8 +79,6 @@ class AmfEventArea {
bool m_LadnInfoIsSet; bool m_LadnInfoIsSet;
}; };
} // namespace model } // namespace oai::amf::model
} // namespace amf
} // namespace oai
#endif /* AmfEventArea_H_ */ #endif /* AmfEventArea_H_ */
/** /**
* Namf_Communication * Namf_EventExposure
* AMF Communication Service © 2019, 3GPP Organizational Partners (ARIB, ATIS, * AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. * CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* *
* The version of the OpenAPI document: 1.1.0.alpha-1 * The version of the OpenAPI document: 1.1.0.alpha-1
...@@ -12,10 +12,11 @@ ...@@ -12,10 +12,11 @@
*/ */
#include "AmfEventMode.h" #include "AmfEventMode.h"
#include "Helpers.h"
namespace oai { #include <sstream>
namespace amf {
namespace model { namespace oai::amf::model {
AmfEventMode::AmfEventMode() { AmfEventMode::AmfEventMode() {
m_MaxReports = 0; m_MaxReports = 0;
...@@ -24,10 +25,43 @@ AmfEventMode::AmfEventMode() { ...@@ -24,10 +25,43 @@ AmfEventMode::AmfEventMode() {
m_ExpiryIsSet = false; m_ExpiryIsSet = false;
} }
AmfEventMode::~AmfEventMode() {} void AmfEventMode::validate() const {
std::stringstream msg;
if (!validate(msg)) {
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool AmfEventMode::validate(std::stringstream& msg) const {
return validate(msg, "");
}
bool AmfEventMode::validate(
std::stringstream& msg, const std::string& pathPrefix) const {
bool success = true;
const std::string _pathPrefix =
pathPrefix.empty() ? "AmfEventMode" : pathPrefix;
return success;
}
bool AmfEventMode::operator==(const AmfEventMode& rhs) const {
return
(getTrigger() == rhs.getTrigger()) &&
((!maxReportsIsSet() && !rhs.maxReportsIsSet()) ||
(maxReportsIsSet() && rhs.maxReportsIsSet() &&
getMaxReports() == rhs.getMaxReports())) &&
((!expiryIsSet() && !rhs.expiryIsSet()) ||
(expiryIsSet() && rhs.expiryIsSet() && getExpiry() == rhs.getExpiry()))
;
}
void AmfEventMode::validate() { bool AmfEventMode::operator!=(const AmfEventMode& rhs) const {
// TODO: implement validation return !(*this == rhs);
} }
void to_json(nlohmann::json& j, const AmfEventMode& o) { void to_json(nlohmann::json& j, const AmfEventMode& o) {
...@@ -82,6 +116,4 @@ void AmfEventMode::unsetExpiry() { ...@@ -82,6 +116,4 @@ void AmfEventMode::unsetExpiry() {
m_ExpiryIsSet = false; m_ExpiryIsSet = false;
} }
} // namespace model } // namespace oai::amf::model
} // namespace amf
} // namespace oai
/** /**
* Namf_Communication * Namf_EventExposure
* AMF Communication Service © 2019, 3GPP Organizational Partners (ARIB, ATIS, * AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. * CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* *
* The version of the OpenAPI document: 1.1.0.alpha-1 * The version of the OpenAPI document: 1.1.0.alpha-1
...@@ -23,9 +23,7 @@ ...@@ -23,9 +23,7 @@
#include <string> #include <string>
#include <nlohmann/json.hpp> #include <nlohmann/json.hpp>
namespace oai { namespace oai::amf::model {
namespace amf {
namespace model {
/// <summary> /// <summary>
/// ///
...@@ -33,9 +31,22 @@ namespace model { ...@@ -33,9 +31,22 @@ namespace model {
class AmfEventMode { class AmfEventMode {
public: public:
AmfEventMode(); AmfEventMode();
virtual ~AmfEventMode(); virtual ~AmfEventMode() = default;
void validate(); /// <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 AmfEventMode& rhs) const;
bool operator!=(const AmfEventMode& rhs) const;
///////////////////////////////////////////// /////////////////////////////////////////////
/// AmfEventMode members /// AmfEventMode members
...@@ -70,10 +81,12 @@ class AmfEventMode { ...@@ -70,10 +81,12 @@ class AmfEventMode {
bool m_MaxReportsIsSet; bool m_MaxReportsIsSet;
std::string m_Expiry; std::string m_Expiry;
bool m_ExpiryIsSet; bool m_ExpiryIsSet;
// 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 model } // namespace oai::amf::model
} // namespace amf
} // namespace oai
#endif /* AmfEventMode_H_ */ #endif /* AmfEventMode_H_ */
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
#include "AmfEventNotification.h"
#include "Helpers.h"
#include <sstream>
namespace oai::amf::model {
AmfEventNotification::AmfEventNotification() {
m_NotifyCorrelationId = "";
m_NotifyCorrelationIdIsSet = false;
m_SubsChangeNotifyCorrelationId = "";
m_SubsChangeNotifyCorrelationIdIsSet = false;
m_ReportListIsSet = false;
}
void AmfEventNotification::validate() const {
std::stringstream msg;
if (!validate(msg)) {
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool AmfEventNotification::validate(std::stringstream& msg) const {
return validate(msg, "");
}
bool AmfEventNotification::validate(
std::stringstream& msg, const std::string& pathPrefix) const {
bool success = true;
const std::string _pathPrefix =
pathPrefix.empty() ? "AmfEventNotification" : pathPrefix;
if (reportListIsSet()) {
const std::vector<AmfEventReport>& value = m_ReportList;
const std::string currentValuePath = _pathPrefix + ".reportList";
if (value.size() < 1) {
success = false;
msg << currentValuePath << ": must have at least 1 elements;";
}
{ // Recursive validation of array elements
const std::string oldValuePath = currentValuePath;
int i = 0;
for (const AmfEventReport& value : value) {
const std::string currentValuePath =
oldValuePath + "[" + std::to_string(i) + "]";
success =
value.validate(msg, currentValuePath + ".reportList") && success;
i++;
}
}
}
return success;
}
bool AmfEventNotification::operator==(const AmfEventNotification& rhs) const {
return
((!notifyCorrelationIdIsSet() && !rhs.notifyCorrelationIdIsSet()) ||
(notifyCorrelationIdIsSet() && rhs.notifyCorrelationIdIsSet() &&
getNotifyCorrelationId() == rhs.getNotifyCorrelationId())) &&
((!subsChangeNotifyCorrelationIdIsSet() &&
!rhs.subsChangeNotifyCorrelationIdIsSet()) ||
(subsChangeNotifyCorrelationIdIsSet() &&
rhs.subsChangeNotifyCorrelationIdIsSet() &&
getSubsChangeNotifyCorrelationId() ==
rhs.getSubsChangeNotifyCorrelationId())) &&
((!reportListIsSet() && !rhs.reportListIsSet()) ||
(reportListIsSet() && rhs.reportListIsSet() &&
getReportList() == rhs.getReportList()))
;
}
bool AmfEventNotification::operator!=(const AmfEventNotification& rhs) const {
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const AmfEventNotification& o) {
j = nlohmann::json();
if (o.notifyCorrelationIdIsSet())
j["notifyCorrelationId"] = o.m_NotifyCorrelationId;
if (o.subsChangeNotifyCorrelationIdIsSet())
j["subsChangeNotifyCorrelationId"] = o.m_SubsChangeNotifyCorrelationId;
if (o.reportListIsSet() || !o.m_ReportList.empty())
j["reportList"] = o.m_ReportList;
}
void from_json(const nlohmann::json& j, AmfEventNotification& o) {
if (j.find("notifyCorrelationId") != j.end()) {
j.at("notifyCorrelationId").get_to(o.m_NotifyCorrelationId);
o.m_NotifyCorrelationIdIsSet = true;
}
if (j.find("subsChangeNotifyCorrelationId") != j.end()) {
j.at("subsChangeNotifyCorrelationId")
.get_to(o.m_SubsChangeNotifyCorrelationId);
o.m_SubsChangeNotifyCorrelationIdIsSet = true;
}
if (j.find("reportList") != j.end()) {
j.at("reportList").get_to(o.m_ReportList);
o.m_ReportListIsSet = true;
}
}
std::string AmfEventNotification::getNotifyCorrelationId() const {
return m_NotifyCorrelationId;
}
void AmfEventNotification::setNotifyCorrelationId(std::string const& value) {
m_NotifyCorrelationId = value;
m_NotifyCorrelationIdIsSet = true;
}
bool AmfEventNotification::notifyCorrelationIdIsSet() const {
return m_NotifyCorrelationIdIsSet;
}
void AmfEventNotification::unsetNotifyCorrelationId() {
m_NotifyCorrelationIdIsSet = false;
}
std::string AmfEventNotification::getSubsChangeNotifyCorrelationId() const {
return m_SubsChangeNotifyCorrelationId;
}
void AmfEventNotification::setSubsChangeNotifyCorrelationId(
std::string const& value) {
m_SubsChangeNotifyCorrelationId = value;
m_SubsChangeNotifyCorrelationIdIsSet = true;
}
bool AmfEventNotification::subsChangeNotifyCorrelationIdIsSet() const {
return m_SubsChangeNotifyCorrelationIdIsSet;
}
void AmfEventNotification::unsetSubsChangeNotifyCorrelationId() {
m_SubsChangeNotifyCorrelationIdIsSet = false;
}
std::vector<AmfEventReport> AmfEventNotification::getReportList() const {
return m_ReportList;
}
void AmfEventNotification::setReportList(
std::vector<AmfEventReport> const& value) {
m_ReportList = value;
m_ReportListIsSet = true;
}
bool AmfEventNotification::reportListIsSet() const {
return m_ReportListIsSet;
}
void AmfEventNotification::unsetReportList() {
m_ReportListIsSet = false;
}
} // namespace oai::amf::model
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
/*
* AmfEventNotification.h
*
*
*/
#ifndef AmfEventNotification_H_
#define AmfEventNotification_H_
#include "AmfEventReport.h"
#include <string>
#include <vector>
#include <nlohmann/json.hpp>
namespace oai::amf::model {
/// <summary>
///
/// </summary>
class AmfEventNotification {
public:
AmfEventNotification();
virtual ~AmfEventNotification() = 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. Returns false on error and writes
/// an error message into the given stringstream.
/// </summary>
bool validate(std::stringstream& msg) const;
bool operator==(const AmfEventNotification& rhs) const;
bool operator!=(const AmfEventNotification& rhs) const;
/////////////////////////////////////////////
/// AmfEventNotification members
/// <summary>
///
/// </summary>
std::string getNotifyCorrelationId() const;
void setNotifyCorrelationId(std::string const& value);
bool notifyCorrelationIdIsSet() const;
void unsetNotifyCorrelationId();
/// <summary>
///
/// </summary>
std::string getSubsChangeNotifyCorrelationId() const;
void setSubsChangeNotifyCorrelationId(std::string const& value);
bool subsChangeNotifyCorrelationIdIsSet() const;
void unsetSubsChangeNotifyCorrelationId();
/// <summary>
///
/// </summary>
std::vector<AmfEventReport> getReportList() const;
void setReportList(std::vector<AmfEventReport> const& value);
bool reportListIsSet() const;
void unsetReportList();
friend void to_json(nlohmann::json& j, const AmfEventNotification& o);
friend void from_json(const nlohmann::json& j, AmfEventNotification& o);
protected:
std::string m_NotifyCorrelationId;
bool m_NotifyCorrelationIdIsSet;
std::string m_SubsChangeNotifyCorrelationId;
bool m_SubsChangeNotifyCorrelationIdIsSet;
std::vector<AmfEventReport> m_ReportList;
bool m_ReportListIsSet;
// 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
#endif /* AmfEventNotification_H_ */
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
#include "AmfEventReport.h"
#include "Helpers.h"
#include <sstream>
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_NumberOfUes = 0;
m_NumberOfUesIsSet = false;
m_r_5gsUserStateListIsSet = false;
}
void AmfEventReport::validate() const {
std::stringstream msg;
if (!validate(msg)) {
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool AmfEventReport::validate(std::stringstream& msg) const {
return validate(msg, "");
}
bool AmfEventReport::validate(
std::stringstream& msg, const std::string& pathPrefix) const {
bool success = true;
const std::string _pathPrefix =
pathPrefix.empty() ? "AmfEventReport" : pathPrefix;
if (supiIsSet()) {
const std::string& value = m_Supi;
const std::string currentValuePath = _pathPrefix + ".supi";
}
if (areaListIsSet()) {
const std::vector<AmfEventArea>& value = m_AreaList;
const std::string currentValuePath = _pathPrefix + ".areaList";
if (value.size() < 1) {
success = false;
msg << currentValuePath << ": must have at least 1 elements;";
}
{ // Recursive validation of array elements
const std::string oldValuePath = currentValuePath;
int i = 0;
for (const AmfEventArea& value : value) {
const std::string currentValuePath =
oldValuePath + "[" + std::to_string(i) + "]";
success =
value.validate(msg, currentValuePath + ".areaList") && success;
i++;
}
}
}
if (gpsiIsSet()) {
const std::string& value = m_Gpsi;
const std::string currentValuePath = _pathPrefix + ".gpsi";
}
if (peiIsSet()) {
const std::string& value = m_Pei;
const std::string currentValuePath = _pathPrefix + ".pei";
}
if (accessTypeListIsSet()) {
const std::vector<AccessType>& value = m_AccessTypeList;
const std::string currentValuePath = _pathPrefix + ".accessTypeList";
if (value.size() < 1) {
success = false;
msg << currentValuePath << ": must have at least 1 elements;";
}
{ // Recursive validation of array elements
const std::string oldValuePath = currentValuePath;
int i = 0;
for (const AccessType& value : value) {
const std::string currentValuePath =
oldValuePath + "[" + std::to_string(i) + "]";
success = value.validate(msg, currentValuePath) && success;
i++;
}
}
}
if (rmInfoListIsSet()) {
const std::vector<RmInfo>& value = m_RmInfoList;
const std::string currentValuePath = _pathPrefix + ".rmInfoList";
if (value.size() < 1) {
success = false;
msg << currentValuePath << ": must have at least 1 elements;";
}
{ // Recursive validation of array elements
const std::string oldValuePath = currentValuePath;
int i = 0;
for (const RmInfo& value : value) {
const std::string currentValuePath =
oldValuePath + "[" + std::to_string(i) + "]";
success =
value.validate(msg, currentValuePath + ".rmInfoList") && success;
i++;
}
}
}
if (cmInfoListIsSet()) {
const std::vector<CmInfo>& value = m_CmInfoList;
const std::string currentValuePath = _pathPrefix + ".cmInfoList";
if (value.size() < 1) {
success = false;
msg << currentValuePath << ": must have at least 1 elements;";
}
{ // Recursive validation of array elements
const std::string oldValuePath = currentValuePath;
int i = 0;
for (const CmInfo& value : value) {
const std::string currentValuePath =
oldValuePath + "[" + std::to_string(i) + "]";
success =
value.validate(msg, currentValuePath + ".cmInfoList") && success;
i++;
}
}
}
if (r5gsUserStateListIsSet()) {
const std::vector<_5GsUserStateInfo>& value = m_r_5gsUserStateList;
const std::string currentValuePath = _pathPrefix + ".r5gsUserStateList";
if (value.size() < 1) {
success = false;
msg << currentValuePath << ": must have at least 1 elements;";
}
{ // Recursive validation of array elements
const std::string oldValuePath = currentValuePath;
int i = 0;
for (const _5GsUserStateInfo& value : value) {
const std::string currentValuePath =
oldValuePath + "[" + std::to_string(i) + "]";
success =
value.validate(msg, currentValuePath + ".r5gsUserStateList") &&
success;
i++;
}
}
}
return success;
}
bool AmfEventReport::operator==(const AmfEventReport& rhs) const {
return
(getType() == rhs.getType()) &&
(getState() == rhs.getState()) &&
(getTimeStamp() == rhs.getTimeStamp()) &&
((!subscriptionIdIsSet() && !rhs.subscriptionIdIsSet()) ||
(subscriptionIdIsSet() && rhs.subscriptionIdIsSet() &&
getSubscriptionId() == rhs.getSubscriptionId())) &&
((!anyUeIsSet() && !rhs.anyUeIsSet()) ||
(anyUeIsSet() && rhs.anyUeIsSet() && isAnyUe() == rhs.isAnyUe())) &&
((!supiIsSet() && !rhs.supiIsSet()) ||
(supiIsSet() && rhs.supiIsSet() && getSupi() == rhs.getSupi())) &&
((!areaListIsSet() && !rhs.areaListIsSet()) ||
(areaListIsSet() && rhs.areaListIsSet() &&
getAreaList() == rhs.getAreaList())) &&
((!refIdIsSet() && !rhs.refIdIsSet()) ||
(refIdIsSet() && rhs.refIdIsSet() && getRefId() == rhs.getRefId())) &&
((!gpsiIsSet() && !rhs.gpsiIsSet()) ||
(gpsiIsSet() && rhs.gpsiIsSet() && getGpsi() == rhs.getGpsi())) &&
((!peiIsSet() && !rhs.peiIsSet()) ||
(peiIsSet() && rhs.peiIsSet() && getPei() == rhs.getPei())) &&
((!locationIsSet() && !rhs.locationIsSet()) ||
(locationIsSet() && rhs.locationIsSet() &&
getLocation() == rhs.getLocation())) &&
((!timezoneIsSet() && !rhs.timezoneIsSet()) ||
(timezoneIsSet() && rhs.timezoneIsSet() &&
getTimezone() == rhs.getTimezone())) &&
((!accessTypeListIsSet() && !rhs.accessTypeListIsSet()) ||
(accessTypeListIsSet() && rhs.accessTypeListIsSet() &&
getAccessTypeList() == rhs.getAccessTypeList())) &&
((!rmInfoListIsSet() && !rhs.rmInfoListIsSet()) ||
(rmInfoListIsSet() && rhs.rmInfoListIsSet() &&
getRmInfoList() == rhs.getRmInfoList())) &&
((!cmInfoListIsSet() && !rhs.cmInfoListIsSet()) ||
(cmInfoListIsSet() && rhs.cmInfoListIsSet() &&
getCmInfoList() == rhs.getCmInfoList())) &&
((!reachabilityIsSet() && !rhs.reachabilityIsSet()) ||
(reachabilityIsSet() && rhs.reachabilityIsSet() &&
getReachability() == rhs.getReachability())) &&
((!commFailureIsSet() && !rhs.commFailureIsSet()) ||
(commFailureIsSet() && rhs.commFailureIsSet() &&
getCommFailure() == rhs.getCommFailure())) &&
((!numberOfUesIsSet() && !rhs.numberOfUesIsSet()) ||
(numberOfUesIsSet() && rhs.numberOfUesIsSet() &&
getNumberOfUes() == rhs.getNumberOfUes())) &&
((!r5gsUserStateListIsSet() && !rhs.r5gsUserStateListIsSet()) ||
(r5gsUserStateListIsSet() && rhs.r5gsUserStateListIsSet() &&
getR5gsUserStateList() == rhs.getR5gsUserStateList()))
;
}
bool AmfEventReport::operator!=(const AmfEventReport& rhs) const {
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const AmfEventReport& o) {
j = nlohmann::json();
j["type"] = o.m_Type;
j["state"] = o.m_State;
j["timeStamp"] = o.m_TimeStamp;
if (o.subscriptionIdIsSet()) j["subscriptionId"] = o.m_SubscriptionId;
if (o.anyUeIsSet()) j["anyUe"] = o.m_AnyUe;
if (o.supiIsSet()) j["supi"] = o.m_Supi;
if (o.areaListIsSet() || !o.m_AreaList.empty()) j["areaList"] = o.m_AreaList;
if (o.refIdIsSet()) j["refId"] = o.m_RefId;
if (o.gpsiIsSet()) j["gpsi"] = o.m_Gpsi;
if (o.peiIsSet()) j["pei"] = o.m_Pei;
if (o.locationIsSet()) j["location"] = o.m_Location;
if (o.timezoneIsSet()) j["timezone"] = o.m_Timezone;
if (o.accessTypeListIsSet() || !o.m_AccessTypeList.empty())
j["accessTypeList"] = o.m_AccessTypeList;
if (o.rmInfoListIsSet() || !o.m_RmInfoList.empty())
j["rmInfoList"] = o.m_RmInfoList;
if (o.cmInfoListIsSet() || !o.m_CmInfoList.empty())
j["cmInfoList"] = o.m_CmInfoList;
if (o.reachabilityIsSet()) j["reachability"] = o.m_Reachability;
if (o.commFailureIsSet()) j["commFailure"] = o.m_CommFailure;
if (o.numberOfUesIsSet()) j["numberOfUes"] = o.m_NumberOfUes;
if (o.r5gsUserStateListIsSet() || !o.m_r_5gsUserStateList.empty())
j["5gsUserStateList"] = o.m_r_5gsUserStateList;
}
void from_json(const nlohmann::json& j, AmfEventReport& o) {
j.at("type").get_to(o.m_Type);
j.at("state").get_to(o.m_State);
j.at("timeStamp").get_to(o.m_TimeStamp);
if (j.find("subscriptionId") != j.end()) {
j.at("subscriptionId").get_to(o.m_SubscriptionId);
o.m_SubscriptionIdIsSet = true;
}
if (j.find("anyUe") != j.end()) {
j.at("anyUe").get_to(o.m_AnyUe);
o.m_AnyUeIsSet = true;
}
if (j.find("supi") != j.end()) {
j.at("supi").get_to(o.m_Supi);
o.m_SupiIsSet = true;
}
if (j.find("areaList") != j.end()) {
j.at("areaList").get_to(o.m_AreaList);
o.m_AreaListIsSet = true;
}
if (j.find("refId") != j.end()) {
j.at("refId").get_to(o.m_RefId);
o.m_RefIdIsSet = true;
}
if (j.find("gpsi") != j.end()) {
j.at("gpsi").get_to(o.m_Gpsi);
o.m_GpsiIsSet = true;
}
if (j.find("pei") != j.end()) {
j.at("pei").get_to(o.m_Pei);
o.m_PeiIsSet = true;
}
if (j.find("location") != j.end()) {
j.at("location").get_to(o.m_Location);
o.m_LocationIsSet = true;
}
if (j.find("timezone") != j.end()) {
j.at("timezone").get_to(o.m_Timezone);
o.m_TimezoneIsSet = true;
}
if (j.find("accessTypeList") != j.end()) {
j.at("accessTypeList").get_to(o.m_AccessTypeList);
o.m_AccessTypeListIsSet = true;
}
if (j.find("rmInfoList") != j.end()) {
j.at("rmInfoList").get_to(o.m_RmInfoList);
o.m_RmInfoListIsSet = true;
}
if (j.find("cmInfoList") != j.end()) {
j.at("cmInfoList").get_to(o.m_CmInfoList);
o.m_CmInfoListIsSet = true;
}
if (j.find("reachability") != j.end()) {
j.at("reachability").get_to(o.m_Reachability);
o.m_ReachabilityIsSet = true;
}
if (j.find("commFailure") != j.end()) {
j.at("commFailure").get_to(o.m_CommFailure);
o.m_CommFailureIsSet = true;
}
if (j.find("numberOfUes") != j.end()) {
j.at("numberOfUes").get_to(o.m_NumberOfUes);
o.m_NumberOfUesIsSet = true;
}
if (j.find("5gsUserStateList") != j.end()) {
j.at("5gsUserStateList").get_to(o.m_r_5gsUserStateList);
o.m_r_5gsUserStateListIsSet = true;
}
}
AmfEventType AmfEventReport::getType() const {
return m_Type;
}
void AmfEventReport::setType(AmfEventType const& value) {
m_Type = value;
}
AmfEventState AmfEventReport::getState() const {
return m_State;
}
void AmfEventReport::setState(AmfEventState const& value) {
m_State = value;
}
std::string AmfEventReport::getTimeStamp() const {
return m_TimeStamp;
}
void AmfEventReport::setTimeStamp(std::string const& value) {
m_TimeStamp = value;
}
std::string AmfEventReport::getSubscriptionId() const {
return m_SubscriptionId;
}
void AmfEventReport::setSubscriptionId(std::string const& value) {
m_SubscriptionId = value;
m_SubscriptionIdIsSet = true;
}
bool AmfEventReport::subscriptionIdIsSet() const {
return m_SubscriptionIdIsSet;
}
void AmfEventReport::unsetSubscriptionId() {
m_SubscriptionIdIsSet = false;
}
bool AmfEventReport::isAnyUe() const {
return m_AnyUe;
}
void AmfEventReport::setAnyUe(bool const value) {
m_AnyUe = value;
m_AnyUeIsSet = true;
}
bool AmfEventReport::anyUeIsSet() const {
return m_AnyUeIsSet;
}
void AmfEventReport::unsetAnyUe() {
m_AnyUeIsSet = false;
}
std::string AmfEventReport::getSupi() const {
return m_Supi;
}
void AmfEventReport::setSupi(std::string const& value) {
m_Supi = value;
m_SupiIsSet = true;
}
bool AmfEventReport::supiIsSet() const {
return m_SupiIsSet;
}
void AmfEventReport::unsetSupi() {
m_SupiIsSet = false;
}
std::vector<AmfEventArea> AmfEventReport::getAreaList() const {
return m_AreaList;
}
void AmfEventReport::setAreaList(std::vector<AmfEventArea> const& value) {
m_AreaList = value;
m_AreaListIsSet = true;
}
bool AmfEventReport::areaListIsSet() const {
return m_AreaListIsSet;
}
void AmfEventReport::unsetAreaList() {
m_AreaListIsSet = false;
}
int32_t AmfEventReport::getRefId() const {
return m_RefId;
}
void AmfEventReport::setRefId(int32_t const value) {
m_RefId = value;
m_RefIdIsSet = true;
}
bool AmfEventReport::refIdIsSet() const {
return m_RefIdIsSet;
}
void AmfEventReport::unsetRefId() {
m_RefIdIsSet = false;
}
std::string AmfEventReport::getGpsi() const {
return m_Gpsi;
}
void AmfEventReport::setGpsi(std::string const& value) {
m_Gpsi = value;
m_GpsiIsSet = true;
}
bool AmfEventReport::gpsiIsSet() const {
return m_GpsiIsSet;
}
void AmfEventReport::unsetGpsi() {
m_GpsiIsSet = false;
}
std::string AmfEventReport::getPei() const {
return m_Pei;
}
void AmfEventReport::setPei(std::string const& value) {
m_Pei = value;
m_PeiIsSet = true;
}
bool AmfEventReport::peiIsSet() const {
return m_PeiIsSet;
}
void AmfEventReport::unsetPei() {
m_PeiIsSet = false;
}
UserLocation AmfEventReport::getLocation() const {
return m_Location;
}
void AmfEventReport::setLocation(UserLocation const& value) {
m_Location = value;
m_LocationIsSet = true;
}
bool AmfEventReport::locationIsSet() const {
return m_LocationIsSet;
}
void AmfEventReport::unsetLocation() {
m_LocationIsSet = false;
}
std::string AmfEventReport::getTimezone() const {
return m_Timezone;
}
void AmfEventReport::setTimezone(std::string const& value) {
m_Timezone = value;
m_TimezoneIsSet = true;
}
bool AmfEventReport::timezoneIsSet() const {
return m_TimezoneIsSet;
}
void AmfEventReport::unsetTimezone() {
m_TimezoneIsSet = false;
}
std::vector<AccessType> AmfEventReport::getAccessTypeList() const {
return m_AccessTypeList;
}
void AmfEventReport::setAccessTypeList(std::vector<AccessType> const& value) {
m_AccessTypeList = value;
m_AccessTypeListIsSet = true;
}
bool AmfEventReport::accessTypeListIsSet() const {
return m_AccessTypeListIsSet;
}
void AmfEventReport::unsetAccessTypeList() {
m_AccessTypeListIsSet = false;
}
std::vector<RmInfo> AmfEventReport::getRmInfoList() const {
return m_RmInfoList;
}
void AmfEventReport::setRmInfoList(std::vector<RmInfo> const& value) {
m_RmInfoList = value;
m_RmInfoListIsSet = true;
}
bool AmfEventReport::rmInfoListIsSet() const {
return m_RmInfoListIsSet;
}
void AmfEventReport::unsetRmInfoList() {
m_RmInfoListIsSet = false;
}
std::vector<CmInfo> AmfEventReport::getCmInfoList() const {
return m_CmInfoList;
}
void AmfEventReport::setCmInfoList(std::vector<CmInfo> const& value) {
m_CmInfoList = value;
m_CmInfoListIsSet = true;
}
bool AmfEventReport::cmInfoListIsSet() const {
return m_CmInfoListIsSet;
}
void AmfEventReport::unsetCmInfoList() {
m_CmInfoListIsSet = false;
}
UeReachability AmfEventReport::getReachability() const {
return m_Reachability;
}
void AmfEventReport::setReachability(UeReachability const& value) {
m_Reachability = value;
m_ReachabilityIsSet = true;
}
bool AmfEventReport::reachabilityIsSet() const {
return m_ReachabilityIsSet;
}
void AmfEventReport::unsetReachability() {
m_ReachabilityIsSet = false;
}
CommunicationFailure AmfEventReport::getCommFailure() const {
return m_CommFailure;
}
void AmfEventReport::setCommFailure(CommunicationFailure const& value) {
m_CommFailure = value;
m_CommFailureIsSet = true;
}
bool AmfEventReport::commFailureIsSet() const {
return m_CommFailureIsSet;
}
void AmfEventReport::unsetCommFailure() {
m_CommFailureIsSet = false;
}
int32_t AmfEventReport::getNumberOfUes() const {
return m_NumberOfUes;
}
void AmfEventReport::setNumberOfUes(int32_t const value) {
m_NumberOfUes = value;
m_NumberOfUesIsSet = true;
}
bool AmfEventReport::numberOfUesIsSet() const {
return m_NumberOfUesIsSet;
}
void AmfEventReport::unsetNumberOfUes() {
m_NumberOfUesIsSet = false;
}
std::vector<_5GsUserStateInfo> AmfEventReport::getR5gsUserStateList() const {
return m_r_5gsUserStateList;
}
void AmfEventReport::setR5gsUserStateList(
std::vector<_5GsUserStateInfo> const& value) {
m_r_5gsUserStateList = value;
m_r_5gsUserStateListIsSet = true;
}
bool AmfEventReport::r5gsUserStateListIsSet() const {
return m_r_5gsUserStateListIsSet;
}
void AmfEventReport::unsetr_5gsUserStateList() {
m_r_5gsUserStateListIsSet = false;
}
} // namespace oai::amf::model
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
/*
* AmfEventReport.h
*
*
*/
#ifndef AmfEventReport_H_
#define AmfEventReport_H_
#include "RmInfo.h"
#include "UeReachability.h"
#include "AmfEventState.h"
#include "AmfEventArea.h"
#include <string>
#include "UserLocation.h"
#include "5GsUserStateInfo.h"
#include <vector>
#include "AccessType.h"
#include "AmfEventType.h"
#include "CmInfo.h"
#include "CommunicationFailure.h"
#include <nlohmann/json.hpp>
namespace oai::amf::model {
/// <summary>
///
/// </summary>
class AmfEventReport {
public:
AmfEventReport();
virtual ~AmfEventReport() = 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. Returns false on error and writes
/// an error message into the given stringstream.
/// </summary>
bool validate(std::stringstream& msg) const;
bool operator==(const AmfEventReport& rhs) const;
bool operator!=(const AmfEventReport& rhs) const;
/////////////////////////////////////////////
/// AmfEventReport members
/// <summary>
///
/// </summary>
AmfEventType getType() const;
void setType(AmfEventType const& value);
/// <summary>
///
/// </summary>
AmfEventState getState() const;
void setState(AmfEventState const& value);
/// <summary>
///
/// </summary>
std::string getTimeStamp() const;
void setTimeStamp(std::string const& value);
/// <summary>
///
/// </summary>
std::string getSubscriptionId() const;
void setSubscriptionId(std::string const& value);
bool subscriptionIdIsSet() const;
void unsetSubscriptionId();
/// <summary>
///
/// </summary>
bool isAnyUe() const;
void setAnyUe(bool const value);
bool anyUeIsSet() const;
void unsetAnyUe();
/// <summary>
///
/// </summary>
std::string getSupi() const;
void setSupi(std::string const& value);
bool supiIsSet() const;
void unsetSupi();
/// <summary>
///
/// </summary>
std::vector<AmfEventArea> getAreaList() const;
void setAreaList(std::vector<AmfEventArea> const& value);
bool areaListIsSet() const;
void unsetAreaList();
/// <summary>
///
/// </summary>
int32_t getRefId() const;
void setRefId(int32_t const value);
bool refIdIsSet() const;
void unsetRefId();
/// <summary>
///
/// </summary>
std::string getGpsi() const;
void setGpsi(std::string const& value);
bool gpsiIsSet() const;
void unsetGpsi();
/// <summary>
///
/// </summary>
std::string getPei() const;
void setPei(std::string const& value);
bool peiIsSet() const;
void unsetPei();
/// <summary>
///
/// </summary>
UserLocation getLocation() const;
void setLocation(UserLocation const& value);
bool locationIsSet() const;
void unsetLocation();
/// <summary>
///
/// </summary>
std::string getTimezone() const;
void setTimezone(std::string const& value);
bool timezoneIsSet() const;
void unsetTimezone();
/// <summary>
///
/// </summary>
std::vector<AccessType> getAccessTypeList() const;
void setAccessTypeList(std::vector<AccessType> const& value);
bool accessTypeListIsSet() const;
void unsetAccessTypeList();
/// <summary>
///
/// </summary>
std::vector<RmInfo> getRmInfoList() const;
void setRmInfoList(std::vector<RmInfo> const& value);
bool rmInfoListIsSet() const;
void unsetRmInfoList();
/// <summary>
///
/// </summary>
std::vector<CmInfo> getCmInfoList() const;
void setCmInfoList(std::vector<CmInfo> const& value);
bool cmInfoListIsSet() const;
void unsetCmInfoList();
/// <summary>
///
/// </summary>
UeReachability getReachability() const;
void setReachability(UeReachability const& value);
bool reachabilityIsSet() const;
void unsetReachability();
/// <summary>
///
/// </summary>
CommunicationFailure getCommFailure() const;
void setCommFailure(CommunicationFailure const& value);
bool commFailureIsSet() const;
void unsetCommFailure();
/// <summary>
///
/// </summary>
int32_t getNumberOfUes() const;
void setNumberOfUes(int32_t const value);
bool numberOfUesIsSet() const;
void unsetNumberOfUes();
/// <summary>
///
/// </summary>
std::vector<_5GsUserStateInfo> getR5gsUserStateList() const;
void setR5gsUserStateList(std::vector<_5GsUserStateInfo> const& value);
bool r5gsUserStateListIsSet() const;
void unsetr_5gsUserStateList();
friend void to_json(nlohmann::json& j, const AmfEventReport& o);
friend void from_json(const nlohmann::json& j, AmfEventReport& o);
// 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:
AmfEventType m_Type;
AmfEventState m_State;
std::string m_TimeStamp;
std::string m_SubscriptionId;
bool m_SubscriptionIdIsSet;
bool m_AnyUe;
bool m_AnyUeIsSet;
std::string m_Supi;
bool m_SupiIsSet;
std::vector<AmfEventArea> m_AreaList;
bool m_AreaListIsSet;
int32_t m_RefId;
bool m_RefIdIsSet;
std::string m_Gpsi;
bool m_GpsiIsSet;
std::string m_Pei;
bool m_PeiIsSet;
UserLocation m_Location;
bool m_LocationIsSet;
std::string m_Timezone;
bool m_TimezoneIsSet;
std::vector<AccessType> m_AccessTypeList;
bool m_AccessTypeListIsSet;
std::vector<RmInfo> m_RmInfoList;
bool m_RmInfoListIsSet;
std::vector<CmInfo> m_CmInfoList;
bool m_CmInfoListIsSet;
UeReachability m_Reachability;
bool m_ReachabilityIsSet;
CommunicationFailure m_CommFailure;
bool m_CommFailureIsSet;
int32_t m_NumberOfUes;
bool m_NumberOfUesIsSet;
std::vector<_5GsUserStateInfo> m_r_5gsUserStateList;
bool m_r_5gsUserStateListIsSet;
};
} // namespace oai::amf::model
#endif /* AmfEventReport_H_ */
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
#include "AmfEventState.h"
#include "Helpers.h"
#include <sstream>
namespace oai::amf::model {
AmfEventState::AmfEventState() {
m_Active = false;
m_RemainReports = 0;
m_RemainReportsIsSet = false;
m_RemainDuration = 0;
m_RemainDurationIsSet = false;
}
void AmfEventState::validate() const {
std::stringstream msg;
if (!validate(msg)) {
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool AmfEventState::validate(std::stringstream& msg) const {
return validate(msg, "");
}
bool AmfEventState::validate(
std::stringstream& msg, const std::string& pathPrefix) const {
bool success = true;
const std::string _pathPrefix =
pathPrefix.empty() ? "AmfEventState" : pathPrefix;
return success;
}
bool AmfEventState::operator==(const AmfEventState& rhs) const {
return
(isActive() == rhs.isActive()) &&
((!remainReportsIsSet() && !rhs.remainReportsIsSet()) ||
(remainReportsIsSet() && rhs.remainReportsIsSet() &&
getRemainReports() == rhs.getRemainReports())) &&
((!remainDurationIsSet() && !rhs.remainDurationIsSet()) ||
(remainDurationIsSet() && rhs.remainDurationIsSet() &&
getRemainDuration() == rhs.getRemainDuration()))
;
}
bool AmfEventState::operator!=(const AmfEventState& rhs) const {
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const AmfEventState& o) {
j = nlohmann::json();
j["active"] = o.m_Active;
if (o.remainReportsIsSet()) j["remainReports"] = o.m_RemainReports;
if (o.remainDurationIsSet()) j["remainDuration"] = o.m_RemainDuration;
}
void from_json(const nlohmann::json& j, AmfEventState& o) {
j.at("active").get_to(o.m_Active);
if (j.find("remainReports") != j.end()) {
j.at("remainReports").get_to(o.m_RemainReports);
o.m_RemainReportsIsSet = true;
}
if (j.find("remainDuration") != j.end()) {
j.at("remainDuration").get_to(o.m_RemainDuration);
o.m_RemainDurationIsSet = true;
}
}
bool AmfEventState::isActive() const {
return m_Active;
}
void AmfEventState::setActive(bool const value) {
m_Active = value;
}
int32_t AmfEventState::getRemainReports() const {
return m_RemainReports;
}
void AmfEventState::setRemainReports(int32_t const value) {
m_RemainReports = value;
m_RemainReportsIsSet = true;
}
bool AmfEventState::remainReportsIsSet() const {
return m_RemainReportsIsSet;
}
void AmfEventState::unsetRemainReports() {
m_RemainReportsIsSet = false;
}
int32_t AmfEventState::getRemainDuration() const {
return m_RemainDuration;
}
void AmfEventState::setRemainDuration(int32_t const value) {
m_RemainDuration = value;
m_RemainDurationIsSet = true;
}
bool AmfEventState::remainDurationIsSet() const {
return m_RemainDurationIsSet;
}
void AmfEventState::unsetRemainDuration() {
m_RemainDurationIsSet = false;
}
} // namespace oai::amf::model
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
/*
* AmfEventState.h
*
*
*/
#ifndef AmfEventState_H_
#define AmfEventState_H_
#include <nlohmann/json.hpp>
namespace oai::amf::model {
/// <summary>
///
/// </summary>
class AmfEventState {
public:
AmfEventState();
virtual ~AmfEventState() = 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. Returns false on error and writes
/// an error message into the given stringstream.
/// </summary>
bool validate(std::stringstream& msg) const;
bool operator==(const AmfEventState& rhs) const;
bool operator!=(const AmfEventState& rhs) const;
/////////////////////////////////////////////
/// AmfEventState members
/// <summary>
///
/// </summary>
bool isActive() const;
void setActive(bool const value);
/// <summary>
///
/// </summary>
int32_t getRemainReports() const;
void setRemainReports(int32_t const value);
bool remainReportsIsSet() const;
void unsetRemainReports();
/// <summary>
///
/// </summary>
int32_t getRemainDuration() const;
void setRemainDuration(int32_t const value);
bool remainDurationIsSet() const;
void unsetRemainDuration();
friend void to_json(nlohmann::json& j, const AmfEventState& o);
friend void from_json(const nlohmann::json& j, AmfEventState& o);
protected:
bool m_Active;
int32_t m_RemainReports;
bool m_RemainReportsIsSet;
int32_t m_RemainDuration;
bool m_RemainDurationIsSet;
// 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
#endif /* AmfEventState_H_ */
/** /**
* Namf_Communication * Namf_EventExposure
* AMF Communication Service © 2019, 3GPP Organizational Partners (ARIB, ATIS, * AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. * CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* *
* The version of the OpenAPI document: 1.1.0.alpha-1 * The version of the OpenAPI document: 1.1.0.alpha-1
...@@ -12,10 +12,11 @@ ...@@ -12,10 +12,11 @@
*/ */
#include "AmfEventSubscription.h" #include "AmfEventSubscription.h"
#include "Helpers.h"
namespace oai { #include <sstream>
namespace amf {
namespace model { namespace oai::amf::model {
AmfEventSubscription::AmfEventSubscription() { AmfEventSubscription::AmfEventSubscription() {
m_EventNotifyUri = ""; m_EventNotifyUri = "";
...@@ -38,10 +39,116 @@ AmfEventSubscription::AmfEventSubscription() { ...@@ -38,10 +39,116 @@ AmfEventSubscription::AmfEventSubscription() {
m_OptionsIsSet = false; m_OptionsIsSet = false;
} }
AmfEventSubscription::~AmfEventSubscription() {} void AmfEventSubscription::validate() const {
std::stringstream msg;
if (!validate(msg)) {
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool AmfEventSubscription::validate(std::stringstream& msg) const {
return validate(msg, "");
}
bool AmfEventSubscription::validate(
std::stringstream& msg, const std::string& pathPrefix) const {
bool success = true;
const std::string _pathPrefix =
pathPrefix.empty() ? "AmfEventSubscription" : pathPrefix;
/* EventList */ {
const std::vector<AmfEvent>& value = m_EventList;
const std::string currentValuePath = _pathPrefix + ".eventList";
if (value.size() < 1) {
success = false;
msg << currentValuePath << ": must have at least 1 elements;";
}
{ // Recursive validation of array elements
const std::string oldValuePath = currentValuePath;
int i = 0;
for (const AmfEvent& value : value) {
const std::string currentValuePath =
oldValuePath + "[" + std::to_string(i) + "]";
success =
value.validate(msg, currentValuePath + ".eventList") && success;
i++;
}
}
}
if (supiIsSet()) {
const std::string& value = m_Supi;
const std::string currentValuePath = _pathPrefix + ".supi";
}
if (groupIdIsSet()) {
const std::string& value = m_GroupId;
const std::string currentValuePath = _pathPrefix + ".groupId";
}
if (gpsiIsSet()) {
const std::string& value = m_Gpsi;
const std::string currentValuePath = _pathPrefix + ".gpsi";
}
if (peiIsSet()) {
const std::string& value = m_Pei;
const std::string currentValuePath = _pathPrefix + ".pei";
}
return success;
}
bool AmfEventSubscription::operator==(const AmfEventSubscription& rhs) const {
return
(getEventList() == rhs.getEventList()) &&
(getEventNotifyUri() == rhs.getEventNotifyUri()) &&
(getNotifyCorrelationId() == rhs.getNotifyCorrelationId()) &&
(getNfId() == rhs.getNfId()) &&
((!subsChangeNotifyUriIsSet() && !rhs.subsChangeNotifyUriIsSet()) ||
(subsChangeNotifyUriIsSet() && rhs.subsChangeNotifyUriIsSet() &&
getSubsChangeNotifyUri() == rhs.getSubsChangeNotifyUri())) &&
void AmfEventSubscription::validate() { ((!subsChangeNotifyCorrelationIdIsSet() &&
// TODO: implement validation !rhs.subsChangeNotifyCorrelationIdIsSet()) ||
(subsChangeNotifyCorrelationIdIsSet() &&
rhs.subsChangeNotifyCorrelationIdIsSet() &&
getSubsChangeNotifyCorrelationId() ==
rhs.getSubsChangeNotifyCorrelationId())) &&
((!supiIsSet() && !rhs.supiIsSet()) ||
(supiIsSet() && rhs.supiIsSet() && getSupi() == rhs.getSupi())) &&
((!groupIdIsSet() && !rhs.groupIdIsSet()) ||
(groupIdIsSet() && rhs.groupIdIsSet() &&
getGroupId() == rhs.getGroupId())) &&
((!gpsiIsSet() && !rhs.gpsiIsSet()) ||
(gpsiIsSet() && rhs.gpsiIsSet() && getGpsi() == rhs.getGpsi())) &&
((!peiIsSet() && !rhs.peiIsSet()) ||
(peiIsSet() && rhs.peiIsSet() && getPei() == rhs.getPei())) &&
((!anyUEIsSet() && !rhs.anyUEIsSet()) ||
(anyUEIsSet() && rhs.anyUEIsSet() && isAnyUE() == rhs.isAnyUE())) &&
((!optionsIsSet() && !rhs.optionsIsSet()) ||
(optionsIsSet() && rhs.optionsIsSet() &&
getOptions() == rhs.getOptions()))
;
}
bool AmfEventSubscription::operator!=(const AmfEventSubscription& rhs) const {
return !(*this == rhs);
} }
void to_json(nlohmann::json& j, const AmfEventSubscription& o) { void to_json(nlohmann::json& j, const AmfEventSubscription& o) {
...@@ -102,9 +209,12 @@ void from_json(const nlohmann::json& j, AmfEventSubscription& o) { ...@@ -102,9 +209,12 @@ void from_json(const nlohmann::json& j, AmfEventSubscription& o) {
} }
} }
std::vector<AmfEvent>& AmfEventSubscription::getEventList() { std::vector<AmfEvent> AmfEventSubscription::getEventList() const {
return m_EventList; return m_EventList;
} }
void AmfEventSubscription::setEventList(std::vector<AmfEvent> const& value) {
m_EventList = value;
}
std::string AmfEventSubscription::getEventNotifyUri() const { std::string AmfEventSubscription::getEventNotifyUri() const {
return m_EventNotifyUri; return m_EventNotifyUri;
} }
...@@ -229,6 +339,4 @@ void AmfEventSubscription::unsetOptions() { ...@@ -229,6 +339,4 @@ void AmfEventSubscription::unsetOptions() {
m_OptionsIsSet = false; m_OptionsIsSet = false;
} }
} // namespace model } // namespace oai::amf::model
} // namespace amf
} // namespace oai
/** /**
* Namf_Communication * Namf_EventExposure
* AMF Communication Service © 2019, 3GPP Organizational Partners (ARIB, ATIS, * AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. * CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* *
* The version of the OpenAPI document: 1.1.0.alpha-1 * The version of the OpenAPI document: 1.1.0.alpha-1
...@@ -25,9 +25,7 @@ ...@@ -25,9 +25,7 @@
#include <vector> #include <vector>
#include <nlohmann/json.hpp> #include <nlohmann/json.hpp>
namespace oai { namespace oai::amf::model {
namespace amf {
namespace model {
/// <summary> /// <summary>
/// ///
...@@ -35,9 +33,22 @@ namespace model { ...@@ -35,9 +33,22 @@ namespace model {
class AmfEventSubscription { class AmfEventSubscription {
public: public:
AmfEventSubscription(); AmfEventSubscription();
virtual ~AmfEventSubscription(); virtual ~AmfEventSubscription() = default;
void validate(); /// <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 AmfEventSubscription& rhs) const;
bool operator!=(const AmfEventSubscription& rhs) const;
///////////////////////////////////////////// /////////////////////////////////////////////
/// AmfEventSubscription members /// AmfEventSubscription members
...@@ -45,7 +56,8 @@ class AmfEventSubscription { ...@@ -45,7 +56,8 @@ class AmfEventSubscription {
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
std::vector<AmfEvent>& getEventList(); std::vector<AmfEvent> getEventList() const;
void setEventList(std::vector<AmfEvent> const& value);
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
...@@ -146,10 +158,12 @@ class AmfEventSubscription { ...@@ -146,10 +158,12 @@ class AmfEventSubscription {
bool m_AnyUEIsSet; bool m_AnyUEIsSet;
AmfEventMode m_Options; AmfEventMode m_Options;
bool m_OptionsIsSet; bool m_OptionsIsSet;
// 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 model } // namespace oai::amf::model
} // namespace amf
} // namespace oai
#endif /* AmfEventSubscription_H_ */ #endif /* AmfEventSubscription_H_ */
/** /**
* Namf_Communication * Namf_EventExposure
* AMF Communication Service © 2019, 3GPP Organizational Partners (ARIB, ATIS, * AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. * CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* *
* The version of the OpenAPI document: 1.1.0.alpha-1 * The version of the OpenAPI document: 1.1.0.alpha-1
...@@ -12,17 +12,42 @@ ...@@ -12,17 +12,42 @@
*/ */
#include "AmfEventTrigger.h" #include "AmfEventTrigger.h"
#include "Helpers.h"
namespace oai { #include <sstream>
namespace amf {
namespace model { namespace oai::amf::model {
AmfEventTrigger::AmfEventTrigger() {} AmfEventTrigger::AmfEventTrigger() {}
AmfEventTrigger::~AmfEventTrigger() {} void AmfEventTrigger::validate() const {
std::stringstream msg;
if (!validate(msg)) {
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool AmfEventTrigger::validate(std::stringstream& msg) const {
return validate(msg, "");
}
bool AmfEventTrigger::validate(
std::stringstream& msg, const std::string& pathPrefix) const {
bool success = true;
const std::string _pathPrefix =
pathPrefix.empty() ? "AmfEventTrigger" : pathPrefix;
return success;
}
bool AmfEventTrigger::operator==(const AmfEventTrigger& rhs) const {
return true; // TODO
;
}
void AmfEventTrigger::validate() { bool AmfEventTrigger::operator!=(const AmfEventTrigger& rhs) const {
// TODO: implement validation return !(*this == rhs);
} }
void to_json(nlohmann::json& j, const AmfEventTrigger& o) { void to_json(nlohmann::json& j, const AmfEventTrigger& o) {
...@@ -31,6 +56,4 @@ void to_json(nlohmann::json& j, const AmfEventTrigger& o) { ...@@ -31,6 +56,4 @@ void to_json(nlohmann::json& j, const AmfEventTrigger& o) {
void from_json(const nlohmann::json& j, AmfEventTrigger& o) {} void from_json(const nlohmann::json& j, AmfEventTrigger& o) {}
} // namespace model } // namespace oai::amf::model
} // namespace amf
} // namespace oai
/** /**
* Namf_Communication * Namf_EventExposure
* AMF Communication Service © 2019, 3GPP Organizational Partners (ARIB, ATIS, * AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. * CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* *
* The version of the OpenAPI document: 1.1.0.alpha-1 * The version of the OpenAPI document: 1.1.0.alpha-1
...@@ -19,11 +19,10 @@ ...@@ -19,11 +19,10 @@
#ifndef AmfEventTrigger_H_ #ifndef AmfEventTrigger_H_
#define AmfEventTrigger_H_ #define AmfEventTrigger_H_
#include "AmfEventTrigger_anyOf.h"
#include <nlohmann/json.hpp> #include <nlohmann/json.hpp>
namespace oai { namespace oai::amf::model {
namespace amf {
namespace model {
/// <summary> /// <summary>
/// ///
...@@ -31,9 +30,22 @@ namespace model { ...@@ -31,9 +30,22 @@ namespace model {
class AmfEventTrigger { class AmfEventTrigger {
public: public:
AmfEventTrigger(); AmfEventTrigger();
virtual ~AmfEventTrigger(); virtual ~AmfEventTrigger() = default;
void validate(); /// <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 AmfEventTrigger& rhs) const;
bool operator!=(const AmfEventTrigger& rhs) const;
///////////////////////////////////////////// /////////////////////////////////////////////
/// AmfEventTrigger members /// AmfEventTrigger members
...@@ -42,10 +54,11 @@ class AmfEventTrigger { ...@@ -42,10 +54,11 @@ class AmfEventTrigger {
friend void from_json(const nlohmann::json& j, AmfEventTrigger& o); friend void from_json(const nlohmann::json& j, AmfEventTrigger& o);
protected: protected:
// 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 model } // namespace oai::amf::model
} // namespace amf
} // namespace oai
#endif /* AmfEventTrigger_H_ */ #endif /* AmfEventTrigger_H_ */
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
#include "AmfEventTrigger_anyOf.h"
#include "Helpers.h"
#include <stdexcept>
#include <sstream>
namespace oai::amf::model {
AmfEventTrigger_anyOf::AmfEventTrigger_anyOf() {}
void AmfEventTrigger_anyOf::validate() const {
std::stringstream msg;
if (!validate(msg)) {
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool AmfEventTrigger_anyOf::validate(std::stringstream& msg) const {
return validate(msg, "");
}
bool AmfEventTrigger_anyOf::validate(
std::stringstream& msg, const std::string& pathPrefix) const {
bool success = true;
const std::string _pathPrefix =
pathPrefix.empty() ? "AmfEventTrigger_anyOf" : pathPrefix;
if (m_value == AmfEventTrigger_anyOf::eAmfEventTrigger_anyOf::
INVALID_VALUE_OPENAPI_GENERATED) {
success = false;
msg << _pathPrefix << ": has no value;";
}
return success;
}
bool AmfEventTrigger_anyOf::operator==(const AmfEventTrigger_anyOf& rhs) const {
return getValue() == rhs.getValue()
;
}
bool AmfEventTrigger_anyOf::operator!=(const AmfEventTrigger_anyOf& rhs) const {
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const AmfEventTrigger_anyOf& o) {
j = nlohmann::json();
switch (o.getValue()) {
case AmfEventTrigger_anyOf::eAmfEventTrigger_anyOf::
INVALID_VALUE_OPENAPI_GENERATED:
j = "INVALID_VALUE_OPENAPI_GENERATED";
break;
case AmfEventTrigger_anyOf::eAmfEventTrigger_anyOf::ONE_TIME:
j = "ONE_TIME";
break;
case AmfEventTrigger_anyOf::eAmfEventTrigger_anyOf::CONTINUOUS:
j = "CONTINUOUS";
break;
}
}
void from_json(const nlohmann::json& j, AmfEventTrigger_anyOf& o) {
auto s = j.get<std::string>();
if (s == "ONE_TIME") {
o.setValue(AmfEventTrigger_anyOf::eAmfEventTrigger_anyOf::ONE_TIME);
} else if (s == "CONTINUOUS") {
o.setValue(AmfEventTrigger_anyOf::eAmfEventTrigger_anyOf::CONTINUOUS);
} else {
std::stringstream ss;
ss << "Unexpected value " << s << " in json"
<< " cannot be converted to enum of type"
<< " AmfEventTrigger_anyOf::eAmfEventTrigger_anyOf";
throw std::invalid_argument(ss.str());
}
}
AmfEventTrigger_anyOf::eAmfEventTrigger_anyOf AmfEventTrigger_anyOf::getValue()
const {
return m_value;
}
void AmfEventTrigger_anyOf::setValue(
AmfEventTrigger_anyOf::eAmfEventTrigger_anyOf value) {
m_value = value;
}
} // namespace oai::amf::model
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
/*
* AmfEventTrigger_anyOf.h
*
*
*/
#ifndef AmfEventTrigger_anyOf_H_
#define AmfEventTrigger_anyOf_H_
#include <nlohmann/json.hpp>
namespace oai::amf::model {
/// <summary>
///
/// </summary>
class AmfEventTrigger_anyOf {
public:
AmfEventTrigger_anyOf();
virtual ~AmfEventTrigger_anyOf() = default;
enum class eAmfEventTrigger_anyOf {
// To have a valid default value.
// Avoiding nameclashes with user defined
// enum values
INVALID_VALUE_OPENAPI_GENERATED = 0,
ONE_TIME,
CONTINUOUS
};
/// <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 AmfEventTrigger_anyOf& rhs) const;
bool operator!=(const AmfEventTrigger_anyOf& rhs) const;
/////////////////////////////////////////////
/// AmfEventTrigger_anyOf members
AmfEventTrigger_anyOf::eAmfEventTrigger_anyOf getValue() const;
void setValue(AmfEventTrigger_anyOf::eAmfEventTrigger_anyOf value);
friend void to_json(nlohmann::json& j, const AmfEventTrigger_anyOf& o);
friend void from_json(const nlohmann::json& j, AmfEventTrigger_anyOf& o);
protected:
AmfEventTrigger_anyOf::eAmfEventTrigger_anyOf m_value =
AmfEventTrigger_anyOf::eAmfEventTrigger_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
#endif /* AmfEventTrigger_anyOf_H_ */
/** /**
* Namf_Communication * Namf_EventExposure
* AMF Communication Service © 2019, 3GPP Organizational Partners (ARIB, ATIS, * AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. * CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* *
* The version of the OpenAPI document: 1.1.0.alpha-1 * The version of the OpenAPI document: 1.1.0.alpha-1
...@@ -12,17 +12,40 @@ ...@@ -12,17 +12,40 @@
*/ */
#include "AmfEventType.h" #include "AmfEventType.h"
#include "Helpers.h"
namespace oai { #include <sstream>
namespace amf {
namespace model { namespace oai::amf::model {
AmfEventType::AmfEventType() {} AmfEventType::AmfEventType() {}
AmfEventType::~AmfEventType() {} void AmfEventType::validate() const {
std::stringstream msg;
if (!validate(msg)) {
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool AmfEventType::validate(std::stringstream& msg) const {
return validate(msg, "");
}
bool AmfEventType::validate(
std::stringstream& msg, const std::string& pathPrefix) const {
bool success = true;
const std::string _pathPrefix =
pathPrefix.empty() ? "AmfEventType" : pathPrefix;
return success;
}
bool AmfEventType::operator==(const AmfEventType& rhs) const {
return true; // TODO
}
void AmfEventType::validate() { bool AmfEventType::operator!=(const AmfEventType& rhs) const {
// TODO: implement validation return !(*this == rhs);
} }
void to_json(nlohmann::json& j, const AmfEventType& o) { void to_json(nlohmann::json& j, const AmfEventType& o) {
...@@ -31,6 +54,4 @@ void to_json(nlohmann::json& j, const AmfEventType& o) { ...@@ -31,6 +54,4 @@ void to_json(nlohmann::json& j, const AmfEventType& o) {
void from_json(const nlohmann::json& j, AmfEventType& o) {} void from_json(const nlohmann::json& j, AmfEventType& o) {}
} // namespace model } // namespace oai::amf::model
} // namespace amf
} // namespace oai
/** /**
* Namf_Communication * Namf_EventExposure
* AMF Communication Service © 2019, 3GPP Organizational Partners (ARIB, ATIS, * AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. * CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* *
* The version of the OpenAPI document: 1.1.0.alpha-1 * The version of the OpenAPI document: 1.1.0.alpha-1
...@@ -19,11 +19,10 @@ ...@@ -19,11 +19,10 @@
#ifndef AmfEventType_H_ #ifndef AmfEventType_H_
#define AmfEventType_H_ #define AmfEventType_H_
#include "AmfEventType_anyOf.h"
#include <nlohmann/json.hpp> #include <nlohmann/json.hpp>
namespace oai { namespace oai::amf::model {
namespace amf {
namespace model {
/// <summary> /// <summary>
/// ///
...@@ -31,9 +30,22 @@ namespace model { ...@@ -31,9 +30,22 @@ namespace model {
class AmfEventType { class AmfEventType {
public: public:
AmfEventType(); AmfEventType();
virtual ~AmfEventType(); virtual ~AmfEventType() = default;
void validate(); /// <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 AmfEventType& rhs) const;
bool operator!=(const AmfEventType& rhs) const;
///////////////////////////////////////////// /////////////////////////////////////////////
/// AmfEventType members /// AmfEventType members
...@@ -42,10 +54,11 @@ class AmfEventType { ...@@ -42,10 +54,11 @@ class AmfEventType {
friend void from_json(const nlohmann::json& j, AmfEventType& o); friend void from_json(const nlohmann::json& j, AmfEventType& o);
protected: protected:
// 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 model } // namespace oai::amf::model
} // namespace amf
} // namespace oai
#endif /* AmfEventType_H_ */ #endif /* AmfEventType_H_ */
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
#include "AmfEventType_anyOf.h"
#include "Helpers.h"
#include <stdexcept>
#include <sstream>
namespace oai::amf::model {
AmfEventType_anyOf::AmfEventType_anyOf() {}
void AmfEventType_anyOf::validate() const {
std::stringstream msg;
if (!validate(msg)) {
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool AmfEventType_anyOf::validate(std::stringstream& msg) const {
return validate(msg, "");
}
bool AmfEventType_anyOf::validate(
std::stringstream& msg, const std::string& pathPrefix) const {
bool success = true;
const std::string _pathPrefix =
pathPrefix.empty() ? "AmfEventType_anyOf" : pathPrefix;
if (m_value == AmfEventType_anyOf::eAmfEventType_anyOf::
INVALID_VALUE_OPENAPI_GENERATED) {
success = false;
msg << _pathPrefix << ": has no value;";
}
return success;
}
bool AmfEventType_anyOf::operator==(const AmfEventType_anyOf& rhs) const {
return getValue() == rhs.getValue()
;
}
bool AmfEventType_anyOf::operator!=(const AmfEventType_anyOf& rhs) const {
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const AmfEventType_anyOf& o) {
j = nlohmann::json();
switch (o.getValue()) {
case AmfEventType_anyOf::eAmfEventType_anyOf::
INVALID_VALUE_OPENAPI_GENERATED:
j = "INVALID_VALUE_OPENAPI_GENERATED";
break;
case AmfEventType_anyOf::eAmfEventType_anyOf::LOCATION_REPORT:
j = "LOCATION_REPORT";
break;
case AmfEventType_anyOf::eAmfEventType_anyOf::PRESENCE_IN_AOI_REPORT:
j = "PRESENCE_IN_AOI_REPORT";
break;
case AmfEventType_anyOf::eAmfEventType_anyOf::TIMEZONE_REPORT:
j = "TIMEZONE_REPORT";
break;
case AmfEventType_anyOf::eAmfEventType_anyOf::ACCESS_TYPE_REPORT:
j = "ACCESS_TYPE_REPORT";
break;
case AmfEventType_anyOf::eAmfEventType_anyOf::REGISTRATION_STATE_REPORT:
j = "REGISTRATION_STATE_REPORT";
break;
case AmfEventType_anyOf::eAmfEventType_anyOf::CONNECTIVITY_STATE_REPORT:
j = "CONNECTIVITY_STATE_REPORT";
break;
case AmfEventType_anyOf::eAmfEventType_anyOf::REACHABILITY_REPORT:
j = "REACHABILITY_REPORT";
break;
case AmfEventType_anyOf::eAmfEventType_anyOf::COMMUNICATION_FAILURE_REPORT:
j = "COMMUNICATION_FAILURE_REPORT";
break;
case AmfEventType_anyOf::eAmfEventType_anyOf::UES_IN_AREA_REPORT:
j = "UES_IN_AREA_REPORT";
break;
case AmfEventType_anyOf::eAmfEventType_anyOf::SUBSCRIPTION_ID_CHANGE:
j = "SUBSCRIPTION_ID_CHANGE";
break;
case AmfEventType_anyOf::eAmfEventType_anyOf::SUBSCRIPTION_ID_ADDITION:
j = "SUBSCRIPTION_ID_ADDITION";
break;
case AmfEventType_anyOf::eAmfEventType_anyOf::LOSS_OF_CONNECTIVITY:
j = "LOSS_OF_CONNECTIVITY";
break;
case AmfEventType_anyOf::eAmfEventType_anyOf::_5GS_USER_STATE_REPORT:
j = "5GS_USER_STATE_REPORT";
break;
}
}
void from_json(const nlohmann::json& j, AmfEventType_anyOf& o) {
auto s = j.get<std::string>();
if (s == "LOCATION_REPORT") {
o.setValue(AmfEventType_anyOf::eAmfEventType_anyOf::LOCATION_REPORT);
} else if (s == "PRESENCE_IN_AOI_REPORT") {
o.setValue(AmfEventType_anyOf::eAmfEventType_anyOf::PRESENCE_IN_AOI_REPORT);
} else if (s == "TIMEZONE_REPORT") {
o.setValue(AmfEventType_anyOf::eAmfEventType_anyOf::TIMEZONE_REPORT);
} else if (s == "ACCESS_TYPE_REPORT") {
o.setValue(AmfEventType_anyOf::eAmfEventType_anyOf::ACCESS_TYPE_REPORT);
} else if (s == "REGISTRATION_STATE_REPORT") {
o.setValue(
AmfEventType_anyOf::eAmfEventType_anyOf::REGISTRATION_STATE_REPORT);
} else if (s == "CONNECTIVITY_STATE_REPORT") {
o.setValue(
AmfEventType_anyOf::eAmfEventType_anyOf::CONNECTIVITY_STATE_REPORT);
} else if (s == "REACHABILITY_REPORT") {
o.setValue(AmfEventType_anyOf::eAmfEventType_anyOf::REACHABILITY_REPORT);
} else if (s == "COMMUNICATION_FAILURE_REPORT") {
o.setValue(
AmfEventType_anyOf::eAmfEventType_anyOf::COMMUNICATION_FAILURE_REPORT);
} else if (s == "UES_IN_AREA_REPORT") {
o.setValue(AmfEventType_anyOf::eAmfEventType_anyOf::UES_IN_AREA_REPORT);
} else if (s == "SUBSCRIPTION_ID_CHANGE") {
o.setValue(AmfEventType_anyOf::eAmfEventType_anyOf::SUBSCRIPTION_ID_CHANGE);
} else if (s == "SUBSCRIPTION_ID_ADDITION") {
o.setValue(
AmfEventType_anyOf::eAmfEventType_anyOf::SUBSCRIPTION_ID_ADDITION);
} else if (s == "LOSS_OF_CONNECTIVITY") {
o.setValue(AmfEventType_anyOf::eAmfEventType_anyOf::LOSS_OF_CONNECTIVITY);
} else if (s == "5GS_USER_STATE_REPORT") {
o.setValue(AmfEventType_anyOf::eAmfEventType_anyOf::_5GS_USER_STATE_REPORT);
} else {
std::stringstream ss;
ss << "Unexpected value " << s << " in json"
<< " cannot be converted to enum of type"
<< " AmfEventType_anyOf::eAmfEventType_anyOf";
throw std::invalid_argument(ss.str());
}
}
AmfEventType_anyOf::eAmfEventType_anyOf AmfEventType_anyOf::getValue() const {
return m_value;
}
void AmfEventType_anyOf::setValue(
AmfEventType_anyOf::eAmfEventType_anyOf value) {
m_value = value;
}
} // namespace oai::amf::model
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
/*
* AmfEventType_anyOf.h
*
*
*/
#ifndef AmfEventType_anyOf_H_
#define AmfEventType_anyOf_H_
#include <nlohmann/json.hpp>
namespace oai::amf::model {
/// <summary>
///
/// </summary>
class AmfEventType_anyOf {
public:
AmfEventType_anyOf();
virtual ~AmfEventType_anyOf() = default;
enum class eAmfEventType_anyOf {
// To have a valid default value.
// Avoiding nameclashes with user defined
// enum values
INVALID_VALUE_OPENAPI_GENERATED = 0,
LOCATION_REPORT,
PRESENCE_IN_AOI_REPORT,
TIMEZONE_REPORT,
ACCESS_TYPE_REPORT,
REGISTRATION_STATE_REPORT,
CONNECTIVITY_STATE_REPORT,
REACHABILITY_REPORT,
COMMUNICATION_FAILURE_REPORT,
UES_IN_AREA_REPORT,
SUBSCRIPTION_ID_CHANGE,
SUBSCRIPTION_ID_ADDITION,
LOSS_OF_CONNECTIVITY,
_5GS_USER_STATE_REPORT
};
/// <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 AmfEventType_anyOf& rhs) const;
bool operator!=(const AmfEventType_anyOf& rhs) const;
/////////////////////////////////////////////
/// AmfEventType_anyOf members
AmfEventType_anyOf::eAmfEventType_anyOf getValue() const;
void setValue(AmfEventType_anyOf::eAmfEventType_anyOf value);
friend void to_json(nlohmann::json& j, const AmfEventType_anyOf& o);
friend void from_json(const nlohmann::json& j, AmfEventType_anyOf& o);
protected:
AmfEventType_anyOf::eAmfEventType_anyOf m_value =
AmfEventType_anyOf::eAmfEventType_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
#endif /* AmfEventType_anyOf_H_ */
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
#include "AmfUpdateEventOptionItem.h"
#include "Helpers.h"
#include <sstream>
namespace oai::amf::model {
AmfUpdateEventOptionItem::AmfUpdateEventOptionItem() {
m_Op = "";
m_Path = "";
m_Value = "";
}
void AmfUpdateEventOptionItem::validate() const {
std::stringstream msg;
if (!validate(msg)) {
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool AmfUpdateEventOptionItem::validate(std::stringstream& msg) const {
return validate(msg, "");
}
bool AmfUpdateEventOptionItem::validate(
std::stringstream& msg, const std::string& pathPrefix) const {
bool success = true;
const std::string _pathPrefix =
pathPrefix.empty() ? "AmfUpdateEventOptionItem" : pathPrefix;
/* Path */ {
const std::string& value = m_Path;
const std::string currentValuePath = _pathPrefix + ".path";
}
return success;
}
bool AmfUpdateEventOptionItem::operator==(
const AmfUpdateEventOptionItem& rhs) const {
return
(getOp() == rhs.getOp()) &&
(getPath() == rhs.getPath()) &&
(getValue() == rhs.getValue())
;
}
bool AmfUpdateEventOptionItem::operator!=(
const AmfUpdateEventOptionItem& rhs) const {
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const AmfUpdateEventOptionItem& o) {
j = nlohmann::json();
j["op"] = o.m_Op;
j["path"] = o.m_Path;
j["value"] = o.m_Value;
}
void from_json(const nlohmann::json& j, AmfUpdateEventOptionItem& o) {
j.at("op").get_to(o.m_Op);
j.at("path").get_to(o.m_Path);
j.at("value").get_to(o.m_Value);
}
std::string AmfUpdateEventOptionItem::getOp() const {
return m_Op;
}
void AmfUpdateEventOptionItem::setOp(std::string const& value) {
m_Op = value;
}
std::string AmfUpdateEventOptionItem::getPath() const {
return m_Path;
}
void AmfUpdateEventOptionItem::setPath(std::string const& value) {
m_Path = value;
}
std::string AmfUpdateEventOptionItem::getValue() const {
return m_Value;
}
void AmfUpdateEventOptionItem::setValue(std::string const& value) {
m_Value = value;
}
} // namespace oai::amf::model
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
/*
* AmfUpdateEventOptionItem.h
*
*
*/
#ifndef AmfUpdateEventOptionItem_H_
#define AmfUpdateEventOptionItem_H_
#include <string>
#include <nlohmann/json.hpp>
namespace oai::amf::model {
/// <summary>
///
/// </summary>
class AmfUpdateEventOptionItem {
public:
AmfUpdateEventOptionItem();
virtual ~AmfUpdateEventOptionItem() = 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. Returns false on error and writes
/// an error message into the given stringstream.
/// </summary>
bool validate(std::stringstream& msg) const;
bool operator==(const AmfUpdateEventOptionItem& rhs) const;
bool operator!=(const AmfUpdateEventOptionItem& rhs) const;
/////////////////////////////////////////////
/// AmfUpdateEventOptionItem members
/// <summary>
///
/// </summary>
std::string getOp() const;
void setOp(std::string const& value);
/// <summary>
///
/// </summary>
std::string getPath() const;
void setPath(std::string const& value);
/// <summary>
///
/// </summary>
std::string getValue() const;
void setValue(std::string const& value);
friend void to_json(nlohmann::json& j, const AmfUpdateEventOptionItem& o);
friend void from_json(const nlohmann::json& j, AmfUpdateEventOptionItem& o);
protected:
std::string m_Op;
std::string m_Path;
std::string m_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
#endif /* AmfUpdateEventOptionItem_H_ */
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
#include "AmfUpdatedEventSubscription.h"
#include "Helpers.h"
#include <sstream>
namespace oai::amf::model {
AmfUpdatedEventSubscription::AmfUpdatedEventSubscription() {}
void AmfUpdatedEventSubscription::validate() const {
std::stringstream msg;
if (!validate(msg)) {
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool AmfUpdatedEventSubscription::validate(std::stringstream& msg) const {
return validate(msg, "");
}
bool AmfUpdatedEventSubscription::validate(
std::stringstream& msg, const std::string& pathPrefix) const {
bool success = true;
const std::string _pathPrefix =
pathPrefix.empty() ? "AmfUpdatedEventSubscription" : pathPrefix;
return success;
}
bool AmfUpdatedEventSubscription::operator==(
const AmfUpdatedEventSubscription& rhs) const {
return
(getSubscription() == rhs.getSubscription())
;
}
bool AmfUpdatedEventSubscription::operator!=(
const AmfUpdatedEventSubscription& rhs) const {
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const AmfUpdatedEventSubscription& o) {
j = nlohmann::json();
j["subscription"] = o.m_Subscription;
}
void from_json(const nlohmann::json& j, AmfUpdatedEventSubscription& o) {
j.at("subscription").get_to(o.m_Subscription);
}
AmfEventSubscription AmfUpdatedEventSubscription::getSubscription() const {
return m_Subscription;
}
void AmfUpdatedEventSubscription::setSubscription(
AmfEventSubscription const& value) {
m_Subscription = value;
}
} // namespace oai::amf::model
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
/*
* AmfUpdatedEventSubscription.h
*
*
*/
#ifndef AmfUpdatedEventSubscription_H_
#define AmfUpdatedEventSubscription_H_
#include "AmfEventSubscription.h"
#include <nlohmann/json.hpp>
namespace oai::amf::model {
/// <summary>
///
/// </summary>
class AmfUpdatedEventSubscription {
public:
AmfUpdatedEventSubscription();
virtual ~AmfUpdatedEventSubscription() = 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. Returns false on error and writes
/// an error message into the given stringstream.
/// </summary>
bool validate(std::stringstream& msg) const;
bool operator==(const AmfUpdatedEventSubscription& rhs) const;
bool operator!=(const AmfUpdatedEventSubscription& rhs) const;
/////////////////////////////////////////////
/// AmfUpdatedEventSubscription members
/// <summary>
///
/// </summary>
AmfEventSubscription getSubscription() const;
void setSubscription(AmfEventSubscription const& value);
friend void to_json(nlohmann::json& j, const AmfUpdatedEventSubscription& o);
friend void from_json(
const nlohmann::json& j, AmfUpdatedEventSubscription& o);
protected:
AmfEventSubscription m_Subscription;
// 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
#endif /* AmfUpdatedEventSubscription_H_ */
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
#include "CmInfo.h"
#include "Helpers.h"
#include <sstream>
namespace oai::amf::model {
CmInfo::CmInfo() {}
void CmInfo::validate() const {
std::stringstream msg;
if (!validate(msg)) {
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool CmInfo::validate(std::stringstream& msg) const {
return validate(msg, "");
}
bool CmInfo::validate(
std::stringstream& msg, const std::string& pathPrefix) const {
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "CmInfo" : pathPrefix;
return success;
}
bool CmInfo::operator==(const CmInfo& rhs) const {
return
(getCmState() == rhs.getCmState()) &&
(getAccessType() == rhs.getAccessType())
;
}
bool CmInfo::operator!=(const CmInfo& rhs) const {
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const CmInfo& o) {
j = nlohmann::json();
j["cmState"] = o.m_CmState;
j["accessType"] = o.m_AccessType;
}
void from_json(const nlohmann::json& j, CmInfo& o) {
j.at("cmState").get_to(o.m_CmState);
j.at("accessType").get_to(o.m_AccessType);
}
CmState CmInfo::getCmState() const {
return m_CmState;
}
void CmInfo::setCmState(CmState const& value) {
m_CmState = value;
}
AccessType CmInfo::getAccessType() const {
return m_AccessType;
}
void CmInfo::setAccessType(AccessType const& value) {
m_AccessType = value;
}
} // namespace oai::amf::model
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
/*
* CmInfo.h
*
*
*/
#ifndef CmInfo_H_
#define CmInfo_H_
#include "CmState.h"
#include "AccessType.h"
#include <nlohmann/json.hpp>
namespace oai::amf::model {
/// <summary>
///
/// </summary>
class CmInfo {
public:
CmInfo();
virtual ~CmInfo() = 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. Returns false on error and writes
/// an error message into the given stringstream.
/// </summary>
bool validate(std::stringstream& msg) const;
bool operator==(const CmInfo& rhs) const;
bool operator!=(const CmInfo& rhs) const;
/////////////////////////////////////////////
/// CmInfo members
/// <summary>
///
/// </summary>
CmState getCmState() const;
void setCmState(CmState const& value);
/// <summary>
///
/// </summary>
AccessType getAccessType() const;
void setAccessType(AccessType const& value);
friend void to_json(nlohmann::json& j, const CmInfo& o);
friend void from_json(const nlohmann::json& j, CmInfo& o);
// 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:
CmState m_CmState;
AccessType m_AccessType;
};
} // namespace oai::amf::model
#endif /* CmInfo_H_ */
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
#include "CmState.h"
#include "Helpers.h"
#include <sstream>
namespace oai::amf::model {
CmState::CmState() {}
void CmState::validate() const {
std::stringstream msg;
if (!validate(msg)) {
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool CmState::validate(std::stringstream& msg) const {
return validate(msg, "");
}
bool CmState::validate(
std::stringstream& msg, const std::string& pathPrefix) const {
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "CmState" : pathPrefix;
return success;
}
bool CmState::operator==(const CmState& rhs) const {
return true; // TODO
;
}
bool CmState::operator!=(const CmState& rhs) const {
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const CmState& o) {
j = nlohmann::json();
}
void from_json(const nlohmann::json& j, CmState& o) {}
} // namespace oai::amf::model
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
/*
* CmState.h
*
*
*/
#ifndef CmState_H_
#define CmState_H_
#include "CmState_anyOf.h"
#include <nlohmann/json.hpp>
namespace oai::amf::model {
/// <summary>
///
/// </summary>
class CmState {
public:
CmState();
virtual ~CmState() = 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. Returns false on error and writes
/// an error message into the given stringstream.
/// </summary>
bool validate(std::stringstream& msg) const;
bool operator==(const CmState& rhs) const;
bool operator!=(const CmState& rhs) const;
/////////////////////////////////////////////
/// CmState members
friend void to_json(nlohmann::json& j, const CmState& o);
friend void from_json(const nlohmann::json& j, CmState& o);
protected:
// 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
#endif /* CmState_H_ */
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
#include "CmState_anyOf.h"
#include "Helpers.h"
#include <stdexcept>
#include <sstream>
namespace oai::amf::model {
CmState_anyOf::CmState_anyOf() {}
void CmState_anyOf::validate() const {
std::stringstream msg;
if (!validate(msg)) {
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool CmState_anyOf::validate(std::stringstream& msg) const {
return validate(msg, "");
}
bool CmState_anyOf::validate(
std::stringstream& msg, const std::string& pathPrefix) const {
bool success = true;
const std::string _pathPrefix =
pathPrefix.empty() ? "CmState_anyOf" : pathPrefix;
if (m_value ==
CmState_anyOf::eCmState_anyOf::INVALID_VALUE_OPENAPI_GENERATED) {
success = false;
msg << _pathPrefix << ": has no value;";
}
return success;
}
bool CmState_anyOf::operator==(const CmState_anyOf& rhs) const {
return getValue() == rhs.getValue()
;
}
bool CmState_anyOf::operator!=(const CmState_anyOf& rhs) const {
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const CmState_anyOf& o) {
j = nlohmann::json();
switch (o.getValue()) {
case CmState_anyOf::eCmState_anyOf::INVALID_VALUE_OPENAPI_GENERATED:
j = "INVALID_VALUE_OPENAPI_GENERATED";
break;
case CmState_anyOf::eCmState_anyOf::IDLE:
j = "IDLE";
break;
case CmState_anyOf::eCmState_anyOf::CONNECTED:
j = "CONNECTED";
break;
}
}
void from_json(const nlohmann::json& j, CmState_anyOf& o) {
auto s = j.get<std::string>();
if (s == "IDLE") {
o.setValue(CmState_anyOf::eCmState_anyOf::IDLE);
} else if (s == "CONNECTED") {
o.setValue(CmState_anyOf::eCmState_anyOf::CONNECTED);
} else {
std::stringstream ss;
ss << "Unexpected value " << s << " in json"
<< " cannot be converted to enum of type"
<< " CmState_anyOf::eCmState_anyOf";
throw std::invalid_argument(ss.str());
}
}
CmState_anyOf::eCmState_anyOf CmState_anyOf::getValue() const {
return m_value;
}
void CmState_anyOf::setValue(CmState_anyOf::eCmState_anyOf value) {
m_value = value;
}
} // namespace oai::amf::model
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
/*
* CmState_anyOf.h
*
*
*/
#ifndef CmState_anyOf_H_
#define CmState_anyOf_H_
#include <nlohmann/json.hpp>
namespace oai::amf::model {
/// <summary>
///
/// </summary>
class CmState_anyOf {
public:
CmState_anyOf();
virtual ~CmState_anyOf() = default;
enum class eCmState_anyOf {
// To have a valid default value.
// Avoiding nameclashes with user defined
// enum values
INVALID_VALUE_OPENAPI_GENERATED = 0,
IDLE,
CONNECTED
};
/// <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 CmState_anyOf& rhs) const;
bool operator!=(const CmState_anyOf& rhs) const;
/////////////////////////////////////////////
/// CmState_anyOf members
CmState_anyOf::eCmState_anyOf getValue() const;
void setValue(CmState_anyOf::eCmState_anyOf value);
friend void to_json(nlohmann::json& j, const CmState_anyOf& o);
friend void from_json(const nlohmann::json& j, CmState_anyOf& o);
protected:
CmState_anyOf::eCmState_anyOf m_value =
CmState_anyOf::eCmState_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
#endif /* CmState_anyOf_H_ */
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
#include "CommunicationFailure.h"
#include "Helpers.h"
#include <sstream>
namespace oai::amf::model {
CommunicationFailure::CommunicationFailure() {
m_NasReleaseCode = "";
m_NasReleaseCodeIsSet = false;
m_RanReleaseCodeIsSet = false;
}
void CommunicationFailure::validate() const {
std::stringstream msg;
if (!validate(msg)) {
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool CommunicationFailure::validate(std::stringstream& msg) const {
return validate(msg, "");
}
bool CommunicationFailure::validate(
std::stringstream& msg, const std::string& pathPrefix) const {
bool success = true;
const std::string _pathPrefix =
pathPrefix.empty() ? "CommunicationFailure" : pathPrefix;
return success;
}
bool CommunicationFailure::operator==(const CommunicationFailure& rhs) const {
return
((!nasReleaseCodeIsSet() && !rhs.nasReleaseCodeIsSet()) ||
(nasReleaseCodeIsSet() && rhs.nasReleaseCodeIsSet() &&
getNasReleaseCode() == rhs.getNasReleaseCode())) &&
((!ranReleaseCodeIsSet() && !rhs.ranReleaseCodeIsSet()) ||
(ranReleaseCodeIsSet() && rhs.ranReleaseCodeIsSet() &&
getRanReleaseCode() == rhs.getRanReleaseCode()))
;
}
bool CommunicationFailure::operator!=(const CommunicationFailure& rhs) const {
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const CommunicationFailure& o) {
j = nlohmann::json();
if (o.nasReleaseCodeIsSet()) j["nasReleaseCode"] = o.m_NasReleaseCode;
if (o.ranReleaseCodeIsSet()) j["ranReleaseCode"] = o.m_RanReleaseCode;
}
void from_json(const nlohmann::json& j, CommunicationFailure& o) {
if (j.find("nasReleaseCode") != j.end()) {
j.at("nasReleaseCode").get_to(o.m_NasReleaseCode);
o.m_NasReleaseCodeIsSet = true;
}
if (j.find("ranReleaseCode") != j.end()) {
j.at("ranReleaseCode").get_to(o.m_RanReleaseCode);
o.m_RanReleaseCodeIsSet = true;
}
}
std::string CommunicationFailure::getNasReleaseCode() const {
return m_NasReleaseCode;
}
void CommunicationFailure::setNasReleaseCode(std::string const& value) {
m_NasReleaseCode = value;
m_NasReleaseCodeIsSet = true;
}
bool CommunicationFailure::nasReleaseCodeIsSet() const {
return m_NasReleaseCodeIsSet;
}
void CommunicationFailure::unsetNasReleaseCode() {
m_NasReleaseCodeIsSet = false;
}
NgApCause CommunicationFailure::getRanReleaseCode() const {
return m_RanReleaseCode;
}
void CommunicationFailure::setRanReleaseCode(NgApCause const& value) {
m_RanReleaseCode = value;
m_RanReleaseCodeIsSet = true;
}
bool CommunicationFailure::ranReleaseCodeIsSet() const {
return m_RanReleaseCodeIsSet;
}
void CommunicationFailure::unsetRanReleaseCode() {
m_RanReleaseCodeIsSet = false;
}
} // namespace oai::amf::model
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
/*
* CommunicationFailure.h
*
*
*/
#ifndef CommunicationFailure_H_
#define CommunicationFailure_H_
#include "NgApCause.h"
#include <string>
#include <nlohmann/json.hpp>
namespace oai::amf::model {
/// <summary>
///
/// </summary>
class CommunicationFailure {
public:
CommunicationFailure();
virtual ~CommunicationFailure() = 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. Returns false on error and writes
/// an error message into the given stringstream.
/// </summary>
bool validate(std::stringstream& msg) const;
bool operator==(const CommunicationFailure& rhs) const;
bool operator!=(const CommunicationFailure& rhs) const;
/////////////////////////////////////////////
/// CommunicationFailure members
/// <summary>
///
/// </summary>
std::string getNasReleaseCode() const;
void setNasReleaseCode(std::string const& value);
bool nasReleaseCodeIsSet() const;
void unsetNasReleaseCode();
/// <summary>
///
/// </summary>
NgApCause getRanReleaseCode() const;
void setRanReleaseCode(NgApCause const& value);
bool ranReleaseCodeIsSet() const;
void unsetRanReleaseCode();
friend void to_json(nlohmann::json& j, const CommunicationFailure& o);
friend void from_json(const nlohmann::json& j, CommunicationFailure& o);
protected:
std::string m_NasReleaseCode;
bool m_NasReleaseCodeIsSet;
NgApCause m_RanReleaseCode;
bool m_RanReleaseCodeIsSet;
// 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
#endif /* CommunicationFailure_H_ */
/** /**
* Namf_Communication * Namf_EventExposure
* AMF Communication Service © 2019, 3GPP Organizational Partners (ARIB, ATIS, * AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. * CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* *
* The version of the OpenAPI document: 1.1.0.alpha-1 * The version of the OpenAPI document: 1.1.0.alpha-1
...@@ -12,30 +12,78 @@ ...@@ -12,30 +12,78 @@
*/ */
#include "Ecgi.h" #include "Ecgi.h"
#include "Helpers.h"
namespace oai { #include <sstream>
namespace amf {
namespace model { namespace oai::amf::model {
Ecgi::Ecgi() { Ecgi::Ecgi() {
m_EutraCellId = ""; m_EutraCellId = "";
m_Nid = "";
m_NidIsSet = false;
}
void Ecgi::validate() const {
std::stringstream msg;
if (!validate(msg)) {
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool Ecgi::validate(std::stringstream& msg) const {
return validate(msg, "");
} }
Ecgi::~Ecgi() {} bool Ecgi::validate(
std::stringstream& msg, const std::string& pathPrefix) const {
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "Ecgi" : pathPrefix;
void Ecgi::validate() { /* EutraCellId */ {
// TODO: implement validation const std::string& value = m_EutraCellId;
const std::string currentValuePath = _pathPrefix + ".eutraCellId";
}
if (nidIsSet()) {
const std::string& value = m_Nid;
const std::string currentValuePath = _pathPrefix + ".nid";
}
return success;
}
bool Ecgi::operator==(const Ecgi& rhs) const {
return
(getPlmnId() == rhs.getPlmnId()) &&
(getEutraCellId() == rhs.getEutraCellId()) &&
((!nidIsSet() && !rhs.nidIsSet()) ||
(nidIsSet() && rhs.nidIsSet() && getNid() == rhs.getNid()))
;
}
bool Ecgi::operator!=(const Ecgi& rhs) const {
return !(*this == rhs);
} }
void to_json(nlohmann::json& j, const Ecgi& o) { void to_json(nlohmann::json& j, const Ecgi& o) {
j = nlohmann::json(); j = nlohmann::json();
j["plmnId"] = o.m_PlmnId; j["plmnId"] = o.m_PlmnId;
j["eutraCellId"] = o.m_EutraCellId; j["eutraCellId"] = o.m_EutraCellId;
if (o.nidIsSet()) j["nid"] = o.m_Nid;
} }
void from_json(const nlohmann::json& j, Ecgi& o) { void from_json(const nlohmann::json& j, Ecgi& o) {
j.at("plmnId").get_to(o.m_PlmnId); j.at("plmnId").get_to(o.m_PlmnId);
j.at("eutraCellId").get_to(o.m_EutraCellId); j.at("eutraCellId").get_to(o.m_EutraCellId);
if (j.find("nid") != j.end()) {
j.at("nid").get_to(o.m_Nid);
o.m_NidIsSet = true;
}
} }
PlmnId Ecgi::getPlmnId() const { PlmnId Ecgi::getPlmnId() const {
...@@ -50,7 +98,18 @@ std::string Ecgi::getEutraCellId() const { ...@@ -50,7 +98,18 @@ std::string Ecgi::getEutraCellId() const {
void Ecgi::setEutraCellId(std::string const& value) { void Ecgi::setEutraCellId(std::string const& value) {
m_EutraCellId = value; m_EutraCellId = value;
} }
std::string Ecgi::getNid() const {
return m_Nid;
}
void Ecgi::setNid(std::string const& value) {
m_Nid = value;
m_NidIsSet = true;
}
bool Ecgi::nidIsSet() const {
return m_NidIsSet;
}
void Ecgi::unsetNid() {
m_NidIsSet = false;
}
} // namespace model } // namespace oai::amf::model
} // namespace amf
} // namespace oai
/** /**
* Namf_Communication * Namf_EventExposure
* AMF Communication Service © 2019, 3GPP Organizational Partners (ARIB, ATIS, * AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. * CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* *
* The version of the OpenAPI document: 1.1.0.alpha-1 * The version of the OpenAPI document: 1.1.0.alpha-1
...@@ -23,9 +23,7 @@ ...@@ -23,9 +23,7 @@
#include "PlmnId.h" #include "PlmnId.h"
#include <nlohmann/json.hpp> #include <nlohmann/json.hpp>
namespace oai { namespace oai::amf::model {
namespace amf {
namespace model {
/// <summary> /// <summary>
/// ///
...@@ -33,9 +31,22 @@ namespace model { ...@@ -33,9 +31,22 @@ namespace model {
class Ecgi { class Ecgi {
public: public:
Ecgi(); Ecgi();
virtual ~Ecgi(); virtual ~Ecgi() = default;
void validate(); /// <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 Ecgi& rhs) const;
bool operator!=(const Ecgi& rhs) const;
///////////////////////////////////////////// /////////////////////////////////////////////
/// Ecgi members /// Ecgi members
...@@ -50,18 +61,30 @@ class Ecgi { ...@@ -50,18 +61,30 @@ class Ecgi {
/// </summary> /// </summary>
std::string getEutraCellId() const; std::string getEutraCellId() const;
void setEutraCellId(std::string const& value); void setEutraCellId(std::string const& value);
/// <summary>
///
/// </summary>
std::string getNid() const;
void setNid(std::string const& value);
bool nidIsSet() const;
void unsetNid();
friend void to_json(nlohmann::json& j, const Ecgi& o); friend void to_json(nlohmann::json& j, const Ecgi& o);
friend void from_json(const nlohmann::json& j, Ecgi& o); friend void from_json(const nlohmann::json& j, Ecgi& o);
// 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: protected:
PlmnId m_PlmnId; PlmnId m_PlmnId;
std::string m_EutraCellId; std::string m_EutraCellId;
std::string m_Nid;
bool m_NidIsSet;
}; };
} // namespace model } // namespace oai::amf::model
} // namespace amf
} // namespace oai
#endif /* Ecgi_H_ */ #endif /* Ecgi_H_ */
/** /**
* Namf_Communication * Namf_EventExposure
* AMF Communication Service © 2019, 3GPP Organizational Partners (ARIB, ATIS, * AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. * CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* *
* The version of the OpenAPI document: 1.1.0.alpha-1 * The version of the OpenAPI document: 1.1.0.alpha-1
...@@ -12,12 +12,15 @@ ...@@ -12,12 +12,15 @@
*/ */
#include "EutraLocation.h" #include "EutraLocation.h"
#include "Helpers.h"
namespace oai { #include <sstream>
namespace amf {
namespace model { namespace oai::amf::model {
EutraLocation::EutraLocation() { EutraLocation::EutraLocation() {
m_IgnoreEcgi = false;
m_IgnoreEcgiIsSet = false;
m_AgeOfLocationInformation = 0; m_AgeOfLocationInformation = 0;
m_AgeOfLocationInformationIsSet = false; m_AgeOfLocationInformationIsSet = false;
m_UeLocationTimestamp = ""; m_UeLocationTimestamp = "";
...@@ -27,18 +30,105 @@ EutraLocation::EutraLocation() { ...@@ -27,18 +30,105 @@ EutraLocation::EutraLocation() {
m_GeodeticInformation = ""; m_GeodeticInformation = "";
m_GeodeticInformationIsSet = false; m_GeodeticInformationIsSet = false;
m_GlobalNgenbIdIsSet = false; m_GlobalNgenbIdIsSet = false;
m_GlobalENbIdIsSet = false;
}
void EutraLocation::validate() const {
std::stringstream msg;
if (!validate(msg)) {
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool EutraLocation::validate(std::stringstream& msg) const {
return validate(msg, "");
} }
EutraLocation::~EutraLocation() {} bool EutraLocation::validate(
std::stringstream& msg, const std::string& pathPrefix) const {
bool success = true;
const std::string _pathPrefix =
pathPrefix.empty() ? "EutraLocation" : pathPrefix;
if (ageOfLocationInformationIsSet()) {
const int32_t& value = m_AgeOfLocationInformation;
const std::string currentValuePath =
_pathPrefix + ".ageOfLocationInformation";
if (value < 0) {
success = false;
msg << currentValuePath << ": must be greater than or equal to 0;";
}
if (value > 32767) {
success = false;
msg << currentValuePath << ": must be less than or equal to 32767;";
}
}
if (geographicalInformationIsSet()) {
const std::string& value = m_GeographicalInformation;
const std::string currentValuePath =
_pathPrefix + ".geographicalInformation";
}
if (geodeticInformationIsSet()) {
const std::string& value = m_GeodeticInformation;
const std::string currentValuePath = _pathPrefix + ".geodeticInformation";
}
void EutraLocation::validate() { return success;
// TODO: implement validation }
bool EutraLocation::operator==(const EutraLocation& rhs) const {
return
(getTai() == rhs.getTai()) &&
(getEcgi() == rhs.getEcgi()) &&
((!ignoreEcgiIsSet() && !rhs.ignoreEcgiIsSet()) ||
(ignoreEcgiIsSet() && rhs.ignoreEcgiIsSet() &&
isIgnoreEcgi() == rhs.isIgnoreEcgi())) &&
((!ageOfLocationInformationIsSet() &&
!rhs.ageOfLocationInformationIsSet()) ||
(ageOfLocationInformationIsSet() &&
rhs.ageOfLocationInformationIsSet() &&
getAgeOfLocationInformation() == rhs.getAgeOfLocationInformation())) &&
((!ueLocationTimestampIsSet() && !rhs.ueLocationTimestampIsSet()) ||
(ueLocationTimestampIsSet() && rhs.ueLocationTimestampIsSet() &&
getUeLocationTimestamp() == rhs.getUeLocationTimestamp())) &&
((!geographicalInformationIsSet() &&
!rhs.geographicalInformationIsSet()) ||
(geographicalInformationIsSet() && rhs.geographicalInformationIsSet() &&
getGeographicalInformation() == rhs.getGeographicalInformation())) &&
((!geodeticInformationIsSet() && !rhs.geodeticInformationIsSet()) ||
(geodeticInformationIsSet() && rhs.geodeticInformationIsSet() &&
getGeodeticInformation() == rhs.getGeodeticInformation())) &&
((!globalNgenbIdIsSet() && !rhs.globalNgenbIdIsSet()) ||
(globalNgenbIdIsSet() && rhs.globalNgenbIdIsSet() &&
getGlobalNgenbId() == rhs.getGlobalNgenbId())) &&
((!globalENbIdIsSet() && !rhs.globalENbIdIsSet()) ||
(globalENbIdIsSet() && rhs.globalENbIdIsSet() &&
getGlobalENbId() == rhs.getGlobalENbId()))
;
}
bool EutraLocation::operator!=(const EutraLocation& rhs) const {
return !(*this == rhs);
} }
void to_json(nlohmann::json& j, const EutraLocation& o) { void to_json(nlohmann::json& j, const EutraLocation& o) {
j = nlohmann::json(); j = nlohmann::json();
j["tai"] = o.m_Tai; j["tai"] = o.m_Tai;
j["ecgi"] = o.m_Ecgi; j["ecgi"] = o.m_Ecgi;
if (o.ignoreEcgiIsSet()) j["ignoreEcgi"] = o.m_IgnoreEcgi;
if (o.ageOfLocationInformationIsSet()) if (o.ageOfLocationInformationIsSet())
j["ageOfLocationInformation"] = o.m_AgeOfLocationInformation; j["ageOfLocationInformation"] = o.m_AgeOfLocationInformation;
if (o.ueLocationTimestampIsSet()) if (o.ueLocationTimestampIsSet())
...@@ -48,11 +138,16 @@ void to_json(nlohmann::json& j, const EutraLocation& o) { ...@@ -48,11 +138,16 @@ void to_json(nlohmann::json& j, const EutraLocation& o) {
if (o.geodeticInformationIsSet()) if (o.geodeticInformationIsSet())
j["geodeticInformation"] = o.m_GeodeticInformation; j["geodeticInformation"] = o.m_GeodeticInformation;
if (o.globalNgenbIdIsSet()) j["globalNgenbId"] = o.m_GlobalNgenbId; if (o.globalNgenbIdIsSet()) j["globalNgenbId"] = o.m_GlobalNgenbId;
if (o.globalENbIdIsSet()) j["globalENbId"] = o.m_GlobalENbId;
} }
void from_json(const nlohmann::json& j, EutraLocation& o) { void from_json(const nlohmann::json& j, EutraLocation& o) {
j.at("tai").get_to(o.m_Tai); j.at("tai").get_to(o.m_Tai);
j.at("ecgi").get_to(o.m_Ecgi); j.at("ecgi").get_to(o.m_Ecgi);
if (j.find("ignoreEcgi") != j.end()) {
j.at("ignoreEcgi").get_to(o.m_IgnoreEcgi);
o.m_IgnoreEcgiIsSet = true;
}
if (j.find("ageOfLocationInformation") != j.end()) { if (j.find("ageOfLocationInformation") != j.end()) {
j.at("ageOfLocationInformation").get_to(o.m_AgeOfLocationInformation); j.at("ageOfLocationInformation").get_to(o.m_AgeOfLocationInformation);
o.m_AgeOfLocationInformationIsSet = true; o.m_AgeOfLocationInformationIsSet = true;
...@@ -73,6 +168,10 @@ void from_json(const nlohmann::json& j, EutraLocation& o) { ...@@ -73,6 +168,10 @@ void from_json(const nlohmann::json& j, EutraLocation& o) {
j.at("globalNgenbId").get_to(o.m_GlobalNgenbId); j.at("globalNgenbId").get_to(o.m_GlobalNgenbId);
o.m_GlobalNgenbIdIsSet = true; o.m_GlobalNgenbIdIsSet = true;
} }
if (j.find("globalENbId") != j.end()) {
j.at("globalENbId").get_to(o.m_GlobalENbId);
o.m_GlobalENbIdIsSet = true;
}
} }
Tai EutraLocation::getTai() const { Tai EutraLocation::getTai() const {
...@@ -87,6 +186,19 @@ Ecgi EutraLocation::getEcgi() const { ...@@ -87,6 +186,19 @@ Ecgi EutraLocation::getEcgi() const {
void EutraLocation::setEcgi(Ecgi const& value) { void EutraLocation::setEcgi(Ecgi const& value) {
m_Ecgi = value; m_Ecgi = value;
} }
bool EutraLocation::isIgnoreEcgi() const {
return m_IgnoreEcgi;
}
void EutraLocation::setIgnoreEcgi(bool const value) {
m_IgnoreEcgi = value;
m_IgnoreEcgiIsSet = true;
}
bool EutraLocation::ignoreEcgiIsSet() const {
return m_IgnoreEcgiIsSet;
}
void EutraLocation::unsetIgnoreEcgi() {
m_IgnoreEcgiIsSet = false;
}
int32_t EutraLocation::getAgeOfLocationInformation() const { int32_t EutraLocation::getAgeOfLocationInformation() const {
return m_AgeOfLocationInformation; return m_AgeOfLocationInformation;
} }
...@@ -152,7 +264,18 @@ bool EutraLocation::globalNgenbIdIsSet() const { ...@@ -152,7 +264,18 @@ bool EutraLocation::globalNgenbIdIsSet() const {
void EutraLocation::unsetGlobalNgenbId() { void EutraLocation::unsetGlobalNgenbId() {
m_GlobalNgenbIdIsSet = false; m_GlobalNgenbIdIsSet = false;
} }
GlobalRanNodeId EutraLocation::getGlobalENbId() const {
return m_GlobalENbId;
}
void EutraLocation::setGlobalENbId(GlobalRanNodeId const& value) {
m_GlobalENbId = value;
m_GlobalENbIdIsSet = true;
}
bool EutraLocation::globalENbIdIsSet() const {
return m_GlobalENbIdIsSet;
}
void EutraLocation::unsetGlobalENbId() {
m_GlobalENbIdIsSet = false;
}
} // namespace model } // namespace oai::amf::model
} // namespace amf
} // namespace oai
/** /**
* Namf_Communication * Namf_EventExposure
* AMF Communication Service © 2019, 3GPP Organizational Partners (ARIB, ATIS, * AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. * CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* *
* The version of the OpenAPI document: 1.1.0.alpha-1 * The version of the OpenAPI document: 1.1.0.alpha-1
...@@ -25,9 +25,7 @@ ...@@ -25,9 +25,7 @@
#include "GlobalRanNodeId.h" #include "GlobalRanNodeId.h"
#include <nlohmann/json.hpp> #include <nlohmann/json.hpp>
namespace oai { namespace oai::amf::model {
namespace amf {
namespace model {
/// <summary> /// <summary>
/// ///
...@@ -35,9 +33,22 @@ namespace model { ...@@ -35,9 +33,22 @@ namespace model {
class EutraLocation { class EutraLocation {
public: public:
EutraLocation(); EutraLocation();
virtual ~EutraLocation(); virtual ~EutraLocation() = default;
void validate(); /// <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 EutraLocation& rhs) const;
bool operator!=(const EutraLocation& rhs) const;
///////////////////////////////////////////// /////////////////////////////////////////////
/// EutraLocation members /// EutraLocation members
...@@ -55,6 +66,13 @@ class EutraLocation { ...@@ -55,6 +66,13 @@ class EutraLocation {
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
bool isIgnoreEcgi() const;
void setIgnoreEcgi(bool const value);
bool ignoreEcgiIsSet() const;
void unsetIgnoreEcgi();
/// <summary>
///
/// </summary>
int32_t getAgeOfLocationInformation() const; int32_t getAgeOfLocationInformation() const;
void setAgeOfLocationInformation(int32_t const value); void setAgeOfLocationInformation(int32_t const value);
bool ageOfLocationInformationIsSet() const; bool ageOfLocationInformationIsSet() const;
...@@ -87,6 +105,13 @@ class EutraLocation { ...@@ -87,6 +105,13 @@ class EutraLocation {
void setGlobalNgenbId(GlobalRanNodeId const& value); void setGlobalNgenbId(GlobalRanNodeId const& value);
bool globalNgenbIdIsSet() const; bool globalNgenbIdIsSet() const;
void unsetGlobalNgenbId(); void unsetGlobalNgenbId();
/// <summary>
///
/// </summary>
GlobalRanNodeId getGlobalENbId() const;
void setGlobalENbId(GlobalRanNodeId const& value);
bool globalENbIdIsSet() const;
void unsetGlobalENbId();
friend void to_json(nlohmann::json& j, const EutraLocation& o); friend void to_json(nlohmann::json& j, const EutraLocation& o);
friend void from_json(const nlohmann::json& j, EutraLocation& o); friend void from_json(const nlohmann::json& j, EutraLocation& o);
...@@ -96,6 +121,8 @@ class EutraLocation { ...@@ -96,6 +121,8 @@ class EutraLocation {
Ecgi m_Ecgi; Ecgi m_Ecgi;
bool m_IgnoreEcgi;
bool m_IgnoreEcgiIsSet;
int32_t m_AgeOfLocationInformation; int32_t m_AgeOfLocationInformation;
bool m_AgeOfLocationInformationIsSet; bool m_AgeOfLocationInformationIsSet;
std::string m_UeLocationTimestamp; std::string m_UeLocationTimestamp;
...@@ -106,10 +133,14 @@ class EutraLocation { ...@@ -106,10 +133,14 @@ class EutraLocation {
bool m_GeodeticInformationIsSet; bool m_GeodeticInformationIsSet;
GlobalRanNodeId m_GlobalNgenbId; GlobalRanNodeId m_GlobalNgenbId;
bool m_GlobalNgenbIdIsSet; bool m_GlobalNgenbIdIsSet;
GlobalRanNodeId m_GlobalENbId;
bool m_GlobalENbIdIsSet;
// 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 model } // namespace oai::amf::model
} // namespace amf
} // namespace oai
#endif /* EutraLocation_H_ */ #endif /* EutraLocation_H_ */
/** /**
* Namf_Communication * Namf_EventExposure
* AMF Communication Service © 2019, 3GPP Organizational Partners (ARIB, ATIS, * AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. * CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* *
* The version of the OpenAPI document: 1.1.0.alpha-1 * The version of the OpenAPI document: 1.1.0.alpha-1
...@@ -12,20 +12,67 @@ ...@@ -12,20 +12,67 @@
*/ */
#include "GNbId.h" #include "GNbId.h"
#include "Helpers.h"
namespace oai { #include <sstream>
namespace amf {
namespace model { namespace oai::amf::model {
GNbId::GNbId() { GNbId::GNbId() {
m_BitLength = 0; m_BitLength = 0;
m_GNBValue = ""; m_GNBValue = "";
} }
GNbId::~GNbId() {} void GNbId::validate() const {
std::stringstream msg;
if (!validate(msg)) {
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool GNbId::validate(std::stringstream& msg) const {
return validate(msg, "");
}
bool GNbId::validate(
std::stringstream& msg, const std::string& pathPrefix) const {
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "GNbId" : pathPrefix;
/* BitLength */ {
const int32_t& value = m_BitLength;
const std::string currentValuePath = _pathPrefix + ".bitLength";
if (value < 22) {
success = false;
msg << currentValuePath << ": must be greater than or equal to 22;";
}
if (value > 32) {
success = false;
msg << currentValuePath << ": must be less than or equal to 32;";
}
}
/* GNBValue */ {
const std::string& value = m_GNBValue;
const std::string currentValuePath = _pathPrefix + ".gNBValue";
}
return success;
}
bool GNbId::operator==(const GNbId& rhs) const {
return
(getBitLength() == rhs.getBitLength()) &&
(getGNBValue() == rhs.getGNBValue())
;
}
void GNbId::validate() { bool GNbId::operator!=(const GNbId& rhs) const {
// TODO: implement validation return !(*this == rhs);
} }
void to_json(nlohmann::json& j, const GNbId& o) { void to_json(nlohmann::json& j, const GNbId& o) {
...@@ -52,6 +99,4 @@ void GNbId::setGNBValue(std::string const& value) { ...@@ -52,6 +99,4 @@ void GNbId::setGNBValue(std::string const& value) {
m_GNBValue = value; m_GNBValue = value;
} }
} // namespace model } // namespace oai::amf::model
} // namespace amf
} // namespace oai
/** /**
* Namf_Communication * Namf_EventExposure
* AMF Communication Service © 2019, 3GPP Organizational Partners (ARIB, ATIS, * AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. * CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* *
* The version of the OpenAPI document: 1.1.0.alpha-1 * The version of the OpenAPI document: 1.1.0.alpha-1
...@@ -22,9 +22,7 @@ ...@@ -22,9 +22,7 @@
#include <string> #include <string>
#include <nlohmann/json.hpp> #include <nlohmann/json.hpp>
namespace oai { namespace oai::amf::model {
namespace amf {
namespace model {
/// <summary> /// <summary>
/// ///
...@@ -32,9 +30,22 @@ namespace model { ...@@ -32,9 +30,22 @@ namespace model {
class GNbId { class GNbId {
public: public:
GNbId(); GNbId();
virtual ~GNbId(); virtual ~GNbId() = default;
void validate(); /// <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 GNbId& rhs) const;
bool operator!=(const GNbId& rhs) const;
///////////////////////////////////////////// /////////////////////////////////////////////
/// GNbId members /// GNbId members
...@@ -57,10 +68,12 @@ class GNbId { ...@@ -57,10 +68,12 @@ class GNbId {
int32_t m_BitLength; int32_t m_BitLength;
std::string m_GNBValue; std::string m_GNBValue;
// 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 model } // namespace oai::amf::model
} // namespace amf
} // namespace oai
#endif /* GNbId_H_ */ #endif /* GNbId_H_ */
/** /**
* Namf_Communication * Namf_EventExposure
* AMF Communication Service © 2019, 3GPP Organizational Partners (ARIB, ATIS, * AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. * CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* *
* The version of the OpenAPI document: 1.1.0.alpha-1 * The version of the OpenAPI document: 1.1.0.alpha-1
...@@ -12,25 +12,255 @@ ...@@ -12,25 +12,255 @@
*/ */
#include "GlobalRanNodeId.h" #include "GlobalRanNodeId.h"
#include "Helpers.h"
namespace oai { #include <sstream>
namespace amf {
namespace model {
GlobalRanNodeId::GlobalRanNodeId() {} namespace oai::amf::model {
GlobalRanNodeId::~GlobalRanNodeId() {} GlobalRanNodeId::GlobalRanNodeId() {
m_N3IwfId = "";
m_N3IwfIdIsSet = false;
m_GNbIdIsSet = false;
m_NgeNbId = "";
m_NgeNbIdIsSet = false;
m_WagfId = "";
m_WagfIdIsSet = false;
m_TngfId = "";
m_TngfIdIsSet = false;
m_Nid = "";
m_NidIsSet = false;
m_ENbId = "";
m_ENbIdIsSet = false;
}
void GlobalRanNodeId::validate() const {
std::stringstream msg;
if (!validate(msg)) {
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
void GlobalRanNodeId::validate() { bool GlobalRanNodeId::validate(std::stringstream& msg) const {
// TODO: implement validation return validate(msg, "");
}
bool GlobalRanNodeId::validate(
std::stringstream& msg, const std::string& pathPrefix) const {
bool success = true;
const std::string _pathPrefix =
pathPrefix.empty() ? "GlobalRanNodeId" : pathPrefix;
if (n3IwfIdIsSet()) {
const std::string& value = m_N3IwfId;
const std::string currentValuePath = _pathPrefix + ".n3IwfId";
}
if (ngeNbIdIsSet()) {
const std::string& value = m_NgeNbId;
const std::string currentValuePath = _pathPrefix + ".ngeNbId";
}
if (wagfIdIsSet()) {
const std::string& value = m_WagfId;
const std::string currentValuePath = _pathPrefix + ".wagfId";
}
if (tngfIdIsSet()) {
const std::string& value = m_TngfId;
const std::string currentValuePath = _pathPrefix + ".tngfId";
}
if (nidIsSet()) {
const std::string& value = m_Nid;
const std::string currentValuePath = _pathPrefix + ".nid";
}
if (eNbIdIsSet()) {
const std::string& value = m_ENbId;
const std::string currentValuePath = _pathPrefix + ".eNbId";
}
return success;
}
bool GlobalRanNodeId::operator==(const GlobalRanNodeId& rhs) const {
return
(getPlmnId() == rhs.getPlmnId()) &&
((!n3IwfIdIsSet() && !rhs.n3IwfIdIsSet()) ||
(n3IwfIdIsSet() && rhs.n3IwfIdIsSet() &&
getN3IwfId() == rhs.getN3IwfId())) &&
((!gNbIdIsSet() && !rhs.gNbIdIsSet()) ||
(gNbIdIsSet() && rhs.gNbIdIsSet() && getGNbId() == rhs.getGNbId())) &&
((!ngeNbIdIsSet() && !rhs.ngeNbIdIsSet()) ||
(ngeNbIdIsSet() && rhs.ngeNbIdIsSet() &&
getNgeNbId() == rhs.getNgeNbId())) &&
((!wagfIdIsSet() && !rhs.wagfIdIsSet()) ||
(wagfIdIsSet() && rhs.wagfIdIsSet() &&
getWagfId() == rhs.getWagfId())) &&
((!tngfIdIsSet() && !rhs.tngfIdIsSet()) ||
(tngfIdIsSet() && rhs.tngfIdIsSet() &&
getTngfId() == rhs.getTngfId())) &&
((!nidIsSet() && !rhs.nidIsSet()) ||
(nidIsSet() && rhs.nidIsSet() && getNid() == rhs.getNid())) &&
((!eNbIdIsSet() && !rhs.eNbIdIsSet()) ||
(eNbIdIsSet() && rhs.eNbIdIsSet() && getENbId() == rhs.getENbId()))
;
}
bool GlobalRanNodeId::operator!=(const GlobalRanNodeId& rhs) const {
return !(*this == rhs);
} }
void to_json(nlohmann::json& j, const GlobalRanNodeId& o) { void to_json(nlohmann::json& j, const GlobalRanNodeId& o) {
j = nlohmann::json(); j = nlohmann::json();
j["plmnId"] = o.m_PlmnId;
if (o.n3IwfIdIsSet()) j["n3IwfId"] = o.m_N3IwfId;
if (o.gNbIdIsSet()) j["gNbId"] = o.m_GNbId;
if (o.ngeNbIdIsSet()) j["ngeNbId"] = o.m_NgeNbId;
if (o.wagfIdIsSet()) j["wagfId"] = o.m_WagfId;
if (o.tngfIdIsSet()) j["tngfId"] = o.m_TngfId;
if (o.nidIsSet()) j["nid"] = o.m_Nid;
if (o.eNbIdIsSet()) j["eNbId"] = o.m_ENbId;
} }
void from_json(const nlohmann::json& j, GlobalRanNodeId& o) {} void from_json(const nlohmann::json& j, GlobalRanNodeId& o) {
j.at("plmnId").get_to(o.m_PlmnId);
if (j.find("n3IwfId") != j.end()) {
j.at("n3IwfId").get_to(o.m_N3IwfId);
o.m_N3IwfIdIsSet = true;
}
if (j.find("gNbId") != j.end()) {
j.at("gNbId").get_to(o.m_GNbId);
o.m_GNbIdIsSet = true;
}
if (j.find("ngeNbId") != j.end()) {
j.at("ngeNbId").get_to(o.m_NgeNbId);
o.m_NgeNbIdIsSet = true;
}
if (j.find("wagfId") != j.end()) {
j.at("wagfId").get_to(o.m_WagfId);
o.m_WagfIdIsSet = true;
}
if (j.find("tngfId") != j.end()) {
j.at("tngfId").get_to(o.m_TngfId);
o.m_TngfIdIsSet = true;
}
if (j.find("nid") != j.end()) {
j.at("nid").get_to(o.m_Nid);
o.m_NidIsSet = true;
}
if (j.find("eNbId") != j.end()) {
j.at("eNbId").get_to(o.m_ENbId);
o.m_ENbIdIsSet = true;
}
}
PlmnId GlobalRanNodeId::getPlmnId() const {
return m_PlmnId;
}
void GlobalRanNodeId::setPlmnId(PlmnId const& value) {
m_PlmnId = value;
}
std::string GlobalRanNodeId::getN3IwfId() const {
return m_N3IwfId;
}
void GlobalRanNodeId::setN3IwfId(std::string const& value) {
m_N3IwfId = value;
m_N3IwfIdIsSet = true;
}
bool GlobalRanNodeId::n3IwfIdIsSet() const {
return m_N3IwfIdIsSet;
}
void GlobalRanNodeId::unsetN3IwfId() {
m_N3IwfIdIsSet = false;
}
GNbId GlobalRanNodeId::getGNbId() const {
return m_GNbId;
}
void GlobalRanNodeId::setGNbId(GNbId const& value) {
m_GNbId = value;
m_GNbIdIsSet = true;
}
bool GlobalRanNodeId::gNbIdIsSet() const {
return m_GNbIdIsSet;
}
void GlobalRanNodeId::unsetGNbId() {
m_GNbIdIsSet = false;
}
std::string GlobalRanNodeId::getNgeNbId() const {
return m_NgeNbId;
}
void GlobalRanNodeId::setNgeNbId(std::string const& value) {
m_NgeNbId = value;
m_NgeNbIdIsSet = true;
}
bool GlobalRanNodeId::ngeNbIdIsSet() const {
return m_NgeNbIdIsSet;
}
void GlobalRanNodeId::unsetNgeNbId() {
m_NgeNbIdIsSet = false;
}
std::string GlobalRanNodeId::getWagfId() const {
return m_WagfId;
}
void GlobalRanNodeId::setWagfId(std::string const& value) {
m_WagfId = value;
m_WagfIdIsSet = true;
}
bool GlobalRanNodeId::wagfIdIsSet() const {
return m_WagfIdIsSet;
}
void GlobalRanNodeId::unsetWagfId() {
m_WagfIdIsSet = false;
}
std::string GlobalRanNodeId::getTngfId() const {
return m_TngfId;
}
void GlobalRanNodeId::setTngfId(std::string const& value) {
m_TngfId = value;
m_TngfIdIsSet = true;
}
bool GlobalRanNodeId::tngfIdIsSet() const {
return m_TngfIdIsSet;
}
void GlobalRanNodeId::unsetTngfId() {
m_TngfIdIsSet = false;
}
std::string GlobalRanNodeId::getNid() const {
return m_Nid;
}
void GlobalRanNodeId::setNid(std::string const& value) {
m_Nid = value;
m_NidIsSet = true;
}
bool GlobalRanNodeId::nidIsSet() const {
return m_NidIsSet;
}
void GlobalRanNodeId::unsetNid() {
m_NidIsSet = false;
}
std::string GlobalRanNodeId::getENbId() const {
return m_ENbId;
}
void GlobalRanNodeId::setENbId(std::string const& value) {
m_ENbId = value;
m_ENbIdIsSet = true;
}
bool GlobalRanNodeId::eNbIdIsSet() const {
return m_ENbIdIsSet;
}
void GlobalRanNodeId::unsetENbId() {
m_ENbIdIsSet = false;
}
} // namespace model } // namespace oai::amf::model
} // namespace amf
} // namespace oai
/** /**
* Namf_Communication * Namf_EventExposure
* AMF Communication Service © 2019, 3GPP Organizational Partners (ARIB, ATIS, * AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. * CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* *
* The version of the OpenAPI document: 1.1.0.alpha-1 * The version of the OpenAPI document: 1.1.0.alpha-1
...@@ -19,11 +19,12 @@ ...@@ -19,11 +19,12 @@
#ifndef GlobalRanNodeId_H_ #ifndef GlobalRanNodeId_H_
#define GlobalRanNodeId_H_ #define GlobalRanNodeId_H_
#include <string>
#include "GNbId.h"
#include "PlmnId.h"
#include <nlohmann/json.hpp> #include <nlohmann/json.hpp>
namespace oai { namespace oai::amf::model {
namespace amf {
namespace model {
/// <summary> /// <summary>
/// ///
...@@ -31,21 +32,107 @@ namespace model { ...@@ -31,21 +32,107 @@ namespace model {
class GlobalRanNodeId { class GlobalRanNodeId {
public: public:
GlobalRanNodeId(); GlobalRanNodeId();
virtual ~GlobalRanNodeId(); virtual ~GlobalRanNodeId() = default;
void validate(); /// <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 GlobalRanNodeId& rhs) const;
bool operator!=(const GlobalRanNodeId& rhs) const;
///////////////////////////////////////////// /////////////////////////////////////////////
/// GlobalRanNodeId members /// GlobalRanNodeId members
/// <summary>
///
/// </summary>
PlmnId getPlmnId() const;
void setPlmnId(PlmnId const& value);
/// <summary>
///
/// </summary>
std::string getN3IwfId() const;
void setN3IwfId(std::string const& value);
bool n3IwfIdIsSet() const;
void unsetN3IwfId();
/// <summary>
///
/// </summary>
GNbId getGNbId() const;
void setGNbId(GNbId const& value);
bool gNbIdIsSet() const;
void unsetGNbId();
/// <summary>
///
/// </summary>
std::string getNgeNbId() const;
void setNgeNbId(std::string const& value);
bool ngeNbIdIsSet() const;
void unsetNgeNbId();
/// <summary>
///
/// </summary>
std::string getWagfId() const;
void setWagfId(std::string const& value);
bool wagfIdIsSet() const;
void unsetWagfId();
/// <summary>
///
/// </summary>
std::string getTngfId() const;
void setTngfId(std::string const& value);
bool tngfIdIsSet() const;
void unsetTngfId();
/// <summary>
///
/// </summary>
std::string getNid() const;
void setNid(std::string const& value);
bool nidIsSet() const;
void unsetNid();
/// <summary>
///
/// </summary>
std::string getENbId() const;
void setENbId(std::string const& value);
bool eNbIdIsSet() const;
void unsetENbId();
friend void to_json(nlohmann::json& j, const GlobalRanNodeId& o); friend void to_json(nlohmann::json& j, const GlobalRanNodeId& o);
friend void from_json(const nlohmann::json& j, GlobalRanNodeId& o); friend void from_json(const nlohmann::json& j, GlobalRanNodeId& o);
// 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: protected:
PlmnId m_PlmnId;
std::string m_N3IwfId;
bool m_N3IwfIdIsSet;
GNbId m_GNbId;
bool m_GNbIdIsSet;
std::string m_NgeNbId;
bool m_NgeNbIdIsSet;
std::string m_WagfId;
bool m_WagfIdIsSet;
std::string m_TngfId;
bool m_TngfIdIsSet;
std::string m_Nid;
bool m_NidIsSet;
std::string m_ENbId;
bool m_ENbIdIsSet;
}; };
} // namespace model } // namespace oai::amf::model
} // namespace amf
} // namespace oai
#endif /* GlobalRanNodeId_H_ */ #endif /* GlobalRanNodeId_H_ */
/** /**
* Namf_Communication * Namf_EventExposure
* AMF Communication Service © 2019, 3GPP Organizational Partners (ARIB, ATIS, * AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. * CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* *
* The version of the OpenAPI document: 1.1.0.alpha-1 * The version of the OpenAPI document: 1.1.0.alpha-1
...@@ -12,19 +12,52 @@ ...@@ -12,19 +12,52 @@
*/ */
#include "Guami.h" #include "Guami.h"
#include "Helpers.h"
namespace oai { #include <sstream>
namespace amf {
namespace model { namespace oai::amf::model {
Guami::Guami() { Guami::Guami() {
m_AmfId = ""; m_AmfId = "";
} }
Guami::~Guami() {} void Guami::validate() const {
std::stringstream msg;
if (!validate(msg)) {
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool Guami::validate(std::stringstream& msg) const {
return validate(msg, "");
}
bool Guami::validate(
std::stringstream& msg, const std::string& pathPrefix) const {
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "Guami" : pathPrefix;
/* AmfId */ {
const std::string& value = m_AmfId;
const std::string currentValuePath = _pathPrefix + ".amfId";
}
return success;
}
bool Guami::operator==(const Guami& rhs) const {
return
(getPlmnId() == rhs.getPlmnId()) &&
(getAmfId() == rhs.getAmfId())
;
}
void Guami::validate() { bool Guami::operator!=(const Guami& rhs) const {
// TODO: implement validation return !(*this == rhs);
} }
void to_json(nlohmann::json& j, const Guami& o) { void to_json(nlohmann::json& j, const Guami& o) {
...@@ -38,10 +71,10 @@ void from_json(const nlohmann::json& j, Guami& o) { ...@@ -38,10 +71,10 @@ void from_json(const nlohmann::json& j, Guami& o) {
j.at("amfId").get_to(o.m_AmfId); j.at("amfId").get_to(o.m_AmfId);
} }
PlmnId Guami::getPlmnId() const { PlmnIdNid Guami::getPlmnId() const {
return m_PlmnId; return m_PlmnId;
} }
void Guami::setPlmnId(PlmnId const& value) { void Guami::setPlmnId(PlmnIdNid const& value) {
m_PlmnId = value; m_PlmnId = value;
} }
std::string Guami::getAmfId() const { std::string Guami::getAmfId() const {
...@@ -51,6 +84,4 @@ void Guami::setAmfId(std::string const& value) { ...@@ -51,6 +84,4 @@ void Guami::setAmfId(std::string const& value) {
m_AmfId = value; m_AmfId = value;
} }
} // namespace model } // namespace oai::amf::model
} // namespace amf
} // namespace oai
/** /**
* Namf_Communication * Namf_EventExposure
* AMF Communication Service © 2019, 3GPP Organizational Partners (ARIB, ATIS, * AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. * CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* *
* The version of the OpenAPI document: 1.1.0.alpha-1 * The version of the OpenAPI document: 1.1.0.alpha-1
...@@ -19,13 +19,11 @@ ...@@ -19,13 +19,11 @@
#ifndef Guami_H_ #ifndef Guami_H_
#define Guami_H_ #define Guami_H_
#include "PlmnIdNid.h"
#include <string> #include <string>
#include "PlmnId.h"
#include <nlohmann/json.hpp> #include <nlohmann/json.hpp>
namespace oai { namespace oai::amf::model {
namespace amf {
namespace model {
/// <summary> /// <summary>
/// ///
...@@ -33,9 +31,22 @@ namespace model { ...@@ -33,9 +31,22 @@ namespace model {
class Guami { class Guami {
public: public:
Guami(); Guami();
virtual ~Guami(); virtual ~Guami() = default;
void validate(); /// <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 Guami& rhs) const;
bool operator!=(const Guami& rhs) const;
///////////////////////////////////////////// /////////////////////////////////////////////
/// Guami members /// Guami members
...@@ -43,8 +54,8 @@ class Guami { ...@@ -43,8 +54,8 @@ class Guami {
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
PlmnId getPlmnId() const; PlmnIdNid getPlmnId() const;
void setPlmnId(PlmnId const& value); void setPlmnId(PlmnIdNid const& value);
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
...@@ -55,13 +66,15 @@ class Guami { ...@@ -55,13 +66,15 @@ class Guami {
friend void from_json(const nlohmann::json& j, Guami& o); friend void from_json(const nlohmann::json& j, Guami& o);
protected: protected:
PlmnId m_PlmnId; PlmnIdNid m_PlmnId;
std::string m_AmfId; std::string m_AmfId;
// 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 model } // namespace oai::amf::model
} // namespace amf
} // namespace oai
#endif /* Guami_H_ */ #endif /* Guami_H_ */
/** /**
* Namf_Communication * Namf_EventExposure
* AMF Communication Service © 2019, 3GPP Organizational Partners (ARIB, ATIS, * AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. * CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* *
* The version of the OpenAPI document: 1.1.0.alpha-1 * The version of the OpenAPI document: 1.1.0.alpha-1
...@@ -11,33 +11,75 @@ ...@@ -11,33 +11,75 @@
* the class manually. * the class manually.
*/ */
#include "Helpers.h" #include "Helpers.h"
#include <regex>
namespace org { namespace org::openapitools::server::helpers {
namespace openapitools {
namespace server { const std::regex regexRfc3339_date(R"(^(\d{4})\-(\d{2})\-(\d{2})$)");
namespace helpers { const std::regex regexRfc3339_date_time(
R"(^(\d{4})\-(\d{2})\-(\d{2})[Tt](\d{2}):(\d{2}):(\d{2})(\.\d+)?([Zz]|([\+\-])(\d{2}):(\d{2}))$)");
namespace {
// Determine if given year is a leap year
// See RFC 3339, Appendix C https://tools.ietf.org/html/rfc3339#appendix-C
bool isLeapYear(const uint16_t year) {
return (year % 4 == 0) && ((year % 100 != 0) || (year % 400 == 0));
}
bool validateDateValues(
const uint16_t year, const uint16_t month, const uint16_t day) {
return !(
(month == 0 || month > 12) || (day == 0) ||
(month == 2 && day > (28 + (isLeapYear(year) ? 1 : 0))) ||
(month <= 7 && day > (30 + month % 2)) ||
(month >= 8 && day > (31 - month % 2)));
}
bool validateTimeValues(
const uint16_t hours, const uint16_t minutes, const uint16_t seconds) {
return (hours <= 23) && (minutes <= 59) && (seconds <= 60);
}
} // namespace
bool validateRfc3339_date(const std::string& str) {
std::smatch match;
const bool found = std::regex_search(str, match, regexRfc3339_date);
return found &&
validateDateValues(
std::stoi(match[1]), std::stoi(match[2]), std::stoi(match[3]));
}
bool validateRfc3339_date_time(const std::string& str) {
std::smatch match;
const bool found = std::regex_search(str, match, regexRfc3339_date_time);
return found &&
validateDateValues(
std::stoi(match[1]), std::stoi(match[2]), std::stoi(match[3])) &&
validateTimeValues(
std::stoi(match[4]), std::stoi(match[5]), std::stoi(match[6]));
}
std::string toStringValue(const std::string& value) { std::string toStringValue(const std::string& value) {
return std::string(value); return std::string(value);
} }
std::string toStringValue(const int32_t& value) { std::string toStringValue(const int32_t value) {
return std::to_string(value); return std::to_string(value);
} }
std::string toStringValue(const int64_t& value) { std::string toStringValue(const int64_t value) {
return std::to_string(value); return std::to_string(value);
} }
std::string toStringValue(const bool& value) { std::string toStringValue(const bool value) {
return value ? std::string("true") : std::string("false"); return value ? std::string("true") : std::string("false");
} }
std::string toStringValue(const float& value) { std::string toStringValue(const float value) {
return std::to_string(value); return std::to_string(value);
} }
std::string toStringValue(const double& value) { std::string toStringValue(const double value) {
return std::to_string(value); return std::to_string(value);
} }
...@@ -65,10 +107,15 @@ bool fromStringValue(const std::string& inStr, int64_t& value) { ...@@ -65,10 +107,15 @@ bool fromStringValue(const std::string& inStr, int64_t& value) {
} }
bool fromStringValue(const std::string& inStr, bool& value) { bool fromStringValue(const std::string& inStr, bool& value) {
bool result = true; if (inStr == "true") {
inStr == "true" ? value = true : value = true;
inStr == "false" ? value = false : result = false; return true;
return result; }
if (inStr == "false") {
value = false;
return true;
}
return false;
} }
bool fromStringValue(const std::string& inStr, float& value) { bool fromStringValue(const std::string& inStr, float& value) {
...@@ -89,7 +136,4 @@ bool fromStringValue(const std::string& inStr, double& value) { ...@@ -89,7 +136,4 @@ bool fromStringValue(const std::string& inStr, double& value) {
return true; return true;
} }
} // namespace helpers } // namespace org::openapitools::server::helpers
} // namespace server
} // namespace openapitools
} // namespace org
/** /**
* Namf_Communication * Namf_EventExposure
* AMF Communication Service © 2019, 3GPP Organizational Partners (ARIB, ATIS, * AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. * CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* *
* The version of the OpenAPI document: 1.1.0.alpha-1 * The version of the OpenAPI document: 1.1.0.alpha-1
...@@ -25,17 +25,74 @@ ...@@ -25,17 +25,74 @@
#include <vector> #include <vector>
#include <map> #include <map>
namespace org { namespace org::openapitools::server::helpers {
namespace openapitools {
namespace server { class ValidationException : public std::runtime_error {
namespace helpers { public:
explicit ValidationException(const std::string& what)
: std::runtime_error(what) {}
~ValidationException() override = default;
};
/// <summary>
/// Validate a string against the full-date definition of RFC 3339, section 5.6.
/// </summary>
bool validateRfc3339_date(const std::string& str);
/// <summary>
/// Validate a string against the date-time definition of RFC 3339, section 5.6.
/// </summary>
bool validateRfc3339_date_time(const std::string& str);
namespace sfinae_helpers {
struct NoType {};
template<typename T1, typename T2>
NoType operator==(const T1&, const T2&);
template<typename T1, typename T2>
class EqualsOperatorAvailable {
public:
enum {
value = !std::is_same<
decltype(std::declval<T1>() == std::declval<T2>()), NoType>::value
};
};
} // namespace sfinae_helpers
/// <summary>
/// Determine if the given vector<T> only has unique elements. T must provide
/// the == operator.
/// </summary>
template<typename T>
bool hasOnlyUniqueItems(const std::vector<T>& vec) {
static_assert(
sfinae_helpers::EqualsOperatorAvailable<T, T>::value,
"hasOnlyUniqueItems<T> cannot be called, passed template type does not "
"provide == operator.");
if (vec.size() <= 1) {
return true;
}
// Compare every element of vec to every other element of vec.
// This isn't an elegant way to do this, since it's O(n^2),
// but it's the best solution working only with the == operator.
// This could be greatly improved if our models provided a valid hash
// and/or the < operator
for (size_t i = 0; i < vec.size() - 1; i++) {
for (size_t j = i + 1; j < vec.size(); j++) {
if (vec[i] == vec[j]) {
return false;
}
}
}
return true;
}
std::string toStringValue(const std::string& value); std::string toStringValue(const std::string& value);
std::string toStringValue(const int32_t& value); std::string toStringValue(const int32_t value);
std::string toStringValue(const int64_t& value); std::string toStringValue(const int64_t value);
std::string toStringValue(const bool& value); std::string toStringValue(const bool value);
std::string toStringValue(const float& value); std::string toStringValue(const float value);
std::string toStringValue(const double& value); std::string toStringValue(const double value);
bool fromStringValue(const std::string& inStr, std::string& value); bool fromStringValue(const std::string& inStr, std::string& value);
bool fromStringValue(const std::string& inStr, int32_t& value); bool fromStringValue(const std::string& inStr, int32_t& value);
...@@ -70,9 +127,6 @@ bool fromStringValue( ...@@ -70,9 +127,6 @@ bool fromStringValue(
return fromStringValue(inStrings, value); return fromStringValue(inStrings, value);
} }
} // namespace helpers } // namespace org::openapitools::server::helpers
} // namespace server
} // namespace openapitools
} // namespace org
#endif // Helpers_H_ #endif // Helpers_H_
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
#include "HfcNodeId.h"
#include "Helpers.h"
#include <sstream>
namespace oai::amf::model {
HfcNodeId::HfcNodeId() {
m_HfcNId = "";
}
void HfcNodeId::validate() const {
std::stringstream msg;
if (!validate(msg)) {
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool HfcNodeId::validate(std::stringstream& msg) const {
return validate(msg, "");
}
bool HfcNodeId::validate(
std::stringstream& msg, const std::string& pathPrefix) const {
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "HfcNodeId" : pathPrefix;
/* HfcNId */ {
const std::string& value = m_HfcNId;
const std::string currentValuePath = _pathPrefix + ".hfcNId";
if (value.length() > 6) {
success = false;
msg << currentValuePath << ": must be at most 6 characters long;";
}
}
return success;
}
bool HfcNodeId::operator==(const HfcNodeId& rhs) const {
return
(getHfcNId() == rhs.getHfcNId())
;
}
bool HfcNodeId::operator!=(const HfcNodeId& rhs) const {
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const HfcNodeId& o) {
j = nlohmann::json();
j["hfcNId"] = o.m_HfcNId;
}
void from_json(const nlohmann::json& j, HfcNodeId& o) {
j.at("hfcNId").get_to(o.m_HfcNId);
}
std::string HfcNodeId::getHfcNId() const {
return m_HfcNId;
}
void HfcNodeId::setHfcNId(std::string const& value) {
m_HfcNId = value;
}
} // namespace oai::amf::model
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
/*
* HfcNodeId.h
*
*
*/
#ifndef HfcNodeId_H_
#define HfcNodeId_H_
#include <string>
#include <nlohmann/json.hpp>
namespace oai::amf::model {
/// <summary>
///
/// </summary>
class HfcNodeId {
public:
HfcNodeId();
virtual ~HfcNodeId() = 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. Returns false on error and writes
/// an error message into the given stringstream.
/// </summary>
bool validate(std::stringstream& msg) const;
bool operator==(const HfcNodeId& rhs) const;
bool operator!=(const HfcNodeId& rhs) const;
/////////////////////////////////////////////
/// HfcNodeId members
/// <summary>
///
/// </summary>
std::string getHfcNId() const;
void setHfcNId(std::string const& value);
friend void to_json(nlohmann::json& j, const HfcNodeId& o);
friend void from_json(const nlohmann::json& j, HfcNodeId& o);
protected:
std::string m_HfcNId;
// 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
#endif /* HfcNodeId_H_ */
/** /**
* Namf_Communication * Namf_EventExposure
* AMF Communication Service © 2019, 3GPP Organizational Partners (ARIB, ATIS, * AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. * CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* *
* The version of the OpenAPI document: 1.1.0.alpha-1 * The version of the OpenAPI document: 1.1.0.alpha-1
...@@ -12,10 +12,11 @@ ...@@ -12,10 +12,11 @@
*/ */
#include "InvalidParam.h" #include "InvalidParam.h"
#include "Helpers.h"
namespace oai { #include <sstream>
namespace amf {
namespace model { namespace oai::amf::model {
InvalidParam::InvalidParam() { InvalidParam::InvalidParam() {
m_Param = ""; m_Param = "";
...@@ -23,10 +24,39 @@ InvalidParam::InvalidParam() { ...@@ -23,10 +24,39 @@ InvalidParam::InvalidParam() {
m_ReasonIsSet = false; m_ReasonIsSet = false;
} }
InvalidParam::~InvalidParam() {} void InvalidParam::validate() const {
std::stringstream msg;
if (!validate(msg)) {
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool InvalidParam::validate(std::stringstream& msg) const {
return validate(msg, "");
}
bool InvalidParam::validate(
std::stringstream& msg, const std::string& pathPrefix) const {
bool success = true;
const std::string _pathPrefix =
pathPrefix.empty() ? "InvalidParam" : pathPrefix;
return success;
}
bool InvalidParam::operator==(const InvalidParam& rhs) const {
return
(getParam() == rhs.getParam()) &&
((!reasonIsSet() && !rhs.reasonIsSet()) ||
(reasonIsSet() && rhs.reasonIsSet() && getReason() == rhs.getReason()))
;
}
void InvalidParam::validate() { bool InvalidParam::operator!=(const InvalidParam& rhs) const {
// TODO: implement validation return !(*this == rhs);
} }
void to_json(nlohmann::json& j, const InvalidParam& o) { void to_json(nlohmann::json& j, const InvalidParam& o) {
...@@ -63,6 +93,4 @@ void InvalidParam::unsetReason() { ...@@ -63,6 +93,4 @@ void InvalidParam::unsetReason() {
m_ReasonIsSet = false; m_ReasonIsSet = false;
} }
} // namespace model } // namespace oai::amf::model
} // namespace amf
} // namespace oai
/** /**
* Namf_Communication * Namf_EventExposure
* AMF Communication Service © 2019, 3GPP Organizational Partners (ARIB, ATIS, * AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. * CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* *
* The version of the OpenAPI document: 1.1.0.alpha-1 * The version of the OpenAPI document: 1.1.0.alpha-1
...@@ -22,9 +22,7 @@ ...@@ -22,9 +22,7 @@
#include <string> #include <string>
#include <nlohmann/json.hpp> #include <nlohmann/json.hpp>
namespace oai { namespace oai::amf::model {
namespace amf {
namespace model {
/// <summary> /// <summary>
/// ///
...@@ -32,9 +30,22 @@ namespace model { ...@@ -32,9 +30,22 @@ namespace model {
class InvalidParam { class InvalidParam {
public: public:
InvalidParam(); InvalidParam();
virtual ~InvalidParam(); virtual ~InvalidParam() = default;
void validate(); /// <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 InvalidParam& rhs) const;
bool operator!=(const InvalidParam& rhs) const;
///////////////////////////////////////////// /////////////////////////////////////////////
/// InvalidParam members /// InvalidParam members
...@@ -55,6 +66,10 @@ class InvalidParam { ...@@ -55,6 +66,10 @@ class InvalidParam {
friend void to_json(nlohmann::json& j, const InvalidParam& o); friend void to_json(nlohmann::json& j, const InvalidParam& o);
friend void from_json(const nlohmann::json& j, InvalidParam& o); friend void from_json(const nlohmann::json& j, InvalidParam& o);
// 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: protected:
std::string m_Param; std::string m_Param;
...@@ -62,8 +77,6 @@ class InvalidParam { ...@@ -62,8 +77,6 @@ class InvalidParam {
bool m_ReasonIsSet; bool m_ReasonIsSet;
}; };
} // namespace model } // namespace oai::amf::model
} // namespace amf
} // namespace oai
#endif /* InvalidParam_H_ */ #endif /* InvalidParam_H_ */
/** /**
* Namf_EventExposure * Namf_EventExposure
* Session Management Event Exposure Service. 2019, 3GPP Organizational * AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. * CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* *
* The version of the OpenAPI document: 1.1.0.alpha-1 * The version of the OpenAPI document: 1.1.0.alpha-1
* *
...@@ -12,17 +12,41 @@ ...@@ -12,17 +12,41 @@
*/ */
#include "Ipv6Addr.h" #include "Ipv6Addr.h"
#include "Helpers.h"
namespace oai { #include <sstream>
namespace amf {
namespace model { namespace oai::amf::model {
Ipv6Addr::Ipv6Addr() {} Ipv6Addr::Ipv6Addr() {}
Ipv6Addr::~Ipv6Addr() {} void Ipv6Addr::validate() const {
std::stringstream msg;
if (!validate(msg)) {
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool Ipv6Addr::validate(std::stringstream& msg) const {
return validate(msg, "");
}
bool Ipv6Addr::validate(
std::stringstream& msg, const std::string& pathPrefix) const {
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "Ipv6Addr" : pathPrefix;
return success;
}
bool Ipv6Addr::operator==(const Ipv6Addr& rhs) const {
return true; // TODO
;
}
void Ipv6Addr::validate() { bool Ipv6Addr::operator!=(const Ipv6Addr& rhs) const {
// TODO: implement validation return !(*this == rhs);
} }
void to_json(nlohmann::json& j, const Ipv6Addr& o) { void to_json(nlohmann::json& j, const Ipv6Addr& o) {
...@@ -31,6 +55,4 @@ void to_json(nlohmann::json& j, const Ipv6Addr& o) { ...@@ -31,6 +55,4 @@ void to_json(nlohmann::json& j, const Ipv6Addr& o) {
void from_json(const nlohmann::json& j, Ipv6Addr& o) {} void from_json(const nlohmann::json& j, Ipv6Addr& o) {}
} // namespace model } // namespace oai::amf::model
} // namespace amf
} // namespace oai
/** /**
* Namf_EventExposure * Namf_EventExposure
* Session Management Event Exposure Service. 2019, 3GPP Organizational * AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. * CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* *
* The version of the OpenAPI document: 1.1.0.alpha-1 * The version of the OpenAPI document: 1.1.0.alpha-1
* *
...@@ -21,9 +21,7 @@ ...@@ -21,9 +21,7 @@
#include <nlohmann/json.hpp> #include <nlohmann/json.hpp>
namespace oai { namespace oai::amf::model {
namespace amf {
namespace model {
/// <summary> /// <summary>
/// ///
...@@ -31,9 +29,22 @@ namespace model { ...@@ -31,9 +29,22 @@ namespace model {
class Ipv6Addr { class Ipv6Addr {
public: public:
Ipv6Addr(); Ipv6Addr();
virtual ~Ipv6Addr(); virtual ~Ipv6Addr() = default;
void validate(); /// <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 Ipv6Addr& rhs) const;
bool operator!=(const Ipv6Addr& rhs) const;
///////////////////////////////////////////// /////////////////////////////////////////////
/// Ipv6Addr members /// Ipv6Addr members
...@@ -42,10 +53,11 @@ class Ipv6Addr { ...@@ -42,10 +53,11 @@ class Ipv6Addr {
friend void from_json(const nlohmann::json& j, Ipv6Addr& o); friend void from_json(const nlohmann::json& j, Ipv6Addr& o);
protected: protected:
// 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 model } // namespace oai::amf::model
} // namespace amf
} // namespace oai
#endif /* Ipv6Addr_H_ */ #endif /* Ipv6Addr_H_ */
/** /**
* Namf_Communication * Namf_EventExposure
* AMF Communication Service © 2019, 3GPP Organizational Partners (ARIB, ATIS, * AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. * CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* *
* The version of the OpenAPI document: 1.1.0.alpha-1 * The version of the OpenAPI document: 1.1.0.alpha-1
...@@ -12,20 +12,50 @@ ...@@ -12,20 +12,50 @@
*/ */
#include "LadnInfo.h" #include "LadnInfo.h"
#include "Helpers.h"
namespace oai { #include <sstream>
namespace amf {
namespace model { namespace oai::amf::model {
LadnInfo::LadnInfo() { LadnInfo::LadnInfo() {
m_Ladn = ""; m_Ladn = "";
m_PresenceIsSet = false; m_PresenceIsSet = false;
} }
LadnInfo::~LadnInfo() {} void LadnInfo::validate() const {
std::stringstream msg;
if (!validate(msg)) {
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool LadnInfo::validate(std::stringstream& msg) const {
return validate(msg, "");
}
bool LadnInfo::validate(
std::stringstream& msg, const std::string& pathPrefix) const {
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "LadnInfo" : pathPrefix;
return success;
}
bool LadnInfo::operator==(const LadnInfo& rhs) const {
return
(getLadn() == rhs.getLadn()) &&
((!presenceIsSet() && !rhs.presenceIsSet()) ||
(presenceIsSet() && rhs.presenceIsSet() &&
getPresence() == rhs.getPresence()))
;
}
void LadnInfo::validate() { bool LadnInfo::operator!=(const LadnInfo& rhs) const {
// TODO: implement validation return !(*this == rhs);
} }
void to_json(nlohmann::json& j, const LadnInfo& o) { void to_json(nlohmann::json& j, const LadnInfo& o) {
...@@ -62,6 +92,4 @@ void LadnInfo::unsetPresence() { ...@@ -62,6 +92,4 @@ void LadnInfo::unsetPresence() {
m_PresenceIsSet = false; m_PresenceIsSet = false;
} }
} // namespace model } // namespace oai::amf::model
} // namespace amf
} // namespace oai
/** /**
* Namf_Communication * Namf_EventExposure
* AMF Communication Service © 2019, 3GPP Organizational Partners (ARIB, ATIS, * AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. * CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* *
* The version of the OpenAPI document: 1.1.0.alpha-1 * The version of the OpenAPI document: 1.1.0.alpha-1
...@@ -23,9 +23,7 @@ ...@@ -23,9 +23,7 @@
#include "PresenceState.h" #include "PresenceState.h"
#include <nlohmann/json.hpp> #include <nlohmann/json.hpp>
namespace oai { namespace oai::amf::model {
namespace amf {
namespace model {
/// <summary> /// <summary>
/// ///
...@@ -33,9 +31,22 @@ namespace model { ...@@ -33,9 +31,22 @@ namespace model {
class LadnInfo { class LadnInfo {
public: public:
LadnInfo(); LadnInfo();
virtual ~LadnInfo(); virtual ~LadnInfo() = default;
void validate(); /// <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 LadnInfo& rhs) const;
bool operator!=(const LadnInfo& rhs) const;
///////////////////////////////////////////// /////////////////////////////////////////////
/// LadnInfo members /// LadnInfo members
...@@ -61,10 +72,12 @@ class LadnInfo { ...@@ -61,10 +72,12 @@ class LadnInfo {
PresenceState m_Presence; PresenceState m_Presence;
bool m_PresenceIsSet; bool m_PresenceIsSet;
// 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 model } // namespace oai::amf::model
} // namespace amf
} // namespace oai
#endif /* LadnInfo_H_ */ #endif /* LadnInfo_H_ */
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
#include "LineType.h"
#include "Helpers.h"
#include <sstream>
namespace oai::amf::model {
LineType::LineType() {}
void LineType::validate() const {
std::stringstream msg;
if (!validate(msg)) {
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool LineType::validate(std::stringstream& msg) const {
return validate(msg, "");
}
bool LineType::validate(
std::stringstream& msg, const std::string& pathPrefix) const {
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "LineType" : pathPrefix;
return success;
}
bool LineType::operator==(const LineType& rhs) const {
return true; // TODO
;
}
bool LineType::operator!=(const LineType& rhs) const {
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const LineType& o) {
j = nlohmann::json();
}
void from_json(const nlohmann::json& j, LineType& o) {}
} // namespace oai::amf::model
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
/*
* LineType.h
*
* Possible values are - DSL: Identifies a DSL line - PON: Identifies a PON line
*/
#ifndef LineType_H_
#define LineType_H_
#include "LineType_anyOf.h"
#include <nlohmann/json.hpp>
namespace oai::amf::model {
/// <summary>
/// Possible values are - DSL: Identifies a DSL line - PON: Identifies a PON
/// line
/// </summary>
class LineType {
public:
LineType();
virtual ~LineType() = 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. Returns false on error and writes
/// an error message into the given stringstream.
/// </summary>
bool validate(std::stringstream& msg) const;
bool operator==(const LineType& rhs) const;
bool operator!=(const LineType& rhs) const;
/////////////////////////////////////////////
/// LineType members
friend void to_json(nlohmann::json& j, const LineType& o);
friend void from_json(const nlohmann::json& j, LineType& o);
protected:
// 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
#endif /* LineType_H_ */
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
#include "LineType_anyOf.h"
#include "Helpers.h"
#include <stdexcept>
#include <sstream>
namespace oai::amf::model {
LineType_anyOf::LineType_anyOf() {}
void LineType_anyOf::validate() const {
std::stringstream msg;
if (!validate(msg)) {
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool LineType_anyOf::validate(std::stringstream& msg) const {
return validate(msg, "");
}
bool LineType_anyOf::validate(
std::stringstream& msg, const std::string& pathPrefix) const {
bool success = true;
const std::string _pathPrefix =
pathPrefix.empty() ? "LineType_anyOf" : pathPrefix;
if (m_value ==
LineType_anyOf::eLineType_anyOf::INVALID_VALUE_OPENAPI_GENERATED) {
success = false;
msg << _pathPrefix << ": has no value;";
}
return success;
}
bool LineType_anyOf::operator==(const LineType_anyOf& rhs) const {
return getValue() == rhs.getValue()
;
}
bool LineType_anyOf::operator!=(const LineType_anyOf& rhs) const {
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const LineType_anyOf& o) {
j = nlohmann::json();
switch (o.getValue()) {
case LineType_anyOf::eLineType_anyOf::INVALID_VALUE_OPENAPI_GENERATED:
j = "INVALID_VALUE_OPENAPI_GENERATED";
break;
case LineType_anyOf::eLineType_anyOf::DSL:
j = "DSL";
break;
case LineType_anyOf::eLineType_anyOf::PON:
j = "PON";
break;
}
}
void from_json(const nlohmann::json& j, LineType_anyOf& o) {
auto s = j.get<std::string>();
if (s == "DSL") {
o.setValue(LineType_anyOf::eLineType_anyOf::DSL);
} else if (s == "PON") {
o.setValue(LineType_anyOf::eLineType_anyOf::PON);
} else {
std::stringstream ss;
ss << "Unexpected value " << s << " in json"
<< " cannot be converted to enum of type"
<< " LineType_anyOf::eLineType_anyOf";
throw std::invalid_argument(ss.str());
}
}
LineType_anyOf::eLineType_anyOf LineType_anyOf::getValue() const {
return m_value;
}
void LineType_anyOf::setValue(LineType_anyOf::eLineType_anyOf value) {
m_value = value;
}
} // namespace oai::amf::model
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
/*
* LineType_anyOf.h
*
*
*/
#ifndef LineType_anyOf_H_
#define LineType_anyOf_H_
#include <nlohmann/json.hpp>
namespace oai::amf::model {
/// <summary>
///
/// </summary>
class LineType_anyOf {
public:
LineType_anyOf();
virtual ~LineType_anyOf() = default;
enum class eLineType_anyOf {
// To have a valid default value.
// Avoiding nameclashes with user defined
// enum values
INVALID_VALUE_OPENAPI_GENERATED = 0,
DSL,
PON
};
/// <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 LineType_anyOf& rhs) const;
bool operator!=(const LineType_anyOf& rhs) const;
/////////////////////////////////////////////
/// LineType_anyOf members
LineType_anyOf::eLineType_anyOf getValue() const;
void setValue(LineType_anyOf::eLineType_anyOf value);
friend void to_json(nlohmann::json& j, const LineType_anyOf& o);
friend void from_json(const nlohmann::json& j, LineType_anyOf& o);
protected:
LineType_anyOf::eLineType_anyOf m_value =
LineType_anyOf::eLineType_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
#endif /* LineType_anyOf_H_ */
/** /**
* Namf_Communication * Namf_EventExposure
* AMF Communication Service © 2019, 3GPP Organizational Partners (ARIB, ATIS, * AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. * CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* *
* The version of the OpenAPI document: 1.1.0.alpha-1 * The version of the OpenAPI document: 1.1.0.alpha-1
...@@ -12,17 +12,42 @@ ...@@ -12,17 +12,42 @@
*/ */
#include "LocationFilter.h" #include "LocationFilter.h"
#include "Helpers.h"
namespace oai { #include <sstream>
namespace amf {
namespace model { namespace oai::amf::model {
LocationFilter::LocationFilter() {} LocationFilter::LocationFilter() {}
LocationFilter::~LocationFilter() {} void LocationFilter::validate() const {
std::stringstream msg;
if (!validate(msg)) {
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool LocationFilter::validate(std::stringstream& msg) const {
return validate(msg, "");
}
bool LocationFilter::validate(
std::stringstream& msg, const std::string& pathPrefix) const {
bool success = true;
const std::string _pathPrefix =
pathPrefix.empty() ? "LocationFilter" : pathPrefix;
return success;
}
bool LocationFilter::operator==(const LocationFilter& rhs) const {
return true; // TODO
;
}
void LocationFilter::validate() { bool LocationFilter::operator!=(const LocationFilter& rhs) const {
// TODO: implement validation return !(*this == rhs);
} }
void to_json(nlohmann::json& j, const LocationFilter& o) { void to_json(nlohmann::json& j, const LocationFilter& o) {
...@@ -31,6 +56,4 @@ void to_json(nlohmann::json& j, const LocationFilter& o) { ...@@ -31,6 +56,4 @@ void to_json(nlohmann::json& j, const LocationFilter& o) {
void from_json(const nlohmann::json& j, LocationFilter& o) {} void from_json(const nlohmann::json& j, LocationFilter& o) {}
} // namespace model } // namespace oai::amf::model
} // namespace amf
} // namespace oai
/** /**
* Namf_Communication * Namf_EventExposure
* AMF Communication Service © 2019, 3GPP Organizational Partners (ARIB, ATIS, * AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. * CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* *
* The version of the OpenAPI document: 1.1.0.alpha-1 * The version of the OpenAPI document: 1.1.0.alpha-1
...@@ -19,11 +19,10 @@ ...@@ -19,11 +19,10 @@
#ifndef LocationFilter_H_ #ifndef LocationFilter_H_
#define LocationFilter_H_ #define LocationFilter_H_
#include "LocationFilter_anyOf.h"
#include <nlohmann/json.hpp> #include <nlohmann/json.hpp>
namespace oai { namespace oai::amf::model {
namespace amf {
namespace model {
/// <summary> /// <summary>
/// ///
...@@ -31,9 +30,22 @@ namespace model { ...@@ -31,9 +30,22 @@ namespace model {
class LocationFilter { class LocationFilter {
public: public:
LocationFilter(); LocationFilter();
virtual ~LocationFilter(); virtual ~LocationFilter() = default;
void validate(); /// <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 LocationFilter& rhs) const;
bool operator!=(const LocationFilter& rhs) const;
///////////////////////////////////////////// /////////////////////////////////////////////
/// LocationFilter members /// LocationFilter members
...@@ -41,11 +53,13 @@ class LocationFilter { ...@@ -41,11 +53,13 @@ class LocationFilter {
friend void to_json(nlohmann::json& j, const LocationFilter& o); friend void to_json(nlohmann::json& j, const LocationFilter& o);
friend void from_json(const nlohmann::json& j, LocationFilter& o); friend void from_json(const nlohmann::json& j, LocationFilter& o);
// 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: protected:
}; };
} // namespace model } // namespace oai::amf::model
} // namespace amf
} // namespace oai
#endif /* LocationFilter_H_ */ #endif /* LocationFilter_H_ */
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
#include "LocationFilter_anyOf.h"
#include "Helpers.h"
#include <stdexcept>
#include <sstream>
namespace oai::amf::model {
LocationFilter_anyOf::LocationFilter_anyOf() {}
void LocationFilter_anyOf::validate() const {
std::stringstream msg;
if (!validate(msg)) {
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool LocationFilter_anyOf::validate(std::stringstream& msg) const {
return validate(msg, "");
}
bool LocationFilter_anyOf::validate(
std::stringstream& msg, const std::string& pathPrefix) const {
bool success = true;
const std::string _pathPrefix =
pathPrefix.empty() ? "LocationFilter_anyOf" : pathPrefix;
if (m_value == LocationFilter_anyOf::eLocationFilter_anyOf::
INVALID_VALUE_OPENAPI_GENERATED) {
success = false;
msg << _pathPrefix << ": has no value;";
}
return success;
}
bool LocationFilter_anyOf::operator==(const LocationFilter_anyOf& rhs) const {
return getValue() == rhs.getValue()
;
}
bool LocationFilter_anyOf::operator!=(const LocationFilter_anyOf& rhs) const {
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const LocationFilter_anyOf& o) {
j = nlohmann::json();
switch (o.getValue()) {
case LocationFilter_anyOf::eLocationFilter_anyOf::
INVALID_VALUE_OPENAPI_GENERATED:
j = "INVALID_VALUE_OPENAPI_GENERATED";
break;
case LocationFilter_anyOf::eLocationFilter_anyOf::TAI:
j = "TAI";
break;
case LocationFilter_anyOf::eLocationFilter_anyOf::CELL_ID:
j = "CELL_ID";
break;
case LocationFilter_anyOf::eLocationFilter_anyOf::N3IWF:
j = "N3IWF";
break;
case LocationFilter_anyOf::eLocationFilter_anyOf::UE_IP:
j = "UE_IP";
break;
case LocationFilter_anyOf::eLocationFilter_anyOf::UDP_PORT:
j = "UDP_PORT";
break;
}
}
void from_json(const nlohmann::json& j, LocationFilter_anyOf& o) {
auto s = j.get<std::string>();
if (s == "TAI") {
o.setValue(LocationFilter_anyOf::eLocationFilter_anyOf::TAI);
} else if (s == "CELL_ID") {
o.setValue(LocationFilter_anyOf::eLocationFilter_anyOf::CELL_ID);
} else if (s == "N3IWF") {
o.setValue(LocationFilter_anyOf::eLocationFilter_anyOf::N3IWF);
} else if (s == "UE_IP") {
o.setValue(LocationFilter_anyOf::eLocationFilter_anyOf::UE_IP);
} else if (s == "UDP_PORT") {
o.setValue(LocationFilter_anyOf::eLocationFilter_anyOf::UDP_PORT);
} else {
std::stringstream ss;
ss << "Unexpected value " << s << " in json"
<< " cannot be converted to enum of type"
<< " LocationFilter_anyOf::eLocationFilter_anyOf";
throw std::invalid_argument(ss.str());
}
}
LocationFilter_anyOf::eLocationFilter_anyOf LocationFilter_anyOf::getValue()
const {
return m_value;
}
void LocationFilter_anyOf::setValue(
LocationFilter_anyOf::eLocationFilter_anyOf value) {
m_value = value;
}
} // namespace oai::amf::model
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
/*
* LocationFilter_anyOf.h
*
*
*/
#ifndef LocationFilter_anyOf_H_
#define LocationFilter_anyOf_H_
#include <nlohmann/json.hpp>
namespace oai::amf::model {
/// <summary>
///
/// </summary>
class LocationFilter_anyOf {
public:
LocationFilter_anyOf();
virtual ~LocationFilter_anyOf() = default;
enum class eLocationFilter_anyOf {
// To have a valid default value.
// Avoiding nameclashes with user defined
// enum values
INVALID_VALUE_OPENAPI_GENERATED = 0,
TAI,
CELL_ID,
N3IWF,
UE_IP,
UDP_PORT
};
/// <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 LocationFilter_anyOf& rhs) const;
bool operator!=(const LocationFilter_anyOf& rhs) const;
/////////////////////////////////////////////
/// LocationFilter_anyOf members
LocationFilter_anyOf::eLocationFilter_anyOf getValue() const;
void setValue(LocationFilter_anyOf::eLocationFilter_anyOf value);
friend void to_json(nlohmann::json& j, const LocationFilter_anyOf& o);
friend void from_json(const nlohmann::json& j, LocationFilter_anyOf& o);
protected:
LocationFilter_anyOf::eLocationFilter_anyOf m_value = LocationFilter_anyOf::
eLocationFilter_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
#endif /* LocationFilter_anyOf_H_ */
/** /**
* Namf_Communication * Namf_EventExposure
* AMF Communication Service © 2019, 3GPP Organizational Partners (ARIB, ATIS, * AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. * CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* *
* The version of the OpenAPI document: 1.1.0.alpha-1 * The version of the OpenAPI document: 1.1.0.alpha-1
...@@ -12,10 +12,11 @@ ...@@ -12,10 +12,11 @@
*/ */
#include "N3gaLocation.h" #include "N3gaLocation.h"
#include "Helpers.h"
namespace oai { #include <sstream>
namespace amf {
namespace model { namespace oai::amf::model {
N3gaLocation::N3gaLocation() { N3gaLocation::N3gaLocation() {
m_N3gppTaiIsSet = false; m_N3gppTaiIsSet = false;
...@@ -26,12 +27,105 @@ N3gaLocation::N3gaLocation() { ...@@ -26,12 +27,105 @@ N3gaLocation::N3gaLocation() {
m_UeIpv6AddrIsSet = false; m_UeIpv6AddrIsSet = false;
m_PortNumber = 0; m_PortNumber = 0;
m_PortNumberIsSet = false; m_PortNumberIsSet = false;
m_TnapIdIsSet = false;
m_TwapIdIsSet = false;
m_HfcNodeIdIsSet = false;
m_GliIsSet = false;
m_W5gbanLineTypeIsSet = false;
m_Gci = "";
m_GciIsSet = false;
}
void N3gaLocation::validate() const {
std::stringstream msg;
if (!validate(msg)) {
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool N3gaLocation::validate(std::stringstream& msg) const {
return validate(msg, "");
}
bool N3gaLocation::validate(
std::stringstream& msg, const std::string& pathPrefix) const {
bool success = true;
const std::string _pathPrefix =
pathPrefix.empty() ? "N3gaLocation" : pathPrefix;
if (n3IwfIdIsSet()) {
const std::string& value = m_N3IwfId;
const std::string currentValuePath = _pathPrefix + ".n3IwfId";
}
if (ueIpv4AddrIsSet()) {
const std::string& value = m_UeIpv4Addr;
const std::string currentValuePath = _pathPrefix + ".ueIpv4Addr";
}
if (portNumberIsSet()) {
const int32_t& value = m_PortNumber;
const std::string currentValuePath = _pathPrefix + ".portNumber";
if (value < 0) {
success = false;
msg << currentValuePath << ": must be greater than or equal to 0;";
}
}
return success;
} }
N3gaLocation::~N3gaLocation() {} bool N3gaLocation::operator==(const N3gaLocation& rhs) const {
return
((!n3gppTaiIsSet() && !rhs.n3gppTaiIsSet()) ||
(n3gppTaiIsSet() && rhs.n3gppTaiIsSet() &&
getN3gppTai() == rhs.getN3gppTai())) &&
((!n3IwfIdIsSet() && !rhs.n3IwfIdIsSet()) ||
(n3IwfIdIsSet() && rhs.n3IwfIdIsSet() &&
getN3IwfId() == rhs.getN3IwfId())) &&
((!ueIpv4AddrIsSet() && !rhs.ueIpv4AddrIsSet()) ||
(ueIpv4AddrIsSet() && rhs.ueIpv4AddrIsSet() &&
getUeIpv4Addr() == rhs.getUeIpv4Addr())) &&
((!ueIpv6AddrIsSet() && !rhs.ueIpv6AddrIsSet()) ||
(ueIpv6AddrIsSet() && rhs.ueIpv6AddrIsSet() &&
getUeIpv6Addr() == rhs.getUeIpv6Addr())) &&
((!portNumberIsSet() && !rhs.portNumberIsSet()) ||
(portNumberIsSet() && rhs.portNumberIsSet() &&
getPortNumber() == rhs.getPortNumber())) &&
((!tnapIdIsSet() && !rhs.tnapIdIsSet()) ||
(tnapIdIsSet() && rhs.tnapIdIsSet() &&
getTnapId() == rhs.getTnapId())) &&
((!twapIdIsSet() && !rhs.twapIdIsSet()) ||
(twapIdIsSet() && rhs.twapIdIsSet() &&
getTwapId() == rhs.getTwapId())) &&
((!hfcNodeIdIsSet() && !rhs.hfcNodeIdIsSet()) ||
(hfcNodeIdIsSet() && rhs.hfcNodeIdIsSet() &&
getHfcNodeId() == rhs.getHfcNodeId())) &&
((!gliIsSet() && !rhs.gliIsSet()) ||
(gliIsSet() && rhs.gliIsSet() && getGli() == rhs.getGli())) &&
((!w5gbanLineTypeIsSet() && !rhs.w5gbanLineTypeIsSet()) ||
(w5gbanLineTypeIsSet() && rhs.w5gbanLineTypeIsSet() &&
getW5gbanLineType() == rhs.getW5gbanLineType())) &&
((!gciIsSet() && !rhs.gciIsSet()) ||
(gciIsSet() && rhs.gciIsSet() && getGci() == rhs.getGci()))
;
}
void N3gaLocation::validate() { bool N3gaLocation::operator!=(const N3gaLocation& rhs) const {
// TODO: implement validation return !(*this == rhs);
} }
void to_json(nlohmann::json& j, const N3gaLocation& o) { void to_json(nlohmann::json& j, const N3gaLocation& o) {
...@@ -41,6 +135,12 @@ void to_json(nlohmann::json& j, const N3gaLocation& o) { ...@@ -41,6 +135,12 @@ void to_json(nlohmann::json& j, const N3gaLocation& o) {
if (o.ueIpv4AddrIsSet()) j["ueIpv4Addr"] = o.m_UeIpv4Addr; if (o.ueIpv4AddrIsSet()) j["ueIpv4Addr"] = o.m_UeIpv4Addr;
if (o.ueIpv6AddrIsSet()) j["ueIpv6Addr"] = o.m_UeIpv6Addr; if (o.ueIpv6AddrIsSet()) j["ueIpv6Addr"] = o.m_UeIpv6Addr;
if (o.portNumberIsSet()) j["portNumber"] = o.m_PortNumber; if (o.portNumberIsSet()) j["portNumber"] = o.m_PortNumber;
if (o.tnapIdIsSet()) j["tnapId"] = o.m_TnapId;
if (o.twapIdIsSet()) j["twapId"] = o.m_TwapId;
if (o.hfcNodeIdIsSet()) j["hfcNodeId"] = o.m_HfcNodeId;
if (o.gliIsSet()) j["gli"] = o.m_Gli;
if (o.w5gbanLineTypeIsSet()) j["w5gbanLineType"] = o.m_W5gbanLineType;
if (o.gciIsSet()) j["gci"] = o.m_Gci;
} }
void from_json(const nlohmann::json& j, N3gaLocation& o) { void from_json(const nlohmann::json& j, N3gaLocation& o) {
...@@ -64,6 +164,30 @@ void from_json(const nlohmann::json& j, N3gaLocation& o) { ...@@ -64,6 +164,30 @@ void from_json(const nlohmann::json& j, N3gaLocation& o) {
j.at("portNumber").get_to(o.m_PortNumber); j.at("portNumber").get_to(o.m_PortNumber);
o.m_PortNumberIsSet = true; o.m_PortNumberIsSet = true;
} }
if (j.find("tnapId") != j.end()) {
j.at("tnapId").get_to(o.m_TnapId);
o.m_TnapIdIsSet = true;
}
if (j.find("twapId") != j.end()) {
j.at("twapId").get_to(o.m_TwapId);
o.m_TwapIdIsSet = true;
}
if (j.find("hfcNodeId") != j.end()) {
j.at("hfcNodeId").get_to(o.m_HfcNodeId);
o.m_HfcNodeIdIsSet = true;
}
if (j.find("gli") != j.end()) {
j.at("gli").get_to(o.m_Gli);
o.m_GliIsSet = true;
}
if (j.find("w5gbanLineType") != j.end()) {
j.at("w5gbanLineType").get_to(o.m_W5gbanLineType);
o.m_W5gbanLineTypeIsSet = true;
}
if (j.find("gci") != j.end()) {
j.at("gci").get_to(o.m_Gci);
o.m_GciIsSet = true;
}
} }
Tai N3gaLocation::getN3gppTai() const { Tai N3gaLocation::getN3gppTai() const {
...@@ -105,10 +229,10 @@ bool N3gaLocation::ueIpv4AddrIsSet() const { ...@@ -105,10 +229,10 @@ bool N3gaLocation::ueIpv4AddrIsSet() const {
void N3gaLocation::unsetUeIpv4Addr() { void N3gaLocation::unsetUeIpv4Addr() {
m_UeIpv4AddrIsSet = false; m_UeIpv4AddrIsSet = false;
} }
std::string N3gaLocation::getUeIpv6Addr() const { Ipv6Addr N3gaLocation::getUeIpv6Addr() const {
return m_UeIpv6Addr; return m_UeIpv6Addr;
} }
void N3gaLocation::setUeIpv6Addr(std::string const& value) { void N3gaLocation::setUeIpv6Addr(Ipv6Addr const& value) {
m_UeIpv6Addr = value; m_UeIpv6Addr = value;
m_UeIpv6AddrIsSet = true; m_UeIpv6AddrIsSet = true;
} }
...@@ -131,7 +255,83 @@ bool N3gaLocation::portNumberIsSet() const { ...@@ -131,7 +255,83 @@ bool N3gaLocation::portNumberIsSet() const {
void N3gaLocation::unsetPortNumber() { void N3gaLocation::unsetPortNumber() {
m_PortNumberIsSet = false; m_PortNumberIsSet = false;
} }
TnapId N3gaLocation::getTnapId() const {
return m_TnapId;
}
void N3gaLocation::setTnapId(TnapId const& value) {
m_TnapId = value;
m_TnapIdIsSet = true;
}
bool N3gaLocation::tnapIdIsSet() const {
return m_TnapIdIsSet;
}
void N3gaLocation::unsetTnapId() {
m_TnapIdIsSet = false;
}
TwapId N3gaLocation::getTwapId() const {
return m_TwapId;
}
void N3gaLocation::setTwapId(TwapId const& value) {
m_TwapId = value;
m_TwapIdIsSet = true;
}
bool N3gaLocation::twapIdIsSet() const {
return m_TwapIdIsSet;
}
void N3gaLocation::unsetTwapId() {
m_TwapIdIsSet = false;
}
HfcNodeId N3gaLocation::getHfcNodeId() const {
return m_HfcNodeId;
}
void N3gaLocation::setHfcNodeId(HfcNodeId const& value) {
m_HfcNodeId = value;
m_HfcNodeIdIsSet = true;
}
bool N3gaLocation::hfcNodeIdIsSet() const {
return m_HfcNodeIdIsSet;
}
void N3gaLocation::unsetHfcNodeId() {
m_HfcNodeIdIsSet = false;
}
std::string N3gaLocation::getGli() const {
return m_Gli;
}
void N3gaLocation::setGli(std::string const& value) {
m_Gli = value;
m_GliIsSet = true;
}
bool N3gaLocation::gliIsSet() const {
return m_GliIsSet;
}
void N3gaLocation::unsetGli() {
m_GliIsSet = false;
}
LineType N3gaLocation::getW5gbanLineType() const {
return m_W5gbanLineType;
}
void N3gaLocation::setW5gbanLineType(LineType const& value) {
m_W5gbanLineType = value;
m_W5gbanLineTypeIsSet = true;
}
bool N3gaLocation::w5gbanLineTypeIsSet() const {
return m_W5gbanLineTypeIsSet;
}
void N3gaLocation::unsetW5gbanLineType() {
m_W5gbanLineTypeIsSet = false;
}
std::string N3gaLocation::getGci() const {
return m_Gci;
}
void N3gaLocation::setGci(std::string const& value) {
m_Gci = value;
m_GciIsSet = true;
}
bool N3gaLocation::gciIsSet() const {
return m_GciIsSet;
}
void N3gaLocation::unsetGci() {
m_GciIsSet = false;
}
} // namespace model } // namespace oai::amf::model
} // namespace amf
} // namespace oai
/** /**
* Namf_Communication * Namf_EventExposure
* AMF Communication Service © 2019, 3GPP Organizational Partners (ARIB, ATIS, * AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. * CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* *
* The version of the OpenAPI document: 1.1.0.alpha-1 * The version of the OpenAPI document: 1.1.0.alpha-1
...@@ -21,11 +21,14 @@ ...@@ -21,11 +21,14 @@
#include "Tai.h" #include "Tai.h"
#include <string> #include <string>
#include "TnapId.h"
#include "Ipv6Addr.h"
#include "TwapId.h"
#include "LineType.h"
#include "HfcNodeId.h"
#include <nlohmann/json.hpp> #include <nlohmann/json.hpp>
namespace oai { namespace oai::amf::model {
namespace amf {
namespace model {
/// <summary> /// <summary>
/// ///
...@@ -33,9 +36,22 @@ namespace model { ...@@ -33,9 +36,22 @@ namespace model {
class N3gaLocation { class N3gaLocation {
public: public:
N3gaLocation(); N3gaLocation();
virtual ~N3gaLocation(); virtual ~N3gaLocation() = default;
void validate(); /// <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 N3gaLocation& rhs) const;
bool operator!=(const N3gaLocation& rhs) const;
///////////////////////////////////////////// /////////////////////////////////////////////
/// N3gaLocation members /// N3gaLocation members
...@@ -64,8 +80,8 @@ class N3gaLocation { ...@@ -64,8 +80,8 @@ class N3gaLocation {
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
std::string getUeIpv6Addr() const; Ipv6Addr getUeIpv6Addr() const;
void setUeIpv6Addr(std::string const& value); void setUeIpv6Addr(Ipv6Addr const& value);
bool ueIpv6AddrIsSet() const; bool ueIpv6AddrIsSet() const;
void unsetUeIpv6Addr(); void unsetUeIpv6Addr();
/// <summary> /// <summary>
...@@ -75,6 +91,48 @@ class N3gaLocation { ...@@ -75,6 +91,48 @@ class N3gaLocation {
void setPortNumber(int32_t const value); void setPortNumber(int32_t const value);
bool portNumberIsSet() const; bool portNumberIsSet() const;
void unsetPortNumber(); void unsetPortNumber();
/// <summary>
///
/// </summary>
TnapId getTnapId() const;
void setTnapId(TnapId const& value);
bool tnapIdIsSet() const;
void unsetTnapId();
/// <summary>
///
/// </summary>
TwapId getTwapId() const;
void setTwapId(TwapId const& value);
bool twapIdIsSet() const;
void unsetTwapId();
/// <summary>
///
/// </summary>
HfcNodeId getHfcNodeId() const;
void setHfcNodeId(HfcNodeId const& value);
bool hfcNodeIdIsSet() const;
void unsetHfcNodeId();
/// <summary>
///
/// </summary>
std::string getGli() const;
void setGli(std::string const& value);
bool gliIsSet() const;
void unsetGli();
/// <summary>
///
/// </summary>
LineType getW5gbanLineType() const;
void setW5gbanLineType(LineType const& value);
bool w5gbanLineTypeIsSet() const;
void unsetW5gbanLineType();
/// <summary>
///
/// </summary>
std::string getGci() const;
void setGci(std::string const& value);
bool gciIsSet() const;
void unsetGci();
friend void to_json(nlohmann::json& j, const N3gaLocation& o); friend void to_json(nlohmann::json& j, const N3gaLocation& o);
friend void from_json(const nlohmann::json& j, N3gaLocation& o); friend void from_json(const nlohmann::json& j, N3gaLocation& o);
...@@ -86,14 +144,28 @@ class N3gaLocation { ...@@ -86,14 +144,28 @@ class N3gaLocation {
bool m_N3IwfIdIsSet; bool m_N3IwfIdIsSet;
std::string m_UeIpv4Addr; std::string m_UeIpv4Addr;
bool m_UeIpv4AddrIsSet; bool m_UeIpv4AddrIsSet;
std::string m_UeIpv6Addr; Ipv6Addr m_UeIpv6Addr;
bool m_UeIpv6AddrIsSet; bool m_UeIpv6AddrIsSet;
int32_t m_PortNumber; int32_t m_PortNumber;
bool m_PortNumberIsSet; bool m_PortNumberIsSet;
TnapId m_TnapId;
bool m_TnapIdIsSet;
TwapId m_TwapId;
bool m_TwapIdIsSet;
HfcNodeId m_HfcNodeId;
bool m_HfcNodeIdIsSet;
std::string m_Gli;
bool m_GliIsSet;
LineType m_W5gbanLineType;
bool m_W5gbanLineTypeIsSet;
std::string m_Gci;
bool m_GciIsSet;
// 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 model } // namespace oai::amf::model
} // namespace amf
} // namespace oai
#endif /* N3gaLocation_H_ */ #endif /* N3gaLocation_H_ */
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
#include "NFType.h"
#include "Helpers.h"
#include <sstream>
namespace oai::amf::model {
NFType::NFType() {}
void NFType::validate() const {
std::stringstream msg;
if (!validate(msg)) {
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool NFType::validate(std::stringstream& msg) const {
return validate(msg, "");
}
bool NFType::validate(
std::stringstream& msg, const std::string& pathPrefix) const {
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "NFType" : pathPrefix;
return success;
}
bool NFType::operator==(const NFType& rhs) const {
return true; // TODO
;
}
bool NFType::operator!=(const NFType& rhs) const {
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const NFType& o) {
j = nlohmann::json();
}
void from_json(const nlohmann::json& j, NFType& o) {}
} // namespace oai::amf::model
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
/*
* NFType.h
*
*
*/
#ifndef NFType_H_
#define NFType_H_
#include "NFType_anyOf.h"
#include <nlohmann/json.hpp>
namespace oai::amf::model {
/// <summary>
///
/// </summary>
class NFType {
public:
NFType();
virtual ~NFType() = 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. Returns false on error and writes
/// an error message into the given stringstream.
/// </summary>
bool validate(std::stringstream& msg) const;
bool operator==(const NFType& rhs) const;
bool operator!=(const NFType& rhs) const;
/////////////////////////////////////////////
/// NFType members
friend void to_json(nlohmann::json& j, const NFType& o);
friend void from_json(const nlohmann::json& j, NFType& o);
protected:
// 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
#endif /* NFType_H_ */
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
#include "NFType_anyOf.h"
#include "Helpers.h"
#include <stdexcept>
#include <sstream>
namespace oai::amf::model {
NFType_anyOf::NFType_anyOf() {}
void NFType_anyOf::validate() const {
std::stringstream msg;
if (!validate(msg)) {
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool NFType_anyOf::validate(std::stringstream& msg) const {
return validate(msg, "");
}
bool NFType_anyOf::validate(
std::stringstream& msg, const std::string& pathPrefix) const {
bool success = true;
const std::string _pathPrefix =
pathPrefix.empty() ? "NFType_anyOf" : pathPrefix;
if (m_value == NFType_anyOf::eNFType_anyOf::INVALID_VALUE_OPENAPI_GENERATED) {
success = false;
msg << _pathPrefix << ": has no value;";
}
return success;
}
bool NFType_anyOf::operator==(const NFType_anyOf& rhs) const {
return getValue() == rhs.getValue()
;
}
bool NFType_anyOf::operator!=(const NFType_anyOf& rhs) const {
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const NFType_anyOf& o) {
j = nlohmann::json();
switch (o.getValue()) {
case NFType_anyOf::eNFType_anyOf::INVALID_VALUE_OPENAPI_GENERATED:
j = "INVALID_VALUE_OPENAPI_GENERATED";
break;
case NFType_anyOf::eNFType_anyOf::NRF:
j = "NRF";
break;
case NFType_anyOf::eNFType_anyOf::UDM:
j = "UDM";
break;
case NFType_anyOf::eNFType_anyOf::AMF:
j = "AMF";
break;
case NFType_anyOf::eNFType_anyOf::SMF:
j = "SMF";
break;
case NFType_anyOf::eNFType_anyOf::AUSF:
j = "AUSF";
break;
case NFType_anyOf::eNFType_anyOf::NEF:
j = "NEF";
break;
case NFType_anyOf::eNFType_anyOf::PCF:
j = "PCF";
break;
case NFType_anyOf::eNFType_anyOf::SMSF:
j = "SMSF";
break;
case NFType_anyOf::eNFType_anyOf::NSSF:
j = "NSSF";
break;
case NFType_anyOf::eNFType_anyOf::UDR:
j = "UDR";
break;
case NFType_anyOf::eNFType_anyOf::LMF:
j = "LMF";
break;
case NFType_anyOf::eNFType_anyOf::GMLC:
j = "GMLC";
break;
case NFType_anyOf::eNFType_anyOf::_5G_EIR:
j = "5G_EIR";
break;
case NFType_anyOf::eNFType_anyOf::SEPP:
j = "SEPP";
break;
case NFType_anyOf::eNFType_anyOf::UPF:
j = "UPF";
break;
case NFType_anyOf::eNFType_anyOf::N3IWF:
j = "N3IWF";
break;
case NFType_anyOf::eNFType_anyOf::AF:
j = "AF";
break;
case NFType_anyOf::eNFType_anyOf::UDSF:
j = "UDSF";
break;
case NFType_anyOf::eNFType_anyOf::BSF:
j = "BSF";
break;
case NFType_anyOf::eNFType_anyOf::CHF:
j = "CHF";
break;
case NFType_anyOf::eNFType_anyOf::NWDAF:
j = "NWDAF";
break;
}
}
void from_json(const nlohmann::json& j, NFType_anyOf& o) {
auto s = j.get<std::string>();
if (s == "NRF") {
o.setValue(NFType_anyOf::eNFType_anyOf::NRF);
} else if (s == "UDM") {
o.setValue(NFType_anyOf::eNFType_anyOf::UDM);
} else if (s == "AMF") {
o.setValue(NFType_anyOf::eNFType_anyOf::AMF);
} else if (s == "SMF") {
o.setValue(NFType_anyOf::eNFType_anyOf::SMF);
} else if (s == "AUSF") {
o.setValue(NFType_anyOf::eNFType_anyOf::AUSF);
} else if (s == "NEF") {
o.setValue(NFType_anyOf::eNFType_anyOf::NEF);
} else if (s == "PCF") {
o.setValue(NFType_anyOf::eNFType_anyOf::PCF);
} else if (s == "SMSF") {
o.setValue(NFType_anyOf::eNFType_anyOf::SMSF);
} else if (s == "NSSF") {
o.setValue(NFType_anyOf::eNFType_anyOf::NSSF);
} else if (s == "UDR") {
o.setValue(NFType_anyOf::eNFType_anyOf::UDR);
} else if (s == "LMF") {
o.setValue(NFType_anyOf::eNFType_anyOf::LMF);
} else if (s == "GMLC") {
o.setValue(NFType_anyOf::eNFType_anyOf::GMLC);
} else if (s == "5G_EIR") {
o.setValue(NFType_anyOf::eNFType_anyOf::_5G_EIR);
} else if (s == "SEPP") {
o.setValue(NFType_anyOf::eNFType_anyOf::SEPP);
} else if (s == "UPF") {
o.setValue(NFType_anyOf::eNFType_anyOf::UPF);
} else if (s == "N3IWF") {
o.setValue(NFType_anyOf::eNFType_anyOf::N3IWF);
} else if (s == "AF") {
o.setValue(NFType_anyOf::eNFType_anyOf::AF);
} else if (s == "UDSF") {
o.setValue(NFType_anyOf::eNFType_anyOf::UDSF);
} else if (s == "BSF") {
o.setValue(NFType_anyOf::eNFType_anyOf::BSF);
} else if (s == "CHF") {
o.setValue(NFType_anyOf::eNFType_anyOf::CHF);
} else if (s == "NWDAF") {
o.setValue(NFType_anyOf::eNFType_anyOf::NWDAF);
} else {
std::stringstream ss;
ss << "Unexpected value " << s << " in json"
<< " cannot be converted to enum of type"
<< " NFType_anyOf::eNFType_anyOf";
throw std::invalid_argument(ss.str());
}
}
NFType_anyOf::eNFType_anyOf NFType_anyOf::getValue() const {
return m_value;
}
void NFType_anyOf::setValue(NFType_anyOf::eNFType_anyOf value) {
m_value = value;
}
} // namespace oai::amf::model
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
/*
* NFType_anyOf.h
*
*
*/
#ifndef NFType_anyOf_H_
#define NFType_anyOf_H_
#include <nlohmann/json.hpp>
namespace oai::amf::model {
/// <summary>
///
/// </summary>
class NFType_anyOf {
public:
NFType_anyOf();
virtual ~NFType_anyOf() = default;
enum class eNFType_anyOf {
// To have a valid default value.
// Avoiding nameclashes with user defined
// enum values
INVALID_VALUE_OPENAPI_GENERATED = 0,
NRF,
UDM,
AMF,
SMF,
AUSF,
NEF,
PCF,
SMSF,
NSSF,
UDR,
LMF,
GMLC,
_5G_EIR,
SEPP,
UPF,
N3IWF,
AF,
UDSF,
BSF,
CHF,
NWDAF
};
/// <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 NFType_anyOf& rhs) const;
bool operator!=(const NFType_anyOf& rhs) const;
/////////////////////////////////////////////
/// NFType_anyOf members
NFType_anyOf::eNFType_anyOf getValue() const;
void setValue(NFType_anyOf::eNFType_anyOf value);
friend void to_json(nlohmann::json& j, const NFType_anyOf& o);
friend void from_json(const nlohmann::json& j, NFType_anyOf& o);
protected:
NFType_anyOf::eNFType_anyOf m_value =
NFType_anyOf::eNFType_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
#endif /* NFType_anyOf_H_ */
/** /**
* Namf_Communication * Namf_EventExposure
* AMF Communication Service © 2019, 3GPP Organizational Partners (ARIB, ATIS, * AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. * CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* *
* The version of the OpenAPI document: 1.1.0.alpha-1 * The version of the OpenAPI document: 1.1.0.alpha-1
...@@ -12,30 +12,78 @@ ...@@ -12,30 +12,78 @@
*/ */
#include "Ncgi.h" #include "Ncgi.h"
#include "Helpers.h"
namespace oai { #include <sstream>
namespace amf {
namespace model { namespace oai::amf::model {
Ncgi::Ncgi() { Ncgi::Ncgi() {
m_NrCellId = ""; m_NrCellId = "";
m_Nid = "";
m_NidIsSet = false;
}
void Ncgi::validate() const {
std::stringstream msg;
if (!validate(msg)) {
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool Ncgi::validate(std::stringstream& msg) const {
return validate(msg, "");
} }
Ncgi::~Ncgi() {} bool Ncgi::validate(
std::stringstream& msg, const std::string& pathPrefix) const {
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "Ncgi" : pathPrefix;
void Ncgi::validate() { /* NrCellId */ {
// TODO: implement validation const std::string& value = m_NrCellId;
const std::string currentValuePath = _pathPrefix + ".nrCellId";
}
if (nidIsSet()) {
const std::string& value = m_Nid;
const std::string currentValuePath = _pathPrefix + ".nid";
}
return success;
}
bool Ncgi::operator==(const Ncgi& rhs) const {
return
(getPlmnId() == rhs.getPlmnId()) &&
(getNrCellId() == rhs.getNrCellId()) &&
((!nidIsSet() && !rhs.nidIsSet()) ||
(nidIsSet() && rhs.nidIsSet() && getNid() == rhs.getNid()))
;
}
bool Ncgi::operator!=(const Ncgi& rhs) const {
return !(*this == rhs);
} }
void to_json(nlohmann::json& j, const Ncgi& o) { void to_json(nlohmann::json& j, const Ncgi& o) {
j = nlohmann::json(); j = nlohmann::json();
j["plmnId"] = o.m_PlmnId; j["plmnId"] = o.m_PlmnId;
j["nrCellId"] = o.m_NrCellId; j["nrCellId"] = o.m_NrCellId;
if (o.nidIsSet()) j["nid"] = o.m_Nid;
} }
void from_json(const nlohmann::json& j, Ncgi& o) { void from_json(const nlohmann::json& j, Ncgi& o) {
j.at("plmnId").get_to(o.m_PlmnId); j.at("plmnId").get_to(o.m_PlmnId);
j.at("nrCellId").get_to(o.m_NrCellId); j.at("nrCellId").get_to(o.m_NrCellId);
if (j.find("nid") != j.end()) {
j.at("nid").get_to(o.m_Nid);
o.m_NidIsSet = true;
}
} }
PlmnId Ncgi::getPlmnId() const { PlmnId Ncgi::getPlmnId() const {
...@@ -50,7 +98,18 @@ std::string Ncgi::getNrCellId() const { ...@@ -50,7 +98,18 @@ std::string Ncgi::getNrCellId() const {
void Ncgi::setNrCellId(std::string const& value) { void Ncgi::setNrCellId(std::string const& value) {
m_NrCellId = value; m_NrCellId = value;
} }
std::string Ncgi::getNid() const {
return m_Nid;
}
void Ncgi::setNid(std::string const& value) {
m_Nid = value;
m_NidIsSet = true;
}
bool Ncgi::nidIsSet() const {
return m_NidIsSet;
}
void Ncgi::unsetNid() {
m_NidIsSet = false;
}
} // namespace model } // namespace oai::amf::model
} // namespace amf
} // namespace oai
/** /**
* Namf_Communication * Namf_EventExposure
* AMF Communication Service © 2019, 3GPP Organizational Partners (ARIB, ATIS, * AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. * CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* *
* The version of the OpenAPI document: 1.1.0.alpha-1 * The version of the OpenAPI document: 1.1.0.alpha-1
...@@ -23,9 +23,7 @@ ...@@ -23,9 +23,7 @@
#include "PlmnId.h" #include "PlmnId.h"
#include <nlohmann/json.hpp> #include <nlohmann/json.hpp>
namespace oai { namespace oai::amf::model {
namespace amf {
namespace model {
/// <summary> /// <summary>
/// ///
...@@ -33,9 +31,22 @@ namespace model { ...@@ -33,9 +31,22 @@ namespace model {
class Ncgi { class Ncgi {
public: public:
Ncgi(); Ncgi();
virtual ~Ncgi(); virtual ~Ncgi() = default;
void validate(); /// <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 Ncgi& rhs) const;
bool operator!=(const Ncgi& rhs) const;
///////////////////////////////////////////// /////////////////////////////////////////////
/// Ncgi members /// Ncgi members
...@@ -50,18 +61,30 @@ class Ncgi { ...@@ -50,18 +61,30 @@ class Ncgi {
/// </summary> /// </summary>
std::string getNrCellId() const; std::string getNrCellId() const;
void setNrCellId(std::string const& value); void setNrCellId(std::string const& value);
/// <summary>
///
/// </summary>
std::string getNid() const;
void setNid(std::string const& value);
bool nidIsSet() const;
void unsetNid();
friend void to_json(nlohmann::json& j, const Ncgi& o); friend void to_json(nlohmann::json& j, const Ncgi& o);
friend void from_json(const nlohmann::json& j, Ncgi& o); friend void from_json(const nlohmann::json& j, Ncgi& o);
// 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: protected:
PlmnId m_PlmnId; PlmnId m_PlmnId;
std::string m_NrCellId; std::string m_NrCellId;
std::string m_Nid;
bool m_NidIsSet;
}; };
} // namespace model } // namespace oai::amf::model
} // namespace amf
} // namespace oai
#endif /* Ncgi_H_ */ #endif /* Ncgi_H_ */
/** /**
* Namf_Communication * Namf_EventExposure
* AMF Communication Service © 2019, 3GPP Organizational Partners (ARIB, ATIS, * AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. * CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* *
* The version of the OpenAPI document: 1.1.0.alpha-1 * The version of the OpenAPI document: 1.1.0.alpha-1
...@@ -12,20 +12,68 @@ ...@@ -12,20 +12,68 @@
*/ */
#include "NgApCause.h" #include "NgApCause.h"
#include "Helpers.h"
namespace oai { #include <sstream>
namespace amf {
namespace model { namespace oai::amf::model {
NgApCause::NgApCause() { NgApCause::NgApCause() {
m_Group = 0; m_Group = 0;
m_Value = 0; m_Value = 0;
} }
NgApCause::~NgApCause() {} void NgApCause::validate() const {
std::stringstream msg;
if (!validate(msg)) {
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool NgApCause::validate(std::stringstream& msg) const {
return validate(msg, "");
}
bool NgApCause::validate(
std::stringstream& msg, const std::string& pathPrefix) const {
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "NgApCause" : pathPrefix;
/* Group */ {
const int32_t& value = m_Group;
const std::string currentValuePath = _pathPrefix + ".group";
if (value < 0) {
success = false;
msg << currentValuePath << ": must be greater than or equal to 0;";
}
}
/* Value */ {
const int32_t& value = m_Value;
const std::string currentValuePath = _pathPrefix + ".value";
if (value < 0) {
success = false;
msg << currentValuePath << ": must be greater than or equal to 0;";
}
}
return success;
}
bool NgApCause::operator==(const NgApCause& rhs) const {
return
(getGroup() == rhs.getGroup()) &&
(getValue() == rhs.getValue())
;
}
void NgApCause::validate() { bool NgApCause::operator!=(const NgApCause& rhs) const {
// TODO: implement validation return !(*this == rhs);
} }
void to_json(nlohmann::json& j, const NgApCause& o) { void to_json(nlohmann::json& j, const NgApCause& o) {
...@@ -52,6 +100,4 @@ void NgApCause::setValue(int32_t const value) { ...@@ -52,6 +100,4 @@ void NgApCause::setValue(int32_t const value) {
m_Value = value; m_Value = value;
} }
} // namespace model } // namespace oai::amf::model
} // namespace amf
} // namespace oai
/** /**
* Namf_Communication * Namf_EventExposure
* AMF Communication Service © 2019, 3GPP Organizational Partners (ARIB, ATIS, * AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. * CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* *
* The version of the OpenAPI document: 1.1.0.alpha-1 * The version of the OpenAPI document: 1.1.0.alpha-1
...@@ -21,9 +21,7 @@ ...@@ -21,9 +21,7 @@
#include <nlohmann/json.hpp> #include <nlohmann/json.hpp>
namespace oai { namespace oai::amf::model {
namespace amf {
namespace model {
/// <summary> /// <summary>
/// ///
...@@ -31,9 +29,22 @@ namespace model { ...@@ -31,9 +29,22 @@ namespace model {
class NgApCause { class NgApCause {
public: public:
NgApCause(); NgApCause();
virtual ~NgApCause(); virtual ~NgApCause() = default;
void validate(); /// <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 NgApCause& rhs) const;
bool operator!=(const NgApCause& rhs) const;
///////////////////////////////////////////// /////////////////////////////////////////////
/// NgApCause members /// NgApCause members
...@@ -56,10 +67,12 @@ class NgApCause { ...@@ -56,10 +67,12 @@ class NgApCause {
int32_t m_Group; int32_t m_Group;
int32_t m_Value; int32_t m_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 model } // namespace oai::amf::model
} // namespace amf
} // namespace oai
#endif /* NgApCause_H_ */ #endif /* NgApCause_H_ */
/** /**
* Namf_Communication * Namf_EventExposure
* AMF Communication Service © 2019, 3GPP Organizational Partners (ARIB, ATIS, * AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. * CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* *
* The version of the OpenAPI document: 1.1.0.alpha-1 * The version of the OpenAPI document: 1.1.0.alpha-1
...@@ -12,10 +12,11 @@ ...@@ -12,10 +12,11 @@
*/ */
#include "NrLocation.h" #include "NrLocation.h"
#include "Helpers.h"
namespace oai { #include <sstream>
namespace amf {
namespace model { namespace oai::amf::model {
NrLocation::NrLocation() { NrLocation::NrLocation() {
m_AgeOfLocationInformation = 0; m_AgeOfLocationInformation = 0;
...@@ -29,10 +30,87 @@ NrLocation::NrLocation() { ...@@ -29,10 +30,87 @@ NrLocation::NrLocation() {
m_GlobalGnbIdIsSet = false; m_GlobalGnbIdIsSet = false;
} }
NrLocation::~NrLocation() {} void NrLocation::validate() const {
std::stringstream msg;
if (!validate(msg)) {
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool NrLocation::validate(std::stringstream& msg) const {
return validate(msg, "");
}
bool NrLocation::validate(
std::stringstream& msg, const std::string& pathPrefix) const {
bool success = true;
const std::string _pathPrefix =
pathPrefix.empty() ? "NrLocation" : pathPrefix;
if (ageOfLocationInformationIsSet()) {
const int32_t& value = m_AgeOfLocationInformation;
const std::string currentValuePath =
_pathPrefix + ".ageOfLocationInformation";
if (value < 0) {
success = false;
msg << currentValuePath << ": must be greater than or equal to 0;";
}
if (value > 32767) {
success = false;
msg << currentValuePath << ": must be less than or equal to 32767;";
}
}
if (geographicalInformationIsSet()) {
const std::string& value = m_GeographicalInformation;
const std::string currentValuePath =
_pathPrefix + ".geographicalInformation";
}
if (geodeticInformationIsSet()) {
const std::string& value = m_GeodeticInformation;
const std::string currentValuePath = _pathPrefix + ".geodeticInformation";
}
return success;
}
bool NrLocation::operator==(const NrLocation& rhs) const {
return
(getTai() == rhs.getTai()) &&
(getNcgi() == rhs.getNcgi()) &&
((!ageOfLocationInformationIsSet() &&
!rhs.ageOfLocationInformationIsSet()) ||
(ageOfLocationInformationIsSet() &&
rhs.ageOfLocationInformationIsSet() &&
getAgeOfLocationInformation() == rhs.getAgeOfLocationInformation())) &&
((!ueLocationTimestampIsSet() && !rhs.ueLocationTimestampIsSet()) ||
(ueLocationTimestampIsSet() && rhs.ueLocationTimestampIsSet() &&
getUeLocationTimestamp() == rhs.getUeLocationTimestamp())) &&
((!geographicalInformationIsSet() &&
!rhs.geographicalInformationIsSet()) ||
(geographicalInformationIsSet() && rhs.geographicalInformationIsSet() &&
getGeographicalInformation() == rhs.getGeographicalInformation())) &&
((!geodeticInformationIsSet() && !rhs.geodeticInformationIsSet()) ||
(geodeticInformationIsSet() && rhs.geodeticInformationIsSet() &&
getGeodeticInformation() == rhs.getGeodeticInformation())) &&
((!globalGnbIdIsSet() && !rhs.globalGnbIdIsSet()) ||
(globalGnbIdIsSet() && rhs.globalGnbIdIsSet() &&
getGlobalGnbId() == rhs.getGlobalGnbId()))
;
}
void NrLocation::validate() { bool NrLocation::operator!=(const NrLocation& rhs) const {
// TODO: implement validation return !(*this == rhs);
} }
void to_json(nlohmann::json& j, const NrLocation& o) { void to_json(nlohmann::json& j, const NrLocation& o) {
...@@ -153,6 +231,4 @@ void NrLocation::unsetGlobalGnbId() { ...@@ -153,6 +231,4 @@ void NrLocation::unsetGlobalGnbId() {
m_GlobalGnbIdIsSet = false; m_GlobalGnbIdIsSet = false;
} }
} // namespace model } // namespace oai::amf::model
} // namespace amf
} // namespace oai
/** /**
* Namf_Communication * Namf_EventExposure
* AMF Communication Service © 2019, 3GPP Organizational Partners (ARIB, ATIS, * AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. * CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* *
* The version of the OpenAPI document: 1.1.0.alpha-1 * The version of the OpenAPI document: 1.1.0.alpha-1
...@@ -25,9 +25,7 @@ ...@@ -25,9 +25,7 @@
#include "GlobalRanNodeId.h" #include "GlobalRanNodeId.h"
#include <nlohmann/json.hpp> #include <nlohmann/json.hpp>
namespace oai { namespace oai::amf::model {
namespace amf {
namespace model {
/// <summary> /// <summary>
/// ///
...@@ -35,9 +33,22 @@ namespace model { ...@@ -35,9 +33,22 @@ namespace model {
class NrLocation { class NrLocation {
public: public:
NrLocation(); NrLocation();
virtual ~NrLocation(); virtual ~NrLocation() = default;
void validate(); /// <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 NrLocation& rhs) const;
bool operator!=(const NrLocation& rhs) const;
///////////////////////////////////////////// /////////////////////////////////////////////
/// NrLocation members /// NrLocation members
...@@ -106,10 +117,12 @@ class NrLocation { ...@@ -106,10 +117,12 @@ class NrLocation {
bool m_GeodeticInformationIsSet; bool m_GeodeticInformationIsSet;
GlobalRanNodeId m_GlobalGnbId; GlobalRanNodeId m_GlobalGnbId;
bool m_GlobalGnbIdIsSet; bool m_GlobalGnbIdIsSet;
// 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 model } // namespace oai::amf::model
} // namespace amf
} // namespace oai
#endif /* NrLocation_H_ */ #endif /* NrLocation_H_ */
/** /**
* Namf_Communication * Namf_EventExposure
* AMF Communication Service © 2019, 3GPP Organizational Partners (ARIB, ATIS, * AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. * CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* *
* The version of the OpenAPI document: 1.1.0.alpha-1 * The version of the OpenAPI document: 1.1.0.alpha-1
...@@ -12,20 +12,58 @@ ...@@ -12,20 +12,58 @@
*/ */
#include "PlmnId.h" #include "PlmnId.h"
#include "Helpers.h"
namespace oai { #include <sstream>
namespace amf {
namespace model { namespace oai::amf::model {
PlmnId::PlmnId() { PlmnId::PlmnId() {
m_Mcc = ""; m_Mcc = "";
m_Mnc = ""; m_Mnc = "";
} }
PlmnId::~PlmnId() {} void PlmnId::validate() const {
std::stringstream msg;
if (!validate(msg)) {
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool PlmnId::validate(std::stringstream& msg) const {
return validate(msg, "");
}
bool PlmnId::validate(
std::stringstream& msg, const std::string& pathPrefix) const {
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "PlmnId" : pathPrefix;
/* Mcc */ {
const std::string& value = m_Mcc;
const std::string currentValuePath = _pathPrefix + ".mcc";
}
/* Mnc */ {
const std::string& value = m_Mnc;
const std::string currentValuePath = _pathPrefix + ".mnc";
}
return success;
}
bool PlmnId::operator==(const PlmnId& rhs) const {
return
(getMcc() == rhs.getMcc()) &&
(getMnc() == rhs.getMnc())
;
}
void PlmnId::validate() { bool PlmnId::operator!=(const PlmnId& rhs) const {
// TODO: implement validation return !(*this == rhs);
} }
void to_json(nlohmann::json& j, const PlmnId& o) { void to_json(nlohmann::json& j, const PlmnId& o) {
...@@ -52,6 +90,4 @@ void PlmnId::setMnc(std::string const& value) { ...@@ -52,6 +90,4 @@ void PlmnId::setMnc(std::string const& value) {
m_Mnc = value; m_Mnc = value;
} }
} // namespace model } // namespace oai::amf::model
} // namespace amf
} // namespace oai
/** /**
* Namf_Communication * Namf_EventExposure
* AMF Communication Service © 2019, 3GPP Organizational Partners (ARIB, ATIS, * AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. * CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* *
* The version of the OpenAPI document: 1.1.0.alpha-1 * The version of the OpenAPI document: 1.1.0.alpha-1
...@@ -22,9 +22,7 @@ ...@@ -22,9 +22,7 @@
#include <string> #include <string>
#include <nlohmann/json.hpp> #include <nlohmann/json.hpp>
namespace oai { namespace oai::amf::model {
namespace amf {
namespace model {
/// <summary> /// <summary>
/// ///
...@@ -32,9 +30,22 @@ namespace model { ...@@ -32,9 +30,22 @@ namespace model {
class PlmnId { class PlmnId {
public: public:
PlmnId(); PlmnId();
virtual ~PlmnId(); virtual ~PlmnId() = default;
void validate(); /// <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 PlmnId& rhs) const;
bool operator!=(const PlmnId& rhs) const;
///////////////////////////////////////////// /////////////////////////////////////////////
/// PlmnId members /// PlmnId members
...@@ -57,10 +68,12 @@ class PlmnId { ...@@ -57,10 +68,12 @@ class PlmnId {
std::string m_Mcc; std::string m_Mcc;
std::string m_Mnc; std::string m_Mnc;
// 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 model } // namespace oai::amf::model
} // namespace amf
} // namespace oai
#endif /* PlmnId_H_ */ #endif /* PlmnId_H_ */
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
#include "PlmnIdNid.h"
#include "Helpers.h"
#include <sstream>
namespace oai::amf::model {
PlmnIdNid::PlmnIdNid() {
m_Mcc = "";
m_Mnc = "";
m_Nid = "";
m_NidIsSet = false;
}
void PlmnIdNid::validate() const {
std::stringstream msg;
if (!validate(msg)) {
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool PlmnIdNid::validate(std::stringstream& msg) const {
return validate(msg, "");
}
bool PlmnIdNid::validate(
std::stringstream& msg, const std::string& pathPrefix) const {
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "PlmnIdNid" : pathPrefix;
/* Mcc */ {
const std::string& value = m_Mcc;
const std::string currentValuePath = _pathPrefix + ".mcc";
}
/* Mnc */ {
const std::string& value = m_Mnc;
const std::string currentValuePath = _pathPrefix + ".mnc";
}
if (nidIsSet()) {
const std::string& value = m_Nid;
const std::string currentValuePath = _pathPrefix + ".nid";
}
return success;
}
bool PlmnIdNid::operator==(const PlmnIdNid& rhs) const {
return
(getMcc() == rhs.getMcc()) &&
(getMnc() == rhs.getMnc()) &&
((!nidIsSet() && !rhs.nidIsSet()) ||
(nidIsSet() && rhs.nidIsSet() && getNid() == rhs.getNid()))
;
}
bool PlmnIdNid::operator!=(const PlmnIdNid& rhs) const {
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const PlmnIdNid& o) {
j = nlohmann::json();
j["mcc"] = o.m_Mcc;
j["mnc"] = o.m_Mnc;
if (o.nidIsSet()) j["nid"] = o.m_Nid;
}
void from_json(const nlohmann::json& j, PlmnIdNid& o) {
j.at("mcc").get_to(o.m_Mcc);
j.at("mnc").get_to(o.m_Mnc);
if (j.find("nid") != j.end()) {
j.at("nid").get_to(o.m_Nid);
o.m_NidIsSet = true;
}
}
std::string PlmnIdNid::getMcc() const {
return m_Mcc;
}
void PlmnIdNid::setMcc(std::string const& value) {
m_Mcc = value;
}
std::string PlmnIdNid::getMnc() const {
return m_Mnc;
}
void PlmnIdNid::setMnc(std::string const& value) {
m_Mnc = value;
}
std::string PlmnIdNid::getNid() const {
return m_Nid;
}
void PlmnIdNid::setNid(std::string const& value) {
m_Nid = value;
m_NidIsSet = true;
}
bool PlmnIdNid::nidIsSet() const {
return m_NidIsSet;
}
void PlmnIdNid::unsetNid() {
m_NidIsSet = false;
}
} // namespace oai::amf::model
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
/*
* PlmnIdNid.h
*
*
*/
#ifndef PlmnIdNid_H_
#define PlmnIdNid_H_
#include <string>
#include <nlohmann/json.hpp>
namespace oai::amf::model {
/// <summary>
///
/// </summary>
class PlmnIdNid {
public:
PlmnIdNid();
virtual ~PlmnIdNid() = 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. Returns false on error and writes
/// an error message into the given stringstream.
/// </summary>
bool validate(std::stringstream& msg) const;
bool operator==(const PlmnIdNid& rhs) const;
bool operator!=(const PlmnIdNid& rhs) const;
/////////////////////////////////////////////
/// PlmnIdNid members
/// <summary>
///
/// </summary>
std::string getMcc() const;
void setMcc(std::string const& value);
/// <summary>
///
/// </summary>
std::string getMnc() const;
void setMnc(std::string const& value);
/// <summary>
///
/// </summary>
std::string getNid() const;
void setNid(std::string const& value);
bool nidIsSet() const;
void unsetNid();
friend void to_json(nlohmann::json& j, const PlmnIdNid& o);
friend void from_json(const nlohmann::json& j, PlmnIdNid& o);
protected:
std::string m_Mcc;
std::string m_Mnc;
std::string m_Nid;
bool m_NidIsSet;
// 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
#endif /* PlmnIdNid_H_ */
/** /**
* Namf_Communication * Namf_EventExposure
* AMF Communication Service © 2019, 3GPP Organizational Partners (ARIB, ATIS, * AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. * CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* *
* The version of the OpenAPI document: 1.1.0.alpha-1 * The version of the OpenAPI document: 1.1.0.alpha-1
...@@ -12,36 +12,215 @@ ...@@ -12,36 +12,215 @@
*/ */
#include "PresenceInfo.h" #include "PresenceInfo.h"
#include "Helpers.h"
namespace oai { #include <sstream>
namespace amf {
namespace model { namespace oai::amf::model {
PresenceInfo::PresenceInfo() { PresenceInfo::PresenceInfo() {
m_PraId = ""; m_PraId = "";
m_PraIdIsSet = false; m_PraIdIsSet = false;
m_AdditionalPraId = "";
m_AdditionalPraIdIsSet = false;
m_PresenceStateIsSet = false; m_PresenceStateIsSet = false;
m_TrackingAreaListIsSet = false; m_TrackingAreaListIsSet = false;
m_EcgiListIsSet = false; m_EcgiListIsSet = false;
m_NcgiListIsSet = false; m_NcgiListIsSet = false;
m_GlobalRanNodeIdListIsSet = false; m_GlobalRanNodeIdListIsSet = false;
m_GlobaleNbIdListIsSet = false;
} }
PresenceInfo::~PresenceInfo() {} void PresenceInfo::validate() const {
std::stringstream msg;
if (!validate(msg)) {
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
void PresenceInfo::validate() { bool PresenceInfo::validate(std::stringstream& msg) const {
// TODO: implement validation return validate(msg, "");
}
bool PresenceInfo::validate(
std::stringstream& msg, const std::string& pathPrefix) const {
bool success = true;
const std::string _pathPrefix =
pathPrefix.empty() ? "PresenceInfo" : pathPrefix;
if (trackingAreaListIsSet()) {
const std::vector<Tai>& value = m_TrackingAreaList;
const std::string currentValuePath = _pathPrefix + ".trackingAreaList";
if (value.size() < 1) {
success = false;
msg << currentValuePath << ": must have at least 1 elements;";
}
{ // Recursive validation of array elements
const std::string oldValuePath = currentValuePath;
int i = 0;
for (const Tai& value : value) {
const std::string currentValuePath =
oldValuePath + "[" + std::to_string(i) + "]";
success = value.validate(msg, currentValuePath + ".trackingAreaList") &&
success;
i++;
}
}
}
if (ecgiListIsSet()) {
const std::vector<Ecgi>& value = m_EcgiList;
const std::string currentValuePath = _pathPrefix + ".ecgiList";
if (value.size() < 1) {
success = false;
msg << currentValuePath << ": must have at least 1 elements;";
}
{ // Recursive validation of array elements
const std::string oldValuePath = currentValuePath;
int i = 0;
for (const Ecgi& value : value) {
const std::string currentValuePath =
oldValuePath + "[" + std::to_string(i) + "]";
success =
value.validate(msg, currentValuePath + ".ecgiList") && success;
i++;
}
}
}
if (ncgiListIsSet()) {
const std::vector<Ncgi>& value = m_NcgiList;
const std::string currentValuePath = _pathPrefix + ".ncgiList";
if (value.size() < 1) {
success = false;
msg << currentValuePath << ": must have at least 1 elements;";
}
{ // Recursive validation of array elements
const std::string oldValuePath = currentValuePath;
int i = 0;
for (const Ncgi& value : value) {
const std::string currentValuePath =
oldValuePath + "[" + std::to_string(i) + "]";
success =
value.validate(msg, currentValuePath + ".ncgiList") && success;
i++;
}
}
}
if (globalRanNodeIdListIsSet()) {
const std::vector<GlobalRanNodeId>& value = m_GlobalRanNodeIdList;
const std::string currentValuePath = _pathPrefix + ".globalRanNodeIdList";
if (value.size() < 1) {
success = false;
msg << currentValuePath << ": must have at least 1 elements;";
}
{ // Recursive validation of array elements
const std::string oldValuePath = currentValuePath;
int i = 0;
for (const GlobalRanNodeId& value : value) {
const std::string currentValuePath =
oldValuePath + "[" + std::to_string(i) + "]";
success =
value.validate(msg, currentValuePath + ".globalRanNodeIdList") &&
success;
i++;
}
}
}
if (globaleNbIdListIsSet()) {
const std::vector<GlobalRanNodeId>& value = m_GlobaleNbIdList;
const std::string currentValuePath = _pathPrefix + ".globaleNbIdList";
if (value.size() < 1) {
success = false;
msg << currentValuePath << ": must have at least 1 elements;";
}
{ // Recursive validation of array elements
const std::string oldValuePath = currentValuePath;
int i = 0;
for (const GlobalRanNodeId& value : value) {
const std::string currentValuePath =
oldValuePath + "[" + std::to_string(i) + "]";
success = value.validate(msg, currentValuePath + ".globaleNbIdList") &&
success;
i++;
}
}
}
return success;
}
bool PresenceInfo::operator==(const PresenceInfo& rhs) const {
return
((!praIdIsSet() && !rhs.praIdIsSet()) ||
(praIdIsSet() && rhs.praIdIsSet() && getPraId() == rhs.getPraId())) &&
((!additionalPraIdIsSet() && !rhs.additionalPraIdIsSet()) ||
(additionalPraIdIsSet() && rhs.additionalPraIdIsSet() &&
getAdditionalPraId() == rhs.getAdditionalPraId())) &&
((!presenceStateIsSet() && !rhs.presenceStateIsSet()) ||
(presenceStateIsSet() && rhs.presenceStateIsSet() &&
getPresenceState() == rhs.getPresenceState())) &&
((!trackingAreaListIsSet() && !rhs.trackingAreaListIsSet()) ||
(trackingAreaListIsSet() && rhs.trackingAreaListIsSet() &&
getTrackingAreaList() == rhs.getTrackingAreaList())) &&
((!ecgiListIsSet() && !rhs.ecgiListIsSet()) ||
(ecgiListIsSet() && rhs.ecgiListIsSet() &&
getEcgiList() == rhs.getEcgiList())) &&
((!ncgiListIsSet() && !rhs.ncgiListIsSet()) ||
(ncgiListIsSet() && rhs.ncgiListIsSet() &&
getNcgiList() == rhs.getNcgiList())) &&
((!globalRanNodeIdListIsSet() && !rhs.globalRanNodeIdListIsSet()) ||
(globalRanNodeIdListIsSet() && rhs.globalRanNodeIdListIsSet() &&
getGlobalRanNodeIdList() == rhs.getGlobalRanNodeIdList())) &&
((!globaleNbIdListIsSet() && !rhs.globaleNbIdListIsSet()) ||
(globaleNbIdListIsSet() && rhs.globaleNbIdListIsSet() &&
getGlobaleNbIdList() == rhs.getGlobaleNbIdList()))
;
}
bool PresenceInfo::operator!=(const PresenceInfo& rhs) const {
return !(*this == rhs);
} }
void to_json(nlohmann::json& j, const PresenceInfo& o) { void to_json(nlohmann::json& j, const PresenceInfo& o) {
j = nlohmann::json(); j = nlohmann::json();
if (o.praIdIsSet()) j["praId"] = o.m_PraId; if (o.praIdIsSet()) j["praId"] = o.m_PraId;
if (o.additionalPraIdIsSet()) j["additionalPraId"] = o.m_AdditionalPraId;
if (o.presenceStateIsSet()) j["presenceState"] = o.m_PresenceState; if (o.presenceStateIsSet()) j["presenceState"] = o.m_PresenceState;
if (o.trackingAreaListIsSet()) j["trackingAreaList"] = o.m_TrackingAreaList; if (o.trackingAreaListIsSet() || !o.m_TrackingAreaList.empty())
if (o.ecgiListIsSet()) j["ecgiList"] = o.m_EcgiList; j["trackingAreaList"] = o.m_TrackingAreaList;
if (o.ncgiListIsSet()) j["ncgiList"] = o.m_NcgiList; if (o.ecgiListIsSet() || !o.m_EcgiList.empty()) j["ecgiList"] = o.m_EcgiList;
if (o.globalRanNodeIdListIsSet()) if (o.ncgiListIsSet() || !o.m_NcgiList.empty()) j["ncgiList"] = o.m_NcgiList;
if (o.globalRanNodeIdListIsSet() || !o.m_GlobalRanNodeIdList.empty())
j["globalRanNodeIdList"] = o.m_GlobalRanNodeIdList; j["globalRanNodeIdList"] = o.m_GlobalRanNodeIdList;
if (o.globaleNbIdListIsSet() || !o.m_GlobaleNbIdList.empty())
j["globaleNbIdList"] = o.m_GlobaleNbIdList;
} }
void from_json(const nlohmann::json& j, PresenceInfo& o) { void from_json(const nlohmann::json& j, PresenceInfo& o) {
...@@ -49,6 +228,10 @@ void from_json(const nlohmann::json& j, PresenceInfo& o) { ...@@ -49,6 +228,10 @@ void from_json(const nlohmann::json& j, PresenceInfo& o) {
j.at("praId").get_to(o.m_PraId); j.at("praId").get_to(o.m_PraId);
o.m_PraIdIsSet = true; o.m_PraIdIsSet = true;
} }
if (j.find("additionalPraId") != j.end()) {
j.at("additionalPraId").get_to(o.m_AdditionalPraId);
o.m_AdditionalPraIdIsSet = true;
}
if (j.find("presenceState") != j.end()) { if (j.find("presenceState") != j.end()) {
j.at("presenceState").get_to(o.m_PresenceState); j.at("presenceState").get_to(o.m_PresenceState);
o.m_PresenceStateIsSet = true; o.m_PresenceStateIsSet = true;
...@@ -69,6 +252,10 @@ void from_json(const nlohmann::json& j, PresenceInfo& o) { ...@@ -69,6 +252,10 @@ void from_json(const nlohmann::json& j, PresenceInfo& o) {
j.at("globalRanNodeIdList").get_to(o.m_GlobalRanNodeIdList); j.at("globalRanNodeIdList").get_to(o.m_GlobalRanNodeIdList);
o.m_GlobalRanNodeIdListIsSet = true; o.m_GlobalRanNodeIdListIsSet = true;
} }
if (j.find("globaleNbIdList") != j.end()) {
j.at("globaleNbIdList").get_to(o.m_GlobaleNbIdList);
o.m_GlobaleNbIdListIsSet = true;
}
} }
std::string PresenceInfo::getPraId() const { std::string PresenceInfo::getPraId() const {
...@@ -84,6 +271,19 @@ bool PresenceInfo::praIdIsSet() const { ...@@ -84,6 +271,19 @@ bool PresenceInfo::praIdIsSet() const {
void PresenceInfo::unsetPraId() { void PresenceInfo::unsetPraId() {
m_PraIdIsSet = false; m_PraIdIsSet = false;
} }
std::string PresenceInfo::getAdditionalPraId() const {
return m_AdditionalPraId;
}
void PresenceInfo::setAdditionalPraId(std::string const& value) {
m_AdditionalPraId = value;
m_AdditionalPraIdIsSet = true;
}
bool PresenceInfo::additionalPraIdIsSet() const {
return m_AdditionalPraIdIsSet;
}
void PresenceInfo::unsetAdditionalPraId() {
m_AdditionalPraIdIsSet = false;
}
PresenceState PresenceInfo::getPresenceState() const { PresenceState PresenceInfo::getPresenceState() const {
return m_PresenceState; return m_PresenceState;
} }
...@@ -97,43 +297,72 @@ bool PresenceInfo::presenceStateIsSet() const { ...@@ -97,43 +297,72 @@ bool PresenceInfo::presenceStateIsSet() const {
void PresenceInfo::unsetPresenceState() { void PresenceInfo::unsetPresenceState() {
m_PresenceStateIsSet = false; m_PresenceStateIsSet = false;
} }
std::vector<Tai>& PresenceInfo::getTrackingAreaList() { std::vector<Tai> PresenceInfo::getTrackingAreaList() const {
return m_TrackingAreaList; return m_TrackingAreaList;
} }
void PresenceInfo::setTrackingAreaList(std::vector<Tai> const& value) {
m_TrackingAreaList = value;
m_TrackingAreaListIsSet = true;
}
bool PresenceInfo::trackingAreaListIsSet() const { bool PresenceInfo::trackingAreaListIsSet() const {
return m_TrackingAreaListIsSet; return m_TrackingAreaListIsSet;
} }
void PresenceInfo::unsetTrackingAreaList() { void PresenceInfo::unsetTrackingAreaList() {
m_TrackingAreaListIsSet = false; m_TrackingAreaListIsSet = false;
} }
std::vector<Ecgi>& PresenceInfo::getEcgiList() { std::vector<Ecgi> PresenceInfo::getEcgiList() const {
return m_EcgiList; return m_EcgiList;
} }
void PresenceInfo::setEcgiList(std::vector<Ecgi> const& value) {
m_EcgiList = value;
m_EcgiListIsSet = true;
}
bool PresenceInfo::ecgiListIsSet() const { bool PresenceInfo::ecgiListIsSet() const {
return m_EcgiListIsSet; return m_EcgiListIsSet;
} }
void PresenceInfo::unsetEcgiList() { void PresenceInfo::unsetEcgiList() {
m_EcgiListIsSet = false; m_EcgiListIsSet = false;
} }
std::vector<Ncgi>& PresenceInfo::getNcgiList() { std::vector<Ncgi> PresenceInfo::getNcgiList() const {
return m_NcgiList; return m_NcgiList;
} }
void PresenceInfo::setNcgiList(std::vector<Ncgi> const& value) {
m_NcgiList = value;
m_NcgiListIsSet = true;
}
bool PresenceInfo::ncgiListIsSet() const { bool PresenceInfo::ncgiListIsSet() const {
return m_NcgiListIsSet; return m_NcgiListIsSet;
} }
void PresenceInfo::unsetNcgiList() { void PresenceInfo::unsetNcgiList() {
m_NcgiListIsSet = false; m_NcgiListIsSet = false;
} }
std::vector<GlobalRanNodeId>& PresenceInfo::getGlobalRanNodeIdList() { std::vector<GlobalRanNodeId> PresenceInfo::getGlobalRanNodeIdList() const {
return m_GlobalRanNodeIdList; return m_GlobalRanNodeIdList;
} }
void PresenceInfo::setGlobalRanNodeIdList(
std::vector<GlobalRanNodeId> const& value) {
m_GlobalRanNodeIdList = value;
m_GlobalRanNodeIdListIsSet = true;
}
bool PresenceInfo::globalRanNodeIdListIsSet() const { bool PresenceInfo::globalRanNodeIdListIsSet() const {
return m_GlobalRanNodeIdListIsSet; return m_GlobalRanNodeIdListIsSet;
} }
void PresenceInfo::unsetGlobalRanNodeIdList() { void PresenceInfo::unsetGlobalRanNodeIdList() {
m_GlobalRanNodeIdListIsSet = false; m_GlobalRanNodeIdListIsSet = false;
} }
std::vector<GlobalRanNodeId> PresenceInfo::getGlobaleNbIdList() const {
return m_GlobaleNbIdList;
}
void PresenceInfo::setGlobaleNbIdList(
std::vector<GlobalRanNodeId> const& value) {
m_GlobaleNbIdList = value;
m_GlobaleNbIdListIsSet = true;
}
bool PresenceInfo::globaleNbIdListIsSet() const {
return m_GlobaleNbIdListIsSet;
}
void PresenceInfo::unsetGlobaleNbIdList() {
m_GlobaleNbIdListIsSet = false;
}
} // namespace model } // namespace oai::amf::model
} // namespace amf
} // namespace oai
/** /**
* Namf_Communication * Namf_EventExposure
* AMF Communication Service © 2019, 3GPP Organizational Partners (ARIB, ATIS, * AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. * CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* *
* The version of the OpenAPI document: 1.1.0.alpha-1 * The version of the OpenAPI document: 1.1.0.alpha-1
...@@ -28,9 +28,7 @@ ...@@ -28,9 +28,7 @@
#include <vector> #include <vector>
#include <nlohmann/json.hpp> #include <nlohmann/json.hpp>
namespace oai { namespace oai::amf::model {
namespace amf {
namespace model {
/// <summary> /// <summary>
/// ///
...@@ -38,9 +36,22 @@ namespace model { ...@@ -38,9 +36,22 @@ namespace model {
class PresenceInfo { class PresenceInfo {
public: public:
PresenceInfo(); PresenceInfo();
virtual ~PresenceInfo(); virtual ~PresenceInfo() = default;
void validate(); /// <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 PresenceInfo& rhs) const;
bool operator!=(const PresenceInfo& rhs) const;
///////////////////////////////////////////// /////////////////////////////////////////////
/// PresenceInfo members /// PresenceInfo members
...@@ -55,6 +66,13 @@ class PresenceInfo { ...@@ -55,6 +66,13 @@ class PresenceInfo {
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
std::string getAdditionalPraId() const;
void setAdditionalPraId(std::string const& value);
bool additionalPraIdIsSet() const;
void unsetAdditionalPraId();
/// <summary>
///
/// </summary>
PresenceState getPresenceState() const; PresenceState getPresenceState() const;
void setPresenceState(PresenceState const& value); void setPresenceState(PresenceState const& value);
bool presenceStateIsSet() const; bool presenceStateIsSet() const;
...@@ -62,34 +80,51 @@ class PresenceInfo { ...@@ -62,34 +80,51 @@ class PresenceInfo {
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
std::vector<Tai>& getTrackingAreaList(); std::vector<Tai> getTrackingAreaList() const;
void setTrackingAreaList(std::vector<Tai> const& value);
bool trackingAreaListIsSet() const; bool trackingAreaListIsSet() const;
void unsetTrackingAreaList(); void unsetTrackingAreaList();
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
std::vector<Ecgi>& getEcgiList(); std::vector<Ecgi> getEcgiList() const;
void setEcgiList(std::vector<Ecgi> const& value);
bool ecgiListIsSet() const; bool ecgiListIsSet() const;
void unsetEcgiList(); void unsetEcgiList();
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
std::vector<Ncgi>& getNcgiList(); std::vector<Ncgi> getNcgiList() const;
void setNcgiList(std::vector<Ncgi> const& value);
bool ncgiListIsSet() const; bool ncgiListIsSet() const;
void unsetNcgiList(); void unsetNcgiList();
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
std::vector<GlobalRanNodeId>& getGlobalRanNodeIdList(); std::vector<GlobalRanNodeId> getGlobalRanNodeIdList() const;
void setGlobalRanNodeIdList(std::vector<GlobalRanNodeId> const& value);
bool globalRanNodeIdListIsSet() const; bool globalRanNodeIdListIsSet() const;
void unsetGlobalRanNodeIdList(); void unsetGlobalRanNodeIdList();
/// <summary>
///
/// </summary>
std::vector<GlobalRanNodeId> getGlobaleNbIdList() const;
void setGlobaleNbIdList(std::vector<GlobalRanNodeId> const& value);
bool globaleNbIdListIsSet() const;
void unsetGlobaleNbIdList();
friend void to_json(nlohmann::json& j, const PresenceInfo& o); friend void to_json(nlohmann::json& j, const PresenceInfo& o);
friend void from_json(const nlohmann::json& j, PresenceInfo& o); friend void from_json(const nlohmann::json& j, PresenceInfo& o);
// 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: protected:
std::string m_PraId; std::string m_PraId;
bool m_PraIdIsSet; bool m_PraIdIsSet;
std::string m_AdditionalPraId;
bool m_AdditionalPraIdIsSet;
PresenceState m_PresenceState; PresenceState m_PresenceState;
bool m_PresenceStateIsSet; bool m_PresenceStateIsSet;
std::vector<Tai> m_TrackingAreaList; std::vector<Tai> m_TrackingAreaList;
...@@ -100,10 +135,10 @@ class PresenceInfo { ...@@ -100,10 +135,10 @@ class PresenceInfo {
bool m_NcgiListIsSet; bool m_NcgiListIsSet;
std::vector<GlobalRanNodeId> m_GlobalRanNodeIdList; std::vector<GlobalRanNodeId> m_GlobalRanNodeIdList;
bool m_GlobalRanNodeIdListIsSet; bool m_GlobalRanNodeIdListIsSet;
std::vector<GlobalRanNodeId> m_GlobaleNbIdList;
bool m_GlobaleNbIdListIsSet;
}; };
} // namespace model } // namespace oai::amf::model
} // namespace amf
} // namespace oai
#endif /* PresenceInfo_H_ */ #endif /* PresenceInfo_H_ */
/** /**
* Namf_Communication * Namf_EventExposure
* AMF Communication Service © 2019, 3GPP Organizational Partners (ARIB, ATIS, * AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. * CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* *
* The version of the OpenAPI document: 1.1.0.alpha-1 * The version of the OpenAPI document: 1.1.0.alpha-1
...@@ -12,17 +12,41 @@ ...@@ -12,17 +12,41 @@
*/ */
#include "PresenceState.h" #include "PresenceState.h"
#include "Helpers.h"
namespace oai { #include <sstream>
namespace amf {
namespace model { namespace oai::amf::model {
PresenceState::PresenceState() {} PresenceState::PresenceState() {}
PresenceState::~PresenceState() {} void PresenceState::validate() const {
std::stringstream msg;
if (!validate(msg)) {
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool PresenceState::validate(std::stringstream& msg) const {
return validate(msg, "");
}
bool PresenceState::validate(
std::stringstream& msg, const std::string& pathPrefix) const {
bool success = true;
const std::string _pathPrefix =
pathPrefix.empty() ? "PresenceState" : pathPrefix;
return success;
}
bool PresenceState::operator==(const PresenceState& rhs) const {
return true; // TODO
;
}
void PresenceState::validate() { bool PresenceState::operator!=(const PresenceState& rhs) const {
// TODO: implement validation return !(*this == rhs);
} }
void to_json(nlohmann::json& j, const PresenceState& o) { void to_json(nlohmann::json& j, const PresenceState& o) {
...@@ -31,6 +55,4 @@ void to_json(nlohmann::json& j, const PresenceState& o) { ...@@ -31,6 +55,4 @@ void to_json(nlohmann::json& j, const PresenceState& o) {
void from_json(const nlohmann::json& j, PresenceState& o) {} void from_json(const nlohmann::json& j, PresenceState& o) {}
} // namespace model } // namespace oai::amf::model
} // namespace amf
} // namespace oai
/** /**
* Namf_Communication * Namf_EventExposure
* AMF Communication Service © 2019, 3GPP Organizational Partners (ARIB, ATIS, * AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. * CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* *
* The version of the OpenAPI document: 1.1.0.alpha-1 * The version of the OpenAPI document: 1.1.0.alpha-1
...@@ -19,11 +19,10 @@ ...@@ -19,11 +19,10 @@
#ifndef PresenceState_H_ #ifndef PresenceState_H_
#define PresenceState_H_ #define PresenceState_H_
#include "PresenceState_anyOf.h"
#include <nlohmann/json.hpp> #include <nlohmann/json.hpp>
namespace oai { namespace oai::amf::model {
namespace amf {
namespace model {
/// <summary> /// <summary>
/// ///
...@@ -31,9 +30,22 @@ namespace model { ...@@ -31,9 +30,22 @@ namespace model {
class PresenceState { class PresenceState {
public: public:
PresenceState(); PresenceState();
virtual ~PresenceState(); virtual ~PresenceState() = default;
void validate(); /// <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 PresenceState& rhs) const;
bool operator!=(const PresenceState& rhs) const;
///////////////////////////////////////////// /////////////////////////////////////////////
/// PresenceState members /// PresenceState members
...@@ -42,10 +54,11 @@ class PresenceState { ...@@ -42,10 +54,11 @@ class PresenceState {
friend void from_json(const nlohmann::json& j, PresenceState& o); friend void from_json(const nlohmann::json& j, PresenceState& o);
protected: protected:
// 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 model } // namespace oai::amf::model
} // namespace amf
} // namespace oai
#endif /* PresenceState_H_ */ #endif /* PresenceState_H_ */
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
#include "PresenceState_anyOf.h"
#include "Helpers.h"
#include <stdexcept>
#include <sstream>
namespace oai::amf::model {
PresenceState_anyOf::PresenceState_anyOf() {}
void PresenceState_anyOf::validate() const {
std::stringstream msg;
if (!validate(msg)) {
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool PresenceState_anyOf::validate(std::stringstream& msg) const {
return validate(msg, "");
}
bool PresenceState_anyOf::validate(
std::stringstream& msg, const std::string& pathPrefix) const {
bool success = true;
const std::string _pathPrefix =
pathPrefix.empty() ? "PresenceState_anyOf" : pathPrefix;
if (m_value == PresenceState_anyOf::ePresenceState_anyOf::
INVALID_VALUE_OPENAPI_GENERATED) {
success = false;
msg << _pathPrefix << ": has no value;";
}
return success;
}
bool PresenceState_anyOf::operator==(const PresenceState_anyOf& rhs) const {
return getValue() == rhs.getValue()
;
}
bool PresenceState_anyOf::operator!=(const PresenceState_anyOf& rhs) const {
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const PresenceState_anyOf& o) {
j = nlohmann::json();
switch (o.getValue()) {
case PresenceState_anyOf::ePresenceState_anyOf::
INVALID_VALUE_OPENAPI_GENERATED:
j = "INVALID_VALUE_OPENAPI_GENERATED";
break;
case PresenceState_anyOf::ePresenceState_anyOf::IN_AREA:
j = "IN_AREA";
break;
case PresenceState_anyOf::ePresenceState_anyOf::OUT_OF_AREA:
j = "OUT_OF_AREA";
break;
case PresenceState_anyOf::ePresenceState_anyOf::UNKNOWN:
j = "UNKNOWN";
break;
case PresenceState_anyOf::ePresenceState_anyOf::INACTIVE:
j = "INACTIVE";
break;
}
}
void from_json(const nlohmann::json& j, PresenceState_anyOf& o) {
auto s = j.get<std::string>();
if (s == "IN_AREA") {
o.setValue(PresenceState_anyOf::ePresenceState_anyOf::IN_AREA);
} else if (s == "OUT_OF_AREA") {
o.setValue(PresenceState_anyOf::ePresenceState_anyOf::OUT_OF_AREA);
} else if (s == "UNKNOWN") {
o.setValue(PresenceState_anyOf::ePresenceState_anyOf::UNKNOWN);
} else if (s == "INACTIVE") {
o.setValue(PresenceState_anyOf::ePresenceState_anyOf::INACTIVE);
} else {
std::stringstream ss;
ss << "Unexpected value " << s << " in json"
<< " cannot be converted to enum of type"
<< " PresenceState_anyOf::ePresenceState_anyOf";
throw std::invalid_argument(ss.str());
}
}
PresenceState_anyOf::ePresenceState_anyOf PresenceState_anyOf::getValue()
const {
return m_value;
}
void PresenceState_anyOf::setValue(
PresenceState_anyOf::ePresenceState_anyOf value) {
m_value = value;
}
} // namespace oai::amf::model
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
/*
* PresenceState_anyOf.h
*
*
*/
#ifndef PresenceState_anyOf_H_
#define PresenceState_anyOf_H_
#include <nlohmann/json.hpp>
namespace oai::amf::model {
/// <summary>
///
/// </summary>
class PresenceState_anyOf {
public:
PresenceState_anyOf();
virtual ~PresenceState_anyOf() = default;
enum class ePresenceState_anyOf {
// To have a valid default value.
// Avoiding nameclashes with user defined
// enum values
INVALID_VALUE_OPENAPI_GENERATED = 0,
IN_AREA,
OUT_OF_AREA,
UNKNOWN,
INACTIVE
};
/// <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 PresenceState_anyOf& rhs) const;
bool operator!=(const PresenceState_anyOf& rhs) const;
/////////////////////////////////////////////
/// PresenceState_anyOf members
PresenceState_anyOf::ePresenceState_anyOf getValue() const;
void setValue(PresenceState_anyOf::ePresenceState_anyOf value);
friend void to_json(nlohmann::json& j, const PresenceState_anyOf& o);
friend void from_json(const nlohmann::json& j, PresenceState_anyOf& o);
protected:
PresenceState_anyOf::ePresenceState_anyOf m_value = PresenceState_anyOf::
ePresenceState_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
#endif /* PresenceState_anyOf_H_ */
/** /**
* Namf_Communication * Namf_EventExposure
* AMF Communication Service © 2019, 3GPP Organizational Partners (ARIB, ATIS, * AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. * CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* *
* The version of the OpenAPI document: 1.1.0.alpha-1 * The version of the OpenAPI document: 1.1.0.alpha-1
...@@ -12,10 +12,11 @@ ...@@ -12,10 +12,11 @@
*/ */
#include "ProblemDetails.h" #include "ProblemDetails.h"
#include "Helpers.h"
namespace oai { #include <sstream>
namespace amf {
namespace model { namespace oai::amf::model {
ProblemDetails::ProblemDetails() { ProblemDetails::ProblemDetails() {
m_Type = ""; m_Type = "";
...@@ -33,12 +34,114 @@ ProblemDetails::ProblemDetails() { ...@@ -33,12 +34,114 @@ ProblemDetails::ProblemDetails() {
m_InvalidParamsIsSet = false; m_InvalidParamsIsSet = false;
m_SupportedFeatures = ""; m_SupportedFeatures = "";
m_SupportedFeaturesIsSet = false; m_SupportedFeaturesIsSet = false;
m_TargetScp = "";
m_TargetScpIsSet = false;
m_AccessTokenErrorIsSet = false;
m_AccessTokenRequestIsSet = false;
m_NrfId = "";
m_NrfIdIsSet = false;
}
void ProblemDetails::validate() const {
std::stringstream msg;
if (!validate(msg)) {
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
} }
ProblemDetails::~ProblemDetails() {} bool ProblemDetails::validate(std::stringstream& msg) const {
return validate(msg, "");
}
bool ProblemDetails::validate(
std::stringstream& msg, const std::string& pathPrefix) const {
bool success = true;
const std::string _pathPrefix =
pathPrefix.empty() ? "ProblemDetails" : pathPrefix;
if (invalidParamsIsSet()) {
const std::vector<InvalidParam>& value = m_InvalidParams;
const std::string currentValuePath = _pathPrefix + ".invalidParams";
if (value.size() < 1) {
success = false;
msg << currentValuePath << ": must have at least 1 elements;";
}
{ // Recursive validation of array elements
const std::string oldValuePath = currentValuePath;
int i = 0;
for (const InvalidParam& value : value) {
const std::string currentValuePath =
oldValuePath + "[" + std::to_string(i) + "]";
success =
value.validate(msg, currentValuePath + ".invalidParams") && success;
i++;
}
}
}
if (supportedFeaturesIsSet()) {
const std::string& value = m_SupportedFeatures;
const std::string currentValuePath = _pathPrefix + ".supportedFeatures";
}
return success;
}
bool ProblemDetails::operator==(const ProblemDetails& rhs) const {
return
((!typeIsSet() && !rhs.typeIsSet()) ||
(typeIsSet() && rhs.typeIsSet() && getType() == rhs.getType())) &&
((!titleIsSet() && !rhs.titleIsSet()) ||
(titleIsSet() && rhs.titleIsSet() && getTitle() == rhs.getTitle())) &&
((!statusIsSet() && !rhs.statusIsSet()) ||
(statusIsSet() && rhs.statusIsSet() &&
getStatus() == rhs.getStatus())) &&
((!detailIsSet() && !rhs.detailIsSet()) ||
(detailIsSet() && rhs.detailIsSet() &&
getDetail() == rhs.getDetail())) &&
((!instanceIsSet() && !rhs.instanceIsSet()) ||
(instanceIsSet() && rhs.instanceIsSet() &&
getInstance() == rhs.getInstance())) &&
((!causeIsSet() && !rhs.causeIsSet()) ||
(causeIsSet() && rhs.causeIsSet() && getCause() == rhs.getCause())) &&
((!invalidParamsIsSet() && !rhs.invalidParamsIsSet()) ||
(invalidParamsIsSet() && rhs.invalidParamsIsSet() &&
getInvalidParams() == rhs.getInvalidParams())) &&
((!supportedFeaturesIsSet() && !rhs.supportedFeaturesIsSet()) ||
(supportedFeaturesIsSet() && rhs.supportedFeaturesIsSet() &&
getSupportedFeatures() == rhs.getSupportedFeatures())) &&
void ProblemDetails::validate() { ((!targetScpIsSet() && !rhs.targetScpIsSet()) ||
// TODO: implement validation (targetScpIsSet() && rhs.targetScpIsSet() &&
getTargetScp() == rhs.getTargetScp())) &&
((!accessTokenErrorIsSet() && !rhs.accessTokenErrorIsSet()) ||
(accessTokenErrorIsSet() && rhs.accessTokenErrorIsSet() &&
getAccessTokenError() == rhs.getAccessTokenError())) &&
((!accessTokenRequestIsSet() && !rhs.accessTokenRequestIsSet()) ||
(accessTokenRequestIsSet() && rhs.accessTokenRequestIsSet() &&
getAccessTokenRequest() == rhs.getAccessTokenRequest())) &&
((!nrfIdIsSet() && !rhs.nrfIdIsSet()) ||
(nrfIdIsSet() && rhs.nrfIdIsSet() && getNrfId() == rhs.getNrfId()))
;
}
bool ProblemDetails::operator!=(const ProblemDetails& rhs) const {
return !(*this == rhs);
} }
void to_json(nlohmann::json& j, const ProblemDetails& o) { void to_json(nlohmann::json& j, const ProblemDetails& o) {
...@@ -49,9 +152,15 @@ void to_json(nlohmann::json& j, const ProblemDetails& o) { ...@@ -49,9 +152,15 @@ void to_json(nlohmann::json& j, const ProblemDetails& o) {
if (o.detailIsSet()) j["detail"] = o.m_Detail; if (o.detailIsSet()) j["detail"] = o.m_Detail;
if (o.instanceIsSet()) j["instance"] = o.m_Instance; if (o.instanceIsSet()) j["instance"] = o.m_Instance;
if (o.causeIsSet()) j["cause"] = o.m_Cause; if (o.causeIsSet()) j["cause"] = o.m_Cause;
if (o.invalidParamsIsSet()) j["invalidParams"] = o.m_InvalidParams; if (o.invalidParamsIsSet() || !o.m_InvalidParams.empty())
j["invalidParams"] = o.m_InvalidParams;
if (o.supportedFeaturesIsSet()) if (o.supportedFeaturesIsSet())
j["supportedFeatures"] = o.m_SupportedFeatures; j["supportedFeatures"] = o.m_SupportedFeatures;
if (o.targetScpIsSet()) j["targetScp"] = o.m_TargetScp;
if (o.accessTokenErrorIsSet()) j["accessTokenError"] = o.m_AccessTokenError;
if (o.accessTokenRequestIsSet())
j["accessTokenRequest"] = o.m_AccessTokenRequest;
if (o.nrfIdIsSet()) j["nrfId"] = o.m_NrfId;
} }
void from_json(const nlohmann::json& j, ProblemDetails& o) { void from_json(const nlohmann::json& j, ProblemDetails& o) {
...@@ -87,6 +196,22 @@ void from_json(const nlohmann::json& j, ProblemDetails& o) { ...@@ -87,6 +196,22 @@ void from_json(const nlohmann::json& j, ProblemDetails& o) {
j.at("supportedFeatures").get_to(o.m_SupportedFeatures); j.at("supportedFeatures").get_to(o.m_SupportedFeatures);
o.m_SupportedFeaturesIsSet = true; o.m_SupportedFeaturesIsSet = true;
} }
if (j.find("targetScp") != j.end()) {
j.at("targetScp").get_to(o.m_TargetScp);
o.m_TargetScpIsSet = true;
}
if (j.find("accessTokenError") != j.end()) {
j.at("accessTokenError").get_to(o.m_AccessTokenError);
o.m_AccessTokenErrorIsSet = true;
}
if (j.find("accessTokenRequest") != j.end()) {
j.at("accessTokenRequest").get_to(o.m_AccessTokenRequest);
o.m_AccessTokenRequestIsSet = true;
}
if (j.find("nrfId") != j.end()) {
j.at("nrfId").get_to(o.m_NrfId);
o.m_NrfIdIsSet = true;
}
} }
std::string ProblemDetails::getType() const { std::string ProblemDetails::getType() const {
...@@ -167,9 +292,13 @@ bool ProblemDetails::causeIsSet() const { ...@@ -167,9 +292,13 @@ bool ProblemDetails::causeIsSet() const {
void ProblemDetails::unsetCause() { void ProblemDetails::unsetCause() {
m_CauseIsSet = false; m_CauseIsSet = false;
} }
std::vector<InvalidParam>& ProblemDetails::getInvalidParams() { std::vector<InvalidParam> ProblemDetails::getInvalidParams() const {
return m_InvalidParams; return m_InvalidParams;
} }
void ProblemDetails::setInvalidParams(std::vector<InvalidParam> const& value) {
m_InvalidParams = value;
m_InvalidParamsIsSet = true;
}
bool ProblemDetails::invalidParamsIsSet() const { bool ProblemDetails::invalidParamsIsSet() const {
return m_InvalidParamsIsSet; return m_InvalidParamsIsSet;
} }
...@@ -189,7 +318,57 @@ bool ProblemDetails::supportedFeaturesIsSet() const { ...@@ -189,7 +318,57 @@ bool ProblemDetails::supportedFeaturesIsSet() const {
void ProblemDetails::unsetSupportedFeatures() { void ProblemDetails::unsetSupportedFeatures() {
m_SupportedFeaturesIsSet = false; m_SupportedFeaturesIsSet = false;
} }
std::string ProblemDetails::getTargetScp() const {
return m_TargetScp;
}
void ProblemDetails::setTargetScp(std::string const& value) {
m_TargetScp = value;
m_TargetScpIsSet = true;
}
bool ProblemDetails::targetScpIsSet() const {
return m_TargetScpIsSet;
}
void ProblemDetails::unsetTargetScp() {
m_TargetScpIsSet = false;
}
AccessTokenErr ProblemDetails::getAccessTokenError() const {
return m_AccessTokenError;
}
void ProblemDetails::setAccessTokenError(AccessTokenErr const& value) {
m_AccessTokenError = value;
m_AccessTokenErrorIsSet = true;
}
bool ProblemDetails::accessTokenErrorIsSet() const {
return m_AccessTokenErrorIsSet;
}
void ProblemDetails::unsetAccessTokenError() {
m_AccessTokenErrorIsSet = false;
}
AccessTokenReq ProblemDetails::getAccessTokenRequest() const {
return m_AccessTokenRequest;
}
void ProblemDetails::setAccessTokenRequest(AccessTokenReq const& value) {
m_AccessTokenRequest = value;
m_AccessTokenRequestIsSet = true;
}
bool ProblemDetails::accessTokenRequestIsSet() const {
return m_AccessTokenRequestIsSet;
}
void ProblemDetails::unsetAccessTokenRequest() {
m_AccessTokenRequestIsSet = false;
}
std::string ProblemDetails::getNrfId() const {
return m_NrfId;
}
void ProblemDetails::setNrfId(std::string const& value) {
m_NrfId = value;
m_NrfIdIsSet = true;
}
bool ProblemDetails::nrfIdIsSet() const {
return m_NrfIdIsSet;
}
void ProblemDetails::unsetNrfId() {
m_NrfIdIsSet = false;
}
} // namespace model } // namespace oai::amf::model
} // namespace amf
} // namespace oai
/** /**
* Namf_Communication * Namf_EventExposure
* AMF Communication Service © 2019, 3GPP Organizational Partners (ARIB, ATIS, * AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. * CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* *
* The version of the OpenAPI document: 1.1.0.alpha-1 * The version of the OpenAPI document: 1.1.0.alpha-1
...@@ -21,12 +21,12 @@ ...@@ -21,12 +21,12 @@
#include <string> #include <string>
#include "InvalidParam.h" #include "InvalidParam.h"
#include "AccessTokenErr.h"
#include "AccessTokenReq.h"
#include <vector> #include <vector>
#include <nlohmann/json.hpp> #include <nlohmann/json.hpp>
namespace oai { namespace oai::amf::model {
namespace amf {
namespace model {
/// <summary> /// <summary>
/// ///
...@@ -34,9 +34,22 @@ namespace model { ...@@ -34,9 +34,22 @@ namespace model {
class ProblemDetails { class ProblemDetails {
public: public:
ProblemDetails(); ProblemDetails();
virtual ~ProblemDetails(); virtual ~ProblemDetails() = default;
void validate(); /// <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 ProblemDetails& rhs) const;
bool operator!=(const ProblemDetails& rhs) const;
///////////////////////////////////////////// /////////////////////////////////////////////
/// ProblemDetails members /// ProblemDetails members
...@@ -86,7 +99,8 @@ class ProblemDetails { ...@@ -86,7 +99,8 @@ class ProblemDetails {
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
std::vector<InvalidParam>& getInvalidParams(); std::vector<InvalidParam> getInvalidParams() const;
void setInvalidParams(std::vector<InvalidParam> const& value);
bool invalidParamsIsSet() const; bool invalidParamsIsSet() const;
void unsetInvalidParams(); void unsetInvalidParams();
/// <summary> /// <summary>
...@@ -96,6 +110,34 @@ class ProblemDetails { ...@@ -96,6 +110,34 @@ class ProblemDetails {
void setSupportedFeatures(std::string const& value); void setSupportedFeatures(std::string const& value);
bool supportedFeaturesIsSet() const; bool supportedFeaturesIsSet() const;
void unsetSupportedFeatures(); void unsetSupportedFeatures();
/// <summary>
///
/// </summary>
std::string getTargetScp() const;
void setTargetScp(std::string const& value);
bool targetScpIsSet() const;
void unsetTargetScp();
/// <summary>
///
/// </summary>
AccessTokenErr getAccessTokenError() const;
void setAccessTokenError(AccessTokenErr const& value);
bool accessTokenErrorIsSet() const;
void unsetAccessTokenError();
/// <summary>
///
/// </summary>
AccessTokenReq getAccessTokenRequest() const;
void setAccessTokenRequest(AccessTokenReq const& value);
bool accessTokenRequestIsSet() const;
void unsetAccessTokenRequest();
/// <summary>
///
/// </summary>
std::string getNrfId() const;
void setNrfId(std::string const& value);
bool nrfIdIsSet() const;
void unsetNrfId();
friend void to_json(nlohmann::json& j, const ProblemDetails& o); friend void to_json(nlohmann::json& j, const ProblemDetails& o);
friend void from_json(const nlohmann::json& j, ProblemDetails& o); friend void from_json(const nlohmann::json& j, ProblemDetails& o);
...@@ -117,10 +159,20 @@ class ProblemDetails { ...@@ -117,10 +159,20 @@ class ProblemDetails {
bool m_InvalidParamsIsSet; bool m_InvalidParamsIsSet;
std::string m_SupportedFeatures; std::string m_SupportedFeatures;
bool m_SupportedFeaturesIsSet; bool m_SupportedFeaturesIsSet;
std::string m_TargetScp;
bool m_TargetScpIsSet;
AccessTokenErr m_AccessTokenError;
bool m_AccessTokenErrorIsSet;
AccessTokenReq m_AccessTokenRequest;
bool m_AccessTokenRequestIsSet;
std::string m_NrfId;
bool m_NrfIdIsSet;
// 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 model } // namespace oai::amf::model
} // namespace amf
} // namespace oai
#endif /* ProblemDetails_H_ */ #endif /* ProblemDetails_H_ */
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
#include "RmInfo.h"
#include "Helpers.h"
#include <sstream>
namespace oai::amf::model {
RmInfo::RmInfo() {}
void RmInfo::validate() const {
std::stringstream msg;
if (!validate(msg)) {
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool RmInfo::validate(std::stringstream& msg) const {
return validate(msg, "");
}
bool RmInfo::validate(
std::stringstream& msg, const std::string& pathPrefix) const {
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "RmInfo" : pathPrefix;
return success;
}
bool RmInfo::operator==(const RmInfo& rhs) const {
return
(getRmState() == rhs.getRmState()) &&
(getAccessType() == rhs.getAccessType())
;
}
bool RmInfo::operator!=(const RmInfo& rhs) const {
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const RmInfo& o) {
j = nlohmann::json();
j["rmState"] = o.m_RmState;
j["accessType"] = o.m_AccessType;
}
void from_json(const nlohmann::json& j, RmInfo& o) {
j.at("rmState").get_to(o.m_RmState);
j.at("accessType").get_to(o.m_AccessType);
}
RmState RmInfo::getRmState() const {
return m_RmState;
}
void RmInfo::setRmState(RmState const& value) {
m_RmState = value;
}
AccessType RmInfo::getAccessType() const {
return m_AccessType;
}
void RmInfo::setAccessType(AccessType const& value) {
m_AccessType = value;
}
} // namespace oai::amf::model
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
/*
* RmInfo.h
*
*
*/
#ifndef RmInfo_H_
#define RmInfo_H_
#include "RmState.h"
#include "AccessType.h"
#include <nlohmann/json.hpp>
namespace oai::amf::model {
/// <summary>
///
/// </summary>
class RmInfo {
public:
RmInfo();
virtual ~RmInfo() = 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. Returns false on error and writes
/// an error message into the given stringstream.
/// </summary>
bool validate(std::stringstream& msg) const;
bool operator==(const RmInfo& rhs) const;
bool operator!=(const RmInfo& rhs) const;
/////////////////////////////////////////////
/// RmInfo members
/// <summary>
///
/// </summary>
RmState getRmState() const;
void setRmState(RmState const& value);
/// <summary>
///
/// </summary>
AccessType getAccessType() const;
void setAccessType(AccessType const& value);
friend void to_json(nlohmann::json& j, const RmInfo& o);
friend void from_json(const nlohmann::json& j, RmInfo& o);
// 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:
RmState m_RmState;
AccessType m_AccessType;
};
} // namespace oai::amf::model
#endif /* RmInfo_H_ */
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
#include "RmState.h"
#include "Helpers.h"
#include <sstream>
namespace oai::amf::model {
RmState::RmState() {}
void RmState::validate() const {
std::stringstream msg;
if (!validate(msg)) {
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool RmState::validate(std::stringstream& msg) const {
return validate(msg, "");
}
bool RmState::validate(
std::stringstream& msg, const std::string& pathPrefix) const {
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "RmState" : pathPrefix;
return success;
}
bool RmState::operator==(const RmState& rhs) const {
return true; // TODO
;
}
bool RmState::operator!=(const RmState& rhs) const {
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const RmState& o) {
j = nlohmann::json();
}
void from_json(const nlohmann::json& j, RmState& o) {}
} // namespace oai::amf::model
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
/*
* RmState.h
*
*
*/
#ifndef RmState_H_
#define RmState_H_
#include "RmState_anyOf.h"
#include <nlohmann/json.hpp>
namespace oai::amf::model {
/// <summary>
///
/// </summary>
class RmState {
public:
RmState();
virtual ~RmState() = 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. Returns false on error and writes
/// an error message into the given stringstream.
/// </summary>
bool validate(std::stringstream& msg) const;
bool operator==(const RmState& rhs) const;
bool operator!=(const RmState& rhs) const;
/////////////////////////////////////////////
/// RmState members
friend void to_json(nlohmann::json& j, const RmState& o);
friend void from_json(const nlohmann::json& j, RmState& o);
protected:
// 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
#endif /* RmState_H_ */
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
#include "RmState_anyOf.h"
#include "Helpers.h"
#include <stdexcept>
#include <sstream>
namespace oai::amf::model {
RmState_anyOf::RmState_anyOf() {}
void RmState_anyOf::validate() const {
std::stringstream msg;
if (!validate(msg)) {
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool RmState_anyOf::validate(std::stringstream& msg) const {
return validate(msg, "");
}
bool RmState_anyOf::validate(
std::stringstream& msg, const std::string& pathPrefix) const {
bool success = true;
const std::string _pathPrefix =
pathPrefix.empty() ? "RmState_anyOf" : pathPrefix;
if (m_value ==
RmState_anyOf::eRmState_anyOf::INVALID_VALUE_OPENAPI_GENERATED) {
success = false;
msg << _pathPrefix << ": has no value;";
}
return success;
}
bool RmState_anyOf::operator==(const RmState_anyOf& rhs) const {
return getValue() == rhs.getValue()
;
}
bool RmState_anyOf::operator!=(const RmState_anyOf& rhs) const {
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const RmState_anyOf& o) {
j = nlohmann::json();
switch (o.getValue()) {
case RmState_anyOf::eRmState_anyOf::INVALID_VALUE_OPENAPI_GENERATED:
j = "INVALID_VALUE_OPENAPI_GENERATED";
break;
case RmState_anyOf::eRmState_anyOf::REGISTERED:
j = "REGISTERED";
break;
case RmState_anyOf::eRmState_anyOf::DEREGISTERED:
j = "DEREGISTERED";
break;
}
}
void from_json(const nlohmann::json& j, RmState_anyOf& o) {
auto s = j.get<std::string>();
if (s == "REGISTERED") {
o.setValue(RmState_anyOf::eRmState_anyOf::REGISTERED);
} else if (s == "DEREGISTERED") {
o.setValue(RmState_anyOf::eRmState_anyOf::DEREGISTERED);
} else {
std::stringstream ss;
ss << "Unexpected value " << s << " in json"
<< " cannot be converted to enum of type"
<< " RmState_anyOf::eRmState_anyOf";
throw std::invalid_argument(ss.str());
}
}
RmState_anyOf::eRmState_anyOf RmState_anyOf::getValue() const {
return m_value;
}
void RmState_anyOf::setValue(RmState_anyOf::eRmState_anyOf value) {
m_value = value;
}
} // namespace oai::amf::model
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
/*
* RmState_anyOf.h
*
*
*/
#ifndef RmState_anyOf_H_
#define RmState_anyOf_H_
#include <nlohmann/json.hpp>
namespace oai::amf::model {
/// <summary>
///
/// </summary>
class RmState_anyOf {
public:
RmState_anyOf();
virtual ~RmState_anyOf() = default;
enum class eRmState_anyOf {
// To have a valid default value.
// Avoiding nameclashes with user defined
// enum values
INVALID_VALUE_OPENAPI_GENERATED = 0,
REGISTERED,
DEREGISTERED
};
/// <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 RmState_anyOf& rhs) const;
bool operator!=(const RmState_anyOf& rhs) const;
/////////////////////////////////////////////
/// RmState_anyOf members
RmState_anyOf::eRmState_anyOf getValue() const;
void setValue(RmState_anyOf::eRmState_anyOf value);
friend void to_json(nlohmann::json& j, const RmState_anyOf& o);
friend void from_json(const nlohmann::json& j, RmState_anyOf& o);
protected:
RmState_anyOf::eRmState_anyOf m_value =
RmState_anyOf::eRmState_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
#endif /* RmState_anyOf_H_ */
/** /**
* Namf_Communication * Namf_EventExposure
* AMF Communication Service © 2019, 3GPP Organizational Partners (ARIB, ATIS, * AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. * CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* *
* The version of the OpenAPI document: 1.1.0.alpha-1 * The version of the OpenAPI document: 1.1.0.alpha-1
...@@ -12,30 +12,78 @@ ...@@ -12,30 +12,78 @@
*/ */
#include "Tai.h" #include "Tai.h"
#include "Helpers.h"
namespace oai { #include <sstream>
namespace amf {
namespace model { namespace oai::amf::model {
Tai::Tai() { Tai::Tai() {
m_Tac = ""; m_Tac = "";
m_Nid = "";
m_NidIsSet = false;
}
void Tai::validate() const {
std::stringstream msg;
if (!validate(msg)) {
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool Tai::validate(std::stringstream& msg) const {
return validate(msg, "");
} }
Tai::~Tai() {} bool Tai::validate(
std::stringstream& msg, const std::string& pathPrefix) const {
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "Tai" : pathPrefix;
void Tai::validate() { /* Tac */ {
// TODO: implement validation const std::string& value = m_Tac;
const std::string currentValuePath = _pathPrefix + ".tac";
}
if (nidIsSet()) {
const std::string& value = m_Nid;
const std::string currentValuePath = _pathPrefix + ".nid";
}
return success;
}
bool Tai::operator==(const Tai& rhs) const {
return
(getPlmnId() == rhs.getPlmnId()) &&
(getTac() == rhs.getTac()) &&
((!nidIsSet() && !rhs.nidIsSet()) ||
(nidIsSet() && rhs.nidIsSet() && getNid() == rhs.getNid()))
;
}
bool Tai::operator!=(const Tai& rhs) const {
return !(*this == rhs);
} }
void to_json(nlohmann::json& j, const Tai& o) { void to_json(nlohmann::json& j, const Tai& o) {
j = nlohmann::json(); j = nlohmann::json();
j["plmnId"] = o.m_PlmnId; j["plmnId"] = o.m_PlmnId;
j["tac"] = o.m_Tac; j["tac"] = o.m_Tac;
if (o.nidIsSet()) j["nid"] = o.m_Nid;
} }
void from_json(const nlohmann::json& j, Tai& o) { void from_json(const nlohmann::json& j, Tai& o) {
j.at("plmnId").get_to(o.m_PlmnId); j.at("plmnId").get_to(o.m_PlmnId);
j.at("tac").get_to(o.m_Tac); j.at("tac").get_to(o.m_Tac);
if (j.find("nid") != j.end()) {
j.at("nid").get_to(o.m_Nid);
o.m_NidIsSet = true;
}
} }
PlmnId Tai::getPlmnId() const { PlmnId Tai::getPlmnId() const {
...@@ -50,7 +98,18 @@ std::string Tai::getTac() const { ...@@ -50,7 +98,18 @@ std::string Tai::getTac() const {
void Tai::setTac(std::string const& value) { void Tai::setTac(std::string const& value) {
m_Tac = value; m_Tac = value;
} }
std::string Tai::getNid() const {
return m_Nid;
}
void Tai::setNid(std::string const& value) {
m_Nid = value;
m_NidIsSet = true;
}
bool Tai::nidIsSet() const {
return m_NidIsSet;
}
void Tai::unsetNid() {
m_NidIsSet = false;
}
} // namespace model } // namespace oai::amf::model
} // namespace amf
} // namespace oai
/** /**
* Namf_Communication * Namf_EventExposure
* AMF Communication Service © 2019, 3GPP Organizational Partners (ARIB, ATIS, * AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. * CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* *
* The version of the OpenAPI document: 1.1.0.alpha-1 * The version of the OpenAPI document: 1.1.0.alpha-1
...@@ -23,9 +23,7 @@ ...@@ -23,9 +23,7 @@
#include "PlmnId.h" #include "PlmnId.h"
#include <nlohmann/json.hpp> #include <nlohmann/json.hpp>
namespace oai { namespace oai::amf::model {
namespace amf {
namespace model {
/// <summary> /// <summary>
/// ///
...@@ -33,9 +31,22 @@ namespace model { ...@@ -33,9 +31,22 @@ namespace model {
class Tai { class Tai {
public: public:
Tai(); Tai();
virtual ~Tai(); virtual ~Tai() = default;
void validate(); /// <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 Tai& rhs) const;
bool operator!=(const Tai& rhs) const;
///////////////////////////////////////////// /////////////////////////////////////////////
/// Tai members /// Tai members
...@@ -50,18 +61,30 @@ class Tai { ...@@ -50,18 +61,30 @@ class Tai {
/// </summary> /// </summary>
std::string getTac() const; std::string getTac() const;
void setTac(std::string const& value); void setTac(std::string const& value);
/// <summary>
///
/// </summary>
std::string getNid() const;
void setNid(std::string const& value);
bool nidIsSet() const;
void unsetNid();
friend void to_json(nlohmann::json& j, const Tai& o); friend void to_json(nlohmann::json& j, const Tai& o);
friend void from_json(const nlohmann::json& j, Tai& o); friend void from_json(const nlohmann::json& j, Tai& o);
// 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: protected:
PlmnId m_PlmnId; PlmnId m_PlmnId;
std::string m_Tac; std::string m_Tac;
std::string m_Nid;
bool m_NidIsSet;
}; };
} // namespace model } // namespace oai::amf::model
} // namespace amf
} // namespace oai
#endif /* Tai_H_ */ #endif /* Tai_H_ */
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
#include "TnapId.h"
#include "Helpers.h"
#include <sstream>
namespace oai::amf::model {
TnapId::TnapId() {
m_SsId = "";
m_SsIdIsSet = false;
m_BssId = "";
m_BssIdIsSet = false;
m_CivicAddressIsSet = false;
}
void TnapId::validate() const {
std::stringstream msg;
if (!validate(msg)) {
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool TnapId::validate(std::stringstream& msg) const {
return validate(msg, "");
}
bool TnapId::validate(
std::stringstream& msg, const std::string& pathPrefix) const {
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "TnapId" : pathPrefix;
return success;
}
bool TnapId::operator==(const TnapId& rhs) const {
return
((!ssIdIsSet() && !rhs.ssIdIsSet()) ||
(ssIdIsSet() && rhs.ssIdIsSet() && getSsId() == rhs.getSsId())) &&
((!bssIdIsSet() && !rhs.bssIdIsSet()) ||
(bssIdIsSet() && rhs.bssIdIsSet() && getBssId() == rhs.getBssId())) &&
((!civicAddressIsSet() && !rhs.civicAddressIsSet()) ||
(civicAddressIsSet() && rhs.civicAddressIsSet() &&
getCivicAddress() == rhs.getCivicAddress()))
;
}
bool TnapId::operator!=(const TnapId& rhs) const {
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const TnapId& o) {
j = nlohmann::json();
if (o.ssIdIsSet()) j["ssId"] = o.m_SsId;
if (o.bssIdIsSet()) j["bssId"] = o.m_BssId;
if (o.civicAddressIsSet()) j["civicAddress"] = o.m_CivicAddress;
}
void from_json(const nlohmann::json& j, TnapId& o) {
if (j.find("ssId") != j.end()) {
j.at("ssId").get_to(o.m_SsId);
o.m_SsIdIsSet = true;
}
if (j.find("bssId") != j.end()) {
j.at("bssId").get_to(o.m_BssId);
o.m_BssIdIsSet = true;
}
if (j.find("civicAddress") != j.end()) {
j.at("civicAddress").get_to(o.m_CivicAddress);
o.m_CivicAddressIsSet = true;
}
}
std::string TnapId::getSsId() const {
return m_SsId;
}
void TnapId::setSsId(std::string const& value) {
m_SsId = value;
m_SsIdIsSet = true;
}
bool TnapId::ssIdIsSet() const {
return m_SsIdIsSet;
}
void TnapId::unsetSsId() {
m_SsIdIsSet = false;
}
std::string TnapId::getBssId() const {
return m_BssId;
}
void TnapId::setBssId(std::string const& value) {
m_BssId = value;
m_BssIdIsSet = true;
}
bool TnapId::bssIdIsSet() const {
return m_BssIdIsSet;
}
void TnapId::unsetBssId() {
m_BssIdIsSet = false;
}
std::string TnapId::getCivicAddress() const {
return m_CivicAddress;
}
void TnapId::setCivicAddress(std::string const& value) {
m_CivicAddress = value;
m_CivicAddressIsSet = true;
}
bool TnapId::civicAddressIsSet() const {
return m_CivicAddressIsSet;
}
void TnapId::unsetCivicAddress() {
m_CivicAddressIsSet = false;
}
} // namespace oai::amf::model
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
/*
* TnapId.h
*
*
*/
#ifndef TnapId_H_
#define TnapId_H_
#include <string>
#include <nlohmann/json.hpp>
namespace oai::amf::model {
/// <summary>
///
/// </summary>
class TnapId {
public:
TnapId();
virtual ~TnapId() = 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. Returns false on error and writes
/// an error message into the given stringstream.
/// </summary>
bool validate(std::stringstream& msg) const;
bool operator==(const TnapId& rhs) const;
bool operator!=(const TnapId& rhs) const;
/////////////////////////////////////////////
/// TnapId members
/// <summary>
///
/// </summary>
std::string getSsId() const;
void setSsId(std::string const& value);
bool ssIdIsSet() const;
void unsetSsId();
/// <summary>
///
/// </summary>
std::string getBssId() const;
void setBssId(std::string const& value);
bool bssIdIsSet() const;
void unsetBssId();
/// <summary>
///
/// </summary>
std::string getCivicAddress() const;
void setCivicAddress(std::string const& value);
bool civicAddressIsSet() const;
void unsetCivicAddress();
friend void to_json(nlohmann::json& j, const TnapId& o);
friend void from_json(const nlohmann::json& j, TnapId& o);
protected:
std::string m_SsId;
bool m_SsIdIsSet;
std::string m_BssId;
bool m_BssIdIsSet;
std::string m_CivicAddress;
bool m_CivicAddressIsSet;
// 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
#endif /* TnapId_H_ */
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
#include "TwapId.h"
#include "Helpers.h"
#include <sstream>
namespace oai::amf::model {
TwapId::TwapId() {
m_SsId = "";
m_BssId = "";
m_BssIdIsSet = false;
m_CivicAddressIsSet = false;
}
void TwapId::validate() const {
std::stringstream msg;
if (!validate(msg)) {
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool TwapId::validate(std::stringstream& msg) const {
return validate(msg, "");
}
bool TwapId::validate(
std::stringstream& msg, const std::string& pathPrefix) const {
bool success = true;
const std::string _pathPrefix = pathPrefix.empty() ? "TwapId" : pathPrefix;
return success;
}
bool TwapId::operator==(const TwapId& rhs) const {
return
(getSsId() == rhs.getSsId()) &&
((!bssIdIsSet() && !rhs.bssIdIsSet()) ||
(bssIdIsSet() && rhs.bssIdIsSet() && getBssId() == rhs.getBssId())) &&
((!civicAddressIsSet() && !rhs.civicAddressIsSet()) ||
(civicAddressIsSet() && rhs.civicAddressIsSet() &&
getCivicAddress() == rhs.getCivicAddress()))
;
}
bool TwapId::operator!=(const TwapId& rhs) const {
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const TwapId& o) {
j = nlohmann::json();
j["ssId"] = o.m_SsId;
if (o.bssIdIsSet()) j["bssId"] = o.m_BssId;
if (o.civicAddressIsSet()) j["civicAddress"] = o.m_CivicAddress;
}
void from_json(const nlohmann::json& j, TwapId& o) {
j.at("ssId").get_to(o.m_SsId);
if (j.find("bssId") != j.end()) {
j.at("bssId").get_to(o.m_BssId);
o.m_BssIdIsSet = true;
}
if (j.find("civicAddress") != j.end()) {
j.at("civicAddress").get_to(o.m_CivicAddress);
o.m_CivicAddressIsSet = true;
}
}
std::string TwapId::getSsId() const {
return m_SsId;
}
void TwapId::setSsId(std::string const& value) {
m_SsId = value;
}
std::string TwapId::getBssId() const {
return m_BssId;
}
void TwapId::setBssId(std::string const& value) {
m_BssId = value;
m_BssIdIsSet = true;
}
bool TwapId::bssIdIsSet() const {
return m_BssIdIsSet;
}
void TwapId::unsetBssId() {
m_BssIdIsSet = false;
}
std::string TwapId::getCivicAddress() const {
return m_CivicAddress;
}
void TwapId::setCivicAddress(std::string const& value) {
m_CivicAddress = value;
m_CivicAddressIsSet = true;
}
bool TwapId::civicAddressIsSet() const {
return m_CivicAddressIsSet;
}
void TwapId::unsetCivicAddress() {
m_CivicAddressIsSet = false;
}
} // namespace oai::amf::model
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
/*
* TwapId.h
*
*
*/
#ifndef TwapId_H_
#define TwapId_H_
#include <string>
#include <nlohmann/json.hpp>
namespace oai::amf::model {
/// <summary>
///
/// </summary>
class TwapId {
public:
TwapId();
virtual ~TwapId() = 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. Returns false on error and writes
/// an error message into the given stringstream.
/// </summary>
bool validate(std::stringstream& msg) const;
bool operator==(const TwapId& rhs) const;
bool operator!=(const TwapId& rhs) const;
/////////////////////////////////////////////
/// TwapId members
/// <summary>
///
/// </summary>
std::string getSsId() const;
void setSsId(std::string const& value);
/// <summary>
///
/// </summary>
std::string getBssId() const;
void setBssId(std::string const& value);
bool bssIdIsSet() const;
void unsetBssId();
/// <summary>
///
/// </summary>
std::string getCivicAddress() const;
void setCivicAddress(std::string const& value);
bool civicAddressIsSet() const;
void unsetCivicAddress();
friend void to_json(nlohmann::json& j, const TwapId& o);
friend void from_json(const nlohmann::json& j, TwapId& o);
protected:
std::string m_SsId;
std::string m_BssId;
bool m_BssIdIsSet;
std::string m_CivicAddress;
bool m_CivicAddressIsSet;
// 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
#endif /* TwapId_H_ */
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
#include "UeReachability.h"
#include "Helpers.h"
#include <sstream>
namespace oai::amf::model {
UeReachability::UeReachability() {}
void UeReachability::validate() const {
std::stringstream msg;
if (!validate(msg)) {
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool UeReachability::validate(std::stringstream& msg) const {
return validate(msg, "");
}
bool UeReachability::validate(
std::stringstream& msg, const std::string& pathPrefix) const {
bool success = true;
const std::string _pathPrefix =
pathPrefix.empty() ? "UeReachability" : pathPrefix;
return success;
}
bool UeReachability::operator==(const UeReachability& rhs) const {
return true; // TODO
;
}
bool UeReachability::operator!=(const UeReachability& rhs) const {
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const UeReachability& o) {
j = nlohmann::json();
}
void from_json(const nlohmann::json& j, UeReachability& o) {}
} // namespace oai::amf::model
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
/*
* UeReachability.h
*
*
*/
#ifndef UeReachability_H_
#define UeReachability_H_
#include "UeReachability_anyOf.h"
#include <nlohmann/json.hpp>
namespace oai::amf::model {
/// <summary>
///
/// </summary>
class UeReachability {
public:
UeReachability();
virtual ~UeReachability() = 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. Returns false on error and writes
/// an error message into the given stringstream.
/// </summary>
bool validate(std::stringstream& msg) const;
bool operator==(const UeReachability& rhs) const;
bool operator!=(const UeReachability& rhs) const;
/////////////////////////////////////////////
/// UeReachability members
friend void to_json(nlohmann::json& j, const UeReachability& o);
friend void from_json(const nlohmann::json& j, UeReachability& o);
protected:
// 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
#endif /* UeReachability_H_ */
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
#include "UeReachability_anyOf.h"
#include "Helpers.h"
#include <stdexcept>
#include <sstream>
namespace oai::amf::model {
UeReachability_anyOf::UeReachability_anyOf() {}
void UeReachability_anyOf::validate() const {
std::stringstream msg;
if (!validate(msg)) {
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool UeReachability_anyOf::validate(std::stringstream& msg) const {
return validate(msg, "");
}
bool UeReachability_anyOf::validate(
std::stringstream& msg, const std::string& pathPrefix) const {
bool success = true;
const std::string _pathPrefix =
pathPrefix.empty() ? "UeReachability_anyOf" : pathPrefix;
if (m_value == UeReachability_anyOf::eUeReachability_anyOf::
INVALID_VALUE_OPENAPI_GENERATED) {
success = false;
msg << _pathPrefix << ": has no value;";
}
return success;
}
bool UeReachability_anyOf::operator==(const UeReachability_anyOf& rhs) const {
return getValue() == rhs.getValue()
;
}
bool UeReachability_anyOf::operator!=(const UeReachability_anyOf& rhs) const {
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const UeReachability_anyOf& o) {
j = nlohmann::json();
switch (o.getValue()) {
case UeReachability_anyOf::eUeReachability_anyOf::
INVALID_VALUE_OPENAPI_GENERATED:
j = "INVALID_VALUE_OPENAPI_GENERATED";
break;
case UeReachability_anyOf::eUeReachability_anyOf::UNREACHABLE:
j = "UNREACHABLE";
break;
case UeReachability_anyOf::eUeReachability_anyOf::REACHABLE:
j = "REACHABLE";
break;
case UeReachability_anyOf::eUeReachability_anyOf::REGULATORY_ONLY:
j = "REGULATORY_ONLY";
break;
}
}
void from_json(const nlohmann::json& j, UeReachability_anyOf& o) {
auto s = j.get<std::string>();
if (s == "UNREACHABLE") {
o.setValue(UeReachability_anyOf::eUeReachability_anyOf::UNREACHABLE);
} else if (s == "REACHABLE") {
o.setValue(UeReachability_anyOf::eUeReachability_anyOf::REACHABLE);
} else if (s == "REGULATORY_ONLY") {
o.setValue(UeReachability_anyOf::eUeReachability_anyOf::REGULATORY_ONLY);
} else {
std::stringstream ss;
ss << "Unexpected value " << s << " in json"
<< " cannot be converted to enum of type"
<< " UeReachability_anyOf::eUeReachability_anyOf";
throw std::invalid_argument(ss.str());
}
}
UeReachability_anyOf::eUeReachability_anyOf UeReachability_anyOf::getValue()
const {
return m_value;
}
void UeReachability_anyOf::setValue(
UeReachability_anyOf::eUeReachability_anyOf value) {
m_value = value;
}
} // namespace oai::amf::model
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
/*
* UeReachability_anyOf.h
*
*
*/
#ifndef UeReachability_anyOf_H_
#define UeReachability_anyOf_H_
#include <nlohmann/json.hpp>
namespace oai::amf::model {
/// <summary>
///
/// </summary>
class UeReachability_anyOf {
public:
UeReachability_anyOf();
virtual ~UeReachability_anyOf() = default;
enum class eUeReachability_anyOf {
// To have a valid default value.
// Avoiding nameclashes with user defined
// enum values
INVALID_VALUE_OPENAPI_GENERATED = 0,
UNREACHABLE,
REACHABLE,
REGULATORY_ONLY
};
/// <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 UeReachability_anyOf& rhs) const;
bool operator!=(const UeReachability_anyOf& rhs) const;
/////////////////////////////////////////////
/// UeReachability_anyOf members
UeReachability_anyOf::eUeReachability_anyOf getValue() const;
void setValue(UeReachability_anyOf::eUeReachability_anyOf value);
friend void to_json(nlohmann::json& j, const UeReachability_anyOf& o);
friend void from_json(const nlohmann::json& j, UeReachability_anyOf& o);
protected:
UeReachability_anyOf::eUeReachability_anyOf m_value = UeReachability_anyOf::
eUeReachability_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
#endif /* UeReachability_anyOf_H_ */
/** /**
* Namf_Communication * Namf_EventExposure
* AMF Communication Service © 2019, 3GPP Organizational Partners (ARIB, ATIS, * AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. * CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* *
* The version of the OpenAPI document: 1.1.0.alpha-1 * The version of the OpenAPI document: 1.1.0.alpha-1
...@@ -12,10 +12,11 @@ ...@@ -12,10 +12,11 @@
*/ */
#include "UserLocation.h" #include "UserLocation.h"
#include "Helpers.h"
namespace oai { #include <sstream>
namespace amf {
namespace model { namespace oai::amf::model {
UserLocation::UserLocation() { UserLocation::UserLocation() {
m_EutraLocationIsSet = false; m_EutraLocationIsSet = false;
...@@ -23,10 +24,46 @@ UserLocation::UserLocation() { ...@@ -23,10 +24,46 @@ UserLocation::UserLocation() {
m_N3gaLocationIsSet = false; m_N3gaLocationIsSet = false;
} }
UserLocation::~UserLocation() {} void UserLocation::validate() const {
std::stringstream msg;
if (!validate(msg)) {
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool UserLocation::validate(std::stringstream& msg) const {
return validate(msg, "");
}
bool UserLocation::validate(
std::stringstream& msg, const std::string& pathPrefix) const {
bool success = true;
const std::string _pathPrefix =
pathPrefix.empty() ? "UserLocation" : pathPrefix;
return success;
}
bool UserLocation::operator==(const UserLocation& rhs) const {
return
((!eutraLocationIsSet() && !rhs.eutraLocationIsSet()) ||
(eutraLocationIsSet() && rhs.eutraLocationIsSet() &&
getEutraLocation() == rhs.getEutraLocation())) &&
((!nrLocationIsSet() && !rhs.nrLocationIsSet()) ||
(nrLocationIsSet() && rhs.nrLocationIsSet() &&
getNrLocation() == rhs.getNrLocation())) &&
((!n3gaLocationIsSet() && !rhs.n3gaLocationIsSet()) ||
(n3gaLocationIsSet() && rhs.n3gaLocationIsSet() &&
getN3gaLocation() == rhs.getN3gaLocation()))
;
}
void UserLocation::validate() { bool UserLocation::operator!=(const UserLocation& rhs) const {
// TODO: implement validation return !(*this == rhs);
} }
void to_json(nlohmann::json& j, const UserLocation& o) { void to_json(nlohmann::json& j, const UserLocation& o) {
...@@ -91,6 +128,4 @@ void UserLocation::unsetN3gaLocation() { ...@@ -91,6 +128,4 @@ void UserLocation::unsetN3gaLocation() {
m_N3gaLocationIsSet = false; m_N3gaLocationIsSet = false;
} }
} // namespace model } // namespace oai::amf::model
} // namespace amf
} // namespace oai
/** /**
* Namf_Communication * Namf_EventExposure
* AMF Communication Service © 2019, 3GPP Organizational Partners (ARIB, ATIS, * AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. * CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* *
* The version of the OpenAPI document: 1.1.0.alpha-1 * The version of the OpenAPI document: 1.1.0.alpha-1
...@@ -24,9 +24,7 @@ ...@@ -24,9 +24,7 @@
#include "N3gaLocation.h" #include "N3gaLocation.h"
#include <nlohmann/json.hpp> #include <nlohmann/json.hpp>
namespace oai { namespace oai::amf::model {
namespace amf {
namespace model {
/// <summary> /// <summary>
/// ///
...@@ -34,9 +32,22 @@ namespace model { ...@@ -34,9 +32,22 @@ namespace model {
class UserLocation { class UserLocation {
public: public:
UserLocation(); UserLocation();
virtual ~UserLocation(); virtual ~UserLocation() = default;
void validate(); /// <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 UserLocation& rhs) const;
bool operator!=(const UserLocation& rhs) const;
///////////////////////////////////////////// /////////////////////////////////////////////
/// UserLocation members /// UserLocation members
...@@ -73,10 +84,12 @@ class UserLocation { ...@@ -73,10 +84,12 @@ class UserLocation {
bool m_NrLocationIsSet; bool m_NrLocationIsSet;
N3gaLocation m_N3gaLocation; N3gaLocation m_N3gaLocation;
bool m_N3gaLocationIsSet; bool m_N3gaLocationIsSet;
// 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 model } // namespace oai::amf::model
} // namespace amf
} // namespace oai
#endif /* UserLocation_H_ */ #endif /* UserLocation_H_ */
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
#include "_5GsUserState_anyOf.h"
#include "Helpers.h"
#include <stdexcept>
#include <sstream>
namespace oai::amf::model {
_5GsUserState_anyOf::_5GsUserState_anyOf() {}
void _5GsUserState_anyOf::validate() const {
std::stringstream msg;
if (!validate(msg)) {
throw org::openapitools::server::helpers::ValidationException(msg.str());
}
}
bool _5GsUserState_anyOf::validate(std::stringstream& msg) const {
return validate(msg, "");
}
bool _5GsUserState_anyOf::validate(
std::stringstream& msg, const std::string& pathPrefix) const {
bool success = true;
const std::string _pathPrefix =
pathPrefix.empty() ? "_5GsUserState_anyOf" : pathPrefix;
if (m_value == _5GsUserState_anyOf::e_5GsUserState_anyOf::
INVALID_VALUE_OPENAPI_GENERATED) {
success = false;
msg << _pathPrefix << ": has no value;";
}
return success;
}
bool _5GsUserState_anyOf::operator==(const _5GsUserState_anyOf& rhs) const {
return getValue() == rhs.getValue()
;
}
bool _5GsUserState_anyOf::operator!=(const _5GsUserState_anyOf& rhs) const {
return !(*this == rhs);
}
void to_json(nlohmann::json& j, const _5GsUserState_anyOf& o) {
j = nlohmann::json();
switch (o.getValue()) {
case _5GsUserState_anyOf::e_5GsUserState_anyOf::
INVALID_VALUE_OPENAPI_GENERATED:
j = "INVALID_VALUE_OPENAPI_GENERATED";
break;
case _5GsUserState_anyOf::e_5GsUserState_anyOf::DEREGISTERED:
j = "DEREGISTERED";
break;
case _5GsUserState_anyOf::e_5GsUserState_anyOf::
REGISTERED_NOT_REACHABLE_FOR_PAGING:
j = "REGISTERED_NOT_REACHABLE_FOR_PAGING";
break;
case _5GsUserState_anyOf::e_5GsUserState_anyOf::
REGISTERED_REACHABLE_FOR_PAGING:
j = "REGISTERED_REACHABLE_FOR_PAGING";
break;
case _5GsUserState_anyOf::e_5GsUserState_anyOf::
CONNECTED_NOT_REACHABLE_FOR_PAGING:
j = "CONNECTED_NOT_REACHABLE_FOR_PAGING";
break;
case _5GsUserState_anyOf::e_5GsUserState_anyOf::
CONNECTED_REACHABLE_FOR_PAGING:
j = "CONNECTED_REACHABLE_FOR_PAGING";
break;
case _5GsUserState_anyOf::e_5GsUserState_anyOf::NOT_PROVIDED_FROM_AMF:
j = "NOT_PROVIDED_FROM_AMF";
break;
}
}
void from_json(const nlohmann::json& j, _5GsUserState_anyOf& o) {
auto s = j.get<std::string>();
if (s == "DEREGISTERED") {
o.setValue(_5GsUserState_anyOf::e_5GsUserState_anyOf::DEREGISTERED);
} else if (s == "REGISTERED_NOT_REACHABLE_FOR_PAGING") {
o.setValue(_5GsUserState_anyOf::e_5GsUserState_anyOf::
REGISTERED_NOT_REACHABLE_FOR_PAGING);
} else if (s == "REGISTERED_REACHABLE_FOR_PAGING") {
o.setValue(_5GsUserState_anyOf::e_5GsUserState_anyOf::
REGISTERED_REACHABLE_FOR_PAGING);
} else if (s == "CONNECTED_NOT_REACHABLE_FOR_PAGING") {
o.setValue(_5GsUserState_anyOf::e_5GsUserState_anyOf::
CONNECTED_NOT_REACHABLE_FOR_PAGING);
} else if (s == "CONNECTED_REACHABLE_FOR_PAGING") {
o.setValue(_5GsUserState_anyOf::e_5GsUserState_anyOf::
CONNECTED_REACHABLE_FOR_PAGING);
} else if (s == "NOT_PROVIDED_FROM_AMF") {
o.setValue(
_5GsUserState_anyOf::e_5GsUserState_anyOf::NOT_PROVIDED_FROM_AMF);
} else {
std::stringstream ss;
ss << "Unexpected value " << s << " in json"
<< " cannot be converted to enum of type"
<< " _5GsUserState_anyOf::e_5GsUserState_anyOf";
throw std::invalid_argument(ss.str());
}
}
_5GsUserState_anyOf::e_5GsUserState_anyOf _5GsUserState_anyOf::getValue()
const {
return m_value;
}
void _5GsUserState_anyOf::setValue(
_5GsUserState_anyOf::e_5GsUserState_anyOf value) {
m_value = value;
}
} // namespace oai::amf::model
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
* NOTE: This class is auto generated by OpenAPI Generator
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* the class manually.
*/
/*
* _5GsUserState_anyOf.h
*
*
*/
#ifndef _5GsUserState_anyOf_H_
#define _5GsUserState_anyOf_H_
#include <nlohmann/json.hpp>
namespace oai::amf::model {
/// <summary>
///
/// </summary>
class _5GsUserState_anyOf {
public:
_5GsUserState_anyOf();
virtual ~_5GsUserState_anyOf() = default;
enum class e_5GsUserState_anyOf {
// To have a valid default value.
// Avoiding nameclashes with user defined
// enum values
INVALID_VALUE_OPENAPI_GENERATED = 0,
DEREGISTERED,
REGISTERED_NOT_REACHABLE_FOR_PAGING,
REGISTERED_REACHABLE_FOR_PAGING,
CONNECTED_NOT_REACHABLE_FOR_PAGING,
CONNECTED_REACHABLE_FOR_PAGING,
NOT_PROVIDED_FROM_AMF
};
/// <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 _5GsUserState_anyOf& rhs) const;
bool operator!=(const _5GsUserState_anyOf& rhs) const;
/////////////////////////////////////////////
/// _5GsUserState_anyOf members
_5GsUserState_anyOf::e_5GsUserState_anyOf getValue() const;
void setValue(_5GsUserState_anyOf::e_5GsUserState_anyOf value);
friend void to_json(nlohmann::json& j, const _5GsUserState_anyOf& o);
friend void from_json(const nlohmann::json& j, _5GsUserState_anyOf& o);
protected:
_5GsUserState_anyOf::e_5GsUserState_anyOf m_value = _5GsUserState_anyOf::
e_5GsUserState_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
#endif /* _5GsUserState_anyOf_H_ */
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