AuthenticationSubscriptionDocumentApiImpl.cpp 2.12 KB
Newer Older
yangjian's avatar
yangjian committed
1
/**
yangjian's avatar
yangjian committed
2 3 4 5 6 7 8 9 10 11 12
 * Nudr_DataRepository API OpenAPI file
 * Unified Data Repository Service. © 2020, 3GPP Organizational Partners (ARIB,
 * ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
 *
 * The version of the OpenAPI document: 2.1.2
 *
 *
 * NOTE: This class is auto generated by OpenAPI Generator
 * (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
 * the class manually.
 */
yangjian's avatar
yangjian committed
13 14 15 16 17

#include "AuthenticationSubscriptionDocumentApiImpl.h"

#include <AuthenticationSubscription.h>

18
#include "PatchResult.h"
19 20 21 22 23
#include "logger.hpp"
#include "udr_app.hpp"
#include "udr_config.hpp"
using namespace config;
extern config::udr_config udr_cfg;
24
namespace oai::udr::api {
yangjian's avatar
yangjian committed
25

26
using namespace oai::udr::model;
yangjian's avatar
yangjian committed
27

yangjian's avatar
yangjian committed
28 29
AuthenticationSubscriptionDocumentApiImpl::
    AuthenticationSubscriptionDocumentApiImpl(
30
        std::shared_ptr<Pistache::Rest::Router> rtr, udr_app *udr_app_inst,
31
        std::string address)
32 33
    : AuthenticationSubscriptionDocumentApi(rtr),
      m_udr_app(udr_app_inst),
34
      m_address(address) {}
yangjian's avatar
yangjian committed
35

yangjian's avatar
yangjian committed
36 37 38 39 40
void AuthenticationSubscriptionDocumentApiImpl::
    modify_authentication_subscription(
        const std::string &ueId, const std::vector<PatchItem> &patchItem,
        const Pistache::Optional<std::string> &supportedFeatures,
        Pistache::Http::ResponseWriter &response) {
41 42 43 44
  nlohmann::json response_data = {};
  Pistache::Http::Code code = {};
  m_udr_app->handle_modify_authentication_subscription(ueId, patchItem,
                                                       response_data, code);
yangjian's avatar
yangjian committed
45

46 47
  Logger::udr_server().debug("HTTP reponse code %d.\n", code);
  response.send(code, response_data.dump());
yangjian's avatar
yangjian committed
48 49
}

yangjian's avatar
yangjian committed
50 51 52 53 54
void AuthenticationSubscriptionDocumentApiImpl::
    read_authentication_subscription(
        const std::string &ueId,
        const Pistache::Optional<std::string> &supportedFeatures,
        Pistache::Http::ResponseWriter &response) {
55 56 57
  nlohmann::json response_data = {};
  Pistache::Http::Code code = {};
  m_udr_app->handle_read_authentication_subscription(ueId, response_data, code);
yangjian's avatar
yangjian committed
58

59 60
  Logger::udr_server().debug("HTTP reponse code %d.\n", code);
  response.send(code, response_data.dump());
yangjian's avatar
yangjian committed
61 62
}

63
}  // namespace oai::udr::api