/**
 * Namf_EventExposure
 * AMF Event Exposure Service © 2019, 3GPP Organizational Partners (ARIB, ATIS,
 * CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
 *
 * The version of the OpenAPI document: 1.1.0.alpha-1
 *
 *
 * NOTE: This class is auto generated by OpenAPI Generator
 * (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
 * the class manually.
 */
/*
 * SubscriptionsCollectionDocumentApiEventExposure.h
 *
 *
 */

#ifndef SubscriptionsCollectionDocumentApi_EventExposure_H_
#define SubscriptionsCollectionDocumentApi_EventExposure_H_

#include <pistache/http.h>
#include <pistache/router.h>
#include <pistache/http_headers.h>
#include <pistache/optional.h>

#include <utility>

#include "AmfCreateEventSubscription.h"
#include "AmfCreatedEventSubscription.h"
#include "ProblemDetails.h"

namespace oai::amf::api {

class SubscriptionsCollectionDocumentApiEventExposure {
 public:
  explicit SubscriptionsCollectionDocumentApiEventExposure(
      const std::shared_ptr<Pistache::Rest::Router>& rtr);
  virtual ~SubscriptionsCollectionDocumentApiEventExposure() = default;
  void init();

  const std::string base = "/namf-evts/";

 private:
  void setupRoutes();

  void create_subscription_handler(
      const Pistache::Rest::Request& request,
      Pistache::Http::ResponseWriter response);
  void subscriptions_collection_document_api_default_handler(
      const Pistache::Rest::Request& request,
      Pistache::Http::ResponseWriter response);

  const std::shared_ptr<Pistache::Rest::Router> router;

  /// <summary>
  /// Helper function to handle unexpected Exceptions during Parameter parsing
  /// and validation. May be overriden to return custom error formats.
  /// </summary>
  virtual std::pair<Pistache::Http::Code, std::string> handleParsingException(
      const std::exception& ex) const noexcept;

  /// <summary>
  /// Helper function to handle unexpected Exceptions during processing of the
  /// request in handler functions. May be overriden to return custom error
  /// formats.
  /// </summary>
  virtual std::pair<Pistache::Http::Code, std::string> handleOperationException(
      const std::exception& ex) const noexcept;

  /// <summary>
  /// Namf_EventExposure Subscribe service Operation
  /// </summary>
  /// <remarks>
  ///
  /// </remarks>
  /// <param name="amfCreateEventSubscription"></param>
  virtual void create_subscription(
      const oai::amf::model::AmfCreateEventSubscription&
          amfCreateEventSubscription,
      Pistache::Http::ResponseWriter& response) = 0;
};

}  // namespace oai::amf::api

#endif /* SubscriptionsCollectionDocumentApiEventExposure_H_ */
