SDMSubscriptionDocumentApiImpl.cpp 3.57 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
/*
 * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The OpenAirInterface Software Alliance licenses this file to You under
 * the OAI Public License, Version 1.1  (the "License"); you may not use this
 * file except in compliance with the License. You may obtain a copy of the
 * License at
 *
 *      http://www.openairinterface.org/?page_id=698
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *-------------------------------------------------------------------------------
 * For more information about the OpenAirInterface (OAI) Software Alliance:
 *      contact@openairinterface.org
 */
yangjian's avatar
yangjian committed
21
/**
yangjian's avatar
yangjian committed
22 23 24 25 26 27 28 29 30 31 32
 * 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
33 34 35

#include "SDMSubscriptionDocumentApiImpl.h"

36 37
#include "logger.hpp"
#include "udr_app.hpp"
38
namespace oai::udr::api {
yangjian's avatar
yangjian committed
39

40
using namespace oai::udr::model;
yangjian's avatar
yangjian committed
41

yangjian's avatar
yangjian committed
42
SDMSubscriptionDocumentApiImpl::SDMSubscriptionDocumentApiImpl(
43
    std::shared_ptr<Pistache::Rest::Router> rtr, udr_app *udr_app_inst,
44
    std::string address)
45 46
    : SDMSubscriptionDocumentApi(rtr),
      m_udr_app(udr_app_inst),
47
      m_address(address) {}
yangjian's avatar
yangjian committed
48

yangjian's avatar
yangjian committed
49 50 51 52 53
void SDMSubscriptionDocumentApiImpl::modifysdm_subscription(
    const std::string &ueId, const std::string &subsId,
    const std::vector<PatchItem> &patchItem,
    const Pistache::Optional<std::string> &supportedFeatures,
    Pistache::Http::ResponseWriter &response) {
Tien-Thinh Nguyen's avatar
Tien-Thinh Nguyen committed
54 55
  response.send(Pistache::Http::Code::Ok,
                "This API has not been implemented yet!\n");
yangjian's avatar
yangjian committed
56
}
yangjian's avatar
yangjian committed
57 58 59
void SDMSubscriptionDocumentApiImpl::querysdm_subscription(
    const std::string &ueId, const std::string &subsId,
    Pistache::Http::ResponseWriter &response) {
60 61 62
  nlohmann::json response_data = {};
  Pistache::Http::Code code = {};
  m_udr_app->handle_query_sdm_subscription(ueId, subsId, response_data, code);
yangjian's avatar
yangjian committed
63

64 65
  Logger::udr_server().debug("HTTP reponse code %d.\n", code);
  response.send(code, response_data.dump());
yangjian's avatar
yangjian committed
66 67 68 69
}
void SDMSubscriptionDocumentApiImpl::removesdm_subscriptions(
    const std::string &ueId, const std::string &subsId,
    Pistache::Http::ResponseWriter &response) {
70 71 72
  nlohmann::json response_data = {};
  Pistache::Http::Code code = {};
  m_udr_app->handle_remove_sdm_subscription(ueId, subsId, response_data, code);
yangjian's avatar
yangjian committed
73

74 75
  Logger::udr_server().debug("HTTP reponse code %d.\n", code);
  response.send(code, response_data.dump());
yangjian's avatar
yangjian committed
76
}
yangjian's avatar
yangjian committed
77 78 79 80
void SDMSubscriptionDocumentApiImpl::updatesdmsubscriptions(
    const std::string &ueId, const std::string &subsId,
    SdmSubscription &sdmSubscription,
    Pistache::Http::ResponseWriter &response) {
81 82 83 84
  nlohmann::json response_data = {};
  Pistache::Http::Code code = {};
  m_udr_app->handle_update_sdm_subscription(ueId, subsId, sdmSubscription,
                                            response_data, code);
yangjian's avatar
yangjian committed
85

86 87
  Logger::udr_server().debug("HTTP reponse code %d.\n", code);
  response.send(code, response_data.dump());
yangjian's avatar
yangjian committed
88 89
}

90
}  // namespace oai::udr::api