From fd48e6bb232c2207ab985f580758dbeebdc20725 Mon Sep 17 00:00:00 2001 From: Santosh Kulkarni <66682828+kr-santosh@users.noreply.github.com> Date: Thu, 8 Apr 2021 11:52:41 +0530 Subject: [PATCH 1/7] Add support to inject/append custom header via RequestOptions. --- .../src/RequestOptions/RequestOptions.cs | 7 +++ .../CosmosHeaderTests.cs | 63 +++++++++++++++++++ 2 files changed, 70 insertions(+) diff --git a/Microsoft.Azure.Cosmos/src/RequestOptions/RequestOptions.cs b/Microsoft.Azure.Cosmos/src/RequestOptions/RequestOptions.cs index 9774daad5c..1877575c74 100644 --- a/Microsoft.Azure.Cosmos/src/RequestOptions/RequestOptions.cs +++ b/Microsoft.Azure.Cosmos/src/RequestOptions/RequestOptions.cs @@ -36,6 +36,11 @@ public class RequestOptions /// public IReadOnlyDictionary Properties { get; set; } + /// + /// Gets or sets a delegate which injects/appends a custom header in the request. + /// + public Action CustomRequestHeaders { get; set; } + /// /// Gets or sets the boolean to use effective partition key routing in the cosmos db request. /// @@ -79,6 +84,8 @@ internal virtual void PopulateRequestOptions(RequestMessage request) { request.Headers.Add(HttpConstants.HttpHeaders.IfNoneMatch, this.IfNoneMatchEtag); } + + this.CustomRequestHeaders?.Invoke(request.Headers); } /// diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosHeaderTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosHeaderTests.cs index ea26efab52..dfaada2321 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosHeaderTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosHeaderTests.cs @@ -46,6 +46,42 @@ public async Task VerifyKnownHeaders() } } + [TestMethod] + public async Task VerifyRequestOptionCustomRequestHeaders() + { + CustomHeaderValidationHandler headerValidationHandler = new CustomHeaderValidationHandler(); + using CosmosClient client = TestCommon.CreateCosmosClient(x => x.AddCustomHandlers(headerValidationHandler)); + Database database = null; + try + { + database = await client.CreateDatabaseAsync(nameof(VerifyKnownHeaders) + Guid.NewGuid().ToString()); + Container container = await database.CreateContainerAsync( + Guid.NewGuid().ToString(), + "/pk"); + + ToDoActivity toDoActivity = ToDoActivity.CreateRandomToDoActivity(); + ItemRequestOptions requestOptions = new ItemRequestOptions + { + CustomRequestHeaders = (headers) => headers["x-ms-cosmos-database-rid"] = "databaseRidValue", + }; + + await container.CreateItemAsync(toDoActivity, new PartitionKey(toDoActivity.pk), requestOptions: requestOptions); + + // null pass + requestOptions.CustomRequestHeaders = null; + + await container.ReadItemAsync(toDoActivity.id, new PartitionKey(toDoActivity.pk), requestOptions: requestOptions); + + } + finally + { + if (database != null) + { + await database.DeleteStreamAsync(); + } + } + } + private class HeaderValidationHandler : RequestHandler { public override async Task SendAsync(RequestMessage request, CancellationToken cancellationToken) @@ -76,5 +112,32 @@ private void ValidateLazyHeadersAreNotCreated(CosmosMessageHeadersInternal inter } } } + + private class CustomHeaderValidationHandler : RequestHandler + { + public override async Task SendAsync(RequestMessage request, CancellationToken cancellationToken) + { + if (request.ResourceType != Documents.ResourceType.Document) + { + return await base.SendAsync(request, cancellationToken); + } + + this.ValidateCustomHeaders(request.Headers.CosmosMessageHeaders); + + ResponseMessage responseMessage = await base.SendAsync(request, cancellationToken); + + return responseMessage; + } + + private void ValidateCustomHeaders(CosmosMessageHeadersInternal internalHeaders) + { + string customHeaderValue = internalHeaders.Get("x-ms-cosmos-database-rid"); + + if (!string.IsNullOrEmpty(customHeaderValue)) + { + Assert.AreEqual("databaseRidValue", customHeaderValue); + } + } + } } } From 08cea4f5015d653d9084c64412df4a8632e82734 Mon Sep 17 00:00:00 2001 From: Santosh Kulkarni <66682828+kr-santosh@users.noreply.github.com> Date: Thu, 8 Apr 2021 17:39:23 +0530 Subject: [PATCH 2/7] Update DotNetSDKAPI.json --- .../Contracts/DotNetSDKAPI.json | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json index 086e541e87..d27de2c277 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json @@ -5599,6 +5599,18 @@ } }, "Members": { + "System.Action`1[Microsoft.Azure.Cosmos.Headers] CustomRequestHeaders": { + "Type": "Property", + "Attributes": [], + "MethodInfo": "System.Action`1[Microsoft.Azure.Cosmos.Headers] CustomRequestHeaders;CanRead:True;CanWrite:True;System.Action`1[Microsoft.Azure.Cosmos.Headers] get_CustomRequestHeaders();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_CustomRequestHeaders(System.Action`1[Microsoft.Azure.Cosmos.Headers]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.Action`1[Microsoft.Azure.Cosmos.Headers] get_CustomRequestHeaders()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "System.Action`1[Microsoft.Azure.Cosmos.Headers] get_CustomRequestHeaders();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, "System.Collections.Generic.IReadOnlyDictionary`2[System.String,System.Object] get_Properties()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { "Type": "Method", "Attributes": [ @@ -5640,6 +5652,13 @@ "Attributes": [], "MethodInfo": "[Void .ctor(), Void .ctor()]" }, + "Void set_CustomRequestHeaders(System.Action`1[Microsoft.Azure.Cosmos.Headers])[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "Void set_CustomRequestHeaders(System.Action`1[Microsoft.Azure.Cosmos.Headers]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, "Void set_IfMatchEtag(System.String)[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { "Type": "Method", "Attributes": [ From c4d02ecf114507ce3455a300a631a8a9e00702b5 Mon Sep 17 00:00:00 2001 From: Santosh Kulkarni <66682828+kr-santosh@users.noreply.github.com> Date: Fri, 9 Apr 2021 07:52:25 +0530 Subject: [PATCH 3/7] Update CosmosHeaderTests.cs --- .../Microsoft.Azure.Cosmos.EmulatorTests/CosmosHeaderTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosHeaderTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosHeaderTests.cs index dfaada2321..aff5f48af1 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosHeaderTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosHeaderTests.cs @@ -54,7 +54,7 @@ public async Task VerifyRequestOptionCustomRequestHeaders() Database database = null; try { - database = await client.CreateDatabaseAsync(nameof(VerifyKnownHeaders) + Guid.NewGuid().ToString()); + database = await client.CreateDatabaseAsync(nameof(VerifyRequestOptionCustomRequestHeaders) + Guid.NewGuid().ToString()); Container container = await database.CreateContainerAsync( Guid.NewGuid().ToString(), "/pk"); From 2402f1d223753e7a4cbc416aa25ee890caeb08d0 Mon Sep 17 00:00:00 2001 From: Santosh Kulkarni <66682828+kr-santosh@users.noreply.github.com> Date: Fri, 9 Apr 2021 18:27:22 +0530 Subject: [PATCH 4/7] Changes as per review comments. --- .../CosmosHeaderTests.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosHeaderTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosHeaderTests.cs index aff5f48af1..6520e3f5ea 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosHeaderTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosHeaderTests.cs @@ -122,11 +122,12 @@ public override async Task SendAsync(RequestMessage request, Ca return await base.SendAsync(request, cancellationToken); } - this.ValidateCustomHeaders(request.Headers.CosmosMessageHeaders); - - ResponseMessage responseMessage = await base.SendAsync(request, cancellationToken); + if (request.ResourceType == Documents.ResourceType.Document) + { + this.ValidateCustomHeaders(request.Headers.CosmosMessageHeaders); + } - return responseMessage; + return await base.SendAsync(request, cancellationToken); } private void ValidateCustomHeaders(CosmosMessageHeadersInternal internalHeaders) From 62e2fad65bc0296c94a38ab67090caae4cbe761d Mon Sep 17 00:00:00 2001 From: Santosh Kulkarni <66682828+kr-santosh@users.noreply.github.com> Date: Fri, 9 Apr 2021 18:30:48 +0530 Subject: [PATCH 5/7] Update CosmosHeaderTests.cs --- .../CosmosHeaderTests.cs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosHeaderTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosHeaderTests.cs index 6520e3f5ea..87e6a34981 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosHeaderTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosHeaderTests.cs @@ -117,11 +117,6 @@ private class CustomHeaderValidationHandler : RequestHandler { public override async Task SendAsync(RequestMessage request, CancellationToken cancellationToken) { - if (request.ResourceType != Documents.ResourceType.Document) - { - return await base.SendAsync(request, cancellationToken); - } - if (request.ResourceType == Documents.ResourceType.Document) { this.ValidateCustomHeaders(request.Headers.CosmosMessageHeaders); From 81bd7ad7cd45c4ebdd3a70cd6901f92b56574d07 Mon Sep 17 00:00:00 2001 From: Santosh Kulkarni <66682828+kr-santosh@users.noreply.github.com> Date: Thu, 15 Apr 2021 19:40:20 +0530 Subject: [PATCH 6/7] Provide shallow copy function. --- .../src/RequestOptions/RequestOptions.cs | 13 +++++++++++-- .../CosmosHeaderTests.cs | 4 ++-- .../Contracts/DotNetSDKAPI.json | 17 +++++++++++------ 3 files changed, 24 insertions(+), 10 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/RequestOptions/RequestOptions.cs b/Microsoft.Azure.Cosmos/src/RequestOptions/RequestOptions.cs index 1877575c74..9169c13f80 100644 --- a/Microsoft.Azure.Cosmos/src/RequestOptions/RequestOptions.cs +++ b/Microsoft.Azure.Cosmos/src/RequestOptions/RequestOptions.cs @@ -39,7 +39,7 @@ public class RequestOptions /// /// Gets or sets a delegate which injects/appends a custom header in the request. /// - public Action CustomRequestHeaders { get; set; } + public Action AddRequestHeaders { get; set; } /// /// Gets or sets the boolean to use effective partition key routing in the cosmos db request. @@ -85,7 +85,16 @@ internal virtual void PopulateRequestOptions(RequestMessage request) request.Headers.Add(HttpConstants.HttpHeaders.IfNoneMatch, this.IfNoneMatchEtag); } - this.CustomRequestHeaders?.Invoke(request.Headers); + this.AddRequestHeaders?.Invoke(request.Headers); + } + + /// + /// Clone RequestOptions. + /// + /// cloned RequestOptions. + public RequestOptions ShallowCopy() + { + return this.MemberwiseClone() as RequestOptions; } /// diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosHeaderTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosHeaderTests.cs index 87e6a34981..ff19b63ea1 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosHeaderTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosHeaderTests.cs @@ -62,13 +62,13 @@ public async Task VerifyRequestOptionCustomRequestHeaders() ToDoActivity toDoActivity = ToDoActivity.CreateRandomToDoActivity(); ItemRequestOptions requestOptions = new ItemRequestOptions { - CustomRequestHeaders = (headers) => headers["x-ms-cosmos-database-rid"] = "databaseRidValue", + AddRequestHeaders = (headers) => headers["x-ms-cosmos-database-rid"] = "databaseRidValue", }; await container.CreateItemAsync(toDoActivity, new PartitionKey(toDoActivity.pk), requestOptions: requestOptions); // null pass - requestOptions.CustomRequestHeaders = null; + requestOptions.AddRequestHeaders = null; await container.ReadItemAsync(toDoActivity.id, new PartitionKey(toDoActivity.pk), requestOptions: requestOptions); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json index d27de2c277..c7fcda0e6b 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json @@ -5599,17 +5599,22 @@ } }, "Members": { - "System.Action`1[Microsoft.Azure.Cosmos.Headers] CustomRequestHeaders": { + "Microsoft.Azure.Cosmos.RequestOptions ShallowCopy()": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "Microsoft.Azure.Cosmos.RequestOptions ShallowCopy();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.Action`1[Microsoft.Azure.Cosmos.Headers] AddRequestHeaders": { "Type": "Property", "Attributes": [], - "MethodInfo": "System.Action`1[Microsoft.Azure.Cosmos.Headers] CustomRequestHeaders;CanRead:True;CanWrite:True;System.Action`1[Microsoft.Azure.Cosmos.Headers] get_CustomRequestHeaders();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_CustomRequestHeaders(System.Action`1[Microsoft.Azure.Cosmos.Headers]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + "MethodInfo": "System.Action`1[Microsoft.Azure.Cosmos.Headers] AddRequestHeaders;CanRead:True;CanWrite:True;System.Action`1[Microsoft.Azure.Cosmos.Headers] get_AddRequestHeaders();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_AddRequestHeaders(System.Action`1[Microsoft.Azure.Cosmos.Headers]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" }, - "System.Action`1[Microsoft.Azure.Cosmos.Headers] get_CustomRequestHeaders()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "System.Action`1[Microsoft.Azure.Cosmos.Headers] get_AddRequestHeaders()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { "Type": "Method", "Attributes": [ "CompilerGeneratedAttribute" ], - "MethodInfo": "System.Action`1[Microsoft.Azure.Cosmos.Headers] get_CustomRequestHeaders();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + "MethodInfo": "System.Action`1[Microsoft.Azure.Cosmos.Headers] get_AddRequestHeaders();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" }, "System.Collections.Generic.IReadOnlyDictionary`2[System.String,System.Object] get_Properties()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { "Type": "Method", @@ -5652,12 +5657,12 @@ "Attributes": [], "MethodInfo": "[Void .ctor(), Void .ctor()]" }, - "Void set_CustomRequestHeaders(System.Action`1[Microsoft.Azure.Cosmos.Headers])[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Void set_AddRequestHeaders(System.Action`1[Microsoft.Azure.Cosmos.Headers])[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { "Type": "Method", "Attributes": [ "CompilerGeneratedAttribute" ], - "MethodInfo": "Void set_CustomRequestHeaders(System.Action`1[Microsoft.Azure.Cosmos.Headers]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + "MethodInfo": "Void set_AddRequestHeaders(System.Action`1[Microsoft.Azure.Cosmos.Headers]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" }, "Void set_IfMatchEtag(System.String)[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { "Type": "Method", From 4c32dcd28baf6e55628ec6153baeca1d7174c1c8 Mon Sep 17 00:00:00 2001 From: Santosh Kulkarni <66682828+kr-santosh@users.noreply.github.com> Date: Tue, 20 Apr 2021 21:24:57 +0530 Subject: [PATCH 7/7] Move to PREVIEW --- .../src/RequestOptions/RequestOptions.cs | 14 ++++++++-- .../CosmosHeaderTests.cs | 1 - .../Contracts/DotNetPreviewSDKAPI.json | 27 ++++++++++++++++++- .../Contracts/DotNetSDKAPI.json | 24 ----------------- 4 files changed, 38 insertions(+), 28 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/RequestOptions/RequestOptions.cs b/Microsoft.Azure.Cosmos/src/RequestOptions/RequestOptions.cs index 9169c13f80..9d81e6ccd3 100644 --- a/Microsoft.Azure.Cosmos/src/RequestOptions/RequestOptions.cs +++ b/Microsoft.Azure.Cosmos/src/RequestOptions/RequestOptions.cs @@ -36,10 +36,15 @@ public class RequestOptions /// public IReadOnlyDictionary Properties { get; set; } +#if PREVIEW /// /// Gets or sets a delegate which injects/appends a custom header in the request. /// - public Action AddRequestHeaders { get; set; } + public +#else + internal +#endif + Action AddRequestHeaders { get; set; } /// /// Gets or sets the boolean to use effective partition key routing in the cosmos db request. @@ -88,11 +93,16 @@ internal virtual void PopulateRequestOptions(RequestMessage request) this.AddRequestHeaders?.Invoke(request.Headers); } +#if PREVIEW /// /// Clone RequestOptions. /// /// cloned RequestOptions. - public RequestOptions ShallowCopy() + public +#else + internal +#endif + RequestOptions ShallowCopy() { return this.MemberwiseClone() as RequestOptions; } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosHeaderTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosHeaderTests.cs index ff19b63ea1..6d3b5b42cb 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosHeaderTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosHeaderTests.cs @@ -71,7 +71,6 @@ public async Task VerifyRequestOptionCustomRequestHeaders() requestOptions.AddRequestHeaders = null; await container.ReadItemAsync(toDoActivity.id, new PartitionKey(toDoActivity.pk), requestOptions: requestOptions); - } finally { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json index 40d30a5f92..358035e272 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json @@ -1677,7 +1677,32 @@ "NestedTypes": {} } }, - "Members": {}, + "Members": { + "Microsoft.Azure.Cosmos.RequestOptions ShallowCopy()": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "Microsoft.Azure.Cosmos.RequestOptions ShallowCopy();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.Action`1[Microsoft.Azure.Cosmos.Headers] AddRequestHeaders": { + "Type": "Property", + "Attributes": [], + "MethodInfo": "System.Action`1[Microsoft.Azure.Cosmos.Headers] AddRequestHeaders;CanRead:True;CanWrite:True;System.Action`1[Microsoft.Azure.Cosmos.Headers] get_AddRequestHeaders();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_AddRequestHeaders(System.Action`1[Microsoft.Azure.Cosmos.Headers]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.Action`1[Microsoft.Azure.Cosmos.Headers] get_AddRequestHeaders()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "System.Action`1[Microsoft.Azure.Cosmos.Headers] get_AddRequestHeaders();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Void set_AddRequestHeaders(System.Action`1[Microsoft.Azure.Cosmos.Headers])[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "Void set_AddRequestHeaders(System.Action`1[Microsoft.Azure.Cosmos.Headers]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + } + }, "NestedTypes": {} }, "Microsoft.Azure.Cosmos.TransactionalBatch;System.Object;IsAbstract:True;IsSealed:False;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:False": { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json index 93a606e2a5..6ad230afe6 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json @@ -5699,23 +5699,6 @@ } }, "Members": { - "Microsoft.Azure.Cosmos.RequestOptions ShallowCopy()": { - "Type": "Method", - "Attributes": [], - "MethodInfo": "Microsoft.Azure.Cosmos.RequestOptions ShallowCopy();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" - }, - "System.Action`1[Microsoft.Azure.Cosmos.Headers] AddRequestHeaders": { - "Type": "Property", - "Attributes": [], - "MethodInfo": "System.Action`1[Microsoft.Azure.Cosmos.Headers] AddRequestHeaders;CanRead:True;CanWrite:True;System.Action`1[Microsoft.Azure.Cosmos.Headers] get_AddRequestHeaders();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_AddRequestHeaders(System.Action`1[Microsoft.Azure.Cosmos.Headers]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" - }, - "System.Action`1[Microsoft.Azure.Cosmos.Headers] get_AddRequestHeaders()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { - "Type": "Method", - "Attributes": [ - "CompilerGeneratedAttribute" - ], - "MethodInfo": "System.Action`1[Microsoft.Azure.Cosmos.Headers] get_AddRequestHeaders();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" - }, "System.Collections.Generic.IReadOnlyDictionary`2[System.String,System.Object] get_Properties()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { "Type": "Method", "Attributes": [ @@ -5757,13 +5740,6 @@ "Attributes": [], "MethodInfo": "[Void .ctor(), Void .ctor()]" }, - "Void set_AddRequestHeaders(System.Action`1[Microsoft.Azure.Cosmos.Headers])[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { - "Type": "Method", - "Attributes": [ - "CompilerGeneratedAttribute" - ], - "MethodInfo": "Void set_AddRequestHeaders(System.Action`1[Microsoft.Azure.Cosmos.Headers]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" - }, "Void set_IfMatchEtag(System.String)[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { "Type": "Method", "Attributes": [