ORE Studio 0.0.4
Loading...
Searching...
No Matches
dataset_protocol.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 *
3 * Copyright (C) 2026 Marco Craveiro <marco.craveiro@gmail.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU General Public License as published by the Free Software
7 * Foundation; either version 3 of the License, or (at your option) any later
8 * version.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13 * details.
14 *
15 * You should have received a copy of the GNU General Public License along with
16 * this program; if not, write to the Free Software Foundation, Inc., 51
17 * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 *
19 */
20#ifndef ORES_DQ_API_MESSAGING_DATASET_PROTOCOL_HPP
21#define ORES_DQ_API_MESSAGING_DATASET_PROTOCOL_HPP
22
23#include <string>
24#include <string_view>
25#include <vector>
26#include "ores.dq.api/domain/dataset.hpp"
27#include "ores.dq.api/domain/publication_mode.hpp"
28#include "ores.dq.api/domain/publication_result.hpp"
29
30namespace ores::dq::messaging {
31
32struct get_datasets_request {
33 using response_type = struct get_datasets_response;
34 static constexpr std::string_view nats_subject = "dq.v1.datasets.list";
35 int offset = 0;
36 int limit = 100;
37};
38
39struct get_datasets_response {
40 std::vector<ores::dq::domain::dataset> datasets;
41 int total_available_count = 0;
42};
43
44struct save_dataset_request {
45 using response_type = struct save_dataset_response;
46 static constexpr std::string_view nats_subject = "dq.v1.datasets.save";
47 std::vector<ores::dq::domain::dataset> datasets;
48};
49
50struct save_dataset_response {
51 bool success = false;
52 std::string message;
53};
54
55struct delete_dataset_request {
56 using response_type = struct delete_dataset_response;
57 static constexpr std::string_view nats_subject = "dq.v1.datasets.delete";
58 std::vector<std::string> ids;
59};
60
61struct delete_dataset_response {
62 bool success = false;
63 std::string message;
64};
65
66struct get_dataset_history_request {
67 using response_type = struct get_dataset_history_response;
68 static constexpr std::string_view nats_subject = "dq.v1.datasets.history";
69 std::string id;
70};
71
72struct get_dataset_history_response {
73 bool success = false;
74 std::string message;
75 std::vector<ores::dq::domain::dataset> history;
76};
77
78struct publish_datasets_request {
79 using response_type = struct publish_datasets_response;
80 static constexpr std::string_view nats_subject = "dq.v1.datasets.publish";
81 std::vector<std::string> dataset_ids;
82 ores::dq::domain::publication_mode mode =
83 ores::dq::domain::publication_mode::upsert;
84 std::string published_by;
85 bool resolve_dependencies = true;
86};
87
88struct publish_datasets_response {
89 bool success = false;
90 std::string message;
91 std::vector<ores::dq::domain::publication_result> results;
92};
93
94}
95
96#endif