Skip to content

Commit

Permalink
Patch: Adds preview support for Patch API (#2308)
Browse files Browse the repository at this point in the history
This adds the patch API to the public preview SDK.
  • Loading branch information
deparash authored Mar 16, 2021
1 parent 0e37903 commit 1de5db6
Show file tree
Hide file tree
Showing 10 changed files with 443 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Microsoft.Azure.Cosmos/src/Batch/TransactionalBatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ public abstract TransactionalBatch DeleteItem(
string id,
TransactionalBatchItemRequestOptions requestOptions = null);

#if INTERNAL
#if PREVIEW
/// <summary>
/// Adds an operation to patch an item into the batch.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Microsoft.Azure.Cosmos

internal abstract class TransactionalBatchInternal : TransactionalBatch
{
#if !INTERNAL
#if !PREVIEW
/// <summary>
/// Adds an operation to patch an item into the batch.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Microsoft.Azure.Cosmos
/// <summary>
/// Cosmos Batch Patch request options
/// </summary>
#if INTERNAL
#if PREVIEW
public
#else
internal
Expand Down
2 changes: 1 addition & 1 deletion Microsoft.Azure.Cosmos/src/Patch/PatchOperation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Microsoft.Azure.Cosmos
/// <summary>
/// Details of Patch operation that is to be applied to the referred Cosmos item.
/// </summary>
#if INTERNAL
#if PREVIEW
public
#else
internal
Expand Down
2 changes: 1 addition & 1 deletion Microsoft.Azure.Cosmos/src/Patch/PatchOperationType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace Microsoft.Azure.Cosmos
/// Type of Patch operation.
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
#if INTERNAL
#if PREVIEW
public
#else
internal
Expand Down
2 changes: 1 addition & 1 deletion Microsoft.Azure.Cosmos/src/Patch/PatchOperation{T}.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Microsoft.Azure.Cosmos
/// Defines PatchOperation with a value parameter.
/// </summary>
/// <typeparam name="T">Data type of value provided for PatchOperation.</typeparam>
#if INTERNAL
#if PREVIEW
public
#else
internal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Microsoft.Azure.Cosmos
/// <summary>
/// Cosmos Patch request options
/// </summary>
#if INTERNAL
#if PREVIEW
public
#else
internal
Expand Down
2 changes: 1 addition & 1 deletion Microsoft.Azure.Cosmos/src/Resource/Container/Container.cs
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ public abstract Task<ItemResponse<T>> ReplaceItemAsync<T>(
ItemRequestOptions requestOptions = null,
CancellationToken cancellationToken = default);

#if INTERNAL
#if PREVIEW
/// <summary>
/// Patches an item in the Azure Cosmos service as an asynchronous operation.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,13 @@ public static void ValidatePartitionKey(object partitionKey, RequestOptions requ
}

#if !INTERNAL
public abstract Task<ResponseMessage> DeleteAllItemsByPartitionKeyStreamAsync(
Cosmos.PartitionKey partitionKey,
RequestOptions requestOptions = null,
CancellationToken cancellationToken = default(CancellationToken));
#endif

#if !PREVIEW
public abstract Task<ResponseMessage> PatchItemStreamAsync(
string id,
PartitionKey partitionKey,
Expand All @@ -139,13 +146,6 @@ public abstract Task<ItemResponse<T>> PatchItemAsync<T>(
PatchItemRequestOptions requestOptions = null,
CancellationToken cancellationToken = default);

public abstract Task<ResponseMessage> DeleteAllItemsByPartitionKeyStreamAsync(
Cosmos.PartitionKey partitionKey,
RequestOptions requestOptions = null,
CancellationToken cancellationToken = default(CancellationToken));
#endif

#if !PREVIEW
public abstract Task<IReadOnlyList<FeedRange>> GetFeedRangesAsync(CancellationToken cancellationToken = default);

public abstract FeedIterator GetChangeFeedStreamIterator(
Expand Down

Large diffs are not rendered by default.

0 comments on commit 1de5db6

Please sign in to comment.