/**
* Nudsf_DataRepository
* Nudsf Data Repository Service. © 2021, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved. 
*
* The version of the OpenAPI document: 1.1.0-alpha.2
* 
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
 * RecordCRUDApi.h
 *
 * 
 */

#ifndef RecordCRUDApi_H_
#define RecordCRUDApi_H_


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


#include "PatchItem.h"
#include "PatchResult.h"
#include "ProblemDetails.h"
#include "Record.h"
#include "RecordMeta.h"
#include "RecordSearchResult.h"
#include "SearchExpression.h"
#include <string>
#include <vector>

namespace org {
namespace openapitools {
namespace server {
namespace api {

using namespace org::openapitools::server::model;

class  RecordCRUDApi {
public:
    RecordCRUDApi(std::shared_ptr<Pistache::Rest::Router>);
    virtual ~RecordCRUDApi() {}
    void init();

    const std::string base = "/nudsf-dr/v1";

private:
    void setupRoutes();

    void create_or_modify_record_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
    void delete_record_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
    void get_meta_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
    void get_record_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
    void search_record_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
    void update_meta_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
    void record_crud_api_default_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);

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

    /// <summary>
    /// Create/Modify Record
    /// </summary>
    /// <remarks>
    /// Create or Modify a Record with a user provided RecordId
    /// </remarks>
    /// <param name="realmId">Identifier(name) of the Realm</param>
    /// <param name="storageId">Identifier of the Storage</param>
    /// <param name="recordId">Identifier of the Record</param>
    /// <param name="record">The record multipart request body. The meta part shall be the first part and is mandatory but can be empty and zero or more block parts may follow the meta part.</param>
    /// <param name="ifNoneMatch">Validator for conditional requests, as described in RFC 7232, 3.2 (optional, default to &quot;&quot;)</param>
    /// <param name="ifMatch">Record validator for conditional requests, as described in RFC 7232, 3.2 (optional, default to &quot;&quot;)</param>
    /// <param name="getPrevious">Retrieve the Record before update (optional, default to false)</param>
    /// <param name="supportedFeatures">Features required to be supported by the target NF (optional, default to &quot;&quot;)</param>
    virtual void create_or_modify_record(const std::string &realmId, const std::string &storageId, const std::string &recordId, const Record &record, const Pistache::Optional<Pistache::Http::Header::Raw> &ifNoneMatch, const Pistache::Optional<Pistache::Http::Header::Raw> &ifMatch, const Pistache::Optional<bool> &getPrevious, const Pistache::Optional<std::string> &supportedFeatures, Pistache::Http::ResponseWriter &response) = 0;

    /// <summary>
    /// Delete a Record with an user provided RecordId
    /// </summary>
    /// <remarks>
    /// 
    /// </remarks>
    /// <param name="realmId">Identifier(name) of the Realm</param>
    /// <param name="storageId">Identifier of the Storage</param>
    /// <param name="recordId">Identifier of the Record</param>
    /// <param name="ifMatch">Record validator for conditional requests, as described in RFC 7232, 3.2 (optional, default to &quot;&quot;)</param>
    /// <param name="getPrevious">Retrieve the Record before delete (optional, default to false)</param>
    /// <param name="supportedFeatures">Features required to be supported by the target NF (optional, default to &quot;&quot;)</param>
    virtual void delete_record(const std::string &realmId, const std::string &storageId, const std::string &recordId, const Pistache::Optional<Pistache::Http::Header::Raw> &ifMatch, const Pistache::Optional<bool> &getPrevious, const Pistache::Optional<std::string> &supportedFeatures, Pistache::Http::ResponseWriter &response) = 0;

    /// <summary>
    /// Record&#39;s meta access
    /// </summary>
    /// <remarks>
    /// retrieve meta of a specific Record
    /// </remarks>
    /// <param name="realmId">Identifier of the Realm</param>
    /// <param name="storageId">Identifier of the Storage</param>
    /// <param name="recordId">Identifier of the Record</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>
    /// <param name="supportedFeatures">Features required to be supported by the target NF (optional, default to &quot;&quot;)</param>
    virtual void get_meta(const std::string &realmId, const std::string &storageId, const std::string &recordId, const Pistache::Optional<Pistache::Http::Header::Raw> &ifNoneMatch, const Pistache::Optional<Pistache::Http::Header::Raw> &ifModifiedSince, const Pistache::Optional<std::string> &supportedFeatures, Pistache::Http::ResponseWriter &response) = 0;

    /// <summary>
    /// Record access
    /// </summary>
    /// <remarks>
    /// retrieve one specific Record
    /// </remarks>
    /// <param name="realmId">Identifier of the Realm</param>
    /// <param name="storageId">Identifier of the Storage</param>
    /// <param name="recordId">Identifier of the Record</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>
    /// <param name="supportedFeatures">Features required to be supported by the target NF (optional, default to &quot;&quot;)</param>
    virtual void get_record(const std::string &realmId, const std::string &storageId, const std::string &recordId, const Pistache::Optional<Pistache::Http::Header::Raw> &ifNoneMatch, const Pistache::Optional<Pistache::Http::Header::Raw> &ifModifiedSince, const Pistache::Optional<std::string> &supportedFeatures, Pistache::Http::ResponseWriter &response) = 0;

    /// <summary>
    /// Records search with get
    /// </summary>
    /// <remarks>
    /// Retrieve one or multiple Records based on filter
    /// </remarks>
    /// <param name="realmId">Identifier of the Realm</param>
    /// <param name="storageId">Identifier of the Storage</param>
    /// <param name="limitRange">The most number of record references to fetch (optional, default to 0)</param>
    /// <param name="filter">Query filter using conditions on tags (optional, default to SearchExpression())</param>
    /// <param name="countIndicator">Indicates whether the number of records that matched the criteria shall be returned. (optional, default to false)</param>
    /// <param name="supportedFeatures">Features required to be supported by the target NF (optional, default to &quot;&quot;)</param>
    virtual void search_record(const std::string &realmId, const std::string &storageId, const Pistache::Optional<int32_t> &limitRange, const Pistache::Optional<SearchExpression> &filter, const Pistache::Optional<bool> &countIndicator, const Pistache::Optional<std::string> &supportedFeatures, Pistache::Http::ResponseWriter &response) = 0;

    /// <summary>
    /// Record&#39;s meta update
    /// </summary>
    /// <remarks>
    /// update meta of a specific Record
    /// </remarks>
    /// <param name="realmId">Identifier of the Realm</param>
    /// <param name="storageId">Identifier of the Storage</param>
    /// <param name="recordId">Identifier of the Record</param>
    /// <param name="patchItem">Meta data to patch</param>
    /// <param name="ifMatch">Record validator for conditional requests, as described in RFC 7232, 3.2 (optional, default to &quot;&quot;)</param>
    /// <param name="supportedFeatures">Features required to be supported by the target NF (optional, default to &quot;&quot;)</param>
    virtual void update_meta(const std::string &realmId, const std::string &storageId, const std::string &recordId, const std::vector<PatchItem> &patchItem, const Pistache::Optional<Pistache::Http::Header::Raw> &ifMatch, const Pistache::Optional<std::string> &supportedFeatures, Pistache::Http::ResponseWriter &response) = 0;

};

}
}
}
}

#endif /* RecordCRUDApi_H_ */

