summaryrefslogtreecommitdiff
path: root/src/mongo/db/coll_mod_reply_validation.h
diff options
context:
space:
mode:
authorMoustafa Maher <m.maher@10gen.com>2021-01-27 00:11:02 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-02-04 22:34:30 +0000
commit14bf2ee40260afb8657b0c101931025e940384ab (patch)
tree82b6e0996de17c4658b8844f207f0e7134706fcc /src/mongo/db/coll_mod_reply_validation.h
parent887ac8a4345814e25e34aca5f393f4a02d38cd4c (diff)
downloadmongo-14bf2ee40260afb8657b0c101931025e940384ab.tar.gz
SERVER-53156 Convert collMod command implementation to inherit from IDL-generated base class
Diffstat (limited to 'src/mongo/db/coll_mod_reply_validation.h')
-rw-r--r--src/mongo/db/coll_mod_reply_validation.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/mongo/db/coll_mod_reply_validation.h b/src/mongo/db/coll_mod_reply_validation.h
new file mode 100644
index 00000000000..75e077d7163
--- /dev/null
+++ b/src/mongo/db/coll_mod_reply_validation.h
@@ -0,0 +1,43 @@
+/**
+ * Copyright (C) 2018-present MongoDB, Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the Server Side Public License, version 1,
+ * as published by MongoDB, Inc.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * Server Side Public License for more details.
+ *
+ * You should have received a copy of the Server Side Public License
+ * along with this program. If not, see
+ * <http://www.mongodb.com/licensing/server-side-public-license>.
+ *
+ * As a special exception, the copyright holders give permission to link the
+ * code of portions of this program with the OpenSSL library under certain
+ * conditions as described in each individual source file and distribute
+ * linked combinations including the program with the OpenSSL library. You
+ * must comply with the Server Side Public License in all respects for
+ * all of the code used other than as permitted herein. If you modify file(s)
+ * with this exception, you may extend this exception to your version of the
+ * file(s), but you are not obligated to do so. If you do not wish to do so,
+ * delete this exception statement from your version. If you delete this
+ * exception statement from all source files in the program, then also delete
+ * it in the license file.
+ */
+
+#pragma once
+
+#include "mongo/db/coll_mod_gen.h"
+
+namespace mongo::coll_mod_reply_validation {
+/**
+ * CollMod reply object requires extra validation, as the current IDL validation capabilities
+ * are not sufficient in this case.
+ * It is used to check that reply includes:
+ * - (expireAfterSeconds_new and expireAfterSeconds_old) together or none of them.
+ * - (hidden_new and hidden_old) together or none of them.
+ */
+void validateReply(const CollModReply& reply);
+} // namespace mongo::coll_mod_reply_validation \ No newline at end of file