# Copyright (C) 2020-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.
#
global:
    cpp_namespace: "mongo"

# This file lists the generic arguments accepted by all commands, and generic
# reply fields that all commands may return.

generic_argument_lists:
    generic_args_api_v1:
        description: "Arguments accepted by all commands. These are guaranteed backwards-compatible for as long as the server supports API Version 1."
        fields:
            apiVersion:
                forward_to_shards: false
            apiStrict:
                forward_to_shards: false
            apiDeprecationErrors:
                forward_to_shards: false
            $db:
                forward_to_shards: false
            maxTimeMS:
                forward_to_shards: true
            readConcern:
                forward_to_shards: true
            writeConcern:
                forward_to_shards: true
            lsid:
                forward_to_shards: true
            clientOperationKey:
                forward_to_shards: true
            txnNumber:
                forward_to_shards: true
            autocommit:
                forward_to_shards: true
            startTransaction:
                forward_to_shards: true
            stmtId:
                forward_to_shards: true
            comment:
                forward_to_shards: true
            $readPreference:
                forward_to_shards: false
            $clusterTime:
                forward_to_shards: false

    generic_args_unstable_v1:
        description: "Arguments accepted by all commands. These are not guaranteed backwards-compatible."
        fields:
            $audit:
                forward_to_shards: false
            $client:
                forward_to_shards: false
            $configServerState:
                forward_to_shards: false
            allowImplicitCollectionCreation:
                forward_to_shards: false
            $oplogQueryData:
                forward_to_shards: false
            $queryOptions:
                forward_to_shards: true
            $replData:
                forward_to_shards: false
            databaseVersion:
                forward_to_shards: false
            shardVersion:
                forward_to_shards: false
            tracking_info:
                forward_to_shards: false
            coordinator:
                forward_to_shards: true
            maxTimeMSOpOnly:
                forward_to_shards: false
            $configTime:
                forward_to_shards: false
            $topologyTime:
                forward_to_shards: false

generic_reply_field_lists:
    generic_reply_fields_api_v1:
        description: "Fields that may appear in any command reply. These are guaranteed backwards-compatible for as long as the server supports API Version 1."
        fields:
            $clusterTime:
                forward_from_shards: false
            operationTime:
                forward_from_shards: false

    generic_reply_fields_unstable_v1:
        description: "Fields that may appear in any command reply. These are not guaranteed backwards-compatible."
        fields:
            $configServerState:
                forward_from_shards: false
            $gleStats:
                forward_from_shards: false
            lastCommittedOpTime:
                forward_from_shards: false
            readOnly:
                forward_from_shards: false
            $configTime:
                forward_from_shards: false
            $replData:
                forward_from_shards: false
            $topologyTime:
                forward_from_shards: false
            $oplogQueryData:
                forward_from_shards: false
