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

Associate EventExposure with AMF App

parent 50003832
......@@ -23,6 +23,7 @@
#define FILE_3GPP_29_518_SEEN
#include "amf.hpp"
#include <vector>
typedef enum amf_event_e {
LOCATION_REPORT = 1,
......
......@@ -9,6 +9,7 @@ void AMFApiServer::init(size_t thr) {
opts.maxRequestSize(PISTACHE_SERVER_MAX_PAYLOAD);
m_httpEndpoint->init(opts);
m_individualSubscriptionDocumentApiImpl->init();
m_individualSubscriptionDocumentApiImplEventExposure->init();
m_individualUeContextDocumentApiImpl->init();
m_n1N2IndividualSubscriptionDocumentApiImpl->init();
m_n1N2MessageCollectionDocumentApiImpl->init();
......@@ -24,6 +25,9 @@ void AMFApiServer::start() {
if (m_individualSubscriptionDocumentApiImpl != nullptr)
Logger::amf_server().debug(
"AMF handler for IndividualSubscriptionDocumentApiImpl");
if (m_individualSubscriptionDocumentApiImplEventExposure != nullptr)
Logger::amf_server().debug(
"AMF handler for IndividualSubscriptionDocumentApiImpl");
if (m_individualUeContextDocumentApiImpl != nullptr)
Logger::amf_server().debug(
"AMF handler for IndividualUeContextDocumentApiImpl");
......
......@@ -8,6 +8,7 @@
#endif
#include "IndividualSubscriptionDocumentApiImpl.h"
#include "IndividualSubscriptionDocumentApiImplEventExposure.h"
#include "IndividualUeContextDocumentApiImpl.h"
#include "N1N2IndividualSubscriptionDocumentApiImpl.h"
#include "N1N2MessageCollectionDocumentApiImpl.h"
......@@ -16,8 +17,6 @@
#include "NonUEN2MessagesCollectionDocumentApiImpl.h"
#include "NonUEN2MessagesSubscriptionsCollectionDocumentApiImpl.h"
#include "SubscriptionsCollectionDocumentApiImpl.h"
#include "SubscriptionsCollectionApiImpl.h"
#include "NFStatusNotifyApiImpl.h"
#define PISTACHE_SERVER_THREADS 2
#define PISTACHE_SERVER_MAX_PAYLOAD 32768
......@@ -36,6 +35,9 @@ class AMFApiServer {
m_individualSubscriptionDocumentApiImpl =
std::make_shared<IndividualSubscriptionDocumentApiImpl>(
m_router, amf_app_inst);
m_individualSubscriptionDocumentApiImplEventExposure =
std::make_shared<IndividualSubscriptionDocumentApiImplEventExposure>(
m_router, amf_app_inst);
m_individualUeContextDocumentApiImpl =
std::make_shared<IndividualUeContextDocumentApiImpl>(
m_router, amf_app_inst);
......@@ -62,11 +64,6 @@ class AMFApiServer {
m_subscriptionsCollectionDocumentApiImpl =
std::make_shared<SubscriptionsCollectionDocumentApiImpl>(
m_router, amf_app_inst);
m_subscriptionsCollectionApiImpl =
std::make_shared<SubscriptionsCollectionApiImpl>(
m_router, amf_app_inst, m_address);
m_nfStatusNotifyApiImpl = std::make_shared<NFStatusNotifyApiImpl>(
m_router, amf_app_inst, m_address);
}
void init(size_t thr = 1);
......@@ -78,6 +75,8 @@ class AMFApiServer {
std::shared_ptr<Pistache::Rest::Router> m_router;
std::shared_ptr<IndividualSubscriptionDocumentApiImpl>
m_individualSubscriptionDocumentApiImpl;
std::shared_ptr<IndividualSubscriptionDocumentApiImplEventExposure>
m_individualSubscriptionDocumentApiImplEventExposure;
std::shared_ptr<IndividualUeContextDocumentApiImpl>
m_individualUeContextDocumentApiImpl;
std::shared_ptr<N1N2IndividualSubscriptionDocumentApiImpl>
......@@ -96,8 +95,5 @@ class AMFApiServer {
m_nonUEN2MessagesSubscriptionsCollectionDocumentApiImpl;
std::shared_ptr<SubscriptionsCollectionDocumentApiImpl>
m_subscriptionsCollectionDocumentApiImpl;
std::shared_ptr<SubscriptionsCollectionApiImpl>
m_subscriptionsCollectionApiImpl;
std::shared_ptr<NFStatusNotifyApiImpl> m_nfStatusNotifyApiImpl;
std::string m_address;
};
......@@ -25,8 +25,9 @@ using namespace org::openapitools::server::helpers;
using namespace oai::amf::model;
IndividualSubscriptionDocumentApi::IndividualSubscriptionDocumentApi(
const std::shared_ptr<Pistache::Rest::Router>& rtr)
: router(rtr) {}
std::shared_ptr<Pistache::Rest::Router> rtr) {
router = rtr;
}
void IndividualSubscriptionDocumentApi::init() {
setupRoutes();
......@@ -35,17 +36,19 @@ void IndividualSubscriptionDocumentApi::init() {
void IndividualSubscriptionDocumentApi::setupRoutes() {
using namespace Pistache::Rest;
Routes::Delete(
Routes::Put(
*router,
base + amf_cfg.sbi_api_version + "/subscriptions/:subscriptionId",
Routes::bind(
&IndividualSubscriptionDocumentApi::delete_subscription_handler,
&IndividualSubscriptionDocumentApi::
a_mf_status_change_subscribe_modfy_handler,
this));
Routes::Patch(
Routes::Delete(
*router,
base + amf_cfg.sbi_api_version + "/subscriptions/:subscriptionId",
Routes::bind(
&IndividualSubscriptionDocumentApi::modify_subscription_handler,
&IndividualSubscriptionDocumentApi::
a_mf_status_change_un_subscribe_handler,
this));
// Default handler, called when a route is not found
......@@ -55,84 +58,47 @@ void IndividualSubscriptionDocumentApi::setupRoutes() {
this));
}
std::pair<Pistache::Http::Code, std::string>
IndividualSubscriptionDocumentApi::handleParsingException(
const std::exception& ex) const noexcept {
try {
throw ex;
} catch (nlohmann::detail::exception& e) {
return std::make_pair(Pistache::Http::Code::Bad_Request, e.what());
} catch (org::openapitools::server::helpers::ValidationException& e) {
return std::make_pair(Pistache::Http::Code::Bad_Request, e.what());
}
}
std::pair<Pistache::Http::Code, std::string>
IndividualSubscriptionDocumentApi::handleOperationException(
const std::exception& ex) const noexcept {
return std::make_pair(Pistache::Http::Code::Internal_Server_Error, ex.what());
}
void IndividualSubscriptionDocumentApi::delete_subscription_handler(
void IndividualSubscriptionDocumentApi::
a_mf_status_change_subscribe_modfy_handler(
const Pistache::Rest::Request& request,
Pistache::Http::ResponseWriter response) {
try {
// Getting the path params
auto subscriptionId = request.param(":subscriptionId").as<std::string>();
// Getting the body param
SubscriptionData subscriptionData;
try {
this->delete_subscription(subscriptionId, response);
} catch (Pistache::Http::HttpError& e) {
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
return;
} catch (std::exception& e) {
const std::pair<Pistache::Http::Code, std::string> errorInfo =
this->handleOperationException(e);
response.send(errorInfo.first, errorInfo.second);
nlohmann::json::parse(request.body()).get_to(subscriptionData);
this->a_mf_status_change_subscribe_modfy(
subscriptionId, subscriptionData, response);
} catch (nlohmann::detail::exception& e) {
// send a 400 error
response.send(Pistache::Http::Code::Bad_Request, e.what());
return;
}
} catch (std::exception& e) {
// send a 500 error
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
return;
}
}
void IndividualSubscriptionDocumentApi::modify_subscription_handler(
void IndividualSubscriptionDocumentApi::a_mf_status_change_un_subscribe_handler(
const Pistache::Rest::Request& request,
Pistache::Http::ResponseWriter response) {
try {
// Getting the path params
auto subscriptionId = request.param(":subscriptionId").as<std::string>();
// Getting the body param
// UNKNOWN_BASE_TYPE uNKNOWNBASETYPE;
AmfUpdateEventOptionItem amfUpdateEventOptionItem;
// TODO:AmfUpdateEventSubscriptionItem
try {
nlohmann::json::parse(request.body()).get_to(amfUpdateEventOptionItem);
amfUpdateEventOptionItem.validate();
} catch (std::exception& e) {
const std::pair<Pistache::Http::Code, std::string> errorInfo =
this->handleParsingException(e);
response.send(errorInfo.first, errorInfo.second);
this->a_mf_status_change_un_subscribe(subscriptionId, response);
} catch (nlohmann::detail::exception& e) {
// send a 400 error
response.send(Pistache::Http::Code::Bad_Request, e.what());
return;
}
/*
//TODO:AmfUpdateEventSubscriptionItem
try {
//this->modify_subscription(subscriptionId, uNKNOWNBASETYPE,
response); } catch (Pistache::Http::HttpError &e) {
response.send(static_cast<Pistache::Http::Code>(e.code()),
e.what()); return; } catch (std::exception &e) { const
std::pair<Pistache::Http::Code, std::string> errorInfo =
this->handleOperationException(e); response.send(errorInfo.first,
errorInfo.second); return;
}
*/
} catch (std::exception& e) {
// send a 500 error
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
return;
}
}
......
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* Namf_Communication
* AMF Communication 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
......@@ -24,13 +24,8 @@
#include <pistache/http_headers.h>
#include <pistache/optional.h>
#include <utility>
#include "AmfUpdatedEventSubscription.h"
//#include "OneOfarrayAmfUpdateEventOptionItem.h"
#include "ProblemDetails.h"
//#include "SubscriptionData.h"
#include "AmfUpdateEventOptionItem.h"
#include "SubscriptionData.h"
#include <string>
namespace oai {
......@@ -41,9 +36,8 @@ using namespace oai::amf::model;
class IndividualSubscriptionDocumentApi {
public:
explicit IndividualSubscriptionDocumentApi(
const std::shared_ptr<Pistache::Rest::Router>& rtr);
virtual ~IndividualSubscriptionDocumentApi() = default;
IndividualSubscriptionDocumentApi(std::shared_ptr<Pistache::Rest::Router>);
virtual ~IndividualSubscriptionDocumentApi() {}
void init();
const std::string base = "/namf-comm/";
......@@ -51,55 +45,41 @@ class IndividualSubscriptionDocumentApi {
private:
void setupRoutes();
void delete_subscription_handler(
void a_mf_status_change_subscribe_modfy_handler(
const Pistache::Rest::Request& request,
Pistache::Http::ResponseWriter response);
void modify_subscription_handler(
void a_mf_status_change_un_subscribe_handler(
const Pistache::Rest::Request& request,
Pistache::Http::ResponseWriter response);
void individual_subscription_document_api_default_handler(
const Pistache::Rest::Request& request,
Pistache::Http::ResponseWriter response);
const std::shared_ptr<Pistache::Rest::Router> router;
/// <summary>
/// Helper function to handle unexpected Exceptions during Parameter parsing
/// and validation. May be overriden to return custom error formats.
/// </summary>
virtual std::pair<Pistache::Http::Code, std::string> handleParsingException(
const std::exception& ex) const noexcept;
/// <summary>
/// Helper function to handle unexpected Exceptions during processing of the
/// request in handler functions. May be overriden to return custom error
/// formats.
/// </summary>
virtual std::pair<Pistache::Http::Code, std::string> handleOperationException(
const std::exception& ex) const noexcept;
std::shared_ptr<Pistache::Rest::Router> router;
/// <summary>
/// Namf_EventExposure Unsubscribe service Operation
/// Namf_Communication AMF Status Change Subscribe Modify service Operation
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="subscriptionId">Unique ID of the subscription to be
/// deleted</param>
virtual void delete_subscription(
/// <param name="subscriptionId">AMF Status Change Subscription
/// Identifier</param> <param name="subscriptionData"></param>
virtual void a_mf_status_change_subscribe_modfy(
const std::string& subscriptionId,
const SubscriptionData& subscriptionData,
Pistache::Http::ResponseWriter& response) = 0;
/// <summary>
/// Namf_EventExposure Subscribe Modify service Operation
/// Namf_Communication AMF Status Change UnSubscribe service Operation
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="subscriptionId">Unique ID of the subscription to be
/// modified</param> <param name="AmfUpdateEventOptionItem"></param>
virtual void modify_subscription(
/// <param name="subscriptionId">AMF Status Change Subscription
/// Identifier</param>
virtual void a_mf_status_change_un_subscribe(
const std::string& subscriptionId,
const oai::amf::model::AmfUpdateEventOptionItem& amfUpdateEventOptionItem,
Pistache::Http::ResponseWriter& response) = 0;
};
......
/**
* Namf_Communication
* AMF Communication 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 "IndividualSubscriptionDocumentApiEventExposure.h"
#include "Helpers.h"
#include "amf_config.hpp"
extern config::amf_config amf_cfg;
namespace oai {
namespace amf {
namespace api {
using namespace org::openapitools::server::helpers;
using namespace oai::amf::model;
IndividualSubscriptionDocumentApiEventExposure::
IndividualSubscriptionDocumentApiEventExposure(
const std::shared_ptr<Pistache::Rest::Router>& rtr)
: router(rtr) {}
void IndividualSubscriptionDocumentApiEventExposure::init() {
setupRoutes();
}
void IndividualSubscriptionDocumentApiEventExposure::setupRoutes() {
using namespace Pistache::Rest;
Routes::Delete(
*router,
base + amf_cfg.sbi_api_version + "/subscriptions/:subscriptionId",
Routes::bind(
&IndividualSubscriptionDocumentApiEventExposure::
delete_subscription_handler,
this));
Routes::Patch(
*router,
base + amf_cfg.sbi_api_version + "/subscriptions/:subscriptionId",
Routes::bind(
&IndividualSubscriptionDocumentApiEventExposure::
modify_subscription_handler,
this));
// Default handler, called when a route is not found
router->addCustomHandler(Routes::bind(
&IndividualSubscriptionDocumentApiEventExposure::
individual_subscription_document_api_default_handler,
this));
}
std::pair<Pistache::Http::Code, std::string>
IndividualSubscriptionDocumentApiEventExposure::handleParsingException(
const std::exception& ex) const noexcept {
try {
throw ex;
} catch (nlohmann::detail::exception& e) {
return std::make_pair(Pistache::Http::Code::Bad_Request, e.what());
} catch (org::openapitools::server::helpers::ValidationException& e) {
return std::make_pair(Pistache::Http::Code::Bad_Request, e.what());
}
}
std::pair<Pistache::Http::Code, std::string>
IndividualSubscriptionDocumentApiEventExposure::handleOperationException(
const std::exception& ex) const noexcept {
return std::make_pair(Pistache::Http::Code::Internal_Server_Error, ex.what());
}
void IndividualSubscriptionDocumentApiEventExposure::
delete_subscription_handler(
const Pistache::Rest::Request& request,
Pistache::Http::ResponseWriter response) {
try {
// Getting the path params
auto subscriptionId = request.param(":subscriptionId").as<std::string>();
try {
this->delete_subscription(subscriptionId, response);
} catch (Pistache::Http::HttpError& e) {
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
return;
} catch (std::exception& e) {
const std::pair<Pistache::Http::Code, std::string> errorInfo =
this->handleOperationException(e);
response.send(errorInfo.first, errorInfo.second);
return;
}
} catch (std::exception& e) {
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
}
}
void IndividualSubscriptionDocumentApiEventExposure::
modify_subscription_handler(
const Pistache::Rest::Request& request,
Pistache::Http::ResponseWriter response) {
try {
// Getting the path params
auto subscriptionId = request.param(":subscriptionId").as<std::string>();
// Getting the body param
// UNKNOWN_BASE_TYPE uNKNOWNBASETYPE;
AmfUpdateEventOptionItem amfUpdateEventOptionItem;
// TODO:AmfUpdateEventSubscriptionItem
try {
nlohmann::json::parse(request.body()).get_to(amfUpdateEventOptionItem);
amfUpdateEventOptionItem.validate();
} catch (std::exception& e) {
const std::pair<Pistache::Http::Code, std::string> errorInfo =
this->handleParsingException(e);
response.send(errorInfo.first, errorInfo.second);
return;
}
/*
//TODO:AmfUpdateEventSubscriptionItem
try {
//this->modify_subscription(subscriptionId, uNKNOWNBASETYPE,
response); } catch (Pistache::Http::HttpError &e) {
response.send(static_cast<Pistache::Http::Code>(e.code()),
e.what()); return; } catch (std::exception &e) { const
std::pair<Pistache::Http::Code, std::string> errorInfo =
this->handleOperationException(e); response.send(errorInfo.first,
errorInfo.second); return;
}
*/
} catch (std::exception& e) {
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
}
}
void IndividualSubscriptionDocumentApiEventExposure::
individual_subscription_document_api_default_handler(
const Pistache::Rest::Request&,
Pistache::Http::ResponseWriter response) {
response.send(
Pistache::Http::Code::Not_Found, "The requested method does not exist");
}
} // namespace api
} // namespace amf
} // namespace oai
/**
* 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.
*/
/*
* IndividualSubscriptionDocumentApiEventExposure.h
*
*
*/
#ifndef IndividualSubscriptionDocumentApiEventExposure_H_
#define IndividualSubscriptionDocumentApiEventExposure_H_
#include <pistache/http.h>
#include <pistache/router.h>
#include <pistache/http_headers.h>
#include <pistache/optional.h>
#include <utility>
#include "AmfUpdatedEventSubscription.h"
//#include "OneOfarrayAmfUpdateEventOptionItem.h"
#include "ProblemDetails.h"
//#include "SubscriptionData.h"
#include "AmfUpdateEventOptionItem.h"
#include <string>
namespace oai {
namespace amf {
namespace api {
using namespace oai::amf::model;
class IndividualSubscriptionDocumentApiEventExposure {
public:
explicit IndividualSubscriptionDocumentApiEventExposure(
const std::shared_ptr<Pistache::Rest::Router>& rtr);
virtual ~IndividualSubscriptionDocumentApiEventExposure() = default;
void init();
const std::string base = "/namf-comm/";
private:
void setupRoutes();
void delete_subscription_handler(
const Pistache::Rest::Request& request,
Pistache::Http::ResponseWriter response);
void modify_subscription_handler(
const Pistache::Rest::Request& request,
Pistache::Http::ResponseWriter response);
void individual_subscription_document_api_default_handler(
const Pistache::Rest::Request& request,
Pistache::Http::ResponseWriter response);
const std::shared_ptr<Pistache::Rest::Router> router;
/// <summary>
/// Helper function to handle unexpected Exceptions during Parameter parsing
/// and validation. May be overriden to return custom error formats.
/// </summary>
virtual std::pair<Pistache::Http::Code, std::string> handleParsingException(
const std::exception& ex) const noexcept;
/// <summary>
/// Helper function to handle unexpected Exceptions during processing of the
/// request in handler functions. May be overriden to return custom error
/// formats.
/// </summary>
virtual std::pair<Pistache::Http::Code, std::string> handleOperationException(
const std::exception& ex) const noexcept;
/// <summary>
/// Namf_EventExposure Unsubscribe service Operation
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="subscriptionId">Unique ID of the subscription to be
/// deleted</param>
virtual void delete_subscription(
const std::string& subscriptionId,
Pistache::Http::ResponseWriter& response) = 0;
/// <summary>
/// Namf_EventExposure Subscribe Modify service Operation
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="subscriptionId">Unique ID of the subscription to be
/// modified</param> <param name="AmfUpdateEventOptionItem"></param>
virtual void modify_subscription(
const std::string& subscriptionId,
const oai::amf::model::AmfUpdateEventOptionItem& amfUpdateEventOptionItem,
Pistache::Http::ResponseWriter& response) = 0;
};
} // namespace api
} // namespace amf
} // namespace oai
#endif /* IndividualSubscriptionDocumentApiEventExposure_H_ */
......@@ -19,9 +19,6 @@ namespace oai::amf::api {
using namespace org::openapitools::server::helpers;
using namespace oai::amf::model;
const std::string SubscriptionsCollectionDocumentApiEventExposure::base =
"/namf-evts/v1";
SubscriptionsCollectionDocumentApiEventExposure::
SubscriptionsCollectionDocumentApiEventExposure(
const std::shared_ptr<Pistache::Rest::Router>& rtr)
......
......@@ -39,7 +39,7 @@ class SubscriptionsCollectionDocumentApiEventExposure {
virtual ~SubscriptionsCollectionDocumentApiEventExposure() = default;
void init();
static const std::string base;
const std::string base = "/namf-evts/";
private:
void setupRoutes();
......
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* Namf_Communication
* AMF Communication 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
......@@ -20,22 +20,25 @@ namespace api {
using namespace oai::amf::model;
IndividualSubscriptionDocumentApiImpl::IndividualSubscriptionDocumentApiImpl(
const std::shared_ptr<Pistache::Rest::Router>& rtr,
std::shared_ptr<Pistache::Rest::Router> rtr,
amf_application::amf_app* amf_app_inst)
: IndividualSubscriptionDocumentApi(rtr), m_amf_app(amf_app_inst) {}
void IndividualSubscriptionDocumentApiImpl::delete_subscription(
const std::string& subscriptionId,
void IndividualSubscriptionDocumentApiImpl::a_mf_status_change_subscribe_modfy(
const std::string& subscriptionId, const SubscriptionData& subscriptionData,
Pistache::Http::ResponseWriter& response) {
response.send(
Pistache::Http::Code::Ok, "This API has not been implemented yet!\n");
Pistache::Http::Code::Ok,
"IndividualSubscriptionDocumentApiImpl::a_mf_status_change_subscribe_"
"modfy API has not been implemented yet!\n");
}
void IndividualSubscriptionDocumentApiImpl::modify_subscription(
void IndividualSubscriptionDocumentApiImpl::a_mf_status_change_un_subscribe(
const std::string& subscriptionId,
const AmfUpdateEventOptionItem& amfUpdateEventOptionItem,
Pistache::Http::ResponseWriter& response) {
response.send(
Pistache::Http::Code::Ok, "This API has not been implemented yet!\n");
Pistache::Http::Code::Ok,
"IndividualSubscriptionDocumentApiImpl::a_mf_status_change_un_subscribe "
"API has not been implemented yet!\n");
}
} // namespace api
......
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* Namf_Communication
* AMF Communication 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
......@@ -29,10 +29,8 @@
#include <pistache/optional.h>
#include "AmfUpdatedEventSubscription.h"
//#include "OneOfarrayAmfUpdateEventOptionItem.h"
#include "ProblemDetails.h"
#include "AmfUpdateEventOptionItem.h"
#include "SubscriptionData.h"
#include <string>
#include "amf_app.hpp"
......@@ -42,22 +40,21 @@ namespace amf {
namespace api {
using namespace oai::amf::model;
using namespace oai::amf::api;
class IndividualSubscriptionDocumentApiImpl
: public IndividualSubscriptionDocumentApi {
: public oai::amf::api::IndividualSubscriptionDocumentApi {
public:
explicit IndividualSubscriptionDocumentApiImpl(
const std::shared_ptr<Pistache::Rest::Router>&,
IndividualSubscriptionDocumentApiImpl(
std::shared_ptr<Pistache::Rest::Router>,
amf_application::amf_app* amf_app_inst);
~IndividualSubscriptionDocumentApiImpl() override = default;
~IndividualSubscriptionDocumentApiImpl() {}
void delete_subscription(
void a_mf_status_change_subscribe_modfy(
const std::string& subscriptionId,
const SubscriptionData& subscriptionData,
Pistache::Http::ResponseWriter& response);
void modify_subscription(
void a_mf_status_change_un_subscribe(
const std::string& subscriptionId,
const AmfUpdateEventOptionItem& amfUpdateEventOptionItem,
Pistache::Http::ResponseWriter& response);
private:
......
/**
* 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 "IndividualSubscriptionDocumentApiImplEventExposure.h"
namespace oai {
namespace amf {
namespace api {
using namespace oai::amf::model;
IndividualSubscriptionDocumentApiImplEventExposure::
IndividualSubscriptionDocumentApiImplEventExposure(
const std::shared_ptr<Pistache::Rest::Router>& rtr,
amf_application::amf_app* amf_app_inst)
: IndividualSubscriptionDocumentApiEventExposure(rtr),
m_amf_app(amf_app_inst) {}
void IndividualSubscriptionDocumentApiImplEventExposure::delete_subscription(
const std::string& subscriptionId,
Pistache::Http::ResponseWriter& response) {
response.send(
Pistache::Http::Code::Ok, "This API has not been implemented yet!\n");
}
void IndividualSubscriptionDocumentApiImplEventExposure::modify_subscription(
const std::string& subscriptionId,
const AmfUpdateEventOptionItem& amfUpdateEventOptionItem,
Pistache::Http::ResponseWriter& response) {
response.send(
Pistache::Http::Code::Ok, "This API has not been implemented yet!\n");
}
} // namespace api
} // namespace amf
} // namespace oai
/**
* 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.
*/
/*
* IndividualSubscriptionDocumentApiImplEventExposure.h
*
*
*/
#ifndef INDIVIDUAL_SUBSCRIPTION_DOCUMENT_API_IMPL_EVENT_EXPOSURE_H_
#define INDIVIDUAL_SUBSCRIPTION_DOCUMENT_API_IMPL_EVENT_EXPOSURE_H_
#include <pistache/endpoint.h>
#include <pistache/http.h>
#include <pistache/router.h>
#include <memory>
#include <IndividualSubscriptionDocumentApiEventExposure.h>
#include <pistache/optional.h>
#include "AmfUpdatedEventSubscription.h"
//#include "OneOfarrayAmfUpdateEventOptionItem.h"
#include "ProblemDetails.h"
#include "AmfUpdateEventOptionItem.h"
#include <string>
#include "amf_app.hpp"
namespace oai {
namespace amf {
namespace api {
using namespace oai::amf::model;
using namespace oai::amf::api;
class IndividualSubscriptionDocumentApiImplEventExposure
: public IndividualSubscriptionDocumentApiEventExposure {
public:
explicit IndividualSubscriptionDocumentApiImplEventExposure(
const std::shared_ptr<Pistache::Rest::Router>&,
amf_application::amf_app* amf_app_inst);
~IndividualSubscriptionDocumentApiImplEventExposure() override = default;
void delete_subscription(
const std::string& subscriptionId,
Pistache::Http::ResponseWriter& response);
void modify_subscription(
const std::string& subscriptionId,
const AmfUpdateEventOptionItem& amfUpdateEventOptionItem,
Pistache::Http::ResponseWriter& response);
private:
amf_application::amf_app* m_amf_app;
};
} // namespace api
} // namespace amf
} // namespace oai
#endif
......@@ -21,8 +21,10 @@ using namespace oai::amf::model;
SubscriptionsCollectionDocumentApiImplEventExposure::
SubscriptionsCollectionDocumentApiImplEventExposure(
const std::shared_ptr<Pistache::Rest::Router>& rtr)
: SubscriptionsCollectionDocumentApiEventExposure(rtr) {}
const std::shared_ptr<Pistache::Rest::Router>& rtr,
amf_application::amf_app* amf_app_inst)
: SubscriptionsCollectionDocumentApiEventExposure(rtr),
m_amf_app(amf_app_inst) {}
void SubscriptionsCollectionDocumentApiImplEventExposure::create_subscription(
const AmfCreateEventSubscription& amfCreateEventSubscription,
......
......@@ -32,21 +32,27 @@
#include "AmfCreateEventSubscription.h"
#include "AmfCreatedEventSubscription.h"
#include "ProblemDetails.h"
#include "amf_app.hpp"
namespace oai::amf::api {
using namespace oai::amf::model;
using namespace oai::amf::api;
class SubscriptionsCollectionDocumentApiImplEventExposure
: public SubscriptionsCollectionDocumentApiEventExposure {
public:
explicit SubscriptionsCollectionDocumentApiImplEventExposure(
const std::shared_ptr<Pistache::Rest::Router>& rtr);
const std::shared_ptr<Pistache::Rest::Router>& rtr,
amf_application::amf_app* amf_app_inst);
~SubscriptionsCollectionDocumentApiImplEventExposure() override = default;
void create_subscription(
const AmfCreateEventSubscription& amfCreateEventSubscription,
Pistache::Http::ResponseWriter& response);
private:
amf_application::amf_app* m_amf_app;
};
} // namespace oai::amf::api
......
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