Skip to content

Commit 1de5db6

Browse files
authored
Patch: Adds preview support for Patch API (#2308)
This adds the patch API to the public preview SDK.
1 parent 0e37903 commit 1de5db6

File tree

10 files changed

+443
-15
lines changed

10 files changed

+443
-15
lines changed

Microsoft.Azure.Cosmos/src/Batch/TransactionalBatch.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ public abstract TransactionalBatch DeleteItem(
206206
string id,
207207
TransactionalBatchItemRequestOptions requestOptions = null);
208208

209-
#if INTERNAL
209+
#if PREVIEW
210210
/// <summary>
211211
/// Adds an operation to patch an item into the batch.
212212
/// </summary>

Microsoft.Azure.Cosmos/src/Batch/TransactionalBatchInternal.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace Microsoft.Azure.Cosmos
1111

1212
internal abstract class TransactionalBatchInternal : TransactionalBatch
1313
{
14-
#if !INTERNAL
14+
#if !PREVIEW
1515
/// <summary>
1616
/// Adds an operation to patch an item into the batch.
1717
/// </summary>

Microsoft.Azure.Cosmos/src/Batch/TransactionalBatchPatchItemRequestOptions.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace Microsoft.Azure.Cosmos
1111
/// <summary>
1212
/// Cosmos Batch Patch request options
1313
/// </summary>
14-
#if INTERNAL
14+
#if PREVIEW
1515
public
1616
#else
1717
internal

Microsoft.Azure.Cosmos/src/Patch/PatchOperation.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace Microsoft.Azure.Cosmos
1010
/// <summary>
1111
/// Details of Patch operation that is to be applied to the referred Cosmos item.
1212
/// </summary>
13-
#if INTERNAL
13+
#if PREVIEW
1414
public
1515
#else
1616
internal

Microsoft.Azure.Cosmos/src/Patch/PatchOperationType.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace Microsoft.Azure.Cosmos
1212
/// Type of Patch operation.
1313
/// </summary>
1414
[JsonConverter(typeof(StringEnumConverter))]
15-
#if INTERNAL
15+
#if PREVIEW
1616
public
1717
#else
1818
internal

Microsoft.Azure.Cosmos/src/Patch/PatchOperation{T}.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace Microsoft.Azure.Cosmos
1010
/// Defines PatchOperation with a value parameter.
1111
/// </summary>
1212
/// <typeparam name="T">Data type of value provided for PatchOperation.</typeparam>
13-
#if INTERNAL
13+
#if PREVIEW
1414
public
1515
#else
1616
internal

Microsoft.Azure.Cosmos/src/RequestOptions/PatchItemRequestOptions.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace Microsoft.Azure.Cosmos
1111
/// <summary>
1212
/// Cosmos Patch request options
1313
/// </summary>
14-
#if INTERNAL
14+
#if PREVIEW
1515
public
1616
#else
1717
internal

Microsoft.Azure.Cosmos/src/Resource/Container/Container.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ public abstract Task<ItemResponse<T>> ReplaceItemAsync<T>(
632632
ItemRequestOptions requestOptions = null,
633633
CancellationToken cancellationToken = default);
634634

635-
#if INTERNAL
635+
#if PREVIEW
636636
/// <summary>
637637
/// Patches an item in the Azure Cosmos service as an asynchronous operation.
638638
/// </summary>

Microsoft.Azure.Cosmos/src/Resource/Container/ContainerInternal.cs

+7-7
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,13 @@ public static void ValidatePartitionKey(object partitionKey, RequestOptions requ
125125
}
126126

127127
#if !INTERNAL
128+
public abstract Task<ResponseMessage> DeleteAllItemsByPartitionKeyStreamAsync(
129+
Cosmos.PartitionKey partitionKey,
130+
RequestOptions requestOptions = null,
131+
CancellationToken cancellationToken = default(CancellationToken));
132+
#endif
133+
134+
#if !PREVIEW
128135
public abstract Task<ResponseMessage> PatchItemStreamAsync(
129136
string id,
130137
PartitionKey partitionKey,
@@ -139,13 +146,6 @@ public abstract Task<ItemResponse<T>> PatchItemAsync<T>(
139146
PatchItemRequestOptions requestOptions = null,
140147
CancellationToken cancellationToken = default);
141148

142-
public abstract Task<ResponseMessage> DeleteAllItemsByPartitionKeyStreamAsync(
143-
Cosmos.PartitionKey partitionKey,
144-
RequestOptions requestOptions = null,
145-
CancellationToken cancellationToken = default(CancellationToken));
146-
#endif
147-
148-
#if !PREVIEW
149149
public abstract Task<IReadOnlyList<FeedRange>> GetFeedRangesAsync(CancellationToken cancellationToken = default);
150150

151151
public abstract FeedIterator GetChangeFeedStreamIterator(

Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json

+428
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)