-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcollection.hpp
53 lines (44 loc) · 1.61 KB
/
collection.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//
// Created by Rakesh on 18/12/2024.
//
#pragma once
#if defined __has_include
#if __has_include("../../../common/visit_struct/visit_struct_intrusive.hpp")
#include "../../../common/visit_struct/visit_struct_intrusive.hpp"
#include "../../../common/util/serialise.hpp"
#else
#include <mongo-service/common/visit_struct/visit_struct_intrusive.hpp>
#include <mongo-service/common/util/serialise.hpp>
#endif
#endif
#include <string>
namespace spt::mongoservice::api::model::response
{
struct CreateCollection
{
explicit CreateCollection( bsoncxx::document::view document ) { util::unmarshall( *this, document ); }
CreateCollection() = default;
~CreateCollection() = default;
CreateCollection(CreateCollection&&) = default;
CreateCollection& operator=(CreateCollection&&) = default;
CreateCollection(const CreateCollection&) = delete;
CreateCollection& operator=(const CreateCollection&) = delete;
BEGIN_VISITABLES(CreateCollection);
VISITABLE(std::string, database);
VISITABLE(std::string, collection);
END_VISITABLES;
};
struct DropCollection
{
explicit DropCollection( bsoncxx::document::view document ) { util::unmarshall( *this, document ); }
DropCollection() = default;
~DropCollection() = default;
DropCollection(DropCollection&&) = default;
DropCollection& operator=(DropCollection&&) = default;
DropCollection(const DropCollection&) = delete;
DropCollection& operator=(const DropCollection&) = delete;
BEGIN_VISITABLES(DropCollection);
VISITABLE_DIRECT_INIT(bool, dropCollection, {false});
END_VISITABLES;
};
}