-
Notifications
You must be signed in to change notification settings - Fork 504
/
Copy pathTransactionalBatchItemRequestOptions.cs
48 lines (44 loc) · 1.96 KB
/
TransactionalBatchItemRequestOptions.cs
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
//------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//------------------------------------------------------------
namespace Microsoft.Azure.Cosmos
{
/// <summary>
/// <see cref="RequestOptions"/> that applies to an operation within a <see cref="TransactionalBatch"/>.
/// </summary>
public class TransactionalBatchItemRequestOptions : RequestOptions
{
/// <summary>
/// Gets or sets the indexing directive (Include or Exclude) for the request in the Azure Cosmos DB service.
/// </summary>
/// <value>
/// The indexing directive to use with a request.
/// </value>
/// <seealso cref="Microsoft.Azure.Cosmos.IndexingPolicy"/>
public IndexingDirective? IndexingDirective { get; set; }
/// <summary>
/// Options to encrypt properties of the item.
/// </summary>
#if PREVIEW
public
#else
internal
#endif
EncryptionOptions EncryptionOptions { get; set; }
internal static TransactionalBatchItemRequestOptions FromItemRequestOptions(ItemRequestOptions itemRequestOptions)
{
if (itemRequestOptions == null)
{
return null;
}
RequestOptions requestOptions = itemRequestOptions as RequestOptions;
TransactionalBatchItemRequestOptions batchItemRequestOptions = new TransactionalBatchItemRequestOptions();
batchItemRequestOptions.IndexingDirective = itemRequestOptions.IndexingDirective;
batchItemRequestOptions.IfMatchEtag = requestOptions.IfMatchEtag;
batchItemRequestOptions.IfNoneMatchEtag = requestOptions.IfNoneMatchEtag;
batchItemRequestOptions.Properties = requestOptions.Properties;
batchItemRequestOptions.IsEffectivePartitionKeyRouting = requestOptions.IsEffectivePartitionKeyRouting;
return batchItemRequestOptions;
}
}
}