109 lines
3.8 KiB
C++
109 lines
3.8 KiB
C++
/**
|
|
* Jungfraujoch writer
|
|
* Jungfraujoch Writer Web API
|
|
*
|
|
* The version of the OpenAPI document: 1.0.0-rc.95
|
|
* Contact: filip.leonarski@psi.ch
|
|
*
|
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
* https://openapi-generator.tech
|
|
* Do not edit the class manually.
|
|
*/
|
|
/*
|
|
* DefaultApi.h
|
|
*
|
|
*
|
|
*/
|
|
|
|
#ifndef DefaultApi_H_
|
|
#define DefaultApi_H_
|
|
|
|
|
|
#include "ApiBase.h"
|
|
|
|
#include <pistache/http.h>
|
|
#include <pistache/router.h>
|
|
#include <pistache/http_headers.h>
|
|
|
|
#include <optional>
|
|
#include <utility>
|
|
|
|
#include "Writer_statistics.h"
|
|
#include <string>
|
|
|
|
namespace org::openapitools::server::api
|
|
{
|
|
|
|
class DefaultApi : public ApiBase {
|
|
public:
|
|
explicit DefaultApi(const std::shared_ptr<Pistache::Rest::Router>& rtr);
|
|
~DefaultApi() override = default;
|
|
void init() override;
|
|
|
|
static const std::string base;
|
|
|
|
private:
|
|
void setupRoutes();
|
|
|
|
void cancel_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
|
void status_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
|
void version_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
|
void default_api_default_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
|
|
|
/// <summary>
|
|
/// Helper function to handle unexpected Exceptions during Parameter parsing and validation.
|
|
/// May be overridden to return custom error formats. This is called inside a catch block.
|
|
/// Important: When overriding, do not call `throw ex;`, but instead use `throw;`.
|
|
/// </summary>
|
|
virtual void handleParsingException(const std::exception& ex, Pistache::Http::ResponseWriter &response) const noexcept;
|
|
|
|
/// <summary>
|
|
/// Helper function to handle unexpected Exceptions during Parameter parsing and validation.
|
|
/// May be overridden to return custom error formats. This is called inside a catch block.
|
|
/// Important: When overriding, do not call `throw ex;`, but instead use `throw;`.
|
|
/// </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 overridden to return custom error formats. This is called inside a catch block.
|
|
/// Important: When overriding, do not call `throw ex;`, but instead use `throw;`.
|
|
/// </summary>
|
|
virtual void handleOperationException(const std::exception& ex, Pistache::Http::ResponseWriter &response) const noexcept;
|
|
|
|
/// <summary>
|
|
/// Helper function to handle unexpected Exceptions during processing of the request in handler functions.
|
|
/// May be overridden to return custom error formats. This is called inside a catch block.
|
|
/// Important: When overriding, do not call `throw ex;`, but instead use `throw;`.
|
|
/// </summary>
|
|
virtual std::pair<Pistache::Http::Code, std::string> handleOperationException(const std::exception& ex) const noexcept;
|
|
|
|
/// <summary>
|
|
/// Cancel running data collection
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// It only instructs writer to cancel, but doesn't wait for cancellation actually happening. It still requires to call `/wait_till_done`
|
|
/// </remarks>
|
|
virtual void cancel_post(Pistache::Http::ResponseWriter &response) = 0;
|
|
/// <summary>
|
|
/// Get writer status
|
|
/// </summary>
|
|
/// <remarks>
|
|
///
|
|
/// </remarks>
|
|
virtual void status_get(Pistache::Http::ResponseWriter &response) = 0;
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <remarks>
|
|
///
|
|
/// </remarks>
|
|
virtual void version_get(Pistache::Http::ResponseWriter &response) = 0;
|
|
|
|
};
|
|
|
|
} // namespace org::openapitools::server::api
|
|
|
|
#endif /* DefaultApi_H_ */
|
|
|