Commit 807452db authored by yangjian's avatar yangjian

Update AuthenticationSubscription

parent 483ac964
/**
* Nudr_DataRepository API OpenAPI file
* Unified Data Repository Service. © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 2.1.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "AMFSubscriptionInfoDocumentApi.h"
#include "Helpers.h"
namespace org {
namespace openapitools {
namespace server {
namespace api {
using namespace org::openapitools::server::helpers;
using namespace org::openapitools::server::model;
AMFSubscriptionInfoDocumentApi::AMFSubscriptionInfoDocumentApi(std::shared_ptr<Pistache::Rest::Router> rtr) {
router = rtr;
}
void AMFSubscriptionInfoDocumentApi::init() {
setupRoutes();
}
void AMFSubscriptionInfoDocumentApi::setupRoutes() {
using namespace Pistache::Rest;
Routes::Put(*router, base + "/subscription-data/:ueId/context-data/ee-subscriptions/:subsId/amf-subscriptions", Routes::bind(&AMFSubscriptionInfoDocumentApi::create_amf_subscriptions_handler, this));
// Default handler, called when a route is not found
router->addCustomHandler(Routes::bind(&AMFSubscriptionInfoDocumentApi::amf_subscription_info_document_api_default_handler, this));
}
void AMFSubscriptionInfoDocumentApi::create_amf_subscriptions_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
// Getting the path params
auto ueId = request.param(":ueId").as<std::string>();
auto subsId = request.param(":subsId").as<std::string>();
// Getting the body param
std::vector<AmfSubscriptionInfo> amfSubscriptionInfo;
try {
nlohmann::json::parse(request.body()).get_to(amfSubscriptionInfo);
this->create_amf_subscriptions(ueId, subsId, amfSubscriptionInfo, response);
} catch (nlohmann::detail::exception &e) {
//send a 400 error
response.send(Pistache::Http::Code::Bad_Request, e.what());
return;
} catch (Pistache::Http::HttpError &e) {
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
return;
} catch (std::exception &e) {
//send a 500 error
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
return;
}
}
void AMFSubscriptionInfoDocumentApi::amf_subscription_info_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");
}
}
}
}
}
/**
* Nudr_DataRepository API OpenAPI file
* Unified Data Repository Service. © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 2.1.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* AMFSubscriptionInfoDocumentApi.h
*
*
*/
#ifndef AMFSubscriptionInfoDocumentApi_H_
#define AMFSubscriptionInfoDocumentApi_H_
#include <pistache/http.h>
#include <pistache/router.h>
#include <pistache/http_headers.h>
#include <pistache/optional.h>
#include "AmfSubscriptionInfo.h"
#include <string>
#include <vector>
namespace org {
namespace openapitools {
namespace server {
namespace api {
using namespace org::openapitools::server::model;
class AMFSubscriptionInfoDocumentApi {
public:
AMFSubscriptionInfoDocumentApi(std::shared_ptr<Pistache::Rest::Router>);
virtual ~AMFSubscriptionInfoDocumentApi() {}
void init();
const std::string base = "/nudr-dr/v2";
private:
void setupRoutes();
void create_amf_subscriptions_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void amf_subscription_info_document_api_default_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
std::shared_ptr<Pistache::Rest::Router> router;
/// <summary>
/// Create AmfSubscriptions for an individual ee subscriptions of a UE
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="ueId"></param>
/// <param name="subsId"></param>
/// <param name="amfSubscriptionInfo"></param>
virtual void create_amf_subscriptions(const std::string &ueId, const std::string &subsId, const std::vector<AmfSubscriptionInfo> &amfSubscriptionInfo, Pistache::Http::ResponseWriter &response) = 0;
};
}
}
}
}
#endif /* AMFSubscriptionInfoDocumentApi_H_ */
/**
* Nudr_DataRepository API OpenAPI file
* Unified Data Repository Service. © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 2.1.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "AuthenticationDataDocumentApi.h"
#include "Helpers.h"
namespace org {
namespace openapitools {
namespace server {
namespace api {
using namespace org::openapitools::server::helpers;
using namespace org::openapitools::server::model;
AuthenticationDataDocumentApi::AuthenticationDataDocumentApi(std::shared_ptr<Pistache::Rest::Router> rtr) {
router = rtr;
}
void AuthenticationDataDocumentApi::init() {
setupRoutes();
}
void AuthenticationDataDocumentApi::setupRoutes() {
using namespace Pistache::Rest;
Routes::Get(*router, base + "/subscription-data/:ueId/authentication-data/authentication-subscription", Routes::bind(&AuthenticationDataDocumentApi::query_auth_subs_data_handler, this));
// Default handler, called when a route is not found
router->addCustomHandler(Routes::bind(&AuthenticationDataDocumentApi::authentication_data_document_api_default_handler, this));
}
void AuthenticationDataDocumentApi::query_auth_subs_data_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
// Getting the path params
auto ueId = request.param(":ueId").as<std::string>();
// Getting the query params
auto supportedFeaturesQuery = request.query().get("supported-features");
Pistache::Optional<std::string> supportedFeatures;
if(!supportedFeaturesQuery.isEmpty()){
std::string valueQuery_instance;
if(fromStringValue(supportedFeaturesQuery.get(), valueQuery_instance)){
supportedFeatures = Pistache::Some(valueQuery_instance);
}
}
try {
this->query_auth_subs_data(ueId, supportedFeatures, response);
} catch (nlohmann::detail::exception &e) {
//send a 400 error
response.send(Pistache::Http::Code::Bad_Request, e.what());
return;
} catch (Pistache::Http::HttpError &e) {
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
return;
} catch (std::exception &e) {
//send a 500 error
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
return;
}
}
void AuthenticationDataDocumentApi::authentication_data_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");
}
}
}
}
}
/**
* Nudr_DataRepository API OpenAPI file
* Unified Data Repository Service. © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 2.1.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* AuthenticationDataDocumentApi.h
*
*
*/
#ifndef AuthenticationDataDocumentApi_H_
#define AuthenticationDataDocumentApi_H_
#include <pistache/http.h>
#include <pistache/router.h>
#include <pistache/http_headers.h>
#include <pistache/optional.h>
#include "AuthenticationSubscription.h"
#include <string>
namespace org {
namespace openapitools {
namespace server {
namespace api {
using namespace org::openapitools::server::model;
class AuthenticationDataDocumentApi {
public:
AuthenticationDataDocumentApi(std::shared_ptr<Pistache::Rest::Router>);
virtual ~AuthenticationDataDocumentApi() {}
void init();
const std::string base = "/nudr-dr/v2";
private:
void setupRoutes();
void query_auth_subs_data_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void authentication_data_document_api_default_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
std::shared_ptr<Pistache::Rest::Router> router;
/// <summary>
/// Retrieves the authentication subscription data of a UE
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="ueId">UE id</param>
/// <param name="supportedFeatures">Supported Features (optional, default to &quot;&quot;)</param>
virtual void query_auth_subs_data(const std::string &ueId, const Pistache::Optional<std::string> &supportedFeatures, Pistache::Http::ResponseWriter &response) = 0;
};
}
}
}
}
#endif /* AuthenticationDataDocumentApi_H_ */
/**
* Nudr_DataRepository API OpenAPI file
* Unified Data Repository Service. © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 2.1.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "AMFSubscriptionInfoDocumentApiImpl.h"
namespace org {
namespace openapitools {
namespace server {
namespace api {
using namespace org::openapitools::server::model;
AMFSubscriptionInfoDocumentApiImpl::AMFSubscriptionInfoDocumentApiImpl(std::shared_ptr<Pistache::Rest::Router> rtr)
: AMFSubscriptionInfoDocumentApi(rtr)
{ }
void AMFSubscriptionInfoDocumentApiImpl::create_amf_subscriptions(const std::string &ueId, const std::string &subsId, const std::vector<AmfSubscriptionInfo> &amfSubscriptionInfo, Pistache::Http::ResponseWriter &response) {
response.send(Pistache::Http::Code::Ok, "Do some magic\n");
}
}
}
}
}
/**
* Nudr_DataRepository API OpenAPI file
* Unified Data Repository Service. © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 2.1.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* AMFSubscriptionInfoDocumentApiImpl.h
*
*
*/
#ifndef AMF_SUBSCRIPTION_INFO_DOCUMENT_API_IMPL_H_
#define AMF_SUBSCRIPTION_INFO_DOCUMENT_API_IMPL_H_
#include <pistache/endpoint.h>
#include <pistache/http.h>
#include <pistache/router.h>
#include <memory>
#include <AMFSubscriptionInfoDocumentApi.h>
#include <pistache/optional.h>
#include "AmfSubscriptionInfo.h"
#include <string>
#include <vector>
namespace org {
namespace openapitools {
namespace server {
namespace api {
using namespace org::openapitools::server::model;
class AMFSubscriptionInfoDocumentApiImpl : public org::openapitools::server::api::AMFSubscriptionInfoDocumentApi {
public:
AMFSubscriptionInfoDocumentApiImpl(std::shared_ptr<Pistache::Rest::Router>);
~AMFSubscriptionInfoDocumentApiImpl() {}
void create_amf_subscriptions(const std::string &ueId, const std::string &subsId, const std::vector<AmfSubscriptionInfo> &amfSubscriptionInfo, Pistache::Http::ResponseWriter &response);
};
}
}
}
}
#endif
\ No newline at end of file
/**
* Nudr_DataRepository API OpenAPI file
* Unified Data Repository Service. © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 2.1.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "AuthenticationDataDocumentApiImpl.h"
namespace org {
namespace openapitools {
namespace server {
namespace api {
using namespace org::openapitools::server::model;
AuthenticationDataDocumentApiImpl::AuthenticationDataDocumentApiImpl(std::shared_ptr<Pistache::Rest::Router> rtr)
: AuthenticationDataDocumentApi(rtr)
{ }
void AuthenticationDataDocumentApiImpl::query_auth_subs_data(const std::string &ueId, const Pistache::Optional<std::string> &supportedFeatures, Pistache::Http::ResponseWriter &response) {
response.send(Pistache::Http::Code::Ok, "Do some magic\n");
}
}
}
}
}
/**
* Nudr_DataRepository API OpenAPI file
* Unified Data Repository Service. © 2020, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 2.1.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* AuthenticationDataDocumentApiImpl.h
*
*
*/
#ifndef AUTHENTICATION_DATA_DOCUMENT_API_IMPL_H_
#define AUTHENTICATION_DATA_DOCUMENT_API_IMPL_H_
#include <pistache/endpoint.h>
#include <pistache/http.h>
#include <pistache/router.h>
#include <memory>
#include <AuthenticationDataDocumentApi.h>
#include <pistache/optional.h>
#include "AuthenticationSubscription.h"
#include <string>
namespace org {
namespace openapitools {
namespace server {
namespace api {
using namespace org::openapitools::server::model;
class AuthenticationDataDocumentApiImpl : public org::openapitools::server::api::AuthenticationDataDocumentApi {
public:
AuthenticationDataDocumentApiImpl(std::shared_ptr<Pistache::Rest::Router>);
~AuthenticationDataDocumentApiImpl() {}
void query_auth_subs_data(const std::string &ueId, const Pistache::Optional<std::string> &supportedFeatures, Pistache::Http::ResponseWriter &response);
};
}
}
}
}
#endif
\ No newline at end of file
#ifndef _ANYTYPE_H_
#define _ANYTYPE_H_
#endif
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