/* Copyright 2017-present MongoDB Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ using MongoDB.Bson; using MongoDB.Driver.Core.Misc; using System; namespace MongoDB.Driver { /// /// Options for a change stream operation. /// public class ChangeStreamOptions { // private fields private int? _batchSize; private Collation _collation; private ChangeStreamFullDocumentOption _fullDocument = ChangeStreamFullDocumentOption.Default; private TimeSpan? _maxAwaitTime; private BsonDocument _resumeAfter; private BsonTimestamp _startAtOperationTime; // public properties /// /// Gets or sets the size of the batch. /// /// /// The size of the batch. /// public int? BatchSize { get { return _batchSize; } set { _batchSize = Ensure.IsNullOrGreaterThanZero(value, nameof(value)); } } /// /// Gets or sets the collation. /// /// /// The collation. /// public Collation Collation { get { return _collation; } set { _collation = value; } } /// /// Gets or sets the full document. /// /// /// The full document. /// public ChangeStreamFullDocumentOption FullDocument { get { return _fullDocument; } set { _fullDocument = value; } } /// /// Gets or sets the maximum await time. /// /// /// The maximum await time. /// public TimeSpan? MaxAwaitTime { get { return _maxAwaitTime; } set { _maxAwaitTime = Ensure.IsNullOrGreaterThanZero(value, nameof(value)); } } /// /// Gets or sets the resume after. /// /// /// The resume after. /// public BsonDocument ResumeAfter { get { return _resumeAfter; } set { _resumeAfter = value; } } /// /// Gets or sets the start at operation time. /// /// /// The start at operation time. /// public BsonTimestamp StartAtOperationTime { get { return _startAtOperationTime; } set { _startAtOperationTime = value; } } } }