diff --git a/sdk/src/Services/DynamoDBv2/Custom/DataModel/BaseOperationConfig.cs b/sdk/src/Services/DynamoDBv2/Custom/DataModel/BaseOperationConfig.cs
index 5f52b622ba09..e8a5a5ea8759 100644
--- a/sdk/src/Services/DynamoDBv2/Custom/DataModel/BaseOperationConfig.cs
+++ b/sdk/src/Services/DynamoDBv2/Custom/DataModel/BaseOperationConfig.cs
@@ -71,7 +71,7 @@ public abstract class BaseOperationConfig
public DynamoDBEntryConversion Conversion { get; set; }
///
- /// Contorls how interprets emptry string values.
+ /// Controls how interprets empty string values.
/// If the property is false (or not set), empty string values will be
/// interpreted as null values.
///
diff --git a/sdk/src/Services/DynamoDBv2/Custom/DataModel/BatchGetConfig.cs b/sdk/src/Services/DynamoDBv2/Custom/DataModel/BatchGetConfig.cs
new file mode 100644
index 000000000000..f7fb57066ee2
--- /dev/null
+++ b/sdk/src/Services/DynamoDBv2/Custom/DataModel/BatchGetConfig.cs
@@ -0,0 +1,58 @@
+/*
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://aws.amazon.com/apache2.0
+ *
+ * or in the "license" file accompanying this file. This file 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 System;
+
+namespace Amazon.DynamoDBv2.DataModel
+{
+ ///
+ /// Input for the BatchGet operation in the object-persistence programming model
+ ///
+#if NET8_0_OR_GREATER
+ // The DataModel namespace doesn't support trimming yet, so annotate public classes/methods as incompatible
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode(Custom.Internal.InternalConstants.RequiresUnreferencedCodeMessage)]
+#endif
+ public class BatchGetConfig : BaseOperationConfig
+ {
+ ///
+ /// Property that directs to use consistent reads.
+ /// If property is not set, behavior defaults to non-consistent reads.
+ ///
+ ///
+ /// Refer to the
+ /// Read Consistency topic in the DynamoDB Developer Guide for more information.
+ ///
+ public bool? ConsistentRead { get; set; }
+
+ ///
+ /// If true, all properties are retrieved in UTC timezone while reading data from DynamoDB. Else, the local timezone is used.
+ ///
+ ///
+ /// This setting is only applicable to the high-level library. Service calls made via
+ /// will always return attributes in UTC.
+ ///
+ public bool? RetrieveDateTimeInUtc { get; set; }
+
+ ///
+ internal override DynamoDBOperationConfig ToDynamoDBOperationConfig()
+ {
+ var config = base.ToDynamoDBOperationConfig();
+ config.ConsistentRead = ConsistentRead;
+ config.RetrieveDateTimeInUtc = RetrieveDateTimeInUtc;
+
+ return config;
+ }
+ }
+}
diff --git a/sdk/src/Services/DynamoDBv2/Custom/DataModel/BatchWriteConfig.cs b/sdk/src/Services/DynamoDBv2/Custom/DataModel/BatchWriteConfig.cs
new file mode 100644
index 000000000000..d96bb4bb93e9
--- /dev/null
+++ b/sdk/src/Services/DynamoDBv2/Custom/DataModel/BatchWriteConfig.cs
@@ -0,0 +1,52 @@
+/*
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://aws.amazon.com/apache2.0
+ *
+ * or in the "license" file accompanying this file. This file 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.
+ */
+
+namespace Amazon.DynamoDBv2.DataModel
+{
+ ///
+ /// Input for the BatchWrite operation in the object-persistence programming model
+ ///
+#if NET8_0_OR_GREATER
+ // The DataModel namespace doesn't support trimming yet, so annotate public classes/methods as incompatible
+ [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode(Custom.Internal.InternalConstants.RequiresUnreferencedCodeMessage)]
+#endif
+ public class BatchWriteConfig : BaseOperationConfig
+ {
+ ///
+ /// Property that directs to skip version checks
+ /// when saving or deleting an object with a version attribute.
+ /// If property is not set, version checks are performed.
+ ///
+ public bool? SkipVersionCheck { get; set; }
+
+ ///
+ /// Directs to ignore null values when
+ /// converting an object to a DynamoDB item. If the property is false
+ /// (or not set), null values will be interpreted as directives to
+ /// delete the specific attributes on the DynamoDB item.
+ ///
+ public bool? IgnoreNullValues { get; set; }
+
+ ///
+ internal override DynamoDBOperationConfig ToDynamoDBOperationConfig()
+ {
+ var config = base.ToDynamoDBOperationConfig();
+ config.SkipVersionCheck = SkipVersionCheck;
+ config.IgnoreNullValues = IgnoreNullValues;
+
+ return config;
+ }
+ }
+}
diff --git a/sdk/src/Services/DynamoDBv2/Custom/DataModel/Context.cs b/sdk/src/Services/DynamoDBv2/Custom/DataModel/Context.cs
index 80e4b78ed8e9..80e9d1458b42 100644
--- a/sdk/src/Services/DynamoDBv2/Custom/DataModel/Context.cs
+++ b/sdk/src/Services/DynamoDBv2/Custom/DataModel/Context.cs
@@ -19,7 +19,6 @@
#if AWS_ASYNC_API
using System.Threading.Tasks;
#endif
-using Amazon.DynamoDBv2;
using Amazon.DynamoDBv2.DocumentModel;
namespace Amazon.DynamoDBv2.DataModel
@@ -208,7 +207,7 @@ public void Dispose()
#endregion
- #region Factory Creates
+ #region BatchGet
///
/// Creates a strongly-typed BatchGet object, allowing
@@ -218,7 +217,7 @@ public void Dispose()
/// Empty strongly-typed BatchGet object
public BatchGet CreateBatchGet()
{
- return CreateBatchGet(null);
+ return CreateBatchGet((BatchGetConfig)null);
}
///
@@ -228,12 +227,25 @@ public BatchGet CreateBatchGet()
/// Type of objects to get
/// Config object which can be used to override that table used.
/// Empty strongly-typed BatchGet object
+ [Obsolete("Use the CreateBatchGet overload that takes BatchGetConfig instead, since DynamoDBOperationConfig contains properties that are not applicable to BatchGet.")]
public BatchGet CreateBatchGet(DynamoDBOperationConfig operationConfig)
{
DynamoDBFlatConfig config = new DynamoDBFlatConfig(operationConfig, this.Config);
return new BatchGet(this, config);
}
+ ///
+ /// Creates a strongly-typed BatchGet object, allowing
+ /// a batch-get operation against DynamoDB.
+ ///
+ /// Type of objects to get
+ /// Config object that can be used to override properties on the table's context for this request
+ /// Empty strongly-typed BatchGet object
+ public BatchGet CreateBatchGet(BatchGetConfig batchGetConfig)
+ {
+ return new BatchGet(this, new DynamoDBFlatConfig(batchGetConfig?.ToDynamoDBOperationConfig(), Config));
+ }
+
///
/// Creates a MultiTableBatchGet object, composed of multiple
/// individual BatchGet objects.
@@ -245,6 +257,10 @@ public MultiTableBatchGet CreateMultiTableBatchGet(params BatchGet[] batches)
return new MultiTableBatchGet(batches);
}
+ #endregion
+
+ #region BatchWrite
+
///
/// Creates a strongly-typed BatchWrite object, allowing
/// a batch-write operation against DynamoDB.
@@ -253,7 +269,7 @@ public MultiTableBatchGet CreateMultiTableBatchGet(params BatchGet[] batches)
/// Empty strongly-typed BatchWrite object
public BatchWrite CreateBatchWrite()
{
- return CreateBatchWrite(null);
+ return CreateBatchWrite((BatchWriteConfig)null);
}
///
@@ -263,6 +279,7 @@ public BatchWrite CreateBatchWrite()
/// Type of objects to write
/// Config object which can be used to override that table used.
/// Empty strongly-typed BatchWrite object
+ [Obsolete("Use the CreateBatchWrite overload that takes BatchWriteConfig instead, since DynamoDBOperationConfig contains properties that are not applicable to BatchWrite.")]
public BatchWrite CreateBatchWrite(DynamoDBOperationConfig operationConfig)
{
DynamoDBFlatConfig config = new DynamoDBFlatConfig(operationConfig, this.Config);
@@ -283,7 +300,7 @@ public BatchWrite CreateBatchWrite(DynamoDBOperationConfig operationConfig
/// Empty strongly-typed BatchWrite object
public BatchWrite