Commit 1dfd340a authored by yangjian's avatar yangjian

update udm

parent dcd7e27e

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

cmake_minimum_required (VERSION 3.2)
project(udm-api-server)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -pg -g3" )
include_directories(model)
include_directories(api)
include_directories(impl)
file(GLOB SRCS
${CMAKE_CURRENT_SOURCE_DIR}/api/*.cpp
${CMAKE_CURRENT_SOURCE_DIR}/impl/*.cpp
${CMAKE_CURRENT_SOURCE_DIR}/model/*.cpp
${CMAKE_CURRENT_SOURCE_DIR}/*.cpp
)
add_executable(${PROJECT_NAME} ${SRCS} )
target_link_libraries(${PROJECT_NAME} pistache pthread)
# REST API Server for Nudm_SDM
# OpenXG-UDM
## Overview
This API Server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project.
It uses the [Pistache](https://github.com/oktal/pistache) Framework.
## Files organization
The Pistache C++ REST server generator creates three folders:
- `api`: This folder contains the handlers for each method specified in the OpenAPI definition. Every handler extracts
the path and body parameters (if any) from the requests and tries to parse and possibly validate them.
Once this step is completed, the main API class calls the corresponding abstract method that should be implemented
by the developer (a basic implementation is provided under the `impl` folder)
- `impl`: As written above, the implementation folder contains, for each API, the corresponding implementation class,
which extends the main API class and implements the abstract methods.
Every method receives the path and body parameters as constant reference variables and a reference to the response
object, that should be filled with the right response and sent at the end of the method with the command:
response.send(returnCode, responseBody, [mimeType])
- `model`: This folder contains the corresponding class for every object schema found in the OpenAPI specification.
The main folder contains also a file with a main that can be used to start the server.
Of course, is you should customize this file based on your needs
## Installation
First of all, you need to download and install the libraries listed [here](#libraries-required).
Once the libraries are installed, in order to compile and run the server please follow the steps below:
```bash
mkdir build
cd build
cmake ..
make
OpenXG-UDM Arch
```
Once compiled run the server:
```bash
cd build
./api-server
├── build: Build directory, contains targets and object files generated by compilation of network functions.
├── scripts: Directory containing scripts for building network functions.
├── ext: Directory containing pistache and the JSON library.
└── UDM: Directory containing object files generated by compilation of UDM network function.
├── etc: Directory containing the configuration file to be deployed for UDM.
└── src: Source files of UDR.
├── udm_app: UDR Procedures handling logic.
├── common: Common definitions for 3GPP specifications.
├── 5gaka: algorithms for 5G-AKA authentication procedures.
├── asnlib: asn library.
├── utils: Common utilities.  .
├── model: UDM service.
├── api: UDM service.
└── impl: UDM service.
```
## Download source code from Gitlab
```
git clone http://git.opensource5g.org/openxg/udm.git
cd openxg-udm/
git checkout master
```
## Libraries required
- [pistache](http://pistache.io/quickstart)
- [JSON for Modern C++](https://github.com/nlohmann/json/#integration): Please download the `json.hpp` file and
put it under the model/nlohmann folder
## Namespaces
oai.udm.api
oai.udm.model
## install dependencies
```
cd ./build/scripts
sudo ./build_udm -I
```
## build UDM
```
sudo ./build_udm -c -b Debug -j
```
## launch UDM
```
sudo ./build/UDR/udm -c etc/udm.conf -o
```
\ No newline at end of file
/**
* Nudm_SDM
* Nudm Subscriber Data Management Service. � 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 2.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 "AccessAndMobilitySubscriptionDataRetrievalApi.h"
#include "Helpers.h"
namespace oai {
namespace udm {
namespace api {
using namespace org::openapitools::server::helpers;
using namespace oai::udm::model;
AccessAndMobilitySubscriptionDataRetrievalApi::AccessAndMobilitySubscriptionDataRetrievalApi(std::shared_ptr<Pistache::Rest::Router> rtr) {
router = rtr;
}
void AccessAndMobilitySubscriptionDataRetrievalApi::init() {
setupRoutes();
}
void AccessAndMobilitySubscriptionDataRetrievalApi::setupRoutes() {
using namespace Pistache::Rest;
Routes::Get(*router, base + "/:supi/am-data", Routes::bind(&AccessAndMobilitySubscriptionDataRetrievalApi::get_am_data_handler, this));
// Default handler, called when a route is not found
router->addCustomHandler(Routes::bind(&AccessAndMobilitySubscriptionDataRetrievalApi::access_and_mobility_subscription_data_retrieval_api_default_handler, this));
}
void AccessAndMobilitySubscriptionDataRetrievalApi::get_am_data_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
// Getting the path params
auto supi = request.param(":supi").as<std::string>();
// Getting the query params
auto supportedFeaturesQuery = request.query().get("supported-features");
Pistache::Optional<std::string> supportedFeatures;
if(!supportedFeaturesQuery.isEmpty()){
std::string value;
if(fromStringValue(supportedFeaturesQuery.get(), value)){
supportedFeatures = Pistache::Some(value);
}
}
auto plmnIdQuery = request.query().get("plmn-id");
Pistache::Optional<PlmnId> plmnId;
/* if(!plmnIdQuery.isEmpty()){
PlmnId value;
if(fromStringValue(plmnIdQuery.get(), value)){
plmnId = Pistache::Some(value);
}
}
*/ // Getting the header params
auto ifNoneMatch = request.headers().tryGetRaw("If-None-Match");
auto ifModifiedSince = request.headers().tryGetRaw("If-Modified-Since");
try {
this->get_am_data(supi, supportedFeatures, plmnId, ifNoneMatch, ifModifiedSince, 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 AccessAndMobilitySubscriptionDataRetrievalApi::access_and_mobility_subscription_data_retrieval_api_default_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
response.send(Pistache::Http::Code::Not_Found, "The requested method does not exist");
}
}
}
}
/**
* Nudm_SDM
* Nudm Subscriber Data Management Service. � 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 2.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.
*/
/*
* AccessAndMobilitySubscriptionDataRetrievalApi.h
*
*
*/
#ifndef AccessAndMobilitySubscriptionDataRetrievalApi_H_
#define AccessAndMobilitySubscriptionDataRetrievalApi_H_
#include <pistache/http.h>
#include <pistache/router.h>
#include <pistache/http_headers.h>
#include <pistache/optional.h>
#include "AccessAndMobilitySubscriptionData.h"
#include "PlmnId.h"
#include "ProblemDetails.h"
#include <string>
namespace oai {
namespace udm {
namespace api {
using namespace oai::udm::model;
class AccessAndMobilitySubscriptionDataRetrievalApi {
public:
AccessAndMobilitySubscriptionDataRetrievalApi(std::shared_ptr<Pistache::Rest::Router>);
virtual ~AccessAndMobilitySubscriptionDataRetrievalApi() {}
void init();
const std::string base = "/nudm-sdm/v2";
private:
void setupRoutes();
void get_am_data_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void access_and_mobility_subscription_data_retrieval_api_default_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
std::shared_ptr<Pistache::Rest::Router> router;
/// <summary>
/// retrieve a UE&#39;s Access and Mobility Subscription Data
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="supi">Identifier of the UE</param>
/// <param name="supportedFeatures">Supported Features (optional, default to &quot;&quot;)</param>
/// <param name="plmnId">serving PLMN ID (optional, default to PlmnId())</param>
/// <param name="ifNoneMatch">Validator for conditional requests, as described in RFC 7232, 3.2 (optional, default to &quot;&quot;)</param>
/// <param name="ifModifiedSince">Validator for conditional requests, as described in RFC 7232, 3.3 (optional, default to &quot;&quot;)</param>
virtual void get_am_data(const std::string &supi, const Pistache::Optional<std::string> &supportedFeatures, const Pistache::Optional<PlmnId> &plmnId, const Pistache::Optional<Pistache::Http::Header::Raw> &ifNoneMatch, const Pistache::Optional<Pistache::Http::Header::Raw> &ifModifiedSince, Pistache::Http::ResponseWriter &response) = 0;
};
}
}
}
#endif /* AccessAndMobilitySubscriptionDataRetrievalApi_H_ */
/**
* Nudm_SDM
* Nudm Subscriber Data Management Service. � 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 2.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 "GPSIToSUPITranslationApi.h"
#include "Helpers.h"
namespace oai {
namespace udm {
namespace api {
using namespace org::openapitools::server::helpers;
using namespace oai::udm::model;
GPSIToSUPITranslationApi::GPSIToSUPITranslationApi(std::shared_ptr<Pistache::Rest::Router> rtr) {
router = rtr;
}
void GPSIToSUPITranslationApi::init() {
setupRoutes();
}
void GPSIToSUPITranslationApi::setupRoutes() {
using namespace Pistache::Rest;
Routes::Get(*router, base + "/:gpsi/id-translation-result", Routes::bind(&GPSIToSUPITranslationApi::get_supi_handler, this));
// Default handler, called when a route is not found
router->addCustomHandler(Routes::bind(&GPSIToSUPITranslationApi::gpsi_to_supi_translation_api_default_handler, this));
}
void GPSIToSUPITranslationApi::get_supi_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
// Getting the path params
auto gpsi = request.param(":gpsi").as<std::string>();
// Getting the query params
auto supportedFeaturesQuery = request.query().get("supported-features");
Pistache::Optional<std::string> supportedFeatures;
if(!supportedFeaturesQuery.isEmpty()){
std::string value;
if(fromStringValue(supportedFeaturesQuery.get(), value)){
supportedFeatures = Pistache::Some(value);
}
}
// Getting the header params
auto ifNoneMatch = request.headers().tryGetRaw("If-None-Match");
auto ifModifiedSince = request.headers().tryGetRaw("If-Modified-Since");
try {
this->get_supi(gpsi, supportedFeatures, ifNoneMatch, ifModifiedSince, 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 GPSIToSUPITranslationApi::gpsi_to_supi_translation_api_default_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
response.send(Pistache::Http::Code::Not_Found, "The requested method does not exist");
}
}
}
}
/**
* Nudm_SDM
* Nudm Subscriber Data Management Service. � 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 2.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.
*/
/*
* GPSIToSUPITranslationApi.h
*
*
*/
#ifndef GPSIToSUPITranslationApi_H_
#define GPSIToSUPITranslationApi_H_
#include <pistache/http.h>
#include <pistache/router.h>
#include <pistache/http_headers.h>
#include <pistache/optional.h>
#include "IdTranslationResult.h"
#include "ProblemDetails.h"
#include <string>
namespace oai {
namespace udm {
namespace api {
using namespace oai::udm::model;
class GPSIToSUPITranslationApi {
public:
GPSIToSUPITranslationApi(std::shared_ptr<Pistache::Rest::Router>);
virtual ~GPSIToSUPITranslationApi() {}
void init();
const std::string base = "/nudm-sdm/v2";
private:
void setupRoutes();
void get_supi_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void gpsi_to_supi_translation_api_default_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
std::shared_ptr<Pistache::Rest::Router> router;
/// <summary>
/// retrieve a UE&#39;s SUPI
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="gpsi">Identifier of the UE</param>
/// <param name="supportedFeatures">Supported Features (optional, default to &quot;&quot;)</param>
/// <param name="ifNoneMatch">Validator for conditional requests, as described in RFC 7232, 3.2 (optional, default to &quot;&quot;)</param>
/// <param name="ifModifiedSince">Validator for conditional requests, as described in RFC 7232, 3.3 (optional, default to &quot;&quot;)</param>
virtual void get_supi(const std::string &gpsi, const Pistache::Optional<std::string> &supportedFeatures, const Pistache::Optional<Pistache::Http::Header::Raw> &ifNoneMatch, const Pistache::Optional<Pistache::Http::Header::Raw> &ifModifiedSince, Pistache::Http::ResponseWriter &response) = 0;
};
}
}
}
#endif /* GPSIToSUPITranslationApi_H_ */
/**
* Nudm_SDM
* Nudm Subscriber Data Management Service. � 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 2.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 "GroupIdentifiersApi.h"
#include "Helpers.h"
namespace oai {
namespace udm {
namespace api {
using namespace org::openapitools::server::helpers;
using namespace oai::udm::model;
GroupIdentifiersApi::GroupIdentifiersApi(std::shared_ptr<Pistache::Rest::Router> rtr) {
router = rtr;
}
void GroupIdentifiersApi::init() {
setupRoutes();
}
void GroupIdentifiersApi::setupRoutes() {
using namespace Pistache::Rest;
Routes::Get(*router, base + "/group-data/group-identifiers", Routes::bind(&GroupIdentifiersApi::get_group_identifiers_handler, this));
// Default handler, called when a route is not found
router->addCustomHandler(Routes::bind(&GroupIdentifiersApi::group_identifiers_api_default_handler, this));
}
void GroupIdentifiersApi::get_group_identifiers_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
// Getting the query params
auto extGroupIdQuery = request.query().get("ext-group-id");
Pistache::Optional<std::string> extGroupId;
if(!extGroupIdQuery.isEmpty()){
std::string value;
if(fromStringValue(extGroupIdQuery.get(), value)){
extGroupId = Pistache::Some(value);
}
}
auto intGroupIdQuery = request.query().get("int-group-id");
Pistache::Optional<std::string> intGroupId;
if(!intGroupIdQuery.isEmpty()){
std::string value;
if(fromStringValue(intGroupIdQuery.get(), value)){
intGroupId = Pistache::Some(value);
}
}
auto supportedFeaturesQuery = request.query().get("supported-features");
Pistache::Optional<std::string> supportedFeatures;
if(!supportedFeaturesQuery.isEmpty()){
std::string value;
if(fromStringValue(supportedFeaturesQuery.get(), value)){
supportedFeatures = Pistache::Some(value);
}
}
// Getting the header params
auto ifNoneMatch = request.headers().tryGetRaw("If-None-Match");
auto ifModifiedSince = request.headers().tryGetRaw("If-Modified-Since");
try {
this->get_group_identifiers(extGroupId, intGroupId, supportedFeatures, ifNoneMatch, ifModifiedSince, 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 GroupIdentifiersApi::group_identifiers_api_default_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
response.send(Pistache::Http::Code::Not_Found, "The requested method does not exist");
}
}
}
}
/**
* Nudm_SDM
* Nudm Subscriber Data Management Service. � 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 2.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.
*/
/*
* GroupIdentifiersApi.h
*
*
*/
#ifndef GroupIdentifiersApi_H_
#define GroupIdentifiersApi_H_
#include <pistache/http.h>
#include <pistache/router.h>
#include <pistache/http_headers.h>
#include <pistache/optional.h>
#include "GroupIdentifiers.h"
#include "ProblemDetails.h"
#include <string>
namespace oai {
namespace udm {
namespace api {
using namespace oai::udm::model;
class GroupIdentifiersApi {
public:
GroupIdentifiersApi(std::shared_ptr<Pistache::Rest::Router>);
virtual ~GroupIdentifiersApi() {}
void init();
const std::string base = "/nudm-sdm/v2";
private:
void setupRoutes();
void get_group_identifiers_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void group_identifiers_api_default_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
std::shared_ptr<Pistache::Rest::Router> router;
/// <summary>
/// Mapping of Group Identifiers
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="extGroupId">External Group Identifier (optional, default to &quot;&quot;)</param>
/// <param name="intGroupId">Internal Group Identifier (optional, default to &quot;&quot;)</param>
/// <param name="supportedFeatures">Supported Features (optional, default to &quot;&quot;)</param>
/// <param name="ifNoneMatch">Validator for conditional requests, as described in RFC 7232, 3.2 (optional, default to &quot;&quot;)</param>
/// <param name="ifModifiedSince">Validator for conditional requests, as described in RFC 7232, 3.3 (optional, default to &quot;&quot;)</param>
virtual void get_group_identifiers(const Pistache::Optional<std::string> &extGroupId, const Pistache::Optional<std::string> &intGroupId, const Pistache::Optional<std::string> &supportedFeatures, const Pistache::Optional<Pistache::Http::Header::Raw> &ifNoneMatch, const Pistache::Optional<Pistache::Http::Header::Raw> &ifModifiedSince, Pistache::Http::ResponseWriter &response) = 0;
};
}
}
}
#endif /* GroupIdentifiersApi_H_ */
/**
* Nudm_SDM
* Nudm Subscriber Data Management Service. � 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 2.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 "ProvidingAcknowledgementOfSteeringOfRoamingApi.h"
#include "Helpers.h"
namespace oai {
namespace udm {
namespace api {
using namespace org::openapitools::server::helpers;
using namespace oai::udm::model;
ProvidingAcknowledgementOfSteeringOfRoamingApi::ProvidingAcknowledgementOfSteeringOfRoamingApi(std::shared_ptr<Pistache::Rest::Router> rtr) {
router = rtr;
}
void ProvidingAcknowledgementOfSteeringOfRoamingApi::init() {
setupRoutes();
}
void ProvidingAcknowledgementOfSteeringOfRoamingApi::setupRoutes() {
using namespace Pistache::Rest;
Routes::Put(*router, base + "/:supi/am-data/sor-ack", Routes::bind(&ProvidingAcknowledgementOfSteeringOfRoamingApi::sor_ack_info_handler, this));
// Default handler, called when a route is not found
router->addCustomHandler(Routes::bind(&ProvidingAcknowledgementOfSteeringOfRoamingApi::providing_acknowledgement_of_steering_of_roaming_api_default_handler, this));
}
void ProvidingAcknowledgementOfSteeringOfRoamingApi::sor_ack_info_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
// Getting the path params
auto supi = request.param(":supi").as<std::string>();
// Getting the body param
AcknowledgeInfo acknowledgeInfo;
try {
nlohmann::json::parse(request.body()).get_to(acknowledgeInfo);
this->sor_ack_info(supi, acknowledgeInfo, 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 ProvidingAcknowledgementOfSteeringOfRoamingApi::providing_acknowledgement_of_steering_of_roaming_api_default_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
response.send(Pistache::Http::Code::Not_Found, "The requested method does not exist");
}
}
}
}
/**
* Nudm_SDM
* Nudm Subscriber Data Management Service. � 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 2.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.
*/
/*
* ProvidingAcknowledgementOfSteeringOfRoamingApi.h
*
*
*/
#ifndef ProvidingAcknowledgementOfSteeringOfRoamingApi_H_
#define ProvidingAcknowledgementOfSteeringOfRoamingApi_H_
#include <pistache/http.h>
#include <pistache/router.h>
#include <pistache/http_headers.h>
#include <pistache/optional.h>
#include "AcknowledgeInfo.h"
#include "ProblemDetails.h"
#include <string>
namespace oai {
namespace udm {
namespace api {
using namespace oai::udm::model;
class ProvidingAcknowledgementOfSteeringOfRoamingApi {
public:
ProvidingAcknowledgementOfSteeringOfRoamingApi(std::shared_ptr<Pistache::Rest::Router>);
virtual ~ProvidingAcknowledgementOfSteeringOfRoamingApi() {}
void init();
const std::string base = "/nudm-sdm/v2";
private:
void setupRoutes();
void sor_ack_info_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void providing_acknowledgement_of_steering_of_roaming_api_default_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
std::shared_ptr<Pistache::Rest::Router> router;
/// <summary>
/// Nudm_Sdm Info service operation
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="supi">Identifier of the UE</param>
/// <param name="acknowledgeInfo"> (optional)</param>
virtual void sor_ack_info(const std::string &supi, const AcknowledgeInfo &acknowledgeInfo, Pistache::Http::ResponseWriter &response) = 0;
};
}
}
}
#endif /* ProvidingAcknowledgementOfSteeringOfRoamingApi_H_ */
/**
* Nudm_SDM
* Nudm Subscriber Data Management Service. � 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 2.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 "ProvidingAcknowledgementOfUEParametersUpdateApi.h"
#include "Helpers.h"
namespace oai {
namespace udm {
namespace api {
using namespace org::openapitools::server::helpers;
using namespace oai::udm::model;
ProvidingAcknowledgementOfUEParametersUpdateApi::ProvidingAcknowledgementOfUEParametersUpdateApi(std::shared_ptr<Pistache::Rest::Router> rtr) {
router = rtr;
}
void ProvidingAcknowledgementOfUEParametersUpdateApi::init() {
setupRoutes();
}
void ProvidingAcknowledgementOfUEParametersUpdateApi::setupRoutes() {
using namespace Pistache::Rest;
Routes::Put(*router, base + "/:supi/am-data/upu-ack", Routes::bind(&ProvidingAcknowledgementOfUEParametersUpdateApi::upu_ack_handler, this));
// Default handler, called when a route is not found
router->addCustomHandler(Routes::bind(&ProvidingAcknowledgementOfUEParametersUpdateApi::providing_acknowledgement_of_ue_parameters_update_api_default_handler, this));
}
void ProvidingAcknowledgementOfUEParametersUpdateApi::upu_ack_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
// Getting the path params
auto supi = request.param(":supi").as<std::string>();
// Getting the body param
AcknowledgeInfo acknowledgeInfo;
try {
nlohmann::json::parse(request.body()).get_to(acknowledgeInfo);
this->upu_ack(supi, acknowledgeInfo, 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 ProvidingAcknowledgementOfUEParametersUpdateApi::providing_acknowledgement_of_ue_parameters_update_api_default_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
response.send(Pistache::Http::Code::Not_Found, "The requested method does not exist");
}
}
}
}
/**
* Nudm_SDM
* Nudm Subscriber Data Management Service. � 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 2.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.
*/
/*
* ProvidingAcknowledgementOfUEParametersUpdateApi.h
*
*
*/
#ifndef ProvidingAcknowledgementOfUEParametersUpdateApi_H_
#define ProvidingAcknowledgementOfUEParametersUpdateApi_H_
#include <pistache/http.h>
#include <pistache/router.h>
#include <pistache/http_headers.h>
#include <pistache/optional.h>
#include "AcknowledgeInfo.h"
#include "ProblemDetails.h"
#include <string>
namespace oai {
namespace udm {
namespace api {
using namespace oai::udm::model;
class ProvidingAcknowledgementOfUEParametersUpdateApi {
public:
ProvidingAcknowledgementOfUEParametersUpdateApi(std::shared_ptr<Pistache::Rest::Router>);
virtual ~ProvidingAcknowledgementOfUEParametersUpdateApi() {}
void init();
const std::string base = "/nudm-sdm/v2";
private:
void setupRoutes();
void upu_ack_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void providing_acknowledgement_of_ue_parameters_update_api_default_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
std::shared_ptr<Pistache::Rest::Router> router;
/// <summary>
/// Nudm_Sdm Info for UPU service operation
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="supi">Identifier of the UE</param>
/// <param name="acknowledgeInfo"> (optional)</param>
virtual void upu_ack(const std::string &supi, const AcknowledgeInfo &acknowledgeInfo, Pistache::Http::ResponseWriter &response) = 0;
};
}
}
}
#endif /* ProvidingAcknowledgementOfUEParametersUpdateApi_H_ */
/**
* Nudm_SDM
* Nudm Subscriber Data Management Service. � 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 2.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 "RetrievalOfMultipleDataSetsApi.h"
#include "Helpers.h"
namespace oai {
namespace udm {
namespace api {
using namespace org::openapitools::server::helpers;
using namespace oai::udm::model;
RetrievalOfMultipleDataSetsApi::RetrievalOfMultipleDataSetsApi(std::shared_ptr<Pistache::Rest::Router> rtr) {
router = rtr;
}
void RetrievalOfMultipleDataSetsApi::init() {
setupRoutes();
}
void RetrievalOfMultipleDataSetsApi::setupRoutes() {
using namespace Pistache::Rest;
Routes::Get(*router, base + "/:supi", Routes::bind(&RetrievalOfMultipleDataSetsApi::get_data_sets_handler, this));
// Default handler, called when a route is not found
router->addCustomHandler(Routes::bind(&RetrievalOfMultipleDataSetsApi::retrieval_of_multiple_data_sets_api_default_handler, this));
}
void RetrievalOfMultipleDataSetsApi::get_data_sets_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
// Getting the path params
auto supi = request.param(":supi").as<std::string>();
// Getting the query params
auto datasetNamesQuery = request.query().get("dataset-names");
Pistache::Optional<std::vector<std::string>> datasetNames;
if(!datasetNamesQuery.isEmpty()){
std::vector<std::string> value;
if(fromStringValue(datasetNamesQuery.get(), value)){
datasetNames = Pistache::Some(value);
}
}
auto plmnIdQuery = request.query().get("plmn-id");
Pistache::Optional<PlmnId> plmnId;
/* if(!plmnIdQuery.isEmpty()){
PlmnId value;
if(fromStringValue(plmnIdQuery.get(), value)){
plmnId = Pistache::Some(value);
}
}
*/
auto supportedFeaturesQuery = request.query().get("supported-features");
Pistache::Optional<std::string> supportedFeatures;
if(!supportedFeaturesQuery.isEmpty()){
std::string value;
if(fromStringValue(supportedFeaturesQuery.get(), value)){
supportedFeatures = Pistache::Some(value);
}
}
// Getting the header params
auto ifNoneMatch = request.headers().tryGetRaw("If-None-Match");
auto ifModifiedSince = request.headers().tryGetRaw("If-Modified-Since");
try {
this->get_data_sets(supi, datasetNames, plmnId, supportedFeatures, ifNoneMatch, ifModifiedSince, 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 RetrievalOfMultipleDataSetsApi::retrieval_of_multiple_data_sets_api_default_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
response.send(Pistache::Http::Code::Not_Found, "The requested method does not exist");
}
}
}
}
/**
* Nudm_SDM
* Nudm Subscriber Data Management Service. � 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 2.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.
*/
/*
* RetrievalOfMultipleDataSetsApi.h
*
*
*/
#ifndef RetrievalOfMultipleDataSetsApi_H_
#define RetrievalOfMultipleDataSetsApi_H_
#include <pistache/http.h>
#include <pistache/router.h>
#include <pistache/http_headers.h>
#include <pistache/optional.h>
#include "PlmnId.h"
#include "ProblemDetails.h"
#include "SubscriptionDataSets.h"
#include <string>
namespace oai {
namespace udm {
namespace api {
using namespace oai::udm::model;
class RetrievalOfMultipleDataSetsApi {
public:
RetrievalOfMultipleDataSetsApi(std::shared_ptr<Pistache::Rest::Router>);
virtual ~RetrievalOfMultipleDataSetsApi() {}
void init();
const std::string base = "/nudm-sdm/v2";
private:
void setupRoutes();
void get_data_sets_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void retrieval_of_multiple_data_sets_api_default_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
std::shared_ptr<Pistache::Rest::Router> router;
/// <summary>
/// retrieve multiple data sets
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="supi">Identifier of the UE</param>
/// <param name="datasetNames">List of dataset names</param>
/// <param name="plmnId">serving PLMN ID (optional, default to PlmnId())</param>
/// <param name="supportedFeatures">Supported Features (optional, default to &quot;&quot;)</param>
/// <param name="ifNoneMatch">Validator for conditional requests, as described in RFC 7232, 3.2 (optional, default to &quot;&quot;)</param>
/// <param name="ifModifiedSince">Validator for conditional requests, as described in RFC 7232, 3.3 (optional, default to &quot;&quot;)</param>
virtual void get_data_sets(const std::string &supi, const Pistache::Optional<std::vector<std::string>> &datasetNames, const Pistache::Optional<PlmnId> &plmnId, const Pistache::Optional<std::string> &supportedFeatures, const Pistache::Optional<Pistache::Http::Header::Raw> &ifNoneMatch, const Pistache::Optional<Pistache::Http::Header::Raw> &ifModifiedSince, Pistache::Http::ResponseWriter &response) = 0;
};
}
}
}
#endif /* RetrievalOfMultipleDataSetsApi_H_ */
/**
* Nudm_SDM
* Nudm Subscriber Data Management Service. � 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 2.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 "RetrievalOfSharedDataApi.h"
#include "Helpers.h"
namespace oai {
namespace udm {
namespace api {
using namespace org::openapitools::server::helpers;
using namespace oai::udm::model;
RetrievalOfSharedDataApi::RetrievalOfSharedDataApi(std::shared_ptr<Pistache::Rest::Router> rtr) {
router = rtr;
}
void RetrievalOfSharedDataApi::init() {
setupRoutes();
}
void RetrievalOfSharedDataApi::setupRoutes() {
using namespace Pistache::Rest;
Routes::Get(*router, base + "/shared-data", Routes::bind(&RetrievalOfSharedDataApi::get_shared_data_handler, this));
// Default handler, called when a route is not found
router->addCustomHandler(Routes::bind(&RetrievalOfSharedDataApi::retrieval_of_shared_data_api_default_handler, this));
}
void RetrievalOfSharedDataApi::get_shared_data_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
// Getting the query params
auto sharedDataIdsQuery = request.query().get("shared-data-ids");
Pistache::Optional<std::vector<std::string>> sharedDataIds;
if(!sharedDataIdsQuery.isEmpty()){
std::vector<std::string> value;
if(fromStringValue(sharedDataIdsQuery.get(), value)){
sharedDataIds = Pistache::Some(value);
}
}
auto supportedFeaturesQuery = request.query().get("supportedFeatures");
Pistache::Optional<std::string> supportedFeatures;
if(!supportedFeaturesQuery.isEmpty()){
std::string value;
if(fromStringValue(supportedFeaturesQuery.get(), value)){
supportedFeatures = Pistache::Some(value);
}
}
// Getting the header params
auto ifNoneMatch = request.headers().tryGetRaw("If-None-Match");
auto ifModifiedSince = request.headers().tryGetRaw("If-Modified-Since");
try {
this->get_shared_data(sharedDataIds, supportedFeatures, ifNoneMatch, ifModifiedSince, 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 RetrievalOfSharedDataApi::retrieval_of_shared_data_api_default_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
response.send(Pistache::Http::Code::Not_Found, "The requested method does not exist");
}
}
}
}
/**
* Nudm_SDM
* Nudm Subscriber Data Management Service. � 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 2.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.
*/
/*
* RetrievalOfSharedDataApi.h
*
*
*/
#ifndef RetrievalOfSharedDataApi_H_
#define RetrievalOfSharedDataApi_H_
#include <pistache/http.h>
#include <pistache/router.h>
#include <pistache/http_headers.h>
#include <pistache/optional.h>
#include "ProblemDetails.h"
#include "SharedData.h"
#include <string>
namespace oai {
namespace udm {
namespace api {
using namespace oai::udm::model;
class RetrievalOfSharedDataApi {
public:
RetrievalOfSharedDataApi(std::shared_ptr<Pistache::Rest::Router>);
virtual ~RetrievalOfSharedDataApi() {}
void init();
const std::string base = "/nudm-sdm/v2";
private:
void setupRoutes();
void get_shared_data_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void retrieval_of_shared_data_api_default_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
std::shared_ptr<Pistache::Rest::Router> router;
/// <summary>
/// retrieve shared data
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="sharedDataIds">List of shared data ids</param>
/// <param name="supportedFeatures">Supported Features (optional, default to &quot;&quot;)</param>
/// <param name="ifNoneMatch">Validator for conditional requests, as described in RFC 7232, 3.2 (optional, default to &quot;&quot;)</param>
/// <param name="ifModifiedSince">Validator for conditional requests, as described in RFC 7232, 3.3 (optional, default to &quot;&quot;)</param>
virtual void get_shared_data(const Pistache::Optional<std::vector<std::string>> &sharedDataIds, const Pistache::Optional<std::string> &supportedFeatures, const Pistache::Optional<Pistache::Http::Header::Raw> &ifNoneMatch, const Pistache::Optional<Pistache::Http::Header::Raw> &ifModifiedSince, Pistache::Http::ResponseWriter &response) = 0;
};
}
}
}
#endif /* RetrievalOfSharedDataApi_H_ */
/**
* Nudm_SDM
* Nudm Subscriber Data Management Service. � 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 2.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 "SMFSelectionSubscriptionDataRetrievalApi.h"
#include "Helpers.h"
namespace oai {
namespace udm {
namespace api {
using namespace org::openapitools::server::helpers;
using namespace oai::udm::model;
SMFSelectionSubscriptionDataRetrievalApi::SMFSelectionSubscriptionDataRetrievalApi(std::shared_ptr<Pistache::Rest::Router> rtr) {
router = rtr;
}
void SMFSelectionSubscriptionDataRetrievalApi::init() {
setupRoutes();
}
void SMFSelectionSubscriptionDataRetrievalApi::setupRoutes() {
using namespace Pistache::Rest;
Routes::Get(*router, base + "/:supi/smf-select-data", Routes::bind(&SMFSelectionSubscriptionDataRetrievalApi::get_smf_sel_data_handler, this));
// Default handler, called when a route is not found
router->addCustomHandler(Routes::bind(&SMFSelectionSubscriptionDataRetrievalApi::smf_selection_subscription_data_retrieval_api_default_handler, this));
}
void SMFSelectionSubscriptionDataRetrievalApi::get_smf_sel_data_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
// Getting the path params
auto supi = request.param(":supi").as<std::string>();
// Getting the query params
auto supportedFeaturesQuery = request.query().get("supported-features");
Pistache::Optional<std::string> supportedFeatures;
if(!supportedFeaturesQuery.isEmpty()){
std::string value;
if(fromStringValue(supportedFeaturesQuery.get(), value)){
supportedFeatures = Pistache::Some(value);
}
}
auto plmnIdQuery = request.query().get("plmn-id");
Pistache::Optional<PlmnId> plmnId;
/* if(!plmnIdQuery.isEmpty()){
PlmnId value;
if(fromStringValue(plmnIdQuery.get(), value)){
plmnId = Pistache::Some(value);
}
}
*/
// Getting the header params
auto ifNoneMatch = request.headers().tryGetRaw("If-None-Match");
auto ifModifiedSince = request.headers().tryGetRaw("If-Modified-Since");
try {
this->get_smf_sel_data(supi, supportedFeatures, plmnId, ifNoneMatch, ifModifiedSince, 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 SMFSelectionSubscriptionDataRetrievalApi::smf_selection_subscription_data_retrieval_api_default_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
response.send(Pistache::Http::Code::Not_Found, "The requested method does not exist");
}
}
}
}
/**
* Nudm_SDM
* Nudm Subscriber Data Management Service. � 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 2.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.
*/
/*
* SMFSelectionSubscriptionDataRetrievalApi.h
*
*
*/
#ifndef SMFSelectionSubscriptionDataRetrievalApi_H_
#define SMFSelectionSubscriptionDataRetrievalApi_H_
#include <pistache/http.h>
#include <pistache/router.h>
#include <pistache/http_headers.h>
#include <pistache/optional.h>
#include "PlmnId.h"
#include "ProblemDetails.h"
#include "SmfSelectionSubscriptionData.h"
#include <string>
namespace oai {
namespace udm {
namespace api {
using namespace oai::udm::model;
class SMFSelectionSubscriptionDataRetrievalApi {
public:
SMFSelectionSubscriptionDataRetrievalApi(std::shared_ptr<Pistache::Rest::Router>);
virtual ~SMFSelectionSubscriptionDataRetrievalApi() {}
void init();
const std::string base = "/nudm-sdm/v2";
private:
void setupRoutes();
void get_smf_sel_data_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void smf_selection_subscription_data_retrieval_api_default_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
std::shared_ptr<Pistache::Rest::Router> router;
/// <summary>
/// retrieve a UE&#39;s SMF Selection Subscription Data
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="supi">Identifier of the UE</param>
/// <param name="supportedFeatures">Supported Features (optional, default to &quot;&quot;)</param>
/// <param name="plmnId">serving PLMN ID (optional, default to PlmnId())</param>
/// <param name="ifNoneMatch">Validator for conditional requests, as described in RFC 7232, 3.2 (optional, default to &quot;&quot;)</param>
/// <param name="ifModifiedSince">Validator for conditional requests, as described in RFC 7232, 3.3 (optional, default to &quot;&quot;)</param>
virtual void get_smf_sel_data(const std::string &supi, const Pistache::Optional<std::string> &supportedFeatures, const Pistache::Optional<PlmnId> &plmnId, const Pistache::Optional<Pistache::Http::Header::Raw> &ifNoneMatch, const Pistache::Optional<Pistache::Http::Header::Raw> &ifModifiedSince, Pistache::Http::ResponseWriter &response) = 0;
};
}
}
}
#endif /* SMFSelectionSubscriptionDataRetrievalApi_H_ */
/**
* Nudm_SDM
* Nudm Subscriber Data Management Service. � 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 2.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 "SMSManagementSubscriptionDataRetrievalApi.h"
#include "Helpers.h"
namespace oai {
namespace udm {
namespace api {
using namespace org::openapitools::server::helpers;
using namespace oai::udm::model;
SMSManagementSubscriptionDataRetrievalApi::SMSManagementSubscriptionDataRetrievalApi(std::shared_ptr<Pistache::Rest::Router> rtr) {
router = rtr;
}
void SMSManagementSubscriptionDataRetrievalApi::init() {
setupRoutes();
}
void SMSManagementSubscriptionDataRetrievalApi::setupRoutes() {
using namespace Pistache::Rest;
Routes::Get(*router, base + "/:supi/sms-mng-data", Routes::bind(&SMSManagementSubscriptionDataRetrievalApi::get_sms_mngt_data_handler, this));
// Default handler, called when a route is not found
router->addCustomHandler(Routes::bind(&SMSManagementSubscriptionDataRetrievalApi::sms_management_subscription_data_retrieval_api_default_handler, this));
}
void SMSManagementSubscriptionDataRetrievalApi::get_sms_mngt_data_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
// Getting the path params
auto supi = request.param(":supi").as<std::string>();
// Getting the query params
auto supportedFeaturesQuery = request.query().get("supported-features");
Pistache::Optional<std::string> supportedFeatures;
if(!supportedFeaturesQuery.isEmpty()){
std::string value;
if(fromStringValue(supportedFeaturesQuery.get(), value)){
supportedFeatures = Pistache::Some(value);
}
}
auto plmnIdQuery = request.query().get("plmn-id");
Pistache::Optional<PlmnId> plmnId;
/* if(!plmnIdQuery.isEmpty()){
PlmnId value;
if(fromStringValue(plmnIdQuery.get(), value)){
plmnId = Pistache::Some(value);
}
}
*/
// Getting the header params
auto ifNoneMatch = request.headers().tryGetRaw("If-None-Match");
auto ifModifiedSince = request.headers().tryGetRaw("If-Modified-Since");
try {
this->get_sms_mngt_data(supi, supportedFeatures, plmnId, ifNoneMatch, ifModifiedSince, 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 SMSManagementSubscriptionDataRetrievalApi::sms_management_subscription_data_retrieval_api_default_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
response.send(Pistache::Http::Code::Not_Found, "The requested method does not exist");
}
}
}
}
/**
* Nudm_SDM
* Nudm Subscriber Data Management Service. � 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 2.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.
*/
/*
* SMSManagementSubscriptionDataRetrievalApi.h
*
*
*/
#ifndef SMSManagementSubscriptionDataRetrievalApi_H_
#define SMSManagementSubscriptionDataRetrievalApi_H_
#include <pistache/http.h>
#include <pistache/router.h>
#include <pistache/http_headers.h>
#include <pistache/optional.h>
#include "PlmnId.h"
#include "ProblemDetails.h"
#include "SmsManagementSubscriptionData.h"
#include <string>
namespace oai {
namespace udm {
namespace api {
using namespace oai::udm::model;
class SMSManagementSubscriptionDataRetrievalApi {
public:
SMSManagementSubscriptionDataRetrievalApi(std::shared_ptr<Pistache::Rest::Router>);
virtual ~SMSManagementSubscriptionDataRetrievalApi() {}
void init();
const std::string base = "/nudm-sdm/v2";
private:
void setupRoutes();
void get_sms_mngt_data_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void sms_management_subscription_data_retrieval_api_default_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
std::shared_ptr<Pistache::Rest::Router> router;
/// <summary>
/// retrieve a UE&#39;s SMS Management Subscription Data
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="supi">Identifier of the UE</param>
/// <param name="supportedFeatures">Supported Features (optional, default to &quot;&quot;)</param>
/// <param name="plmnId"> (optional, default to PlmnId())</param>
/// <param name="ifNoneMatch">Validator for conditional requests, as described in RFC 7232, 3.2 (optional, default to &quot;&quot;)</param>
/// <param name="ifModifiedSince">Validator for conditional requests, as described in RFC 7232, 3.3 (optional, default to &quot;&quot;)</param>
virtual void get_sms_mngt_data(const std::string &supi, const Pistache::Optional<std::string> &supportedFeatures, const Pistache::Optional<PlmnId> &plmnId, const Pistache::Optional<Pistache::Http::Header::Raw> &ifNoneMatch, const Pistache::Optional<Pistache::Http::Header::Raw> &ifModifiedSince, Pistache::Http::ResponseWriter &response) = 0;
};
}
}
}
#endif /* SMSManagementSubscriptionDataRetrievalApi_H_ */
/**
* Nudm_SDM
* Nudm Subscriber Data Management Service. � 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 2.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 "SMSSubscriptionDataRetrievalApi.h"
#include "Helpers.h"
namespace oai {
namespace udm {
namespace api {
using namespace org::openapitools::server::helpers;
using namespace oai::udm::model;
SMSSubscriptionDataRetrievalApi::SMSSubscriptionDataRetrievalApi(std::shared_ptr<Pistache::Rest::Router> rtr) {
router = rtr;
}
void SMSSubscriptionDataRetrievalApi::init() {
setupRoutes();
}
void SMSSubscriptionDataRetrievalApi::setupRoutes() {
using namespace Pistache::Rest;
Routes::Get(*router, base + "/:supi/sms-data", Routes::bind(&SMSSubscriptionDataRetrievalApi::get_sms_data_handler, this));
// Default handler, called when a route is not found
router->addCustomHandler(Routes::bind(&SMSSubscriptionDataRetrievalApi::sms_subscription_data_retrieval_api_default_handler, this));
}
void SMSSubscriptionDataRetrievalApi::get_sms_data_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
// Getting the path params
auto supi = request.param(":supi").as<std::string>();
// Getting the query params
//TTN: Don't need
auto supportedFeaturesQuery = request.query().get("supported-features");
Pistache::Optional<std::string> supportedFeatures;
if(!supportedFeaturesQuery.isEmpty()){
std::string value;
if(fromStringValue(supportedFeaturesQuery.get(), value)){
supportedFeatures = Pistache::Some(value);
}
}
//TTN: Don't need
auto plmnIdQuery = request.query().get("plmn-id");
Pistache::Optional<PlmnId> plmnId;
/* if(!plmnIdQuery.isEmpty()){
PlmnId value;
if(fromStringValue(plmnIdQuery.get(), value)){
plmnId = Pistache::Some(value);
}
}
*/
// Getting the header params
auto ifNoneMatch = request.headers().tryGetRaw("If-None-Match");
auto ifModifiedSince = request.headers().tryGetRaw("If-Modified-Since");
try {
this->get_sms_data(supi, supportedFeatures, plmnId, ifNoneMatch, ifModifiedSince, 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 SMSSubscriptionDataRetrievalApi::sms_subscription_data_retrieval_api_default_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
response.send(Pistache::Http::Code::Not_Found, "The requested method does not exist");
}
}
}
}
/**
* Nudm_SDM
* Nudm Subscriber Data Management Service. � 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 2.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.
*/
/*
* SMSSubscriptionDataRetrievalApi.h
*
*
*/
#ifndef SMSSubscriptionDataRetrievalApi_H_
#define SMSSubscriptionDataRetrievalApi_H_
#include <pistache/http.h>
#include <pistache/router.h>
#include <pistache/http_headers.h>
#include <pistache/optional.h>
#include "PlmnId.h"
#include "ProblemDetails.h"
#include "SmsSubscriptionData.h"
#include <string>
namespace oai {
namespace udm {
namespace api {
using namespace oai::udm::model;
class SMSSubscriptionDataRetrievalApi {
public:
SMSSubscriptionDataRetrievalApi(std::shared_ptr<Pistache::Rest::Router>);
virtual ~SMSSubscriptionDataRetrievalApi() {}
void init();
const std::string base = "/nudm-sdm/v2";
private:
void setupRoutes();
void get_sms_data_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void sms_subscription_data_retrieval_api_default_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
std::shared_ptr<Pistache::Rest::Router> router;
/// <summary>
/// retrieve a UE&#39;s SMS Subscription Data
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="supi">Identifier of the UE</param>
/// <param name="supportedFeatures">Supported Features (optional, default to &quot;&quot;)</param>
/// <param name="plmnId"> (optional, default to PlmnId())</param>
/// <param name="ifNoneMatch">Validator for conditional requests, as described in RFC 7232, 3.2 (optional, default to &quot;&quot;)</param>
/// <param name="ifModifiedSince">Validator for conditional requests, as described in RFC 7232, 3.3 (optional, default to &quot;&quot;)</param>
virtual void get_sms_data(const std::string &supi, const Pistache::Optional<std::string> &supportedFeatures, const Pistache::Optional<PlmnId> &plmnId, const Pistache::Optional<Pistache::Http::Header::Raw> &ifNoneMatch, const Pistache::Optional<Pistache::Http::Header::Raw> &ifModifiedSince, Pistache::Http::ResponseWriter &response) = 0;
};
}
}
}
#endif /* SMSSubscriptionDataRetrievalApi_H_ */
/**
* Nudm_SDM
* Nudm Subscriber Data Management Service. � 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 2.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 "SessionManagementSubscriptionDataRetrievalApi.h"
#include "Helpers.h"
namespace oai {
namespace udm {
namespace api {
using namespace org::openapitools::server::helpers;
using namespace oai::udm::model;
SessionManagementSubscriptionDataRetrievalApi::SessionManagementSubscriptionDataRetrievalApi(std::shared_ptr<Pistache::Rest::Router> rtr) {
router = rtr;
}
void SessionManagementSubscriptionDataRetrievalApi::init() {
setupRoutes();
}
void SessionManagementSubscriptionDataRetrievalApi::setupRoutes() {
using namespace Pistache::Rest;
Routes::Get(*router, base + "/:supi/sm-data", Routes::bind(&SessionManagementSubscriptionDataRetrievalApi::get_sm_data_handler, this));
// Default handler, called when a route is not found
router->addCustomHandler(Routes::bind(&SessionManagementSubscriptionDataRetrievalApi::session_management_subscription_data_retrieval_api_default_handler, this));
}
void SessionManagementSubscriptionDataRetrievalApi::get_sm_data_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
// Getting the path params
auto supi = request.param(":supi").as<std::string>();
// Getting the query params
/*
* TODO:
auto supportedFeaturesQuery = request.query().get("supported-features");
Pistache::Optional<std::string> supportedFeatures;
if(!supportedFeaturesQuery.isEmpty()){
std::string value;
if(fromStringValue(supportedFeaturesQuery.get(), value)){
supportedFeatures = Pistache::Some(value);
}
}
*/
auto singleNssaiQuery = request.query().get("single-nssai");
Pistache::Optional<Snssai> singleNssai;
/* if(!singleNssaiQuery.isEmpty()){
Snssai value;
if(fromStringValue(singleNssaiQuery.get(), value)){
singleNssai = Pistache::Some(value);
}
}
*/
auto dnnQuery = request.query().get("dnn");
Pistache::Optional<std::string> dnn;
if(!dnnQuery.isEmpty()){
std::string value;
if(fromStringValue(dnnQuery.get(), value)){
dnn = Pistache::Some(value);
}
}
/*
* TODO:
auto plmnIdQuery = request.query().get("plmn-id");
Pistache::Optional<PlmnId> plmnId;
if(!plmnIdQuery.isEmpty()){
PlmnId value;
if(fromStringValue(plmnIdQuery.get(), value)){
plmnId = Pistache::Some(value);
}
}
*/
/*
* TODO:
// Getting the header params
auto ifNoneMatch = request.headers().tryGetRaw("If-None-Match");
auto ifModifiedSince = request.headers().tryGetRaw("If-Modified-Since");
*/
try {
//this->get_sm_data(supi, supportedFeatures, singleNssai, dnn, plmnId, ifNoneMatch, ifModifiedSince, response);
this->get_sm_data(supi, singleNssai, dnn, 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 SessionManagementSubscriptionDataRetrievalApi::session_management_subscription_data_retrieval_api_default_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
response.send(Pistache::Http::Code::Not_Found, "The requested method does not exist");
}
}
}
}
/**
* Nudm_SDM
* Nudm Subscriber Data Management Service. � 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 2.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.
*/
/*
* SessionManagementSubscriptionDataRetrievalApi.h
*
*
*/
#ifndef SessionManagementSubscriptionDataRetrievalApi_H_
#define SessionManagementSubscriptionDataRetrievalApi_H_
#include <pistache/http.h>
#include <pistache/router.h>
#include <pistache/http_headers.h>
#include <pistache/optional.h>
#include "PlmnId.h"
#include "ProblemDetails.h"
#include "SessionManagementSubscriptionData.h"
#include "Snssai.h"
#include <string>
namespace oai {
namespace udm {
namespace api {
using namespace oai::udm::model;
class SessionManagementSubscriptionDataRetrievalApi {
public:
SessionManagementSubscriptionDataRetrievalApi(std::shared_ptr<Pistache::Rest::Router>);
virtual ~SessionManagementSubscriptionDataRetrievalApi() {}
void init();
const std::string base = "/nudm-sdm/v2";
private:
void setupRoutes();
void get_sm_data_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void session_management_subscription_data_retrieval_api_default_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
std::shared_ptr<Pistache::Rest::Router> router;
/// <summary>
/// retrieve a UE&#39;s Session Management Subscription Data
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="supi">Identifier of the UE</param>
/// <param name="supportedFeatures">Supported Features (optional, default to &quot;&quot;)</param>
/// <param name="singleNssai"> (optional, default to Snssai())</param>
/// <param name="dnn"> (optional, default to &quot;&quot;)</param>
/// <param name="plmnId"> (optional, default to PlmnId())</param>
/// <param name="ifNoneMatch">Validator for conditional requests, as described in RFC 7232, 3.2 (optional, default to &quot;&quot;)</param>
/// <param name="ifModifiedSince">Validator for conditional requests, as described in RFC 7232, 3.3 (optional, default to &quot;&quot;)</param>
//virtual void get_sm_data(const std::string &supi, const Pistache::Optional<std::string> &supportedFeatures, const Pistache::Optional<Snssai> &singleNssai, const Pistache::Optional<std::string> &dnn, const Pistache::Optional<PlmnId> &plmnId, const Pistache::Optional<Pistache::Http::Header::Raw> &ifNoneMatch, const Pistache::Optional<Pistache::Http::Header::Raw> &ifModifiedSince, Pistache::Http::ResponseWriter &response) = 0;
virtual void get_sm_data(const std::string &supi, const Pistache::Optional<Snssai> &singleNssai, const Pistache::Optional<std::string> &dnn, Pistache::Http::ResponseWriter &response) = 0;
};
}
}
}
#endif /* SessionManagementSubscriptionDataRetrievalApi_H_ */
/**
* Nudm_SDM
* Nudm Subscriber Data Management Service. � 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 2.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 "SliceSelectionSubscriptionDataRetrievalApi.h"
#include "Helpers.h"
namespace oai {
namespace udm {
namespace api {
using namespace org::openapitools::server::helpers;
using namespace oai::udm::model;
SliceSelectionSubscriptionDataRetrievalApi::SliceSelectionSubscriptionDataRetrievalApi(std::shared_ptr<Pistache::Rest::Router> rtr) {
router = rtr;
}
void SliceSelectionSubscriptionDataRetrievalApi::init() {
setupRoutes();
}
void SliceSelectionSubscriptionDataRetrievalApi::setupRoutes() {
using namespace Pistache::Rest;
Routes::Get(*router, base + "/:supi/nssai", Routes::bind(&SliceSelectionSubscriptionDataRetrievalApi::get_nssai_handler, this));
// Default handler, called when a route is not found
router->addCustomHandler(Routes::bind(&SliceSelectionSubscriptionDataRetrievalApi::slice_selection_subscription_data_retrieval_api_default_handler, this));
}
void SliceSelectionSubscriptionDataRetrievalApi::get_nssai_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
// Getting the path params
auto supi = request.param(":supi").as<std::string>();
// Getting the query params
auto supportedFeaturesQuery = request.query().get("supported-features");
Pistache::Optional<std::string> supportedFeatures;
if(!supportedFeaturesQuery.isEmpty()){
std::string value;
if(fromStringValue(supportedFeaturesQuery.get(), value)){
supportedFeatures = Pistache::Some(value);
}
}
auto plmnIdQuery = request.query().get("plmn-id");
Pistache::Optional<PlmnId> plmnId;
/* if(!plmnIdQuery.isEmpty()){
PlmnId value;
if(fromStringValue(plmnIdQuery.get(), value)){
plmnId = Pistache::Some(value);
}
}
*/
// Getting the header params
auto ifNoneMatch = request.headers().tryGetRaw("If-None-Match");
auto ifModifiedSince = request.headers().tryGetRaw("If-Modified-Since");
try {
this->get_nssai(supi, supportedFeatures, plmnId, ifNoneMatch, ifModifiedSince, 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 SliceSelectionSubscriptionDataRetrievalApi::slice_selection_subscription_data_retrieval_api_default_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
response.send(Pistache::Http::Code::Not_Found, "The requested method does not exist");
}
}
}
}
/**
* Nudm_SDM
* Nudm Subscriber Data Management Service. � 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 2.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.
*/
/*
* SliceSelectionSubscriptionDataRetrievalApi.h
*
*
*/
#ifndef SliceSelectionSubscriptionDataRetrievalApi_H_
#define SliceSelectionSubscriptionDataRetrievalApi_H_
#include <pistache/http.h>
#include <pistache/router.h>
#include <pistache/http_headers.h>
#include <pistache/optional.h>
#include "Nssai.h"
#include "PlmnId.h"
#include "ProblemDetails.h"
#include <string>
namespace oai {
namespace udm {
namespace api {
using namespace oai::udm::model;
class SliceSelectionSubscriptionDataRetrievalApi {
public:
SliceSelectionSubscriptionDataRetrievalApi(std::shared_ptr<Pistache::Rest::Router>);
virtual ~SliceSelectionSubscriptionDataRetrievalApi() {}
void init();
const std::string base = "/nudm-sdm/v2";
private:
void setupRoutes();
void get_nssai_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void slice_selection_subscription_data_retrieval_api_default_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
std::shared_ptr<Pistache::Rest::Router> router;
/// <summary>
/// retrieve a UE&#39;s subscribed NSSAI
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="supi">Identifier of the UE</param>
/// <param name="supportedFeatures">Supported Features (optional, default to &quot;&quot;)</param>
/// <param name="plmnId">serving PLMN ID (optional, default to PlmnId())</param>
/// <param name="ifNoneMatch">Validator for conditional requests, as described in RFC 7232, 3.2 (optional, default to &quot;&quot;)</param>
/// <param name="ifModifiedSince">Validator for conditional requests, as described in RFC 7232, 3.3 (optional, default to &quot;&quot;)</param>
virtual void get_nssai(const std::string &supi, const Pistache::Optional<std::string> &supportedFeatures, const Pistache::Optional<PlmnId> &plmnId, const Pistache::Optional<Pistache::Http::Header::Raw> &ifNoneMatch, const Pistache::Optional<Pistache::Http::Header::Raw> &ifModifiedSince, Pistache::Http::ResponseWriter &response) = 0;
};
}
}
}
#endif /* SliceSelectionSubscriptionDataRetrievalApi_H_ */
/**
* Nudm_SDM
* Nudm Subscriber Data Management Service. � 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 2.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 "SubscriptionCreationApi.h"
#include "Helpers.h"
namespace oai {
namespace udm {
namespace api {
using namespace org::openapitools::server::helpers;
using namespace oai::udm::model;
SubscriptionCreationApi::SubscriptionCreationApi(std::shared_ptr<Pistache::Rest::Router> rtr) {
router = rtr;
}
void SubscriptionCreationApi::init() {
setupRoutes();
}
void SubscriptionCreationApi::setupRoutes() {
using namespace Pistache::Rest;
Routes::Post(*router, base + "/:supi/sdm-subscriptions", Routes::bind(&SubscriptionCreationApi::subscribe_handler, this));
// Default handler, called when a route is not found
router->addCustomHandler(Routes::bind(&SubscriptionCreationApi::subscription_creation_api_default_handler, this));
}
void SubscriptionCreationApi::subscribe_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
// Getting the path params
auto supi = request.param(":supi").as<std::string>();
// Getting the body param
SdmSubscription sdmSubscription;
try {
nlohmann::json::parse(request.body()).get_to(sdmSubscription);
this->subscribe(supi, sdmSubscription, 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 SubscriptionCreationApi::subscription_creation_api_default_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
response.send(Pistache::Http::Code::Not_Found, "The requested method does not exist");
}
}
}
}
/**
* Nudm_SDM
* Nudm Subscriber Data Management Service. � 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 2.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.
*/
/*
* SubscriptionCreationApi.h
*
*
*/
#ifndef SubscriptionCreationApi_H_
#define SubscriptionCreationApi_H_
#include <pistache/http.h>
#include <pistache/router.h>
#include <pistache/http_headers.h>
#include <pistache/optional.h>
#include "ProblemDetails.h"
#include "SdmSubscription.h"
#include <string>
namespace oai {
namespace udm {
namespace api {
using namespace oai::udm::model;
class SubscriptionCreationApi {
public:
SubscriptionCreationApi(std::shared_ptr<Pistache::Rest::Router>);
virtual ~SubscriptionCreationApi() {}
void init();
const std::string base = "/nudm-sdm/v2";
private:
void setupRoutes();
void subscribe_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void subscription_creation_api_default_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
std::shared_ptr<Pistache::Rest::Router> router;
/// <summary>
/// subscribe to notifications
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="supi">SUPI of the user</param>
/// <param name="sdmSubscription"></param>
virtual void subscribe(const std::string &supi, const SdmSubscription &sdmSubscription, Pistache::Http::ResponseWriter &response) = 0;
};
}
}
}
#endif /* SubscriptionCreationApi_H_ */
/**
* Nudm_SDM
* Nudm Subscriber Data Management Service. � 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 2.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 "SubscriptionCreationForSharedDataApi.h"
#include "Helpers.h"
namespace oai {
namespace udm {
namespace api {
using namespace org::openapitools::server::helpers;
using namespace oai::udm::model;
SubscriptionCreationForSharedDataApi::SubscriptionCreationForSharedDataApi(std::shared_ptr<Pistache::Rest::Router> rtr) {
router = rtr;
}
void SubscriptionCreationForSharedDataApi::init() {
setupRoutes();
}
void SubscriptionCreationForSharedDataApi::setupRoutes() {
using namespace Pistache::Rest;
Routes::Post(*router, base + "/shared-data-subscriptions", Routes::bind(&SubscriptionCreationForSharedDataApi::subscribe_to_shared_data_handler, this));
// Default handler, called when a route is not found
router->addCustomHandler(Routes::bind(&SubscriptionCreationForSharedDataApi::subscription_creation_for_shared_data_api_default_handler, this));
}
void SubscriptionCreationForSharedDataApi::subscribe_to_shared_data_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
// Getting the body param
SdmSubscription sdmSubscription;
try {
nlohmann::json::parse(request.body()).get_to(sdmSubscription);
this->subscribe_to_shared_data(sdmSubscription, 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 SubscriptionCreationForSharedDataApi::subscription_creation_for_shared_data_api_default_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
response.send(Pistache::Http::Code::Not_Found, "The requested method does not exist");
}
}
}
}
/**
* Nudm_SDM
* Nudm Subscriber Data Management Service. � 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 2.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.
*/
/*
* SubscriptionCreationForSharedDataApi.h
*
*
*/
#ifndef SubscriptionCreationForSharedDataApi_H_
#define SubscriptionCreationForSharedDataApi_H_
#include <pistache/http.h>
#include <pistache/router.h>
#include <pistache/http_headers.h>
#include <pistache/optional.h>
#include "ProblemDetails.h"
#include "SdmSubscription.h"
namespace oai {
namespace udm {
namespace api {
using namespace oai::udm::model;
class SubscriptionCreationForSharedDataApi {
public:
SubscriptionCreationForSharedDataApi(std::shared_ptr<Pistache::Rest::Router>);
virtual ~SubscriptionCreationForSharedDataApi() {}
void init();
const std::string base = "/nudm-sdm/v2";
private:
void setupRoutes();
void subscribe_to_shared_data_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void subscription_creation_for_shared_data_api_default_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
std::shared_ptr<Pistache::Rest::Router> router;
/// <summary>
/// subscribe to notifications for shared data
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="sdmSubscription"></param>
virtual void subscribe_to_shared_data(const SdmSubscription &sdmSubscription, Pistache::Http::ResponseWriter &response) = 0;
};
}
}
}
#endif /* SubscriptionCreationForSharedDataApi_H_ */
/**
* Nudm_SDM
* Nudm Subscriber Data Management Service. � 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 2.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 "SubscriptionDeletionApi.h"
#include "Helpers.h"
namespace oai {
namespace udm {
namespace api {
using namespace org::openapitools::server::helpers;
using namespace oai::udm::model;
SubscriptionDeletionApi::SubscriptionDeletionApi(std::shared_ptr<Pistache::Rest::Router> rtr) {
router = rtr;
}
void SubscriptionDeletionApi::init() {
setupRoutes();
}
void SubscriptionDeletionApi::setupRoutes() {
using namespace Pistache::Rest;
Routes::Delete(*router, base + "/:supi/sdm-subscriptions/:subscriptionId", Routes::bind(&SubscriptionDeletionApi::unsubscribe_handler, this));
// Default handler, called when a route is not found
router->addCustomHandler(Routes::bind(&SubscriptionDeletionApi::subscription_deletion_api_default_handler, this));
}
void SubscriptionDeletionApi::unsubscribe_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
// Getting the path params
auto supi = request.param(":supi").as<std::string>();
auto subscriptionId = request.param(":subscriptionId").as<std::string>();
try {
this->unsubscribe(supi, subscriptionId, 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 SubscriptionDeletionApi::subscription_deletion_api_default_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
response.send(Pistache::Http::Code::Not_Found, "The requested method does not exist");
}
}
}
}
/**
* Nudm_SDM
* Nudm Subscriber Data Management Service. � 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 2.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.
*/
/*
* SubscriptionDeletionApi.h
*
*
*/
#ifndef SubscriptionDeletionApi_H_
#define SubscriptionDeletionApi_H_
#include <pistache/http.h>
#include <pistache/router.h>
#include <pistache/http_headers.h>
#include <pistache/optional.h>
#include "ProblemDetails.h"
#include <string>
namespace oai {
namespace udm {
namespace api {
using namespace oai::udm::model;
class SubscriptionDeletionApi {
public:
SubscriptionDeletionApi(std::shared_ptr<Pistache::Rest::Router>);
virtual ~SubscriptionDeletionApi() {}
void init();
const std::string base = "/nudm-sdm/v2";
private:
void setupRoutes();
void unsubscribe_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void subscription_deletion_api_default_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
std::shared_ptr<Pistache::Rest::Router> router;
/// <summary>
/// unsubscribe from notifications
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="supi">SUPI of the user</param>
/// <param name="subscriptionId">Id of the SDM Subscription</param>
virtual void unsubscribe(const std::string &supi, const std::string &subscriptionId, Pistache::Http::ResponseWriter &response) = 0;
};
}
}
}
#endif /* SubscriptionDeletionApi_H_ */
/**
* Nudm_SDM
* Nudm Subscriber Data Management Service. � 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 2.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 "SubscriptionDeletionForSharedDataApi.h"
#include "Helpers.h"
namespace oai {
namespace udm {
namespace api {
using namespace org::openapitools::server::helpers;
using namespace oai::udm::model;
SubscriptionDeletionForSharedDataApi::SubscriptionDeletionForSharedDataApi(std::shared_ptr<Pistache::Rest::Router> rtr) {
router = rtr;
}
void SubscriptionDeletionForSharedDataApi::init() {
setupRoutes();
}
void SubscriptionDeletionForSharedDataApi::setupRoutes() {
using namespace Pistache::Rest;
Routes::Delete(*router, base + "/shared-data-subscriptions/:subscriptionId", Routes::bind(&SubscriptionDeletionForSharedDataApi::unsubscribe_for_shared_data_handler, this));
// Default handler, called when a route is not found
router->addCustomHandler(Routes::bind(&SubscriptionDeletionForSharedDataApi::subscription_deletion_for_shared_data_api_default_handler, this));
}
void SubscriptionDeletionForSharedDataApi::unsubscribe_for_shared_data_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
// Getting the path params
auto subscriptionId = request.param(":subscriptionId").as<std::string>();
try {
this->unsubscribe_for_shared_data(subscriptionId, 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 SubscriptionDeletionForSharedDataApi::subscription_deletion_for_shared_data_api_default_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
response.send(Pistache::Http::Code::Not_Found, "The requested method does not exist");
}
}
}
}
/**
* Nudm_SDM
* Nudm Subscriber Data Management Service. � 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 2.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.
*/
/*
* SubscriptionDeletionForSharedDataApi.h
*
*
*/
#ifndef SubscriptionDeletionForSharedDataApi_H_
#define SubscriptionDeletionForSharedDataApi_H_
#include <pistache/http.h>
#include <pistache/router.h>
#include <pistache/http_headers.h>
#include <pistache/optional.h>
#include "ProblemDetails.h"
#include <string>
namespace oai {
namespace udm {
namespace api {
using namespace oai::udm::model;
class SubscriptionDeletionForSharedDataApi {
public:
SubscriptionDeletionForSharedDataApi(std::shared_ptr<Pistache::Rest::Router>);
virtual ~SubscriptionDeletionForSharedDataApi() {}
void init();
const std::string base = "/nudm-sdm/v2";
private:
void setupRoutes();
void unsubscribe_for_shared_data_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void subscription_deletion_for_shared_data_api_default_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
std::shared_ptr<Pistache::Rest::Router> router;
/// <summary>
/// unsubscribe from notifications for shared data
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="subscriptionId">Id of the Shared data Subscription</param>
virtual void unsubscribe_for_shared_data(const std::string &subscriptionId, Pistache::Http::ResponseWriter &response) = 0;
};
}
}
}
#endif /* SubscriptionDeletionForSharedDataApi_H_ */
/**
* Nudm_SDM
* Nudm Subscriber Data Management Service. � 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 2.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 "SubscriptionModificationApi.h"
#include "Helpers.h"
namespace oai {
namespace udm {
namespace api {
using namespace org::openapitools::server::helpers;
using namespace oai::udm::model;
SubscriptionModificationApi::SubscriptionModificationApi(std::shared_ptr<Pistache::Rest::Router> rtr) {
router = rtr;
}
void SubscriptionModificationApi::init() {
setupRoutes();
}
void SubscriptionModificationApi::setupRoutes() {
using namespace Pistache::Rest;
Routes::Patch(*router, base + "/:supi/sdm-subscriptions/:subscriptionId", Routes::bind(&SubscriptionModificationApi::modify_handler, this));
Routes::Patch(*router, base + "/shared-data-subscriptions/:subscriptionId", Routes::bind(&SubscriptionModificationApi::modify_shared_data_subs_handler, this));
// Default handler, called when a route is not found
router->addCustomHandler(Routes::bind(&SubscriptionModificationApi::subscription_modification_api_default_handler, this));
}
void SubscriptionModificationApi::modify_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
// Getting the path params
auto supi = request.param(":supi").as<std::string>();
auto subscriptionId = request.param(":subscriptionId").as<std::string>();
// Getting the body param
SdmSubsModification sdmSubsModification;
try {
nlohmann::json::parse(request.body()).get_to(sdmSubsModification);
this->modify(supi, subscriptionId, sdmSubsModification, 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 SubscriptionModificationApi::modify_shared_data_subs_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
// Getting the path params
auto subscriptionId = request.param(":subscriptionId").as<std::string>();
// Getting the body param
SdmSubsModification sdmSubsModification;
try {
nlohmann::json::parse(request.body()).get_to(sdmSubsModification);
this->modify_shared_data_subs(subscriptionId, sdmSubsModification, 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 SubscriptionModificationApi::subscription_modification_api_default_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
response.send(Pistache::Http::Code::Not_Found, "The requested method does not exist");
}
}
}
}
/**
* Nudm_SDM
* Nudm Subscriber Data Management Service. � 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 2.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.
*/
/*
* SubscriptionModificationApi.h
*
*
*/
#ifndef SubscriptionModificationApi_H_
#define SubscriptionModificationApi_H_
#include <pistache/http.h>
#include <pistache/router.h>
#include <pistache/http_headers.h>
#include <pistache/optional.h>
#include "ProblemDetails.h"
#include "SdmSubsModification.h"
#include "SdmSubscription.h"
#include <string>
namespace oai {
namespace udm {
namespace api {
using namespace oai::udm::model;
class SubscriptionModificationApi {
public:
SubscriptionModificationApi(std::shared_ptr<Pistache::Rest::Router>);
virtual ~SubscriptionModificationApi() {}
void init();
const std::string base = "/nudm-sdm/v2";
private:
void setupRoutes();
void modify_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void modify_shared_data_subs_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void subscription_modification_api_default_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
std::shared_ptr<Pistache::Rest::Router> router;
/// <summary>
/// modify the subscription
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="supi">SUPI of the user</param>
/// <param name="subscriptionId">Id of the SDM Subscription</param>
/// <param name="sdmSubsModification"></param>
virtual void modify(const std::string &supi, const std::string &subscriptionId, const SdmSubsModification &sdmSubsModification, Pistache::Http::ResponseWriter &response) = 0;
/// <summary>
/// modify the subscription
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="subscriptionId">Id of the SDM Subscription</param>
/// <param name="sdmSubsModification"></param>
virtual void modify_shared_data_subs(const std::string &subscriptionId, const SdmSubsModification &sdmSubsModification, Pistache::Http::ResponseWriter &response) = 0;
};
}
}
}
#endif /* SubscriptionModificationApi_H_ */
/**
* Nudm_SDM
* Nudm Subscriber Data Management Service. � 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 2.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 "TraceConfigurationDataRetrievalApi.h"
#include "Helpers.h"
namespace oai {
namespace udm {
namespace api {
using namespace org::openapitools::server::helpers;
using namespace oai::udm::model;
TraceConfigurationDataRetrievalApi::TraceConfigurationDataRetrievalApi(std::shared_ptr<Pistache::Rest::Router> rtr) {
router = rtr;
}
void TraceConfigurationDataRetrievalApi::init() {
setupRoutes();
}
void TraceConfigurationDataRetrievalApi::setupRoutes() {
using namespace Pistache::Rest;
Routes::Get(*router, base + "/:supi/trace-data", Routes::bind(&TraceConfigurationDataRetrievalApi::get_trace_config_data_handler, this));
// Default handler, called when a route is not found
router->addCustomHandler(Routes::bind(&TraceConfigurationDataRetrievalApi::trace_configuration_data_retrieval_api_default_handler, this));
}
void TraceConfigurationDataRetrievalApi::get_trace_config_data_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
// Getting the path params
auto supi = request.param(":supi").as<std::string>();
// Getting the query params
auto supportedFeaturesQuery = request.query().get("supported-features");
Pistache::Optional<std::string> supportedFeatures;
if(!supportedFeaturesQuery.isEmpty()){
std::string value;
if(fromStringValue(supportedFeaturesQuery.get(), value)){
supportedFeatures = Pistache::Some(value);
}
}
auto plmnIdQuery = request.query().get("plmn-id");
Pistache::Optional<PlmnId> plmnId;
/* if(!plmnIdQuery.isEmpty()){
PlmnId value;
if(fromStringValue(plmnIdQuery.get(), value)){
plmnId = Pistache::Some(value);
}
}
*/
// Getting the header params
auto ifNoneMatch = request.headers().tryGetRaw("If-None-Match");
auto ifModifiedSince = request.headers().tryGetRaw("If-Modified-Since");
try {
this->get_trace_config_data(supi, supportedFeatures, plmnId, ifNoneMatch, ifModifiedSince, 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 TraceConfigurationDataRetrievalApi::trace_configuration_data_retrieval_api_default_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
response.send(Pistache::Http::Code::Not_Found, "The requested method does not exist");
}
}
}
}
/**
* Nudm_SDM
* Nudm Subscriber Data Management Service. � 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 2.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.
*/
/*
* TraceConfigurationDataRetrievalApi.h
*
*
*/
#ifndef TraceConfigurationDataRetrievalApi_H_
#define TraceConfigurationDataRetrievalApi_H_
#include <pistache/http.h>
#include <pistache/router.h>
#include <pistache/http_headers.h>
#include <pistache/optional.h>
#include "PlmnId.h"
#include "ProblemDetails.h"
#include "TraceDataResponse.h"
#include <string>
namespace oai {
namespace udm {
namespace api {
using namespace oai::udm::model;
class TraceConfigurationDataRetrievalApi {
public:
TraceConfigurationDataRetrievalApi(std::shared_ptr<Pistache::Rest::Router>);
virtual ~TraceConfigurationDataRetrievalApi() {}
void init();
const std::string base = "/nudm-sdm/v2";
private:
void setupRoutes();
void get_trace_config_data_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void trace_configuration_data_retrieval_api_default_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
std::shared_ptr<Pistache::Rest::Router> router;
/// <summary>
/// retrieve a UE&#39;s Trace Configuration Data
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="supi">Identifier of the UE</param>
/// <param name="supportedFeatures">Supported Features (optional, default to &quot;&quot;)</param>
/// <param name="plmnId">serving PLMN ID (optional, default to PlmnId())</param>
/// <param name="ifNoneMatch">Validator for conditional requests, as described in RFC 7232, 3.2 (optional, default to &quot;&quot;)</param>
/// <param name="ifModifiedSince">Validator for conditional requests, as described in RFC 7232, 3.3 (optional, default to &quot;&quot;)</param>
virtual void get_trace_config_data(const std::string &supi, const Pistache::Optional<std::string> &supportedFeatures, const Pistache::Optional<PlmnId> &plmnId, const Pistache::Optional<Pistache::Http::Header::Raw> &ifNoneMatch, const Pistache::Optional<Pistache::Http::Header::Raw> &ifModifiedSince, Pistache::Http::ResponseWriter &response) = 0;
};
}
}
}
#endif /* TraceConfigurationDataRetrievalApi_H_ */
/**
* Nudm_SDM
* Nudm Subscriber Data Management Service. � 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 2.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 "UEContextInSMFDataRetrievalApi.h"
#include "Helpers.h"
namespace oai {
namespace udm {
namespace api {
using namespace org::openapitools::server::helpers;
using namespace oai::udm::model;
UEContextInSMFDataRetrievalApi::UEContextInSMFDataRetrievalApi(std::shared_ptr<Pistache::Rest::Router> rtr) {
router = rtr;
}
void UEContextInSMFDataRetrievalApi::init() {
setupRoutes();
}
void UEContextInSMFDataRetrievalApi::setupRoutes() {
using namespace Pistache::Rest;
Routes::Get(*router, base + "/:supi/ue-context-in-smf-data", Routes::bind(&UEContextInSMFDataRetrievalApi::get_ue_ctx_in_smf_data_handler, this));
// Default handler, called when a route is not found
router->addCustomHandler(Routes::bind(&UEContextInSMFDataRetrievalApi::ue_context_in_smf_data_retrieval_api_default_handler, this));
}
void UEContextInSMFDataRetrievalApi::get_ue_ctx_in_smf_data_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
// Getting the path params
auto supi = request.param(":supi").as<std::string>();
// Getting the query params
auto supportedFeaturesQuery = request.query().get("supported-features");
Pistache::Optional<std::string> supportedFeatures;
if(!supportedFeaturesQuery.isEmpty()){
std::string value;
if(fromStringValue(supportedFeaturesQuery.get(), value)){
supportedFeatures = Pistache::Some(value);
}
}
try {
this->get_ue_ctx_in_smf_data(supi, supportedFeatures, 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 UEContextInSMFDataRetrievalApi::ue_context_in_smf_data_retrieval_api_default_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
response.send(Pistache::Http::Code::Not_Found, "The requested method does not exist");
}
}
}
}
/**
* Nudm_SDM
* Nudm Subscriber Data Management Service. � 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 2.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.
*/
/*
* UEContextInSMFDataRetrievalApi.h
*
*
*/
#ifndef UEContextInSMFDataRetrievalApi_H_
#define UEContextInSMFDataRetrievalApi_H_
#include <pistache/http.h>
#include <pistache/router.h>
#include <pistache/http_headers.h>
#include <pistache/optional.h>
#include "ProblemDetails.h"
#include "UeContextInSmfData.h"
#include <string>
namespace oai {
namespace udm {
namespace api {
using namespace oai::udm::model;
class UEContextInSMFDataRetrievalApi {
public:
UEContextInSMFDataRetrievalApi(std::shared_ptr<Pistache::Rest::Router>);
virtual ~UEContextInSMFDataRetrievalApi() {}
void init();
const std::string base = "/nudm-sdm/v2";
private:
void setupRoutes();
void get_ue_ctx_in_smf_data_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void ue_context_in_smf_data_retrieval_api_default_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
std::shared_ptr<Pistache::Rest::Router> router;
/// <summary>
/// retrieve a UE&#39;s UE Context In SMF Data
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="supi">Identifier of the UE</param>
/// <param name="supportedFeatures">Supported Features (optional, default to &quot;&quot;)</param>
virtual void get_ue_ctx_in_smf_data(const std::string &supi, const Pistache::Optional<std::string> &supportedFeatures, Pistache::Http::ResponseWriter &response) = 0;
};
}
}
}
#endif /* UEContextInSMFDataRetrievalApi_H_ */
/**
* Nudm_SDM
* Nudm Subscriber Data Management Service. � 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 2.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 "UEContextInSMSFDataRetrievalApi.h"
#include "Helpers.h"
namespace oai {
namespace udm {
namespace api {
using namespace org::openapitools::server::helpers;
using namespace oai::udm::model;
UEContextInSMSFDataRetrievalApi::UEContextInSMSFDataRetrievalApi(std::shared_ptr<Pistache::Rest::Router> rtr) {
router = rtr;
}
void UEContextInSMSFDataRetrievalApi::init() {
setupRoutes();
}
void UEContextInSMSFDataRetrievalApi::setupRoutes() {
using namespace Pistache::Rest;
Routes::Get(*router, base + "/:supi/ue-context-in-smsf-data", Routes::bind(&UEContextInSMSFDataRetrievalApi::get_ue_ctx_in_smsf_data_handler, this));
// Default handler, called when a route is not found
router->addCustomHandler(Routes::bind(&UEContextInSMSFDataRetrievalApi::ue_context_in_smsf_data_retrieval_api_default_handler, this));
}
void UEContextInSMSFDataRetrievalApi::get_ue_ctx_in_smsf_data_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
// Getting the path params
auto supi = request.param(":supi").as<std::string>();
// Getting the query params
auto supportedFeaturesQuery = request.query().get("supported-features");
Pistache::Optional<std::string> supportedFeatures;
if(!supportedFeaturesQuery.isEmpty()){
std::string value;
if(fromStringValue(supportedFeaturesQuery.get(), value)){
supportedFeatures = Pistache::Some(value);
}
}
try {
this->get_ue_ctx_in_smsf_data(supi, supportedFeatures, 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 UEContextInSMSFDataRetrievalApi::ue_context_in_smsf_data_retrieval_api_default_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
response.send(Pistache::Http::Code::Not_Found, "The requested method does not exist");
}
}
}
}
/**
* Nudm_SDM
* Nudm Subscriber Data Management Service. � 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 2.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.
*/
/*
* UEContextInSMSFDataRetrievalApi.h
*
*
*/
#ifndef UEContextInSMSFDataRetrievalApi_H_
#define UEContextInSMSFDataRetrievalApi_H_
#include <pistache/http.h>
#include <pistache/router.h>
#include <pistache/http_headers.h>
#include <pistache/optional.h>
#include "ProblemDetails.h"
#include "UeContextInSmsfData.h"
#include <string>
namespace oai {
namespace udm {
namespace api {
using namespace oai::udm::model;
class UEContextInSMSFDataRetrievalApi {
public:
UEContextInSMSFDataRetrievalApi(std::shared_ptr<Pistache::Rest::Router>);
virtual ~UEContextInSMSFDataRetrievalApi() {}
void init();
const std::string base = "/nudm-sdm/v2";
private:
void setupRoutes();
void get_ue_ctx_in_smsf_data_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
void ue_context_in_smsf_data_retrieval_api_default_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
std::shared_ptr<Pistache::Rest::Router> router;
/// <summary>
/// retrieve a UE&#39;s UE Context In SMSF Data
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="supi">Identifier of the UE</param>
/// <param name="supportedFeatures">Supported Features (optional, default to &quot;&quot;)</param>
virtual void get_ue_ctx_in_smsf_data(const std::string &supi, const Pistache::Optional<std::string> &supportedFeatures, Pistache::Http::ResponseWriter &response) = 0;
};
}
}
}
#endif /* UEContextInSMSFDataRetrievalApi_H_ */
version: 2
jobs:
build_stable:
docker:
- image: debian:stretch
steps:
- checkout
- run:
name: Install required tools
command: 'apt-get update && apt-get install -y gcc g++ git cmake'
- run:
name: Run CMake
command: 'mkdir build ; cd build ; cmake .. -DJSON_BuildTests=On'
- run:
name: Compile
command: 'cmake --build build'
- run:
name: Execute test suite
command: 'cd build ; ctest --output-on-failure -j 2'
build_bleeding_edge:
docker:
- image: archlinux
steps:
- checkout
- run:
name: Install required tools
command: 'pacman -Sy --noconfirm base base-devel gcc git cmake'
- run:
name: Run CMake
command: 'mkdir build ; cd build ; cmake .. -DJSON_BuildTests=On'
- run:
name: Compile
command: 'cmake --build build'
- run:
name: Execute test suite
command: 'cd build ; ctest --output-on-failure -j 2'
workflows:
version: 2
build_and_test_all:
jobs:
- build_stable:
filters:
branches:
ignore:
gh-pages
- build_bleeding_edge:
filters:
branches:
ignore:
gh-pages
#AccessModifierOffset: 2
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
#AlignConsecutiveBitFields: false
AlignConsecutiveDeclarations: false
AlignConsecutiveMacros: false
AlignEscapedNewlines: Right
#AlignOperands: AlignAfterOperator
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: false
AllowAllConstructorInitializersOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: false
#AllowShortEnumsOnASingleLine: true
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: Empty
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: false
BinPackParameters: false
#BitFieldColonSpacing: Both
BreakBeforeBraces: Custom # or Allman
BraceWrapping:
AfterCaseLabel: true
AfterClass: true
AfterControlStatement: Always
AfterEnum: true
AfterFunction: true
AfterNamespace: false
AfterStruct: true
AfterUnion: true
AfterExternBlock: false
BeforeCatch: true
BeforeElse: true
#BeforeLambdaBody: false
#BeforeWhile: false
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: false
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeComma
BreakStringLiterals: false
ColumnLimit: 0
CompactNamespaces: false
ConstructorInitializerIndentWidth: 2
Cpp11BracedListStyle: true
PointerAlignment: Left
FixNamespaceComments: true
IncludeBlocks: Preserve
#IndentCaseBlocks: false
IndentCaseLabels: true
IndentGotoLabels: false
IndentPPDirectives: BeforeHash
IndentWidth: 4
KeepEmptyLinesAtTheStartOfBlocks: false
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ReflowComments: false
SortIncludes: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceBeforeSquareBrackets: false
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInConditionalStatement: false
SpacesInContainerLiterals: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: c++11
TabWidth: 4
UseTab: Never
Checks: '*,
-cppcoreguidelines-avoid-goto,
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-macro-usage,
-fuchsia-default-arguments-calls,
-fuchsia-default-arguments-declarations,
-fuchsia-overloaded-operator,
-google-explicit-constructor,
-google-runtime-references,
-hicpp-avoid-goto,
-hicpp-explicit-conversions,
-hicpp-no-array-decay,
-hicpp-uppercase-literal-suffix,
-llvm-header-guard,
-llvm-include-order,
-misc-non-private-member-variables-in-classes,
-modernize-use-trailing-return-type,
-readability-magic-numbers,
-readability-uppercase-literal-suffix'
CheckOptions:
- key: hicpp-special-member-functions.AllowSoleDefaultDtor
value: 1
# JSON for Modern C++ has been originally written by Niels Lohmann.
# Since 2013 over 140 contributors have helped to improve the library.
# This CODEOWNERS file is only to make sure that @nlohmann is requested
# for a code review in case of a pull request.
* @nlohmann
[![Issue Stats](http://issuestats.com/github/nlohmann/json/badge/pr?style=flat)](http://issuestats.com/github/nlohmann/json) [![Issue Stats](http://issuestats.com/github/nlohmann/json/badge/issue?style=flat)](http://issuestats.com/github/nlohmann/json)
# How to contribute
This project started as a little excuse to exercise some of the cool new C++11 features. Over time, people actually started to use the JSON library (yey!) and started to help improve it by proposing features, finding bugs, or even fixing my mistakes. I am really [thankful](https://github.com/nlohmann/json/blob/master/README.md#thanks) for this and try to keep track of all the helpers.
To make it as easy as possible for you to contribute and for me to keep an overview, here are a few guidelines which should help us avoid all kinds of unnecessary work or disappointment. And of course, this document is subject to discussion, so please [create an issue](https://github.com/nlohmann/json/issues/new/choose) or a pull request if you find a way to improve it!
## Private reports
Usually, all issues are tracked publicly on [GitHub](https://github.com/nlohmann/json/issues). If you want to make a private report (e.g., for a vulnerability or to attach an example that is not meant to be published), please send an email to <mail@nlohmann.me>.
## Prerequisites
Please [create an issue](https://github.com/nlohmann/json/issues/new/choose), assuming one does not already exist, and describe your concern. Note you need a [GitHub account](https://github.com/signup/free) for this.
## Describe your issue
Clearly describe the issue:
- If it is a bug, please describe how to **reproduce** it. If possible, attach a complete example which demonstrates the error. Please also state what you **expected** to happen instead of the error.
- If you propose a change or addition, try to give an **example** how the improved code could look like or how to use it.
- If you found a compilation error, please tell us which **compiler** (version and operating system) you used and paste the (relevant part of) the error messages to the ticket.
Please stick to the provided issue templates ([bug report](https://github.com/nlohmann/json/blob/develop/.github/ISSUE_TEMPLATE/Bug_report.md), [feature request](https://github.com/nlohmann/json/blob/develop/.github/ISSUE_TEMPLATE/Feature_request.md), or [question](https://github.com/nlohmann/json/blob/develop/.github/ISSUE_TEMPLATE/question.md)) if possible.
## Files to change
:exclamation: Before you make any changes, note the single-header file [`single_include/nlohmann/json.hpp`](https://github.com/nlohmann/json/blob/develop/single_include/nlohmann/json.hpp) is **generated** from the source files in the [`include/nlohmann` directory](https://github.com/nlohmann/json/tree/develop/include/nlohmann). Please **do not** edit file `single_include/nlohmann/json.hpp` directly, but change the `include/nlohmann` sources and regenerate file `single_include/nlohmann/json.hpp` by executing `make amalgamate`.
To make changes, you need to edit the following files:
1. [`include/nlohmann/*`](https://github.com/nlohmann/json/tree/develop/include/nlohmann) - These files are the sources of the library. Before testing or creating a pull request, execute `make amalgamate` to regenerate `single_include/nlohmann/json.hpp`.
2. [`test/src/unit-*.cpp`](https://github.com/nlohmann/json/tree/develop/test/src) - These files contain the [doctest](https://github.com/onqtam/doctest) unit tests which currently cover [100 %](https://coveralls.io/github/nlohmann/json) of the library's code.
If you add or change a feature, please also add a unit test to this file. The unit tests can be compiled and executed with
```sh
$ mkdir build
$ cd build
$ cmake ..
$ cmake --build .
$ ctest
```
The test cases are also executed with several different compilers on [Travis](https://travis-ci.org/nlohmann/json) once you open a pull request.
## Note
- If you open a pull request, the code will be automatically tested with [Valgrind](http://valgrind.org)'s Memcheck tool to detect memory leaks. Please be aware that the execution with Valgrind _may_ in rare cases yield different behavior than running the code directly. This can result in failing unit tests which run successfully without Valgrind.
- There is a Makefile target `make pretty` which runs [Artistic Style](http://astyle.sourceforge.net) to fix indentation. If possible, run it before opening the pull request. Otherwise, we shall run it afterward.
## Please don't
- The C++11 support varies between different **compilers** and versions. Please note the [list of supported compilers](https://github.com/nlohmann/json/blob/master/README.md#supported-compilers). Some compilers like GCC 4.7 (and earlier), Clang 3.3 (and earlier), or Microsoft Visual Studio 13.0 and earlier are known not to work due to missing or incomplete C++11 support. Please refrain from proposing changes that work around these compiler's limitations with `#ifdef`s or other means.
- Specifically, I am aware of compilation problems with **Microsoft Visual Studio** (there even is an [issue label](https://github.com/nlohmann/json/issues?utf8=✓&q=label%3A%22visual+studio%22+) for these kind of bugs). I understand that even in 2016, complete C++11 support isn't there yet. But please also understand that I do not want to drop features or uglify the code just to make Microsoft's sub-standard compiler happy. The past has shown that there are ways to express the functionality such that the code compiles with the most recent MSVC - unfortunately, this is not the main objective of the project.
- Please refrain from proposing changes that would **break [JSON](https://json.org) conformance**. If you propose a conformant extension of JSON to be supported by the library, please motivate this extension.
- We shall not extend the library to **support comments**. There is quite some [controversy](https://www.reddit.com/r/programming/comments/4v6chu/why_json_doesnt_support_comments_douglas_crockford/) around this topic, and there were quite some [issues](https://github.com/nlohmann/json/issues/376) on this. We believe that JSON is fine without comments.
- We do not preserve the **insertion order of object elements**. The [JSON standard](https://tools.ietf.org/html/rfc7159.html) defines objects as "an unordered collection of zero or more name/value pairs". To this end, this library does not preserve insertion order of name/value pairs. (In fact, keys will be traversed in alphabetical order as `std::map` with `std::less` is used by default.) Note this behavior conforms to the standard, and we shall not change it to any other order. If you do want to preserve the insertion order, you can specialize the object type with containers like [`tsl::ordered_map`](https://github.com/Tessil/ordered-map) or [`nlohmann::fifo_map`](https://github.com/nlohmann/fifo_map).
- Please do not open pull requests that address **multiple issues**.
## Wanted
The following areas really need contribution:
- Extending the **continuous integration** toward more exotic compilers such as Android NDK, Intel's Compiler, or the bleeding-edge versions Clang.
- Improving the efficiency of the **JSON parser**. The current parser is implemented as a naive recursive descent parser with hand coded string handling. More sophisticated approaches like LALR parsers would be really appreciated. That said, parser generators like Bison or ANTLR do not play nice with single-header files -- I really would like to keep the parser inside the `json.hpp` header, and I am not aware of approaches similar to [`re2c`](http://re2c.org) for parsing.
- Extending and updating existing **benchmarks** to include (the most recent version of) this library. Though efficiency is not everything, speed and memory consumption are very important characteristics for C++ developers, so having proper comparisons would be interesting.
github: nlohmann
custom: http://paypal.me/nlohmann
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: 'kind: bug'
assignees: ''
---
<!-- Provide a concise summary of the issue in the title above. -->
#### What is the issue you have?
<!-- Provide a detailed introduction to the issue itself, and why you consider it to be a bug. -->
<!-- If possible, be specific and add stack traces, error messages, etc. Avoid vague terms like "crash" or "doesn't work". -->
#### Please describe the steps to reproduce the issue.
<!-- Provide a link to a live example, or an unambiguous set of steps to -->
<!-- reproduce this bug. Include code to reproduce, if relevant -->
1.
2.
3.
#### Can you provide a small but working code example?
<!-- Please understand that we cannot analyze and debug large code bases. -->
#### What is the expected behavior?
<!-- Tell us what should happen -->
#### And what is the actual behavior instead?
<!-- Tell us what happens instead. -->
#### Which compiler and operating system are you using?
<!-- Include as many relevant details about the environment you experienced the bug in. -->
<!-- Make sure you use a supported compiler, see https://github.com/nlohmann/json#supported-compilers. -->
- Compiler: ___
- Operating system: ___
#### Which version of the library did you use?
<!-- Please add an `x` to the respective line. -->
- [ ] latest release version 3.9.1
- [ ] other release - please state the version: ___
- [ ] the `develop` branch
#### If you experience a compilation error: can you [compile and run the unit tests](https://github.com/nlohmann/json#execute-unit-tests)?
- [ ] yes
- [ ] no - please copy/paste the error message below
blank_issues_enabled: false
contact_links:
- name: Ask a question
url: https://github.com/nlohmann/json/discussions
about: Ask questions and discuss with other community members
[Describe your pull request here. Please read the text below the line, and make sure you follow the checklist.]
* * *
## Pull request checklist
Read the [Contribution Guidelines](https://github.com/nlohmann/json/blob/develop/.github/CONTRIBUTING.md) for detailed information.
- [ ] Changes are described in the pull request, or an [existing issue is referenced](https://github.com/nlohmann/json/issues).
- [ ] The test suite [compiles and runs](https://github.com/nlohmann/json/blob/develop/README.md#execute-unit-tests) without error.
- [ ] [Code coverage](https://coveralls.io/github/nlohmann/json) is 100%. Test cases can be added by editing the [test suite](https://github.com/nlohmann/json/tree/develop/test/src).
- [ ] The source code is amalgamated; that is, after making changes to the sources in the `include/nlohmann` directory, run `make amalgamate` to create the single-header file `single_include/nlohmann/json.hpp`. The whole process is described [here](https://github.com/nlohmann/json/blob/develop/.github/CONTRIBUTING.md#files-to-change).
## Please don't
- The C++11 support varies between different **compilers** and versions. Please note the [list of supported compilers](https://github.com/nlohmann/json/blob/master/README.md#supported-compilers). Some compilers like GCC 4.7 (and earlier), Clang 3.3 (and earlier), or Microsoft Visual Studio 13.0 and earlier are known not to work due to missing or incomplete C++11 support. Please refrain from proposing changes that work around these compiler's limitations with `#ifdef`s or other means.
- Specifically, I am aware of compilation problems with **Microsoft Visual Studio** (there even is an [issue label](https://github.com/nlohmann/json/issues?utf8=✓&q=label%3A%22visual+studio%22+) for these kind of bugs). I understand that even in 2016, complete C++11 support isn't there yet. But please also understand that I do not want to drop features or uglify the code just to make Microsoft's sub-standard compiler happy. The past has shown that there are ways to express the functionality such that the code compiles with the most recent MSVC - unfortunately, this is not the main objective of the project.
- Please refrain from proposing changes that would **break [JSON](https://json.org) conformance**. If you propose a conformant extension of JSON to be supported by the library, please motivate this extension.
- Please do not open pull requests that address **multiple issues**.
# Security Policy
## Reporting a Vulnerability
Usually, all issues are tracked publicly on [GitHub](https://github.com/nlohmann/json/issues). If you want to make a private report (e.g., for a vulnerability or to attach an example that is not meant to be published), please send an email to <mail@nlohmann.me>. You can use [this key](https://keybase.io/nlohmann/pgp_keys.asc?fingerprint=797167ae41c0a6d9232e48457f3cea63ae251b69) for encryption.
# Configuration for sentiment-bot - https://github.com/behaviorbot/sentiment-bot
# *Required* toxicity threshold between 0 and .99 with the higher numbers being the most toxic
# Anything higher than this threshold will be marked as toxic and commented on
sentimentBotToxicityThreshold: .7
# *Required* Comment to reply with
sentimentBotReplyComment: >
Please be sure to review the [code of conduct](https://github.com/nlohmann/json/blob/develop/CODE_OF_CONDUCT.md) and be respectful of other users. cc/ @nlohmann
# Configuration for request-info - https://github.com/behaviorbot/request-info
# *Required* Comment to reply with
requestInfoReplyComment: >
We would appreciate it if you could provide us with more info about this issue or pull request! Please check the [issue template](https://github.com/nlohmann/json/blob/develop/.github/ISSUE_TEMPLATE.md) and the [pull request template](https://github.com/nlohmann/json/blob/develop/.github/PULL_REQUEST_TEMPLATE.md).
# *OPTIONAL* Label to be added to Issues and Pull Requests with insufficient information given
requestInfoLabelToAdd: "state: needs more info"
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 30
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
# Issues with these labels will never be considered stale
exemptLabels:
- pinned
- security
# Label to use when marking an issue as stale
staleLabel: "state: stale"
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false
name: "Code scanning - action"
on:
push:
branches: [develop, ]
pull_request:
# The branches below must be a subset of the branches above
branches: [develop]
schedule:
- cron: '0 19 * * 1'
jobs:
CodeQL-Build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
# Override language selection by uncommenting this and choosing your languages
# with:
# languages: go, javascript, csharp, python, cpp, java
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
#- run: |
# make bootstrap
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
name: macOS
on: [push, pull_request]
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v1
- name: cmake
run: cmake -S . -B build -D CMAKE_BUILD_TYPE=Debug -DJSON_BuildTests=On
- name: build
run: cmake --build build --parallel 10
- name: test
run: cd build ; ctest -j 10 --output-on-failure
name: Ubuntu
on: [push, pull_request]
jobs:
gcc_build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: install_gcc
run: |
sudo apt update
sudo apt install gcc-10 g++-10
shell: bash
- name: cmake
run: cmake -S . -B build -D CMAKE_BUILD_TYPE=Debug -DJSON_BuildTests=On
env:
CC: gcc-10
CXX: g++-10
- name: build
run: cmake --build build --parallel 10
- name: test
run: cd build ; ctest -j 10 --output-on-failure
clang_build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: install_gcc
run: |
sudo apt update
sudo apt install clang-10
shell: bash
- name: cmake
run: cmake -S . -B build -D CMAKE_BUILD_TYPE=Debug -DJSON_BuildTests=On
env:
CC: clang-10
CXX: clang++-10
- name: build
run: cmake --build build --parallel 10
- name: test
run: cd build ; ctest -j 10 --output-on-failure
clang_build_cxx20:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: install_gcc
run: |
sudo apt update
sudo apt install clang-10
shell: bash
- name: cmake
run: cmake -S . -B build -D CMAKE_BUILD_TYPE=Debug -DJSON_BuildTests=On -DCMAKE_CXX_STANDARD=20 -DCMAKE_CXX_STANDARD_REQUIRED=ON
env:
CC: clang-10
CXX: clang++-10
- name: build
run: cmake --build build --parallel 10
- name: test
run: cd build ; ctest -j 10 --output-on-failure
name: Windows
on: [push, pull_request]
jobs:
msvc2019:
runs-on: windows-latest
steps:
- uses: actions/checkout@v1
- name: cmake
run: cmake -S . -B build -G "Visual Studio 16 2019" -D CMAKE_BUILD_TYPE=Debug -DJSON_BuildTests=On
- name: build
run: cmake --build build --parallel 10
- name: test
run: cd build ; ctest -j 10 -C Debug --exclude-regex "test-unicode" --output-on-failure
clang10:
runs-on: windows-latest
steps:
- uses: actions/checkout@v1
- name: install Clang
run: curl -fsSL -o LLVM10.exe https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/LLVM-10.0.0-win64.exe ; 7z x LLVM10.exe -y -o"C:/Program Files/LLVM"
- name: cmake
run: cmake -S . -B build -DCMAKE_CXX_COMPILER="C:/Program Files/LLVM/bin/clang++.exe" -G"MinGW Makefiles" -DCMAKE_BUILD_TYPE=Debug -DJSON_BuildTests=On
- name: build
run: cmake --build build --parallel 10
- name: test
run: cd build ; ctest -j 10 -C Debug --exclude-regex "test-unicode" --output-on-failure
clang-cl-10-x64:
runs-on: windows-latest
steps:
- uses: actions/checkout@v1
- name: cmake
run: cmake -S . -B build -G "Visual Studio 16 2019" -A x64 -T ClangCL -DJSON_BuildTests=On
- name: build
run: cmake --build build --config Debug --parallel 10
- name: test
run: cd build ; ctest -j 10 -C Debug --exclude-regex "test-unicode" --output-on-failure
clang-cl-10-x86:
runs-on: windows-latest
steps:
- uses: actions/checkout@v1
- name: cmake
run: cmake -S . -B build -G "Visual Studio 16 2019" -A Win32 -T ClangCL -DJSON_BuildTests=On
- name: build
run: cmake --build build --config Debug --parallel 10
- name: test
run: cd build ; ctest -j 10 -C Debug --exclude-regex "test-unicode" --output-on-failure
json_unit
json_benchmarks
json_benchmarks_simple
fuzz-testing
*.dSYM
*.o
*.gcno
*.gcda
build
build_coverage
clang_analyze_build
doc/xml
doc/html
me.nlohmann.json.docset
benchmarks/files/numbers/*.json
.wsjcpp-logs/*
.wsjcpp/*
.idea
/cmake-build-*
test/test-*
/.vs
doc/mkdocs/venv/
doc/mkdocs/docs/images
doc/mkdocs/docs/examples
doc/mkdocs/site
doc/mkdocs/docs/__pycache__/
doc/xml
/doc/docset/nlohmann_json.docset/
#########################
# project configuration #
#########################
# C++ project
language: cpp
dist: trusty
sudo: required
group: edge
################
# build matrix #
################
matrix:
include:
# Valgrind
- os: linux
compiler: gcc
env:
- COMPILER=g++-4.9
- CMAKE_OPTIONS=-DJSON_Valgrind=ON
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-4.9', 'valgrind', 'ninja-build']
# clang sanitizer
- os: linux
compiler: clang
env:
- COMPILER=clang++-7
- CMAKE_OPTIONS=-DJSON_Sanitizer=ON
- UBSAN_OPTIONS=print_stacktrace=1,suppressions=$(pwd)/test/src/UBSAN.supp
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-7']
packages: ['g++-6', 'clang-7', 'ninja-build']
before_script:
- export PATH=$PATH:/usr/lib/llvm-7/bin
# cppcheck
- os: linux
compiler: gcc
env:
- COMPILER=g++-4.9
- SPECIAL=cppcheck
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-4.9', 'cppcheck', 'ninja-build']
after_success:
- make cppcheck
# no exceptions
- os: linux
compiler: gcc
env:
- COMPILER=g++-4.9
- CMAKE_OPTIONS=-DJSON_NoExceptions=ON
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-4.9', 'ninja-build']
# check amalgamation
- os: linux
compiler: gcc
env:
- COMPILER=g++-4.9
- SPECIAL=amalgamation
- MULTIPLE_HEADERS=ON
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-4.9', 'astyle', 'ninja-build']
after_success:
- make check-amalgamation
# Coveralls (http://gronlier.fr/blog/2015/01/adding-code-coverage-to-your-c-project/)
- os: linux
compiler: gcc
dist: bionic
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-7', 'ninja-build']
before_script:
- pip install --user cpp-coveralls
after_success:
- coveralls --build-root test --include include/nlohmann --gcov 'gcov-7' --gcov-options '\-lp'
env:
- COMPILER=g++-7
- CMAKE_OPTIONS=-DJSON_Coverage=ON
- MULTIPLE_HEADERS=ON
# Coverity (only for branch coverity_scan)
- os: linux
compiler: clang
before_install: echo -n | openssl s_client -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-certificates.crt
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.6']
packages: ['g++-6', 'clang-3.6', 'ninja-build']
coverity_scan:
project:
name: "nlohmann/json"
description: "Build submitted via Travis CI"
notification_email: niels.lohmann@gmail.com
build_command_prepend: "mkdir coverity_build ; cd coverity_build ; cmake .. ; cd .."
build_command: "make -C coverity_build"
branch_pattern: coverity_scan
env:
- SPECIAL=coverity
- COMPILER=clang++-3.6
# The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
# via the "travis encrypt" command using the project repo's public key
- secure: "m89SSgE+ASLO38rSKx7MTXK3n5NkP9bIx95jwY71YEiuFzib30PDJ/DifKnXxBjvy/AkCGztErQRk/8ZCvq+4HXozU2knEGnL/RUitvlwbhzfh2D4lmS3BvWBGS3N3NewoPBrRmdcvnT0xjOGXxtZaJ3P74TkB9GBnlz/HmKORA="
# OSX / Clang
- os: osx
osx_image: xcode10.2
- os: osx
osx_image: xcode11.2
- os: osx
osx_image: xcode12
- os: osx
osx_image: xcode12
env:
- IMPLICIT_CONVERSIONS=OFF
# Linux / GCC
- os: linux
compiler: gcc
env: COMPILER=g++-4.8
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-4.8', 'ninja-build']
- os: linux
compiler: gcc
env: COMPILER=g++-4.9
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-4.9', 'ninja-build']
- os: linux
compiler: gcc
env: COMPILER=g++-5
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-5', 'ninja-build']
- os: linux
compiler: gcc
env: COMPILER=g++-6
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-6', 'ninja-build']
- os: linux
compiler: gcc
env: COMPILER=g++-7
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-7', 'ninja-build']
- os: linux
compiler: gcc
env: COMPILER=g++-8
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-8', 'ninja-build']
- os: linux
compiler: gcc
env: COMPILER=g++-9
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-9', 'ninja-build']
- os: linux
compiler: gcc
env:
- COMPILER=g++-9
- IMPLICIT_CONVERSIONS=OFF
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-9', 'ninja-build']
- os: linux
compiler: gcc
env:
- COMPILER=g++-9
- CXX_STANDARD=17
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-9', 'ninja-build']
# Linux / Clang
- os: linux
compiler: clang
env: COMPILER=clang++-3.5
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.5']
packages: ['g++-6', 'clang-3.5', 'ninja-build']
- os: linux
compiler: clang
env: COMPILER=clang++-3.6
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.6']
packages: ['g++-6', 'clang-3.6', 'ninja-build']
- os: linux
compiler: clang
env: COMPILER=clang++-3.7
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.7']
packages: ['g++-6', 'clang-3.7', 'ninja-build']
- os: linux
compiler: clang
env: COMPILER=clang++-3.8
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-6', 'clang-3.8', 'ninja-build']
- os: linux
compiler: clang
env: COMPILER=clang++-3.9
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-6', 'clang-3.9', 'ninja-build']
- os: linux
compiler: clang
env: COMPILER=clang++-4.0
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-4.0']
packages: ['g++-6', 'clang-4.0', 'ninja-build']
- os: linux
compiler: clang
env: COMPILER=clang++-5.0
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-5.0']
packages: ['g++-6', 'clang-5.0', 'ninja-build']
- os: linux
compiler: clang
env: COMPILER=clang++-6.0
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-6.0']
packages: ['g++-6', 'clang-6.0', 'ninja-build']
- os: linux
compiler: clang
env: COMPILER=clang++-7
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-7']
packages: ['g++-6', 'clang-7', 'ninja-build']
- os: linux
compiler: clang
env:
- COMPILER=clang++-7
- CXX_STANDARD=17
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-trusty-7']
packages: ['g++-7', 'clang-7', 'ninja-build']
################
# build script #
################
script:
# get CMake and Ninja (only for systems with brew - macOS)
- |
if [[ (-x $(which brew)) ]]; then
brew update
brew install cmake ninja
brew upgrade cmake
cmake --version
fi
# make sure CXX is correctly set
- if [[ "${COMPILER}" != "" ]]; then export CXX=${COMPILER}; fi
# by default, use the single-header version
- if [[ "${MULTIPLE_HEADERS}" == "" ]]; then export MULTIPLE_HEADERS=OFF; fi
# by default, use implicit conversions
- if [[ "${IMPLICIT_CONVERSIONS}" == "" ]]; then export IMPLICIT_CONVERSIONS=ON; fi
# append CXX_STANDARD to CMAKE_OPTIONS if required
- CMAKE_OPTIONS+=${CXX_STANDARD:+ -DCMAKE_CXX_STANDARD=$CXX_STANDARD -DCMAKE_CXX_STANDARD_REQUIRED=ON}
# compile and execute unit tests
- mkdir -p build && cd build
- cmake .. ${CMAKE_OPTIONS} -DJSON_MultipleHeaders=${MULTIPLE_HEADERS} -DJSON_ImplicitConversions=${IMPLICIT_CONVERSIONS} -DJSON_BuildTests=On -GNinja && cmake --build . --config Release
- ctest -C Release --timeout 2700 -V -j
- cd ..
# check if homebrew works (only checks develop branch)
- if [ `which brew` ]; then
brew update ;
brew tap nlohmann/json ;
brew install nlohmann_json --HEAD ;
brew test nlohmann_json ;
fi
cmake_minimum_required(VERSION 3.1)
##
## PROJECT
## name and version
##
project(nlohmann_json VERSION 3.9.1 LANGUAGES CXX)
##
## MAIN_PROJECT CHECK
## determine if nlohmann_json is built as a subproject (using add_subdirectory) or if it is the main project
##
set(MAIN_PROJECT OFF)
if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
set(MAIN_PROJECT ON)
endif()
##
## INCLUDE
##
##
include(ExternalProject)
##
## OPTIONS
##
if (POLICY CMP0077)
# Allow CMake 3.13+ to override options when using FetchContent / add_subdirectory.
cmake_policy(SET CMP0077 NEW)
endif ()
option(JSON_BuildTests "Build the unit tests when BUILD_TESTING is enabled." ${MAIN_PROJECT})
option(JSON_Install "Install CMake targets during install step." ${MAIN_PROJECT})
option(JSON_MultipleHeaders "Use non-amalgamated version of the library." OFF)
option(JSON_ImplicitConversions "Enable implicit conversions." ON)
##
## CONFIGURATION
##
include(GNUInstallDirs)
set(NLOHMANN_JSON_TARGET_NAME ${PROJECT_NAME})
set(NLOHMANN_JSON_CONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" CACHE INTERNAL "")
set(NLOHMANN_JSON_INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}")
set(NLOHMANN_JSON_TARGETS_EXPORT_NAME "${PROJECT_NAME}Targets")
set(NLOHMANN_JSON_CMAKE_CONFIG_TEMPLATE "cmake/config.cmake.in")
set(NLOHMANN_JSON_CMAKE_CONFIG_DIR "${CMAKE_CURRENT_BINARY_DIR}")
set(NLOHMANN_JSON_CMAKE_VERSION_CONFIG_FILE "${NLOHMANN_JSON_CMAKE_CONFIG_DIR}/${PROJECT_NAME}ConfigVersion.cmake")
set(NLOHMANN_JSON_CMAKE_PROJECT_CONFIG_FILE "${NLOHMANN_JSON_CMAKE_CONFIG_DIR}/${PROJECT_NAME}Config.cmake")
set(NLOHMANN_JSON_CMAKE_PROJECT_TARGETS_FILE "${NLOHMANN_JSON_CMAKE_CONFIG_DIR}/${PROJECT_NAME}Targets.cmake")
set(NLOHMANN_JSON_PKGCONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
if (JSON_MultipleHeaders)
set(NLOHMANN_JSON_INCLUDE_BUILD_DIR "${PROJECT_SOURCE_DIR}/include/")
message(STATUS "Using the multi-header code from ${NLOHMANN_JSON_INCLUDE_BUILD_DIR}")
else()
set(NLOHMANN_JSON_INCLUDE_BUILD_DIR "${PROJECT_SOURCE_DIR}/single_include/")
message(STATUS "Using the single-header code from ${NLOHMANN_JSON_INCLUDE_BUILD_DIR}")
endif()
if (NOT JSON_ImplicitConversions)
message(STATUS "Implicit conversions are disabled")
endif()
##
## TARGET
## create target and add include path
##
add_library(${NLOHMANN_JSON_TARGET_NAME} INTERFACE)
add_library(${PROJECT_NAME}::${NLOHMANN_JSON_TARGET_NAME} ALIAS ${NLOHMANN_JSON_TARGET_NAME})
if (${CMAKE_VERSION} VERSION_LESS "3.8.0")
target_compile_features(${NLOHMANN_JSON_TARGET_NAME} INTERFACE cxx_range_for)
else()
target_compile_features(${NLOHMANN_JSON_TARGET_NAME} INTERFACE cxx_std_11)
endif()
target_compile_definitions(
${NLOHMANN_JSON_TARGET_NAME}
INTERFACE
JSON_USE_IMPLICIT_CONVERSIONS=$<BOOL:${JSON_ImplicitConversions}>
)
target_include_directories(
${NLOHMANN_JSON_TARGET_NAME}
INTERFACE
$<BUILD_INTERFACE:${NLOHMANN_JSON_INCLUDE_BUILD_DIR}>
$<INSTALL_INTERFACE:include>
)
## add debug view definition file for msvc (natvis)
if (MSVC)
set(NLOHMANN_ADD_NATVIS TRUE)
set(NLOHMANN_NATVIS_FILE "nlohmann_json.natvis")
target_sources(
${NLOHMANN_JSON_TARGET_NAME}
INTERFACE
$<INSTALL_INTERFACE:${NLOHMANN_NATVIS_FILE}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/${NLOHMANN_NATVIS_FILE}>
)
endif()
# Install a pkg-config file, so other tools can find this.
CONFIGURE_FILE(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/pkg-config.pc.in"
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc"
)
##
## TESTS
## create and configure the unit test target
##
if (JSON_BuildTests)
include(CTest)
enable_testing()
add_subdirectory(test)
endif()
##
## INSTALL
## install header files, generate and install cmake config files for find_package()
##
include(CMakePackageConfigHelpers)
# use a custom package version config file instead of
# write_basic_package_version_file to ensure that it's architecture-independent
# https://github.com/nlohmann/json/issues/1697
configure_file(
"cmake/nlohmann_jsonConfigVersion.cmake.in"
${NLOHMANN_JSON_CMAKE_VERSION_CONFIG_FILE}
@ONLY
)
configure_file(
${NLOHMANN_JSON_CMAKE_CONFIG_TEMPLATE}
${NLOHMANN_JSON_CMAKE_PROJECT_CONFIG_FILE}
@ONLY
)
if(JSON_Install)
install(
DIRECTORY ${NLOHMANN_JSON_INCLUDE_BUILD_DIR}
DESTINATION ${NLOHMANN_JSON_INCLUDE_INSTALL_DIR}
)
install(
FILES ${NLOHMANN_JSON_CMAKE_PROJECT_CONFIG_FILE} ${NLOHMANN_JSON_CMAKE_VERSION_CONFIG_FILE}
DESTINATION ${NLOHMANN_JSON_CONFIG_INSTALL_DIR}
)
if (NLOHMANN_ADD_NATVIS)
install(
FILES ${NLOHMANN_NATVIS_FILE}
DESTINATION .
)
endif()
export(
TARGETS ${NLOHMANN_JSON_TARGET_NAME}
NAMESPACE ${PROJECT_NAME}::
FILE ${NLOHMANN_JSON_CMAKE_PROJECT_TARGETS_FILE}
)
install(
TARGETS ${NLOHMANN_JSON_TARGET_NAME}
EXPORT ${NLOHMANN_JSON_TARGETS_EXPORT_NAME}
INCLUDES DESTINATION ${NLOHMANN_JSON_INCLUDE_INSTALL_DIR}
)
install(
EXPORT ${NLOHMANN_JSON_TARGETS_EXPORT_NAME}
NAMESPACE ${PROJECT_NAME}::
DESTINATION ${NLOHMANN_JSON_CONFIG_INSTALL_DIR}
)
install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc"
DESTINATION ${NLOHMANN_JSON_PKGCONFIG_INSTALL_DIR}
)
endif()
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at mail@nlohmann.me. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
This diff is collapsed.
MIT License
Copyright (c) 2013-2021 Niels Lohmann
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
This diff is collapsed.
This diff is collapsed.
version: '{build}'
environment:
matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
configuration: Debug
platform: x86
CXX_FLAGS: ""
LINKER_FLAGS: ""
CMAKE_OPTIONS: ""
GENERATOR: Visual Studio 14 2015
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
configuration: Debug
platform: x86
CXX_FLAGS: ""
LINKER_FLAGS: ""
CMAKE_OPTIONS: ""
GENERATOR: Visual Studio 15 2017
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
configuration: Debug
platform: x86
CXX_FLAGS: ""
LINKER_FLAGS: ""
CMAKE_OPTIONS: ""
GENERATOR: Visual Studio 16 2019
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
configuration: Debug
platform: x64
CXX_FLAGS: ""
LINKER_FLAGS: ""
CMAKE_OPTIONS: ""
GENERATOR: Visual Studio 16 2019
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
configuration: Debug
COMPILER: mingw
platform: x86
CXX_FLAGS: ""
LINKER_FLAGS: ""
CMAKE_OPTIONS: ""
GENERATOR: Ninja
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
configuration: Release
COMPILER: mingw
platform: x86
CXX_FLAGS: ""
LINKER_FLAGS: ""
CMAKE_OPTIONS: ""
GENERATOR: Ninja
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
configuration: Release
platform: x86
CXX_FLAGS: ""
LINKER_FLAGS: ""
CMAKE_OPTIONS: ""
GENERATOR: Visual Studio 14 2015
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
configuration: Release
platform: x86
name: with_win_header
CXX_FLAGS: ""
LINKER_FLAGS: ""
CMAKE_OPTIONS: ""
GENERATOR: Visual Studio 14 2015
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
configuration: Release
platform: x86
CXX_FLAGS: "/permissive- /std:c++latest /utf-8"
LINKER_FLAGS: ""
CMAKE_OPTIONS: ""
GENERATOR: Visual Studio 15 2017
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
configuration: Release
platform: x86
CXX_FLAGS: ""
LINKER_FLAGS: ""
CMAKE_OPTIONS: "-DJSON_ImplicitConversions=OFF"
GENERATOR: Visual Studio 16 2019
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
configuration: Release
platform: x64
CXX_FLAGS: ""
LINKER_FLAGS: ""
CMAKE_OPTIONS: ""
GENERATOR: Visual Studio 16 2019
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
configuration: Release
platform: x64
CXX_FLAGS: ""
LINKER_FLAGS: ""
CMAKE_OPTIONS: ""
GENERATOR: Visual Studio 14 2015
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
configuration: Release
platform: x64
CXX_FLAGS: "/permissive- /std:c++latest /Zc:__cplusplus /utf-8 /F4000000"
LINKER_FLAGS: "/STACK:4000000"
CMAKE_OPTIONS: ""
GENERATOR: Visual Studio 15 2017
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
configuration: Release
platform: x64
CXX_FLAGS: ""
LINKER_FLAGS: ""
CMAKE_OPTIONS: ""
GENERATOR: Visual Studio 16 2019
init:
- cmake --version
- msbuild /version
install:
- if "%COMPILER%"=="mingw" appveyor DownloadFile https://github.com/ninja-build/ninja/releases/download/v1.6.0/ninja-win.zip -FileName ninja.zip
- if "%COMPILER%"=="mingw" 7z x ninja.zip -oC:\projects\deps\ninja > nul
- if "%COMPILER%"=="mingw" set PATH=C:\projects\deps\ninja;%PATH%
- if "%COMPILER%"=="mingw" set PATH=C:\mingw-w64\x86_64-7.3.0-posix-seh-rt_v5-rev0\mingw64\bin;%PATH%
- if "%COMPILER%"=="mingw" g++ --version
- if "%platform%"=="x86" set GENERATOR_PLATFORM=Win32
before_build:
# for with_win_header build, inject the inclusion of Windows.h to the single-header library
- ps: if ($env:name -Eq "with_win_header") { $header_path = "single_include\nlohmann\json.hpp" }
- ps: if ($env:name -Eq "with_win_header") { "#include <Windows.h>`n" + (Get-Content $header_path | Out-String) | Set-Content $header_path }
- if "%GENERATOR%"=="Ninja" (cmake . -G "%GENERATOR%" -DCMAKE_BUILD_TYPE="%configuration%" -DCMAKE_CXX_FLAGS="%CXX_FLAGS%" -DCMAKE_EXE_LINKER_FLAGS="%LINKER_FLAGS%" -DCMAKE_IGNORE_PATH="C:/Program Files/Git/usr/bin" -DJSON_BuildTests=On "%CMAKE_OPTIONS%") else (cmake . -G "%GENERATOR%" -A "%GENERATOR_PLATFORM%" -DCMAKE_CXX_FLAGS="%CXX_FLAGS%" -DCMAKE_EXE_LINKER_FLAGS="%LINKER_FLAGS%" -DCMAKE_IGNORE_PATH="C:/Program Files/Git/usr/bin" -DJSON_BuildTests=On "%CMAKE_OPTIONS%")
build_script:
- cmake --build . --config "%configuration%"
test_script:
- if "%configuration%"=="Release" ctest -C "%configuration%" -V -j
# On Debug builds, skip test-unicode_all
# as it is extremely slow to run and cause
# occasional timeouts on AppVeyor.
# More info: https://github.com/nlohmann/json/pull/1570
- if "%configuration%"=="Debug" ctest --exclude-regex "test-unicode" -C "%configuration%" -V -j
cmake_minimum_required(VERSION 3.8)
project(JSON_Benchmarks LANGUAGES CXX)
# set compiler flags
if((CMAKE_CXX_COMPILER_ID MATCHES GNU) OR (CMAKE_CXX_COMPILER_ID MATCHES Clang))
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flto -DNDEBUG -O3")
endif()
# configure Google Benchmarks
set(BENCHMARK_ENABLE_TESTING OFF CACHE INTERNAL "" FORCE)
add_subdirectory(thirdparty/benchmark)
# header directories
include_directories(thirdparty)
include_directories(${CMAKE_SOURCE_DIR}/../single_include)
# download test data
include(${CMAKE_SOURCE_DIR}/../cmake/download_test_data.cmake)
# benchmark binary
add_executable(json_benchmarks src/benchmarks.cpp)
target_compile_features(json_benchmarks PRIVATE cxx_std_11)
target_link_libraries(json_benchmarks benchmark ${CMAKE_THREAD_LIBS_INIT})
add_dependencies(json_benchmarks download_test_data)
target_include_directories(json_benchmarks PRIVATE ${CMAKE_BINARY_DIR}/include)
#include "benchmark/benchmark.h"
#include <nlohmann/json.hpp>
#include <fstream>
#include <test_data.hpp>
using json = nlohmann::json;
//////////////////////////////////////////////////////////////////////////////
// parse JSON from file
//////////////////////////////////////////////////////////////////////////////
static void ParseFile(benchmark::State& state, const char* filename)
{
while (state.KeepRunning())
{
state.PauseTiming();
auto* f = new std::ifstream(filename);
auto* j = new json();
state.ResumeTiming();
*j = json::parse(*f);
state.PauseTiming();
delete f;
delete j;
state.ResumeTiming();
}
std::ifstream file(filename, std::ios::binary | std::ios::ate);
state.SetBytesProcessed(state.iterations() * file.tellg());
}
BENCHMARK_CAPTURE(ParseFile, jeopardy, TEST_DATA_DIRECTORY "/jeopardy/jeopardy.json");
BENCHMARK_CAPTURE(ParseFile, canada, TEST_DATA_DIRECTORY "/nativejson-benchmark/canada.json");
BENCHMARK_CAPTURE(ParseFile, citm_catalog, TEST_DATA_DIRECTORY "/nativejson-benchmark/citm_catalog.json");
BENCHMARK_CAPTURE(ParseFile, twitter, TEST_DATA_DIRECTORY "/nativejson-benchmark/twitter.json");
BENCHMARK_CAPTURE(ParseFile, floats, TEST_DATA_DIRECTORY "/regression/floats.json");
BENCHMARK_CAPTURE(ParseFile, signed_ints, TEST_DATA_DIRECTORY "/regression/signed_ints.json");
BENCHMARK_CAPTURE(ParseFile, unsigned_ints, TEST_DATA_DIRECTORY "/regression/unsigned_ints.json");
BENCHMARK_CAPTURE(ParseFile, small_signed_ints, TEST_DATA_DIRECTORY "/regression/small_signed_ints.json");
//////////////////////////////////////////////////////////////////////////////
// parse JSON from string
//////////////////////////////////////////////////////////////////////////////
static void ParseString(benchmark::State& state, const char* filename)
{
std::ifstream f(filename);
std::string str((std::istreambuf_iterator<char>(f)), std::istreambuf_iterator<char>());
while (state.KeepRunning())
{
state.PauseTiming();
auto* j = new json();
state.ResumeTiming();
*j = json::parse(str);
state.PauseTiming();
delete j;
state.ResumeTiming();
}
state.SetBytesProcessed(state.iterations() * str.size());
}
BENCHMARK_CAPTURE(ParseString, jeopardy, TEST_DATA_DIRECTORY "/jeopardy/jeopardy.json");
BENCHMARK_CAPTURE(ParseString, canada, TEST_DATA_DIRECTORY "/nativejson-benchmark/canada.json");
BENCHMARK_CAPTURE(ParseString, citm_catalog, TEST_DATA_DIRECTORY "/nativejson-benchmark/citm_catalog.json");
BENCHMARK_CAPTURE(ParseString, twitter, TEST_DATA_DIRECTORY "/nativejson-benchmark/twitter.json");
BENCHMARK_CAPTURE(ParseString, floats, TEST_DATA_DIRECTORY "/regression/floats.json");
BENCHMARK_CAPTURE(ParseString, signed_ints, TEST_DATA_DIRECTORY "/regression/signed_ints.json");
BENCHMARK_CAPTURE(ParseString, unsigned_ints, TEST_DATA_DIRECTORY "/regression/unsigned_ints.json");
BENCHMARK_CAPTURE(ParseString, small_signed_ints, TEST_DATA_DIRECTORY "/regression/small_signed_ints.json");
//////////////////////////////////////////////////////////////////////////////
// serialize JSON
//////////////////////////////////////////////////////////////////////////////
static void Dump(benchmark::State& state, const char* filename, int indent)
{
std::ifstream f(filename);
std::string str((std::istreambuf_iterator<char>(f)), std::istreambuf_iterator<char>());
json j = json::parse(str);
while (state.KeepRunning())
{
j.dump(indent);
}
state.SetBytesProcessed(state.iterations() * j.dump(indent).size());
}
BENCHMARK_CAPTURE(Dump, jeopardy / -, TEST_DATA_DIRECTORY "/jeopardy/jeopardy.json", -1);
BENCHMARK_CAPTURE(Dump, jeopardy / 4, TEST_DATA_DIRECTORY "/jeopardy/jeopardy.json", 4);
BENCHMARK_CAPTURE(Dump, canada / -, TEST_DATA_DIRECTORY "/nativejson-benchmark/canada.json", -1);
BENCHMARK_CAPTURE(Dump, canada / 4, TEST_DATA_DIRECTORY "/nativejson-benchmark/canada.json", 4);
BENCHMARK_CAPTURE(Dump, citm_catalog / -, TEST_DATA_DIRECTORY "/nativejson-benchmark/citm_catalog.json", -1);
BENCHMARK_CAPTURE(Dump, citm_catalog / 4, TEST_DATA_DIRECTORY "/nativejson-benchmark/citm_catalog.json", 4);
BENCHMARK_CAPTURE(Dump, twitter / -, TEST_DATA_DIRECTORY "/nativejson-benchmark/twitter.json", -1);
BENCHMARK_CAPTURE(Dump, twitter / 4, TEST_DATA_DIRECTORY "/nativejson-benchmark/twitter.json", 4);
BENCHMARK_CAPTURE(Dump, floats / -, TEST_DATA_DIRECTORY "/regression/floats.json", -1);
BENCHMARK_CAPTURE(Dump, floats / 4, TEST_DATA_DIRECTORY "/regression/floats.json", 4);
BENCHMARK_CAPTURE(Dump, signed_ints / -, TEST_DATA_DIRECTORY "/regression/signed_ints.json", -1);
BENCHMARK_CAPTURE(Dump, signed_ints / 4, TEST_DATA_DIRECTORY "/regression/signed_ints.json", 4);
BENCHMARK_CAPTURE(Dump, unsigned_ints / -, TEST_DATA_DIRECTORY "/regression/unsigned_ints.json", -1);
BENCHMARK_CAPTURE(Dump, unsigned_ints / 4, TEST_DATA_DIRECTORY "/regression/unsigned_ints.json", 4);
BENCHMARK_CAPTURE(Dump, small_signed_ints / -, TEST_DATA_DIRECTORY "/regression/small_signed_ints.json", -1);
BENCHMARK_CAPTURE(Dump, small_signed_ints / 4, TEST_DATA_DIRECTORY "/regression/small_signed_ints.json", 4);
BENCHMARK_MAIN();
# This is the official list of benchmark authors for copyright purposes.
# This file is distinct from the CONTRIBUTORS files.
# See the latter for an explanation.
#
# Names should be added to this file as:
# Name or Organization <email address>
# The email address is not required for organizations.
#
# Please keep the list sorted.
Albert Pretorius <pretoalb@gmail.com>
Arne Beer <arne@twobeer.de>
Carto
Christopher Seymour <chris.j.seymour@hotmail.com>
David Coeurjolly <david.coeurjolly@liris.cnrs.fr>
Deniz Evrenci <denizevrenci@gmail.com>
Dirac Research
Dominik Czarnota <dominik.b.czarnota@gmail.com>
Eric Fiselier <eric@efcs.ca>
Eugene Zhuk <eugene.zhuk@gmail.com>
Evgeny Safronov <division494@gmail.com>
Felix Homann <linuxaudio@showlabor.de>
Google Inc.
International Business Machines Corporation
Ismael Jimenez Martinez <ismael.jimenez.martinez@gmail.com>
Jern-Kuan Leong <jernkuan@gmail.com>
JianXiong Zhou <zhoujianxiong2@gmail.com>
Joao Paulo Magalhaes <joaoppmagalhaes@gmail.com>
Jussi Knuuttila <jussi.knuuttila@gmail.com>
Kaito Udagawa <umireon@gmail.com>
Kishan Kumar <kumar.kishan@outlook.com>
Lei Xu <eddyxu@gmail.com>
Matt Clarkson <mattyclarkson@gmail.com>
Maxim Vafin <maxvafin@gmail.com>
MongoDB Inc.
Nick Hutchinson <nshutchinson@gmail.com>
Oleksandr Sochka <sasha.sochka@gmail.com>
Paul Redmond <paul.redmond@gmail.com>
Radoslav Yovchev <radoslav.tm@gmail.com>
Roman Lebedev <lebedev.ri@gmail.com>
Shuo Chen <chenshuo@chenshuo.com>
Steinar H. Gunderson <sgunderson@bigfoot.com>
Stripe, Inc.
Yixuan Qiu <yixuanq@gmail.com>
Yusuke Suzuki <utatane.tea@gmail.com>
Zbigniew Skowron <zbychs@gmail.com>
licenses(["notice"])
config_setting(
name = "windows",
values = {
"cpu": "x64_windows",
},
visibility = [":__subpackages__"],
)
cc_library(
name = "benchmark",
srcs = glob(
[
"src/*.cc",
"src/*.h",
],
exclude = ["src/benchmark_main.cc"],
),
hdrs = ["include/benchmark/benchmark.h"],
linkopts = select({
":windows": ["-DEFAULTLIB:shlwapi.lib"],
"//conditions:default": ["-pthread"],
}),
strip_include_prefix = "include",
visibility = ["//visibility:public"],
)
cc_library(
name = "benchmark_main",
srcs = ["src/benchmark_main.cc"],
hdrs = ["include/benchmark/benchmark.h"],
strip_include_prefix = "include",
visibility = ["//visibility:public"],
deps = [":benchmark"],
)
cc_library(
name = "benchmark_internal_headers",
hdrs = glob(["src/*.h"]),
visibility = ["//test:__pkg__"],
)
# How to contribute #
We'd love to accept your patches and contributions to this project. There are
a just a few small guidelines you need to follow.
## Contributor License Agreement ##
Contributions to any Google project must be accompanied by a Contributor
License Agreement. This is not a copyright **assignment**, it simply gives
Google permission to use and redistribute your contributions as part of the
project.
* If you are an individual writing original source code and you're sure you
own the intellectual property, then you'll need to sign an [individual
CLA][].
* If you work for a company that wants to allow you to contribute your work,
then you'll need to sign a [corporate CLA][].
You generally only need to submit a CLA once, so if you've already submitted
one (even if it was for a different project), you probably don't need to do it
again.
[individual CLA]: https://developers.google.com/open-source/cla/individual
[corporate CLA]: https://developers.google.com/open-source/cla/corporate
Once your CLA is submitted (or if you already submitted one for
another Google project), make a commit adding yourself to the
[AUTHORS][] and [CONTRIBUTORS][] files. This commit can be part
of your first [pull request][].
[AUTHORS]: AUTHORS
[CONTRIBUTORS]: CONTRIBUTORS
## Submitting a patch ##
1. It's generally best to start by opening a new issue describing the bug or
feature you're intending to fix. Even if you think it's relatively minor,
it's helpful to know what people are working on. Mention in the initial
issue that you are planning to work on that bug or feature so that it can
be assigned to you.
1. Follow the normal process of [forking][] the project, and setup a new
branch to work in. It's important that each group of changes be done in
separate branches in order to ensure that a pull request only includes the
commits related to that bug or feature.
1. Do your best to have [well-formed commit messages][] for each change.
This provides consistency throughout the project, and ensures that commit
messages are able to be formatted properly by various git tools.
1. Finally, push the commits to your fork and submit a [pull request][].
[forking]: https://help.github.com/articles/fork-a-repo
[well-formed commit messages]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
[pull request]: https://help.github.com/articles/creating-a-pull-request
# People who have agreed to one of the CLAs and can contribute patches.
# The AUTHORS file lists the copyright holders; this file
# lists people. For example, Google employees are listed here
# but not in AUTHORS, because Google holds the copyright.
#
# Names should be added to this file only after verifying that
# the individual or the individual's organization has agreed to
# the appropriate Contributor License Agreement, found here:
#
# https://developers.google.com/open-source/cla/individual
# https://developers.google.com/open-source/cla/corporate
#
# The agreement for individuals can be filled out on the web.
#
# When adding J Random Contributor's name to this file,
# either J's name or J's organization's name should be
# added to the AUTHORS file, depending on whether the
# individual or corporate CLA was used.
#
# Names should be added to this file as:
# Name <email address>
#
# Please keep the list sorted.
Albert Pretorius <pretoalb@gmail.com>
Arne Beer <arne@twobeer.de>
Billy Robert O'Neal III <billy.oneal@gmail.com> <bion@microsoft.com>
Chris Kennelly <ckennelly@google.com> <ckennelly@ckennelly.com>
Christopher Seymour <chris.j.seymour@hotmail.com>
David Coeurjolly <david.coeurjolly@liris.cnrs.fr>
Deniz Evrenci <denizevrenci@gmail.com>
Dominic Hamon <dma@stripysock.com> <dominic@google.com>
Dominik Czarnota <dominik.b.czarnota@gmail.com>
Eric Fiselier <eric@efcs.ca>
Eugene Zhuk <eugene.zhuk@gmail.com>
Evgeny Safronov <division494@gmail.com>
Felix Homann <linuxaudio@showlabor.de>
Ismael Jimenez Martinez <ismael.jimenez.martinez@gmail.com>
Jern-Kuan Leong <jernkuan@gmail.com>
JianXiong Zhou <zhoujianxiong2@gmail.com>
Joao Paulo Magalhaes <joaoppmagalhaes@gmail.com>
John Millikin <jmillikin@stripe.com>
Jussi Knuuttila <jussi.knuuttila@gmail.com>
Kai Wolf <kai.wolf@gmail.com>
Kishan Kumar <kumar.kishan@outlook.com>
Kaito Udagawa <umireon@gmail.com>
Lei Xu <eddyxu@gmail.com>
Matt Clarkson <mattyclarkson@gmail.com>
Maxim Vafin <maxvafin@gmail.com>
Nick Hutchinson <nshutchinson@gmail.com>
Oleksandr Sochka <sasha.sochka@gmail.com>
Pascal Leroy <phl@google.com>
Paul Redmond <paul.redmond@gmail.com>
Pierre Phaneuf <pphaneuf@google.com>
Radoslav Yovchev <radoslav.tm@gmail.com>
Raul Marin <rmrodriguez@cartodb.com>
Ray Glover <ray.glover@uk.ibm.com>
Robert Guo <robert.guo@mongodb.com>
Roman Lebedev <lebedev.ri@gmail.com>
Shuo Chen <chenshuo@chenshuo.com>
Tobias Ulvgård <tobias.ulvgard@dirac.se>
Tom Madams <tom.ej.madams@gmail.com> <tmadams@google.com>
Yixuan Qiu <yixuanq@gmail.com>
Yusuke Suzuki <utatane.tea@gmail.com>
Zbigniew Skowron <zbychs@gmail.com>
This diff is collapsed.
workspace(name = "com_github_google_benchmark")
http_archive(
name = "com_google_googletest",
urls = ["https://github.com/google/googletest/archive/3f0cf6b62ad1eb50d8736538363d3580dd640c3e.zip"],
strip_prefix = "googletest-3f0cf6b62ad1eb50d8736538363d3580dd640c3e",
)
version: '{build}'
image: Visual Studio 2017
configuration:
- Debug
- Release
environment:
matrix:
- compiler: msvc-15-seh
generator: "Visual Studio 15 2017"
- compiler: msvc-15-seh
generator: "Visual Studio 15 2017 Win64"
- compiler: msvc-14-seh
generator: "Visual Studio 14 2015"
- compiler: msvc-14-seh
generator: "Visual Studio 14 2015 Win64"
- compiler: msvc-12-seh
generator: "Visual Studio 12 2013"
- compiler: msvc-12-seh
generator: "Visual Studio 12 2013 Win64"
- compiler: gcc-5.3.0-posix
generator: "MinGW Makefiles"
cxx_path: 'C:\mingw-w64\i686-5.3.0-posix-dwarf-rt_v4-rev0\mingw32\bin'
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
matrix:
fast_finish: true
install:
# git bash conflicts with MinGW makefiles
- if "%generator%"=="MinGW Makefiles" (set "PATH=%PATH:C:\Program Files\Git\usr\bin;=%")
- if not "%cxx_path%"=="" (set "PATH=%PATH%;%cxx_path%")
build_script:
- md _build -Force
- cd _build
- echo %configuration%
- cmake -G "%generator%" "-DCMAKE_BUILD_TYPE=%configuration%" -DBENCHMARK_DOWNLOAD_DEPENDENCIES=ON ..
- cmake --build . --config %configuration%
test_script:
- ctest -c %configuration% --timeout 300 --output-on-failure
artifacts:
- path: '_build/CMakeFiles/*.log'
name: logs
- path: '_build/Testing/**/*.xml'
name: test_results
include("${CMAKE_CURRENT_LIST_DIR}/@targets_export_name@.cmake")
include(FeatureSummary)
find_program(LLVMAR_EXECUTABLE
NAMES llvm-ar
DOC "The llvm-ar executable"
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LLVMAr
DEFAULT_MSG
LLVMAR_EXECUTABLE)
SET_PACKAGE_PROPERTIES(LLVMAr PROPERTIES
URL https://llvm.org/docs/CommandGuide/llvm-ar.html
DESCRIPTION "create, modify, and extract from archives"
)
include(FeatureSummary)
find_program(LLVMNM_EXECUTABLE
NAMES llvm-nm
DOC "The llvm-nm executable"
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LLVMNm
DEFAULT_MSG
LLVMNM_EXECUTABLE)
SET_PACKAGE_PROPERTIES(LLVMNm PROPERTIES
URL https://llvm.org/docs/CommandGuide/llvm-nm.html
DESCRIPTION "list LLVM bitcode and object file’s symbol table"
)
include(FeatureSummary)
find_program(LLVMRANLIB_EXECUTABLE
NAMES llvm-ranlib
DOC "The llvm-ranlib executable"
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LLVMRanLib
DEFAULT_MSG
LLVMRANLIB_EXECUTABLE)
SET_PACKAGE_PROPERTIES(LLVMRanLib PROPERTIES
DESCRIPTION "generate index for LLVM archive"
)
macro(split_list listname)
string(REPLACE ";" " " ${listname} "${${listname}}")
endmacro()
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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