lintel 0.2.0
Loading...
Searching...
No Matches
MessageQueueDtos.h
Go to the documentation of this file.
1#ifndef MESSAGEQUEUEDTOS_H
2#define MESSAGEQUEUEDTOS_H
4#include <optional>
5#include <vector>
6
7#include "MessageQueueDto.h"
9
10namespace lintel {
13{
14private:
16 std::vector<MessageQueueDto> m_messageQueueDtos;
17
18public:
20 MessageQueueDtos() = default;
21
25 static std::vector<MessageQueueDto> build(const std::vector<std::pair<MessageQueueEntry, int32_t>> &pairs);
26
29 MessageQueueDtos(const std::vector<std::pair<MessageQueueEntry, int32_t>> &messageQueueDtos);
30
33 [[nodiscard]] const std::vector<MessageQueueDto> &getMessageQueueDtos() const;
34
37 void serialize(rapidjson::Writer<rapidjson::StringBuffer> *writer) const override;
38
41 void deserialize(const std::string &json) override;
42};
43
46{
47private:
49 std::vector<MessageQueueDto> m_messageQueueDtos;
51 bool m_hasMore = false;
53 std::optional<std::string> m_nextAfter;
54
56 static struct Shapes
57 {
58 const char *const ITEMS = "items";
59 const char *const HAS_MORE = "has_more";
60 const char *const NEXT_AFTER = "next_after";
61 } shape;
62
63public:
67
70
73 void serialize(rapidjson::Writer<rapidjson::StringBuffer> *writer) const override;
74
77 void deserialize(const std::string &json) override;
78
81 [[nodiscard]] const std::vector<MessageQueueDto> &getMessageQueueDtos() const;
82
84 [[nodiscard]] bool hasMore() const;
85
87 [[nodiscard]] const std::optional<std::string> &getNextAfter() const;
88};
89
90}// namespace lintel
91#endif// MESSAGEQUEUEDTOS_H
Definition JsonSerializable.h:17
Definition MessageQueueDtos.h:13
void deserialize(const std::string &json) override
const std::vector< MessageQueueDto > & getMessageQueueDtos() const
void serialize(rapidjson::Writer< rapidjson::StringBuffer > *writer) const override
static std::vector< MessageQueueDto > build(const std::vector< std::pair< MessageQueueEntry, int32_t > > &pairs)
MessageQueueDtos(const std::vector< std::pair< MessageQueueEntry, int32_t > > &messageQueueDtos)
Definition MessageQueueDtos.h:46
const std::vector< MessageQueueDto > & getMessageQueueDtos() const
MessageQueuesPageDto(const Page< MessageQueueEntry > &page)
const std::optional< std::string > & getNextAfter() const
void serialize(rapidjson::Writer< rapidjson::StringBuffer > *writer) const override
void deserialize(const std::string &json) override
Definition Page.h:15
Definition BaseFeature.h:6
constexpr std::string_view type_name()
Definition TypeName.h:9