|
| 1 | +/* |
| 2 | + * hlquery C++ Client - Resource APIs |
| 3 | + * https://www.hlquery.com |
| 4 | + * |
| 5 | + * Copyright (C) 2021-2026, Carlos F. Ferry <carlos.ferry@gmail.com> |
| 6 | + * |
| 7 | + * This file is part of hlquery, released under the BSD License version 3. |
| 8 | + * You are free to redistribute and/or modify this software |
| 9 | + * under the terms of the BSD License. |
| 10 | + * For more details, please visit: https://docs.hlquery.com |
| 11 | + */ |
| 12 | + |
| 13 | +#pragma once |
| 14 | + |
| 15 | +#include <map> |
| 16 | +#include <memory> |
| 17 | +#include <string> |
| 18 | + |
| 19 | +#include "request.h" |
| 20 | +#include "response.h" |
| 21 | + |
| 22 | +namespace hlquery |
| 23 | +{ |
| 24 | + |
| 25 | +class Aliases |
| 26 | +{ |
| 27 | + public: |
| 28 | + |
| 29 | + explicit Aliases(std::shared_ptr<Request> request); |
| 30 | + |
| 31 | + Response list(); |
| 32 | + Response list(const std::string& collection_name); |
| 33 | + Response get(const std::string& name); |
| 34 | + Response upsert(const std::string& name, const nlohmann::json& body); |
| 35 | + Response create(const std::string& name, const nlohmann::json& body); |
| 36 | + Response update(const std::string& name, const nlohmann::json& body); |
| 37 | + Response remove(const std::string& name); |
| 38 | + |
| 39 | + private: |
| 40 | + |
| 41 | + std::shared_ptr<Request> request_; |
| 42 | +}; |
| 43 | + |
| 44 | +class Synonyms |
| 45 | +{ |
| 46 | + public: |
| 47 | + |
| 48 | + explicit Synonyms(std::shared_ptr<Request> request); |
| 49 | + |
| 50 | + Response list(const std::string& collection_name); |
| 51 | + Response get(const std::string& collection_name, const std::string& id); |
| 52 | + Response upsert(const std::string& collection_name, const std::string& id, const nlohmann::json& body); |
| 53 | + Response create(const std::string& collection_name, const std::string& id, const nlohmann::json& body); |
| 54 | + Response update(const std::string& collection_name, const std::string& id, const nlohmann::json& body); |
| 55 | + Response remove(const std::string& collection_name, const std::string& id); |
| 56 | + Response listAll(); |
| 57 | + Response listGlobal(); |
| 58 | + Response getGlobal(const std::string& id); |
| 59 | + Response upsertGlobal(const std::string& id, const nlohmann::json& body); |
| 60 | + Response createGlobal(const std::string& id, const nlohmann::json& body); |
| 61 | + Response updateGlobal(const std::string& id, const nlohmann::json& body); |
| 62 | + Response removeGlobal(const std::string& id); |
| 63 | + |
| 64 | + private: |
| 65 | + |
| 66 | + std::shared_ptr<Request> request_; |
| 67 | +}; |
| 68 | + |
| 69 | +class Stopwords |
| 70 | +{ |
| 71 | + public: |
| 72 | + |
| 73 | + explicit Stopwords(std::shared_ptr<Request> request); |
| 74 | + |
| 75 | + Response list(const std::string& collection_name); |
| 76 | + Response create(const std::string& collection_name, const nlohmann::json& body); |
| 77 | + Response remove(const std::string& collection_name, const std::string& word); |
| 78 | + Response listAll(); |
| 79 | + Response listGlobal(); |
| 80 | + Response createGlobal(const nlohmann::json& body); |
| 81 | + Response removeGlobal(const std::string& word); |
| 82 | + |
| 83 | + private: |
| 84 | + |
| 85 | + std::shared_ptr<Request> request_; |
| 86 | +}; |
| 87 | + |
| 88 | +class Overrides |
| 89 | +{ |
| 90 | + public: |
| 91 | + |
| 92 | + explicit Overrides(std::shared_ptr<Request> request); |
| 93 | + |
| 94 | + Response list(const std::string& collection_name); |
| 95 | + Response get(const std::string& collection_name, const std::string& id); |
| 96 | + Response upsert(const std::string& collection_name, const std::string& id, const nlohmann::json& body); |
| 97 | + Response create(const std::string& collection_name, const std::string& id, const nlohmann::json& body); |
| 98 | + Response update(const std::string& collection_name, const std::string& id, const nlohmann::json& body); |
| 99 | + Response remove(const std::string& collection_name, const std::string& id); |
| 100 | + |
| 101 | + private: |
| 102 | + |
| 103 | + std::shared_ptr<Request> request_; |
| 104 | +}; |
| 105 | + |
| 106 | +class Keys |
| 107 | +{ |
| 108 | + public: |
| 109 | + |
| 110 | + explicit Keys(std::shared_ptr<Request> request); |
| 111 | + |
| 112 | + Response list(); |
| 113 | + Response get(const std::string& id); |
| 114 | + Response create(const nlohmann::json& body); |
| 115 | + Response update(const std::string& id, const nlohmann::json& body); |
| 116 | + Response remove(const std::string& id); |
| 117 | + |
| 118 | + private: |
| 119 | + |
| 120 | + std::shared_ptr<Request> request_; |
| 121 | +}; |
| 122 | + |
| 123 | +class Users |
| 124 | +{ |
| 125 | + public: |
| 126 | + |
| 127 | + explicit Users(std::shared_ptr<Request> request); |
| 128 | + |
| 129 | + Response list(); |
| 130 | + Response get(const std::string& id); |
| 131 | + Response create(const nlohmann::json& body); |
| 132 | + Response update(const std::string& id, const nlohmann::json& body); |
| 133 | + Response remove(const std::string& id); |
| 134 | + |
| 135 | + private: |
| 136 | + |
| 137 | + std::shared_ptr<Request> request_; |
| 138 | +}; |
| 139 | + |
| 140 | +class Modules |
| 141 | +{ |
| 142 | + public: |
| 143 | + |
| 144 | + explicit Modules(std::shared_ptr<Request> request); |
| 145 | + |
| 146 | + Response list(); |
| 147 | + Response syntax(const std::string& name); |
| 148 | + Response load(const std::string& name, const nlohmann::json& body = nlohmann::json::object()); |
| 149 | + Response unload(const std::string& name, const nlohmann::json& body = nlohmann::json::object()); |
| 150 | + Response call(const std::string& method, const std::string& path, const nlohmann::json& body = nullptr, |
| 151 | + const std::map<std::string, std::string>& query_params = {}); |
| 152 | + |
| 153 | + private: |
| 154 | + |
| 155 | + std::shared_ptr<Request> request_; |
| 156 | +}; |
| 157 | + |
| 158 | +class Presets |
| 159 | +{ |
| 160 | + public: |
| 161 | + |
| 162 | + explicit Presets(std::shared_ptr<Request> request); |
| 163 | + |
| 164 | + Response list(); |
| 165 | + Response get(const std::string& name); |
| 166 | + Response upsert(const std::string& name, const nlohmann::json& body); |
| 167 | + Response create(const std::string& name, const nlohmann::json& body); |
| 168 | + Response update(const std::string& name, const nlohmann::json& body); |
| 169 | + Response remove(const std::string& name); |
| 170 | + |
| 171 | + private: |
| 172 | + |
| 173 | + std::shared_ptr<Request> request_; |
| 174 | +}; |
| 175 | + |
| 176 | +class Analytics |
| 177 | +{ |
| 178 | + public: |
| 179 | + |
| 180 | + explicit Analytics(std::shared_ptr<Request> request); |
| 181 | + |
| 182 | + Response click(const nlohmann::json& body); |
| 183 | + |
| 184 | + private: |
| 185 | + |
| 186 | + std::shared_ptr<Request> request_; |
| 187 | +}; |
| 188 | + |
| 189 | +} |
0 commit comments