20#ifndef ORES_DQ_MESSAGING_BADGE_DEFINITION_PROTOCOL_HPP
21#define ORES_DQ_MESSAGING_BADGE_DEFINITION_PROTOCOL_HPP
27#include "ores.utility/serialization/error_code.hpp"
28#include "ores.dq/domain/badge_definition.hpp"
30namespace ores::dq::messaging {
39struct get_badge_definitions_request final {
40 std::vector<std::byte> serialize()
const;
41 static std::expected<get_badge_definitions_request,
42 ores::utility::serialization::error_code>
43 deserialize(std::span<const std::byte> data);
46std::ostream& operator<<(std::ostream& s,
const get_badge_definitions_request& v);
51struct get_badge_definitions_response final {
52 std::vector<domain::badge_definition> definitions;
54 std::vector<std::byte> serialize()
const;
55 static std::expected<get_badge_definitions_response,
56 ores::utility::serialization::error_code>
57 deserialize(std::span<const std::byte> data);
60std::ostream& operator<<(std::ostream& s,
const get_badge_definitions_response& v);
65struct save_badge_definition_request final {
66 domain::badge_definition definition;
68 std::vector<std::byte> serialize()
const;
69 static std::expected<save_badge_definition_request,
70 ores::utility::serialization::error_code>
71 deserialize(std::span<const std::byte> data);
74std::ostream& operator<<(std::ostream& s,
const save_badge_definition_request& v);
79struct save_badge_definition_response final {
83 std::vector<std::byte> serialize()
const;
84 static std::expected<save_badge_definition_response,
85 ores::utility::serialization::error_code>
86 deserialize(std::span<const std::byte> data);
89std::ostream& operator<<(std::ostream& s,
const save_badge_definition_response& v);
106 std::vector<std::string>
codes;
108 std::vector<std::byte> serialize()
const;
110 ores::utility::serialization::error_code>
111 deserialize(std::span<const std::byte> data);
114std::ostream& operator<<(std::ostream& s,
const delete_badge_definition_request& v);
119struct delete_badge_definition_response final {
120 std::vector<delete_badge_definition_result> results;
122 std::vector<std::byte> serialize()
const;
123 static std::expected<delete_badge_definition_response,
124 ores::utility::serialization::error_code>
125 deserialize(std::span<const std::byte> data);
128std::ostream& operator<<(std::ostream& s,
const delete_badge_definition_response& v);
133struct get_badge_definition_history_request final {
136 std::vector<std::byte> serialize()
const;
137 static std::expected<get_badge_definition_history_request,
138 ores::utility::serialization::error_code>
139 deserialize(std::span<const std::byte> data);
142std::ostream& operator<<(std::ostream& s,
const get_badge_definition_history_request& v);
147struct get_badge_definition_history_response final {
150 std::vector<domain::badge_definition> versions;
152 std::vector<std::byte> serialize()
const;
153 static std::expected<get_badge_definition_history_response,
154 ores::utility::serialization::error_code>
155 deserialize(std::span<const std::byte> data);
158std::ostream& operator<<(std::ostream& s,
const get_badge_definition_history_response& v);
Request to delete one or more badge definitions.
Definition badge_protocol.hpp:175
std::vector< std::string > codes
Primary keys.
Definition badge_protocol.hpp:178
std::string code
Primary key.
Definition badge_protocol.hpp:189
Result for a single badge definition deletion.
Definition badge_definition_protocol.hpp:94
std::string code
Primary key.
Definition badge_definition_protocol.hpp:95