diff --git a/.github/fabricbot.json b/.github/fabricbot.json deleted file mode 100644 index e400139553..0000000000 --- a/.github/fabricbot.json +++ /dev/null @@ -1,183 +0,0 @@ -{ - "version": "1.0", - "tasks": [ - { - "taskType": "scheduled", - "capabilityId": "ScheduledSearch", - "subCapability": "ScheduledSearch", - "version": "1.1", - "config": { - "frequency": [ - { - "weekDay": 0, - "hours": [], - "timezoneOffset": -8 - } - ], - "searchTerms": [ - { - "name": "noActivitySince", - "parameters": { - "days": 180 - } - }, - { - "name": "noLabel", - "parameters": { - "label": "VNext" - } - }, - { - "name": "noLabel", - "parameters": { - "label": "feature-request" - } - } - ], - "taskName": "CosmosV3-InactivePruge", - "actions": [ - { - "name": "addReply", - "parameters": { - "comment": "Closing due to in-activity, pease feel free to re-open." - } - }, - { - "name": "closeIssue", - "parameters": {} - } - ] - }, - "disabled": true - }, - { - "taskType": "trigger", - "capabilityId": "IssueResponder", - "subCapability": "IssuesOnlyResponder", - "version": "1.0", - "config": { - "conditions": { - "operator": "and", - "operands": [ - { - "operator": "not", - "operands": [ - { - "name": "isAssignedToSomeone", - "parameters": {} - } - ] - }, - { - "name": "isAction", - "parameters": { - "action": "opened" - } - }, - { - "operator": "not", - "operands": [ - { - "name": "hasLabel", - "parameters": { - "label": "needs-investigation" - } - } - ] - } - ] - }, - "eventType": "issue", - "eventNames": [ - "issues", - "project_card" - ], - "taskName": "Add needs-investigation", - "actions": [ - { - "name": "addLabel", - "parameters": { - "label": "needs-investigation" - } - } - ] - } - }, - { - "taskType": "trigger", - "capabilityId": "AutoMerge", - "subCapability": "AutoMerge", - "version": "1.0", - "config": { - "taskName": "PR Automerge", - "allowAutoMergeInstructionsWithoutLabel": false, - "mergeType": "squash", - "deleteBranches": true, - "removeLabelOnPush": true, - "label": "auto-merge", - "requireAllStatuses": false, - "requireSpecificCheckRuns": false, - "usePrDescriptionAsCommitMessage": false, - "minMinutesOpen": "60", - "enforceDMPAsStatus": true - } - }, - { - "taskType": "scheduled", - "capabilityId": "ScheduledSearch", - "subCapability": "ScheduledSearch", - "version": "1.1", - "config": { - "frequency": [ - { - "weekDay": 1, - "hours": [ - 9 - ], - "timezoneOffset": -7 - } - ], - "searchTerms": [ - { - "name": "isOpen", - "parameters": {} - }, - { - "name": "isIssue", - "parameters": {} - }, - { - "name": "hasLabel", - "parameters": { - "label": "needs-more-information" - } - }, - { - "name": "noActivitySince", - "parameters": { - "days": 14 - } - }, - { - "name": "noAssignees", - "parameters": {} - } - ], - "taskName": "Close inactive needs-information", - "actions": [ - { - "name": "addReply", - "parameters": { - "comment": "@${issueAuthor} this issue requires more information for the team to be able to help. In case this information is available, please add it and re-open the Issue." - } - }, - { - "name": "closeIssue", - "parameters": {} - } - ] - } - } - ], - "userGroups": [] -} diff --git a/.github/policies/resourceManagement.yml b/.github/policies/resourceManagement.yml new file mode 100644 index 0000000000..8207a0708a --- /dev/null +++ b/.github/policies/resourceManagement.yml @@ -0,0 +1,57 @@ +id: +name: GitOps.PullRequestIssueManagement +description: GitOps.PullRequestIssueManagement primitive +owner: +resource: repository +disabled: false +where: +configuration: + resourceManagementConfiguration: + scheduledSearches: + - description: + frequencies: + - weekday: + day: Monday + time: 9:0 + filters: + - isOpen + - isIssue + - hasLabel: + label: needs-more-information + - noActivitySince: + days: 14 + - isNotAssigned + actions: + - addReply: + reply: '@${issueAuthor} this issue requires more information for the team to be able to help. In case this information is available, please add it and re-open the Issue.' + - closeIssue + eventResponderTasks: + - if: + - payloadType: Issues + - not: isAssignedToSomeone + - isAction: + action: Opened + - not: + hasLabel: + label: needs-investigation + then: + - addLabel: + label: needs-investigation + description: + - if: + - payloadType: Pull_Request + - hasLabel: + label: auto-merge + then: + - enableAutoMerge: + mergeMethod: Squash + description: + - if: + - payloadType: Pull_Request + - labelRemoved: + label: auto-merge + then: + - disableAutoMerge + description: +onFailure: +onSuccess: diff --git a/Directory.Build.props b/Directory.Build.props index eb4940bf4b..b9171d6307 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,13 +1,13 @@ - 3.35.0 - 3.35.0 + 3.35.2 + 3.35.2 preview - 3.31.2 + 3.31.3 2.0.2 2.0.2 preview - 1.0.0-preview05 + 1.0.0-preview06 1.1.0-preview3 10.0 $([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../')) diff --git a/Microsoft.Azure.Cosmos.Encryption.Custom/changelog.md b/Microsoft.Azure.Cosmos.Encryption.Custom/changelog.md index 58fcf1d790..a96c9c325b 100644 --- a/Microsoft.Azure.Cosmos.Encryption.Custom/changelog.md +++ b/Microsoft.Azure.Cosmos.Encryption.Custom/changelog.md @@ -3,6 +3,11 @@ Preview features are treated as a separate branch and will not be included in th The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +### [1.0.0-preview06](https://www.nuget.org/packages/Microsoft.Azure.Cosmos.Encryption.Custom/1.0.0-preview06) - 2023-06-28 + +#### Fixes +- [#3956](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3956) Updates package reference Microsoft.Azure.Cosmos to version 3.35.1-preview. + ### [1.0.0-preview05](https://www.nuget.org/packages/Microsoft.Azure.Cosmos.Encryption.Custom/1.0.0-preview05) - 2023-04-27 #### Fixes diff --git a/Microsoft.Azure.Cosmos.Encryption.Custom/src/Microsoft.Azure.Cosmos.Encryption.Custom.csproj b/Microsoft.Azure.Cosmos.Encryption.Custom/src/Microsoft.Azure.Cosmos.Encryption.Custom.csproj index 09b92aa37e..a9f729c9ab 100644 --- a/Microsoft.Azure.Cosmos.Encryption.Custom/src/Microsoft.Azure.Cosmos.Encryption.Custom.csproj +++ b/Microsoft.Azure.Cosmos.Encryption.Custom/src/Microsoft.Azure.Cosmos.Encryption.Custom.csproj @@ -27,7 +27,7 @@ - + diff --git a/Microsoft.Azure.Cosmos.Encryption.Custom/tests/EmulatorTests/Microsoft.Azure.Cosmos.Encryption.Custom.EmulatorTests.csproj b/Microsoft.Azure.Cosmos.Encryption.Custom/tests/EmulatorTests/Microsoft.Azure.Cosmos.Encryption.Custom.EmulatorTests.csproj index d8dc8fb6a7..c5dfa8db0c 100644 --- a/Microsoft.Azure.Cosmos.Encryption.Custom/tests/EmulatorTests/Microsoft.Azure.Cosmos.Encryption.Custom.EmulatorTests.csproj +++ b/Microsoft.Azure.Cosmos.Encryption.Custom/tests/EmulatorTests/Microsoft.Azure.Cosmos.Encryption.Custom.EmulatorTests.csproj @@ -26,7 +26,6 @@ - diff --git a/Microsoft.Azure.Cosmos.Encryption/tests/EmulatorTests/Microsoft.Azure.Cosmos.Encryption.EmulatorTests.csproj b/Microsoft.Azure.Cosmos.Encryption/tests/EmulatorTests/Microsoft.Azure.Cosmos.Encryption.EmulatorTests.csproj index 458cfb6849..0b7c24dbdd 100644 --- a/Microsoft.Azure.Cosmos.Encryption/tests/EmulatorTests/Microsoft.Azure.Cosmos.Encryption.EmulatorTests.csproj +++ b/Microsoft.Azure.Cosmos.Encryption/tests/EmulatorTests/Microsoft.Azure.Cosmos.Encryption.EmulatorTests.csproj @@ -26,7 +26,6 @@ - diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkOperationType.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkOperationType.cs new file mode 100644 index 0000000000..b18fb1c318 --- /dev/null +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkOperationType.cs @@ -0,0 +1,16 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace CosmosBenchmark +{ + /// + /// Benchmark operation type. + /// + public enum BenchmarkOperationType + { + Read, + Insert, + Query + } +} diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/CosmosDiagnosticsLogger.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/CosmosDiagnosticsLogger.cs index 9a399c5dc8..e08b2dd6da 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/CosmosDiagnosticsLogger.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/CosmosDiagnosticsLogger.cs @@ -6,11 +6,8 @@ namespace CosmosBenchmark { using System; using System.Collections.Concurrent; - using System.Collections.Generic; using System.Diagnostics; using System.Linq; - using System.Runtime.CompilerServices; - using System.Text; using Microsoft.Azure.Cosmos; using Newtonsoft.Json.Linq; diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/IBenchmarkOperation.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/IBenchmarkOperation.cs index d6933fcce5..3580a8a6fc 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/IBenchmarkOperation.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/IBenchmarkOperation.cs @@ -6,10 +6,26 @@ namespace CosmosBenchmark { using System.Threading.Tasks; + /// + /// Represents the Benchmark operation. + /// internal interface IBenchmarkOperation { - Task PrepareAsync(); + /// + /// Benchmark operation type. + /// + BenchmarkOperationType OperationType { get; } + /// + /// Executes Benchmark operation once asynchronously. + /// + /// The operation result wrapped by task. Task ExecuteOnceAsync(); + + /// + /// Prepares Benchmark operation asynchronously. + /// + /// The task related to method's work. + Task PrepareAsync(); } } diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/InsertV2BenchmarkOperation.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/InsertV2BenchmarkOperation.cs index 744bb9f577..124c841085 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/InsertV2BenchmarkOperation.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/InsertV2BenchmarkOperation.cs @@ -38,6 +38,8 @@ public InsertV2BenchmarkOperation( this.sampleJObject = JsonHelper.Deserialize>(sampleJson); } + public BenchmarkOperationType OperationType => BenchmarkOperationType.Insert; + public async Task ExecuteOnceAsync() { ResourceResponse itemResponse = await this.documentClient.CreateDocumentAsync( diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/QueryStreamSinglePkV2BenchmarkOperation.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/QueryStreamSinglePkV2BenchmarkOperation.cs index 1bf3bf245e..b0f071f6de 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/QueryStreamSinglePkV2BenchmarkOperation.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/QueryStreamSinglePkV2BenchmarkOperation.cs @@ -47,6 +47,8 @@ public QueryStreamSinglePkV2BenchmarkOperation( this.containerUri = UriFactory.CreateDocumentCollectionUri(this.databsaeName, this.containerName); } + public BenchmarkOperationType OperationType => BenchmarkOperationType.Query; + public async Task ExecuteOnceAsync() { IDocumentQuery query = this.documentClient.CreateDocumentQuery( diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/QueryTSinglePkV2BenchmarkOperation.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/QueryTSinglePkV2BenchmarkOperation.cs index 7d58447859..cd50a789b8 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/QueryTSinglePkV2BenchmarkOperation.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/QueryTSinglePkV2BenchmarkOperation.cs @@ -46,6 +46,8 @@ public QueryTSinglePkV2BenchmarkOperation( this.sampleJObject[this.partitionKeyPath] = this.executionItemPartitionKey; } + public BenchmarkOperationType OperationType => BenchmarkOperationType.Query; + public async Task ExecuteOnceAsync() { IDocumentQuery> query = this.documentClient.CreateDocumentQuery>( @@ -107,7 +109,7 @@ public async Task PrepareAsync() new RequestOptions() { PartitionKey = new PartitionKey(this.executionItemPartitionKey) }); if (itemResponse.StatusCode != HttpStatusCode.Created) { - throw new Exception($"Create failed with statuscode: {itemResponse.StatusCode}"); + throw new Exception($"Create failed with status code: {itemResponse.StatusCode}"); } this.initialized = true; diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/ReadFeedStreamV2BenchmarkOperation.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/ReadFeedStreamV2BenchmarkOperation.cs index 379cd363e6..0a9b9e3d7f 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/ReadFeedStreamV2BenchmarkOperation.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/ReadFeedStreamV2BenchmarkOperation.cs @@ -40,6 +40,8 @@ public ReadFeedStreamV2BenchmarkOperation( this.sampleJObject = JsonHelper.Deserialize>(sampleJson); } + public BenchmarkOperationType OperationType => BenchmarkOperationType.Read; + public async Task ExecuteOnceAsync() { Uri containerUri = UriFactory.CreateDocumentCollectionUri(this.databsaeName, this.containerName); @@ -75,7 +77,7 @@ public async Task PrepareAsync() new RequestOptions() { PartitionKey = new PartitionKey(this.nextExecutionItemPartitionKey) }); if (itemResponse.StatusCode != HttpStatusCode.Created) { - throw new Exception($"Create failed with statuscode: {itemResponse.StatusCode}"); + throw new Exception($"Create failed with status code: {itemResponse.StatusCode}"); } } } diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/ReadNotExistsV2BenchmarkOperation.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/ReadNotExistsV2BenchmarkOperation.cs index f5e8f94c68..1d8b99449e 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/ReadNotExistsV2BenchmarkOperation.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/ReadNotExistsV2BenchmarkOperation.cs @@ -22,6 +22,8 @@ internal class ReadNotExistsV2BenchmarkOperation : IBenchmarkOperation private readonly DocumentClient documentClient; + public BenchmarkOperationType OperationType => BenchmarkOperationType.Read; + public ReadNotExistsV2BenchmarkOperation( DocumentClient documentClient, string dbName, @@ -52,7 +54,7 @@ public async Task ExecuteOnceAsync() { if (dce.StatusCode != HttpStatusCode.NotFound) { - throw new Exception($"ReadItem failed wth {dce?.StatusCode} {dce?.ToString()}"); + throw new Exception($"ReadItem failed with {dce?.StatusCode} {dce?.ToString()}"); } return new OperationResult() diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/ReadStreamExistsV2BenchmarkOperation.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/ReadStreamExistsV2BenchmarkOperation.cs index 7afd4cdf71..c7419db811 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/ReadStreamExistsV2BenchmarkOperation.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/ReadStreamExistsV2BenchmarkOperation.cs @@ -25,6 +25,8 @@ internal class ReadStreamExistsV2BenchmarkOperation : IBenchmarkOperation private readonly DocumentClient documentClient; + public BenchmarkOperationType OperationType => BenchmarkOperationType.Read; + public ReadStreamExistsV2BenchmarkOperation( DocumentClient documentClient, string dbName, @@ -84,7 +86,7 @@ public async Task PrepareAsync() if (itemResponse.StatusCode != HttpStatusCode.Created) { - throw new Exception($"Create failed with statuscode: {itemResponse.StatusCode}"); + throw new Exception($"Create failed with status code: {itemResponse.StatusCode}"); } } } diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/ReadTExistsV2BenchmarkOperation.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/ReadTExistsV2BenchmarkOperation.cs index 061183c575..7e161f8ffc 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/ReadTExistsV2BenchmarkOperation.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/ReadTExistsV2BenchmarkOperation.cs @@ -26,6 +26,8 @@ internal class ReadTExistsV2BenchmarkOperation : IBenchmarkOperation private readonly DocumentClient documentClient; + public BenchmarkOperationType OperationType => BenchmarkOperationType.Read; + public ReadTExistsV2BenchmarkOperation( DocumentClient documentClient, string dbName, @@ -85,7 +87,7 @@ public async Task PrepareAsync() if (itemResponse.StatusCode != HttpStatusCode.Created) { - throw new Exception($"Create failed with statuscode: {itemResponse.StatusCode}"); + throw new Exception($"Create failed with status code: {itemResponse.StatusCode}"); } } } diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/InsertV3BenchmarkOperation.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/InsertV3BenchmarkOperation.cs index 1ab5861242..504148bfda 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/InsertV3BenchmarkOperation.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/InsertV3BenchmarkOperation.cs @@ -37,6 +37,8 @@ public InsertV3BenchmarkOperation( this.sampleJObject = JsonHelper.Deserialize>(sampleJson); } + public BenchmarkOperationType OperationType => BenchmarkOperationType.Insert; + public async Task ExecuteOnceAsync() { using (MemoryStream input = JsonHelper.ToStream(this.sampleJObject)) diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/QueryTV3BenchmarkOperation.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/QueryTV3BenchmarkOperation.cs index bdb0b38cf8..f78153034b 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/QueryTV3BenchmarkOperation.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/QueryTV3BenchmarkOperation.cs @@ -31,6 +31,8 @@ internal abstract class QueryTV3BenchmarkOperation : IBenchmarkOperation public abstract bool IsPaginationEnabled { get; } public abstract bool IsQueryStream { get; } + public BenchmarkOperationType OperationType => BenchmarkOperationType.Query; + protected string executionItemId = null; protected string executionPartitionKey = null; @@ -291,7 +293,7 @@ public virtual async Task PrepareAsync() if (itemResponse.StatusCode != HttpStatusCode.Created) { - throw new Exception($"Create failed with statuscode: {itemResponse.StatusCode}"); + throw new Exception($"Create failed with status code: {itemResponse.StatusCode}"); } } } diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/ReadFeedStreamV3BenchmarkOperation.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/ReadFeedStreamV3BenchmarkOperation.cs index 99789040b0..3b9c5cd800 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/ReadFeedStreamV3BenchmarkOperation.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/ReadFeedStreamV3BenchmarkOperation.cs @@ -39,6 +39,8 @@ public ReadFeedStreamV3BenchmarkOperation( this.sampleJObject = JsonHelper.Deserialize>(sampleJson); } + public BenchmarkOperationType OperationType => BenchmarkOperationType.Read; + public async Task ExecuteOnceAsync() { FeedIterator feedIterator = this.container @@ -50,7 +52,7 @@ public async Task ExecuteOnceAsync() ResponseMessage feedResponse = await feedIterator.ReadNextAsync(); if (feedResponse.StatusCode != HttpStatusCode.OK) { - throw new Exception($"ReadItem failed wth {feedResponse.StatusCode}"); + throw new Exception($"ReadItem failed with {feedResponse.StatusCode}"); } return new OperationResult() @@ -84,7 +86,7 @@ public async Task PrepareAsync() if (itemResponse.StatusCode != HttpStatusCode.Created) { - throw new Exception($"Create failed with statuscode: {itemResponse.StatusCode}"); + throw new Exception($"Create failed with status code: {itemResponse.StatusCode}"); } } } diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/ReadNotExistsV3BenchmarkOperation.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/ReadNotExistsV3BenchmarkOperation.cs index c97d1af4b7..1804ea9852 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/ReadNotExistsV3BenchmarkOperation.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/ReadNotExistsV3BenchmarkOperation.cs @@ -32,6 +32,8 @@ public ReadNotExistsV3BenchmarkOperation( this.container = cosmosClient.GetContainer(this.databsaeName, this.containerName); } + public BenchmarkOperationType OperationType => BenchmarkOperationType.Read; + public async Task ExecuteOnceAsync() { using (ResponseMessage itemResponse = await this.container.ReadItemStreamAsync( @@ -40,7 +42,7 @@ public async Task ExecuteOnceAsync() { if (itemResponse.StatusCode != HttpStatusCode.NotFound) { - throw new Exception($"ReadItem failed wth {itemResponse.StatusCode}"); + throw new Exception($"ReadItem failed with {itemResponse.StatusCode}"); } return new OperationResult() diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/ReadStreamExistsV3BenchmarkOperation.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/ReadStreamExistsV3BenchmarkOperation.cs index aba0a4ea7a..fabe8f20bd 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/ReadStreamExistsV3BenchmarkOperation.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/ReadStreamExistsV3BenchmarkOperation.cs @@ -39,6 +39,8 @@ public ReadStreamExistsV3BenchmarkOperation( this.sampleJObject = JsonHelper.Deserialize>(sampleJson); } + public BenchmarkOperationType OperationType => BenchmarkOperationType.Read; + public async Task ExecuteOnceAsync() { using (ResponseMessage itemResponse = await this.container.ReadItemStreamAsync( diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/ReadStreamExistsWithDiagnosticsV3BenchmarkOperation.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/ReadStreamExistsWithDiagnosticsV3BenchmarkOperation.cs index ebdc14924b..74f2ac67f7 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/ReadStreamExistsWithDiagnosticsV3BenchmarkOperation.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/ReadStreamExistsWithDiagnosticsV3BenchmarkOperation.cs @@ -39,6 +39,8 @@ public ReadStreamExistsWithDiagnosticsV3BenchmarkOperation( this.sampleJObject = JsonHelper.Deserialize>(sampleJson); } + public BenchmarkOperationType OperationType => BenchmarkOperationType.Read; + public async Task ExecuteOnceAsync() { using (ResponseMessage itemResponse = await this.container.ReadItemStreamAsync( @@ -47,7 +49,7 @@ public async Task ExecuteOnceAsync() { if (itemResponse.StatusCode != HttpStatusCode.OK) { - throw new Exception($"ReadItem failed wth {itemResponse.StatusCode}"); + throw new Exception($"ReadItem failed with {itemResponse.StatusCode}"); } string diagnostics = itemResponse.Diagnostics.ToString(); diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/ReadTExistsV3BenchmarkOperation.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/ReadTExistsV3BenchmarkOperation.cs index 7fd40397be..bb6295356e 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/ReadTExistsV3BenchmarkOperation.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/ReadTExistsV3BenchmarkOperation.cs @@ -10,7 +10,6 @@ namespace CosmosBenchmark using System.Net; using System.Threading.Tasks; using Microsoft.Azure.Cosmos; - using Newtonsoft.Json.Linq; internal class ReadTExistsV3BenchmarkOperation : IBenchmarkOperation { @@ -40,6 +39,8 @@ public ReadTExistsV3BenchmarkOperation( this.sampleJObject = JsonHelper.Deserialize>(sampleJson); } + public BenchmarkOperationType OperationType => BenchmarkOperationType.Read; + public async Task ExecuteOnceAsync() { ItemResponse> itemResponse = await this.container.ReadItemAsync>( @@ -47,7 +48,7 @@ public async Task ExecuteOnceAsync() new PartitionKey(this.nextExecutionItemPartitionKey)); if (itemResponse.StatusCode != HttpStatusCode.OK) { - throw new Exception($"ReadItem failed wth {itemResponse.StatusCode}"); + throw new Exception($"ReadItem failed with {itemResponse.StatusCode}"); } return new OperationResult() @@ -81,7 +82,7 @@ public async Task PrepareAsync() if (itemResponse.StatusCode != HttpStatusCode.Created) { - throw new Exception($"Create failed with statuscode: {itemResponse.StatusCode}"); + throw new Exception($"Create failed with status code: {itemResponse.StatusCode}"); } } } diff --git a/Microsoft.Azure.Cosmos/contracts/API_3.35.1-preview.txt b/Microsoft.Azure.Cosmos/contracts/API_3.35.1-preview.txt new file mode 100644 index 0000000000..6c989053fd --- /dev/null +++ b/Microsoft.Azure.Cosmos/contracts/API_3.35.1-preview.txt @@ -0,0 +1,1563 @@ +namespace Microsoft.Azure.Cosmos +{ + public class AccountConsistency + { + public AccountConsistency(); + public ConsistencyLevel DefaultConsistencyLevel { get; } + public int MaxStalenessIntervalInSeconds { get; } + public int MaxStalenessPrefix { get; } + } + public class AccountProperties + { + public AccountConsistency Consistency { get; } + public string ETag { get; } + public string Id { get; } + public IEnumerable ReadableRegions { get; } + public IEnumerable WritableRegions { get; } + } + public class AccountRegion + { + public AccountRegion(); + public string Endpoint { get; } + public string Name { get; } + } + public sealed class BoundingBoxProperties + { + public BoundingBoxProperties(); + public double Xmax { get; set; } + public double Xmin { get; set; } + public double Ymax { get; set; } + public double Ymin { get; set; } + } + public abstract class ChangeFeedEstimator + { + protected ChangeFeedEstimator(); + public abstract FeedIterator GetCurrentStateIterator(ChangeFeedEstimatorRequestOptions changeFeedEstimatorRequestOptions=null); + } + public sealed class ChangeFeedEstimatorRequestOptions + { + public ChangeFeedEstimatorRequestOptions(); + public Nullable MaxItemCount { get; set; } + } + public class ChangeFeedItemChange + { + public ChangeFeedItemChange(); + public T Current { get; set; } + public ChangeFeedMetadata Metadata { get; set; } + public T Previous { get; set; } + } + public class ChangeFeedMetadata + { + public ChangeFeedMetadata(DateTime conflictResolutionTimestamp, long lsn, ChangeFeedOperationType operationType, long previousLsn); + public DateTime ConflictResolutionTimestamp { get; } + public bool IsTimeToLiveExpired { get; } + public long Lsn { get; } + public ChangeFeedOperationType OperationType { get; } + public long PreviousLsn { get; } + } + public abstract class ChangeFeedMode + { + public static ChangeFeedMode AllVersionsAndDeletes { get; } + public static ChangeFeedMode Incremental { get; } + public static ChangeFeedMode LatestVersion { get; } + } + public enum ChangeFeedOperationType + { + Create = 0, + Delete = 2, + Replace = 1, + } + public sealed class ChangeFeedPolicy + { + public ChangeFeedPolicy(); + public static TimeSpan FullFidelityNoRetention { get; } + public TimeSpan FullFidelityRetention { get; set; } + } + public abstract class ChangeFeedProcessor + { + protected ChangeFeedProcessor(); + public abstract Task StartAsync(); + public abstract Task StopAsync(); + } + public class ChangeFeedProcessorBuilder + { + public ChangeFeedProcessor Build(); + public ChangeFeedProcessorBuilder WithErrorNotification(Container.ChangeFeedMonitorErrorDelegate errorDelegate); + public ChangeFeedProcessorBuilder WithInstanceName(string instanceName); + public ChangeFeedProcessorBuilder WithLeaseAcquireNotification(Container.ChangeFeedMonitorLeaseAcquireDelegate acquireDelegate); + public ChangeFeedProcessorBuilder WithLeaseConfiguration(Nullable acquireInterval=default(Nullable), Nullable expirationInterval=default(Nullable), Nullable renewInterval=default(Nullable)); + public ChangeFeedProcessorBuilder WithLeaseContainer(Container leaseContainer); + public ChangeFeedProcessorBuilder WithLeaseReleaseNotification(Container.ChangeFeedMonitorLeaseReleaseDelegate releaseDelegate); + public ChangeFeedProcessorBuilder WithMaxItems(int maxItemCount); + public ChangeFeedProcessorBuilder WithPollInterval(TimeSpan pollInterval); + public ChangeFeedProcessorBuilder WithStartTime(DateTime startTime); + } + public abstract class ChangeFeedProcessorContext + { + protected ChangeFeedProcessorContext(); + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract Headers Headers { get; } + public abstract string LeaseToken { get; } + } + public sealed class ChangeFeedProcessorState + { + public ChangeFeedProcessorState(string leaseToken, long estimatedLag, string instanceName); + public long EstimatedLag { get; } + public string InstanceName { get; } + public string LeaseToken { get; } + } + public class ChangeFeedProcessorUserException : Exception + { + public ChangeFeedProcessorUserException(Exception originalException, ChangeFeedProcessorContext context); + protected ChangeFeedProcessorUserException(SerializationInfo info, StreamingContext context); + public ChangeFeedProcessorContext ChangeFeedProcessorContext { get; } + public override void GetObjectData(SerializationInfo info, StreamingContext context); + } + public sealed class ChangeFeedRequestOptions : RequestOptions + { + public ChangeFeedRequestOptions(); + public new string IfMatchEtag { get; set; } + public new string IfNoneMatchEtag { get; set; } + public Nullable PageSizeHint { get; set; } + } + public abstract class ChangeFeedStartFrom + { + public static ChangeFeedStartFrom Beginning(); + public static ChangeFeedStartFrom Beginning(FeedRange feedRange); + public static ChangeFeedStartFrom ContinuationToken(string continuationToken); + public static ChangeFeedStartFrom Now(); + public static ChangeFeedStartFrom Now(FeedRange feedRange); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc, FeedRange feedRange); + } + public sealed class ClientEncryptionIncludedPath + { + public ClientEncryptionIncludedPath(); + public string ClientEncryptionKeyId { get; set; } + public string EncryptionAlgorithm { get; set; } + public string EncryptionType { get; set; } + public string Path { get; set; } + } + public abstract class ClientEncryptionKey + { + protected ClientEncryptionKey(); + public abstract string Id { get; } + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class ClientEncryptionKeyProperties : IEquatable + { + protected ClientEncryptionKeyProperties(); + public ClientEncryptionKeyProperties(string id, string encryptionAlgorithm, byte[] wrappedDataEncryptionKey, EncryptionKeyWrapMetadata encryptionKeyWrapMetadata); + public Nullable CreatedTime { get; } + public string EncryptionAlgorithm { get; } + public EncryptionKeyWrapMetadata EncryptionKeyWrapMetadata { get; } + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public virtual string SelfLink { get; } + public byte[] WrappedDataEncryptionKey { get; } + public bool Equals(ClientEncryptionKeyProperties other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public class ClientEncryptionKeyResponse : Response + { + protected ClientEncryptionKeyResponse(); + public override string ActivityId { get; } + public virtual ClientEncryptionKey ClientEncryptionKey { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ClientEncryptionKeyProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ClientEncryptionKey (ClientEncryptionKeyResponse response); + } + public sealed class ClientEncryptionPolicy + { + public ClientEncryptionPolicy(IEnumerable includedPaths); + public ClientEncryptionPolicy(IEnumerable includedPaths, int policyFormatVersion); + public IEnumerable IncludedPaths { get; } + public int PolicyFormatVersion { get; } + } + public sealed class CompositePath + { + public CompositePath(); + public CompositePathSortOrder Order { get; set; } + public string Path { get; set; } + } + public enum CompositePathSortOrder + { + Ascending = 0, + Descending = 1, + } + public sealed class ComputedProperty + { + public ComputedProperty(); + public string Name { get; set; } + public string Query { get; set; } + } + public class ConflictProperties + { + public ConflictProperties(); + public string Id { get; } + public OperationKind OperationKind { get; } + public string SelfLink { get; } + } + public enum ConflictResolutionMode + { + Custom = 1, + LastWriterWins = 0, + } + public class ConflictResolutionPolicy + { + public ConflictResolutionPolicy(); + public ConflictResolutionMode Mode { get; set; } + public string ResolutionPath { get; set; } + public string ResolutionProcedure { get; set; } + } + public abstract class Conflicts + { + protected Conflicts(); + public abstract Task DeleteAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetConflictQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract T ReadConflictContent(ConflictProperties conflict); + public abstract Task> ReadCurrentAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum ConnectionMode + { + Direct = 1, + Gateway = 0, + } + public enum ConsistencyLevel + { + BoundedStaleness = 1, + ConsistentPrefix = 4, + Eventual = 3, + Session = 2, + Strong = 0, + } + public abstract class Container + { + protected Container(); + public abstract Conflicts Conflicts { get; } + public abstract Database Database { get; } + public abstract string Id { get; } + public abstract Scripts Scripts { get; } + public abstract Task> CreateItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch CreateTransactionalBatch(PartitionKey partitionKey); + public abstract Task DeleteAllItemsByPartitionKeyStreamAsync(PartitionKey partitionKey, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> DeleteItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ChangeFeedEstimator GetChangeFeedEstimator(string processorName, Container leaseContainer); + public abstract ChangeFeedProcessorBuilder GetChangeFeedEstimatorBuilder(string processorName, Container.ChangesEstimationHandler estimationDelegate, Nullable estimationPeriod=default(Nullable)); + public abstract FeedIterator GetChangeFeedIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedStreamHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedStreamHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangesHandler onChangesDelegate); + public abstract FeedIterator GetChangeFeedStreamIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract Task> GetFeedRangesAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract IOrderedQueryable GetItemLinqQueryable(bool allowSynchronousQueryExecution=false, string continuationToken=null, QueryRequestOptions requestOptions=null, CosmosLinqSerializerOptions linqSerializerOptions=null); + public abstract FeedIterator GetItemQueryIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task> GetPartitionKeyRangesAsync(FeedRange feedRange, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> PatchItemAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task PatchItemStreamAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadManyItemsAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadManyItemsStreamAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerStreamAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReplaceItemAsync(T item, string id, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceItemStreamAsync(Stream streamPayload, string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> UpsertItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public delegate Task ChangeFeedHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, IReadOnlyCollection changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangeFeedHandler(ChangeFeedProcessorContext context, IReadOnlyCollection changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedMonitorErrorDelegate(string leaseToken, Exception exception); + public delegate Task ChangeFeedMonitorLeaseAcquireDelegate(string leaseToken); + public delegate Task ChangeFeedMonitorLeaseReleaseDelegate(string leaseToken); + public delegate Task ChangeFeedStreamHandler(ChangeFeedProcessorContext context, Stream changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedStreamHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, Stream changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangesEstimationHandler(long estimatedPendingChanges, CancellationToken cancellationToken); + public delegate Task ChangesHandler(IReadOnlyCollection changes, CancellationToken cancellationToken); + } + public class ContainerProperties + { + public ContainerProperties(); + public ContainerProperties(string id, IReadOnlyList partitionKeyPaths); + public ContainerProperties(string id, string partitionKeyPath); + public Nullable AnalyticalStoreTimeToLiveInSeconds { get; set; } + public ChangeFeedPolicy ChangeFeedPolicy { get; set; } + public ClientEncryptionPolicy ClientEncryptionPolicy { get; set; } + public Collection ComputedProperties { get; set; } + public ConflictResolutionPolicy ConflictResolutionPolicy { get; set; } + public Nullable DefaultTimeToLive { get; set; } + public string ETag { get; } + public GeospatialConfig GeospatialConfig { get; set; } + public string Id { get; set; } + public IndexingPolicy IndexingPolicy { get; set; } + public Nullable LastModified { get; } + public Nullable PartitionKeyDefinitionVersion { get; set; } + public string PartitionKeyPath { get; set; } + public IReadOnlyList PartitionKeyPaths { get; set; } + public string SelfLink { get; } + public string TimeToLivePropertyPath { get; set; } + public UniqueKeyPolicy UniqueKeyPolicy { get; set; } + } + public class ContainerRequestOptions : RequestOptions + { + public ContainerRequestOptions(); + public bool PopulateQuotaInfo { get; set; } + } + public class ContainerResponse : Response + { + protected ContainerResponse(); + public override string ActivityId { get; } + public virtual Container Container { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ContainerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Container (ContainerResponse response); + } + public class CosmosClient : IDisposable + { + protected CosmosClient(); + public CosmosClient(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, TokenCredential tokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string connectionString, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, string authKeyOrResourceToken, CosmosClientOptions clientOptions=null); + public virtual CosmosClientOptions ClientOptions { get; } + public virtual Uri Endpoint { get; } + public virtual CosmosResponseFactory ResponseFactory { get; } + public static Task CreateAndInitializeAsync(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, TokenCredential tokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string connectionString, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, string authKeyOrResourceToken, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseStreamAsync(DatabaseProperties databaseProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual Container GetContainer(string databaseId, string containerId); + public virtual Database GetDatabase(string id); + public virtual FeedIterator GetDatabaseQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual Task ReadAccountAsync(); + } + public class CosmosClientOptions + { + public CosmosClientOptions(); + public bool AllowBulkExecution { get; set; } + public string ApplicationName { get; set; } + public IReadOnlyList ApplicationPreferredRegions { get; set; } + public string ApplicationRegion { get; set; } + public ConnectionMode ConnectionMode { get; set; } + public Nullable ConsistencyLevel { get; set; } + public Collection CustomHandlers { get; } + public Nullable EnableContentResponseOnWrite { get; set; } + public bool EnableTcpConnectionEndpointRediscovery { get; set; } + public int GatewayModeMaxConnectionLimit { get; set; } + public Func HttpClientFactory { get; set; } + public Nullable IdleTcpConnectionTimeout { get; set; } + public bool IsDistributedTracingEnabled { get; set; } + public bool LimitToEndpoint { get; set; } + public Nullable MaxRequestsPerTcpConnection { get; set; } + public Nullable MaxRetryAttemptsOnRateLimitedRequests { get; set; } + public Nullable MaxRetryWaitTimeOnRateLimitedRequests { get; set; } + public Nullable MaxTcpConnectionsPerEndpoint { get; set; } + public Nullable OpenTcpConnectionTimeout { get; set; } + public Nullable PortReuseMode { get; set; } + public TimeSpan RequestTimeout { get; set; } + public CosmosSerializer Serializer { get; set; } + public CosmosSerializationOptions SerializerOptions { get; set; } + public Func ServerCertificateCustomValidationCallback { get; set; } + public Nullable TokenCredentialBackgroundRefreshInterval { get; set; } + public IWebProxy WebProxy { get; set; } + } + public abstract class CosmosDiagnostics + { + protected CosmosDiagnostics(); + public virtual TimeSpan GetClientElapsedTime(); + public abstract IReadOnlyList> GetContactedRegions(); + public virtual int GetFailedRequestCount(); + public virtual Nullable GetStartTimeUtc(); + public abstract override string ToString(); + } + public class CosmosException : Exception + { + public CosmosException(string message, HttpStatusCode statusCode, int subStatusCode, string activityId, double requestCharge); + public virtual string ActivityId { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual Headers Headers { get; } + public override string Message { get; } + public virtual double RequestCharge { get; } + public virtual string ResponseBody { get; } + public virtual Nullable RetryAfter { get; } + public override string StackTrace { get; } + public virtual HttpStatusCode StatusCode { get; } + public virtual int SubStatusCode { get; } + public override string ToString(); + public virtual bool TryGetHeader(string headerName, out string value); + } + public sealed class CosmosLinqSerializerOptions + { + public CosmosLinqSerializerOptions(); + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public class CosmosOperationCanceledException : OperationCanceledException + { + public CosmosOperationCanceledException(OperationCanceledException originalException, CosmosDiagnostics diagnostics); + protected CosmosOperationCanceledException(SerializationInfo info, StreamingContext context); + public override IDictionary Data { get; } + public CosmosDiagnostics Diagnostics { get; } + public override string HelpLink { get; set; } + public override string Message { get; } + public override string Source { get; set; } + public override string StackTrace { get; } + public override Exception GetBaseException(); + public override void GetObjectData(SerializationInfo info, StreamingContext context); + public override string ToString(); + } + public enum CosmosPropertyNamingPolicy + { + CamelCase = 1, + Default = 0, + } + public abstract class CosmosResponseFactory + { + protected CosmosResponseFactory(); + public abstract FeedResponse CreateItemFeedResponse(ResponseMessage responseMessage); + public abstract ItemResponse CreateItemResponse(ResponseMessage responseMessage); + public abstract StoredProcedureExecuteResponse CreateStoredProcedureExecuteResponse(ResponseMessage responseMessage); + } + public sealed class CosmosSerializationOptions + { + public CosmosSerializationOptions(); + public bool IgnoreNullValues { get; set; } + public bool Indented { get; set; } + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public abstract class CosmosSerializer + { + protected CosmosSerializer(); + public abstract T FromStream(Stream stream); + public abstract Stream ToStream(T input); + } + public abstract class Database + { + protected Database(); + public abstract CosmosClient Client { get; } + public abstract string Id { get; } + public abstract Task CreateClientEncryptionKeyAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ContainerBuilder DefineContainer(string name, string partitionKeyPath); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ClientEncryptionKey GetClientEncryptionKey(string id); + public abstract FeedIterator GetClientEncryptionKeyQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Container GetContainer(string id); + public abstract FeedIterator GetContainerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract User GetUser(string id); + public abstract FeedIterator GetUserQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class DatabaseProperties + { + public DatabaseProperties(); + public DatabaseProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class DatabaseResponse : Response + { + protected DatabaseResponse(); + public override string ActivityId { get; } + public virtual Database Database { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override DatabaseProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Database (DatabaseResponse response); + } + public enum DataType + { + LineString = 3, + MultiPolygon = 5, + Number = 0, + Point = 2, + Polygon = 4, + String = 1, + } + public class DedicatedGatewayRequestOptions + { + public DedicatedGatewayRequestOptions(); + public Nullable BypassIntegratedCache { get; set; } + public Nullable MaxIntegratedCacheStaleness { get; set; } + } + public class EncryptionKeyWrapMetadata : IEquatable + { + public EncryptionKeyWrapMetadata(EncryptionKeyWrapMetadata source); + public EncryptionKeyWrapMetadata(string type, string name, string value, string algorithm); + public string Algorithm { get; } + public string Name { get; } + public string Type { get; } + public string Value { get; } + public bool Equals(EncryptionKeyWrapMetadata other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class ExcludedPath + { + public ExcludedPath(); + public string Path { get; set; } + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task> ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedRange + { + protected FeedRange(); + public static FeedRange FromJsonString(string toStringValue); + public static FeedRange FromPartitionKey(PartitionKey partitionKey); + public abstract string ToJsonString(); + } + public abstract class FeedResponse : IEnumerable, IEnumerable + { + protected FeedResponse(); + public override string ActivityId { get; } + public abstract string ContinuationToken { get; } + public abstract int Count { get; } + public override string ETag { get; } + public abstract string IndexMetrics { get; } + public override double RequestCharge { get; } + public abstract IEnumerator GetEnumerator(); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public sealed class GeospatialConfig + { + public GeospatialConfig(); + public GeospatialConfig(GeospatialType geospatialType); + public GeospatialType GeospatialType { get; set; } + } + public enum GeospatialType + { + Geography = 0, + Geometry = 1, + } + public class Headers : IEnumerable + { + public Headers(); + public virtual string ActivityId { get; } + public virtual string ContentLength { get; set; } + public virtual string ContentType { get; } + public virtual string ContinuationToken { get; } + public virtual string ETag { get; } + public virtual string this[string headerName] { get; set; } + public virtual string Location { get; } + public virtual double RequestCharge { get; } + public virtual string Session { get; } + public virtual void Add(string headerName, IEnumerable values); + public virtual void Add(string headerName, string value); + public virtual string[] AllKeys(); + public virtual string Get(string headerName); + public virtual IEnumerator GetEnumerator(); + public virtual T GetHeaderValue(string headerName); + public virtual string GetValueOrDefault(string headerName); + public virtual void Remove(string headerName); + public virtual void Set(string headerName, string value); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + public virtual bool TryGetValue(string headerName, out string value); + } + public sealed class IncludedPath + { + public IncludedPath(); + public string Path { get; set; } + } + public enum IndexingDirective + { + Default = 0, + Exclude = 2, + Include = 1, + } + public enum IndexingMode + { + Consistent = 0, + Lazy = 1, + None = 2, + } + public sealed class IndexingPolicy + { + public IndexingPolicy(); + public bool Automatic { get; set; } + public Collection> CompositeIndexes { get; } + public Collection ExcludedPaths { get; } + public Collection IncludedPaths { get; } + public IndexingMode IndexingMode { get; set; } + public Collection SpatialIndexes { get; } + } + public enum IndexKind + { + Hash = 0, + Range = 1, + Spatial = 2, + } + public class ItemRequestOptions : RequestOptions + { + public ItemRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + public IEnumerable PostTriggers { get; set; } + public IEnumerable PreTriggers { get; set; } + public string SessionToken { get; set; } + } + public class ItemResponse : Response + { + protected ItemResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public override HttpStatusCode StatusCode { get; } + } + public enum OperationKind + { + Create = 1, + Delete = 3, + Invalid = 0, + Read = 4, + Replace = 2, + } + public struct PartitionKey : IEquatable + { + public static readonly PartitionKey None; + public static readonly PartitionKey Null; + public static readonly string SystemKeyName; + public static readonly string SystemKeyPath; + public PartitionKey(bool partitionKeyValue); + public PartitionKey(double partitionKeyValue); + public PartitionKey(string partitionKeyValue); + public bool Equals(PartitionKey other); + public override bool Equals(object obj); + public override int GetHashCode(); + public static bool operator ==(PartitionKey left, PartitionKey right); + public static bool operator !=(PartitionKey left, PartitionKey right); + public override string ToString(); + } + public sealed class PartitionKeyBuilder + { + public PartitionKeyBuilder(); + public PartitionKeyBuilder Add(bool val); + public PartitionKeyBuilder Add(double val); + public PartitionKeyBuilder Add(string val); + public PartitionKeyBuilder AddNoneType(); + public PartitionKeyBuilder AddNullValue(); + public PartitionKey Build(); + } + public enum PartitionKeyDefinitionVersion + { + V1 = 1, + V2 = 2, + } + public sealed class PatchItemRequestOptions : ItemRequestOptions + { + public PatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public abstract class PatchOperation + { + protected PatchOperation(); + public virtual string From { get; set; } + public abstract PatchOperationType OperationType { get; } + public abstract string Path { get; } + public static PatchOperation Add(string path, T value); + public static PatchOperation Increment(string path, double value); + public static PatchOperation Increment(string path, long value); + public static PatchOperation Move(string from, string path); + public static PatchOperation Remove(string path); + public static PatchOperation Replace(string path, T value); + public static PatchOperation Set(string path, T value); + public virtual bool TrySerializeValueParameter(CosmosSerializer cosmosSerializer, out Stream valueParam); + } + public enum PatchOperationType + { + Add = 0, + Increment = 4, + Move = 5, + Remove = 1, + Replace = 2, + Set = 3, + } + public abstract class PatchOperation : PatchOperation + { + protected PatchOperation(); + public abstract T Value { get; } + } + public abstract class Permission + { + protected Permission(); + public abstract string Id { get; } + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadAsync(Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum PermissionMode : byte + { + All = (byte)2, + Read = (byte)1, + } + public class PermissionProperties + { + public PermissionProperties(string id, PermissionMode permissionMode, Container container, PartitionKey resourcePartitionKey, string itemId); + public PermissionProperties(string id, PermissionMode permissionMode, Container container, Nullable resourcePartitionKey=default(Nullable)); + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public PermissionMode PermissionMode { get; } + public Nullable ResourcePartitionKey { get; set; } + public string ResourceUri { get; } + public string SelfLink { get; } + public string Token { get; } + } + public class PermissionResponse : Response + { + protected PermissionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public virtual Permission Permission { get; } + public override double RequestCharge { get; } + public override PermissionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Permission (PermissionResponse response); + } + public enum PortReuseMode + { + PrivatePortPool = 1, + ReuseUnicastPort = 0, + } + public enum PriorityLevel + { + High = 1, + Low = 2, + } + public class QueryDefinition + { + public QueryDefinition(string query); + public string QueryText { get; } + public IReadOnlyList> GetQueryParameters(); + public QueryDefinition WithParameter(string name, object value); + public QueryDefinition WithParameterStream(string name, Stream valueStream); + } + public class QueryRequestOptions : RequestOptions + { + public QueryRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableLowPrecisionOrderBy { get; set; } + public bool EnableOptimisticDirectExecution { get; set; } + public Nullable EnableScanInQuery { get; set; } + public Nullable MaxBufferedItemCount { get; set; } + public Nullable MaxConcurrency { get; set; } + public Nullable MaxItemCount { get; set; } + public Nullable PartitionKey { get; set; } + public Nullable PopulateIndexMetrics { get; set; } + public Nullable ResponseContinuationTokenLimitInKb { get; set; } + public string SessionToken { get; set; } + } + public class ReadManyRequestOptions : RequestOptions + { + public ReadManyRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public static class Regions + { + public const string AustraliaCentral = "Australia Central"; + public const string AustraliaCentral2 = "Australia Central 2"; + public const string AustraliaEast = "Australia East"; + public const string AustraliaSoutheast = "Australia Southeast"; + public const string BrazilSouth = "Brazil South"; + public const string BrazilSoutheast = "Brazil Southeast"; + public const string CanadaCentral = "Canada Central"; + public const string CanadaEast = "Canada East"; + public const string CentralIndia = "Central India"; + public const string CentralUS = "Central US"; + public const string CentralUSEUAP = "Central US EUAP"; + public const string ChinaEast = "China East"; + public const string ChinaEast2 = "China East 2"; + public const string ChinaEast3 = "China East 3"; + public const string ChinaNorth = "China North"; + public const string ChinaNorth2 = "China North 2"; + public const string ChinaNorth3 = "China North 3"; + public const string EastAsia = "East Asia"; + public const string EastUS = "East US"; + public const string EastUS2 = "East US 2"; + public const string EastUS2EUAP = "East US 2 EUAP"; + public const string EastUSSLV = "East US SLV"; + public const string FranceCentral = "France Central"; + public const string FranceSouth = "France South"; + public const string GermanyCentral = "Germany Central"; + public const string GermanyNorth = "Germany North"; + public const string GermanyNortheast = "Germany Northeast"; + public const string GermanyWestCentral = "Germany West Central"; + public const string IsraelCentral = "Israel Central"; + public const string ItalyNorth = "Italy North"; + public const string JapanEast = "Japan East"; + public const string JapanWest = "Japan West"; + public const string JioIndiaCentral = "Jio India Central"; + public const string JioIndiaWest = "Jio India West"; + public const string KoreaCentral = "Korea Central"; + public const string KoreaSouth = "Korea South"; + public const string MalaysiaSouth = "Malaysia South"; + public const string NorthCentralUS = "North Central US"; + public const string NorthEurope = "North Europe"; + public const string NorwayEast = "Norway East"; + public const string NorwayWest = "Norway West"; + public const string PolandCentral = "Poland Central"; + public const string QatarCentral = "Qatar Central"; + public const string SouthAfricaNorth = "South Africa North"; + public const string SouthAfricaWest = "South Africa West"; + public const string SouthCentralUS = "South Central US"; + public const string SoutheastAsia = "Southeast Asia"; + public const string SouthIndia = "South India"; + public const string SwedenCentral = "Sweden Central"; + public const string SwedenSouth = "Sweden South"; + public const string SwitzerlandNorth = "Switzerland North"; + public const string SwitzerlandWest = "Switzerland West"; + public const string UAECentral = "UAE Central"; + public const string UAENorth = "UAE North"; + public const string UKSouth = "UK South"; + public const string UKWest = "UK West"; + public const string USDoDCentral = "USDoD Central"; + public const string USDoDEast = "USDoD East"; + public const string USGovArizona = "USGov Arizona"; + public const string USGovTexas = "USGov Texas"; + public const string USGovVirginia = "USGov Virginia"; + public const string USNatEast = "USNat East"; + public const string USNatWest = "USNat West"; + public const string USSecEast = "USSec East"; + public const string USSecWest = "USSec West"; + public const string WestCentralUS = "West Central US"; + public const string WestEurope = "West Europe"; + public const string WestIndia = "West India"; + public const string WestUS = "West US"; + public const string WestUS2 = "West US 2"; + public const string WestUS3 = "West US 3"; + } + public abstract class RequestHandler + { + protected RequestHandler(); + public RequestHandler InnerHandler { get; set; } + public virtual Task SendAsync(RequestMessage request, CancellationToken cancellationToken); + } + public class RequestMessage : IDisposable + { + public RequestMessage(); + public RequestMessage(HttpMethod method, Uri requestUri); + public virtual Stream Content { get; set; } + public virtual Headers Headers { get; } + public virtual HttpMethod Method { get; } + public virtual Dictionary Properties { get; } + public virtual Uri RequestUri { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + } + public class RequestOptions + { + public RequestOptions(); + public Action AddRequestHeaders { get; set; } + public string IfMatchEtag { get; set; } + public string IfNoneMatchEtag { get; set; } + public Nullable PriorityLevel { get; set; } + public IReadOnlyDictionary Properties { get; set; } + public RequestOptions ShallowCopy(); + } + public class ResponseMessage : IDisposable + { + public ResponseMessage(); + public ResponseMessage(HttpStatusCode statusCode, RequestMessage requestMessage=null, string errorMessage=null); + public virtual Stream Content { get; set; } + public virtual string ContinuationToken { get; } + public virtual CosmosDiagnostics Diagnostics { get; set; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public string IndexMetrics { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual RequestMessage RequestMessage { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual ResponseMessage EnsureSuccessStatusCode(); + } + public abstract class Response + { + protected Response(); + public abstract string ActivityId { get; } + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract string ETag { get; } + public abstract Headers Headers { get; } + public abstract double RequestCharge { get; } + public abstract T Resource { get; } + public abstract HttpStatusCode StatusCode { get; } + public static implicit operator T (Response response); + } + public sealed class SpatialPath + { + public SpatialPath(); + public BoundingBoxProperties BoundingBox { get; set; } + public string Path { get; set; } + public Collection SpatialTypes { get; } + } + public enum SpatialType + { + LineString = 1, + MultiPolygon = 3, + Point = 0, + Polygon = 2, + } + public class ThroughputProperties + { + public Nullable AutoscaleMaxThroughput { get; } + public string ETag { get; } + public Nullable LastModified { get; } + public string SelfLink { get; } + public Nullable Throughput { get; } + public static ThroughputProperties CreateAutoscaleThroughput(int autoscaleMaxThroughput); + public static ThroughputProperties CreateManualThroughput(int throughput); + } + public class ThroughputResponse : Response + { + protected ThroughputResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public Nullable IsReplacePending { get; } + public Nullable MinThroughput { get; } + public override double RequestCharge { get; } + public override ThroughputProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ThroughputProperties (ThroughputResponse response); + } + public abstract class TransactionalBatch + { + protected TransactionalBatch(); + public abstract TransactionalBatch CreateItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch CreateItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch DeleteItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract Task ExecuteAsync(TransactionalBatchRequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch PatchItem(string id, IReadOnlyList patchOperations, TransactionalBatchPatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReadItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItemStream(string id, Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItem(string id, T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + } + public class TransactionalBatchItemRequestOptions : RequestOptions + { + public TransactionalBatchItemRequestOptions(); + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + } + public class TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual string ETag { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual Stream ResourceStream { get; } + public virtual TimeSpan RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + } + public class TransactionalBatchOperationResult : TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual T Resource { get; set; } + } + public class TransactionalBatchPatchItemRequestOptions : TransactionalBatchItemRequestOptions + { + public TransactionalBatchPatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public class TransactionalBatchRequestOptions : RequestOptions + { + public TransactionalBatchRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public class TransactionalBatchResponse : IDisposable, IEnumerable, IEnumerable, IReadOnlyCollection, IReadOnlyList + { + protected TransactionalBatchResponse(); + public virtual string ActivityId { get; } + public virtual int Count { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual TransactionalBatchOperationResult this[int index] { get; } + public virtual double RequestCharge { get; } + public virtual Nullable RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual IEnumerator GetEnumerator(); + public virtual TransactionalBatchOperationResult GetOperationResultAtIndex(int index); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public class UniqueKey + { + public UniqueKey(); + public Collection Paths { get; } + } + public sealed class UniqueKeyPolicy + { + public UniqueKeyPolicy(); + public Collection UniqueKeys { get; } + } + public abstract class User + { + protected User(); + public abstract string Id { get; } + public abstract Task CreatePermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Permission GetPermission(string id); + public abstract FeedIterator GetPermissionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetPermissionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(UserProperties userProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertPermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class UserProperties + { + protected UserProperties(); + public UserProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class UserResponse : Response + { + protected UserResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public virtual User User { get; } + public static implicit operator User (UserResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Fluent +{ + public class ChangeFeedPolicyDefinition + { + public ContainerBuilder Attach(); + } + public sealed class ClientEncryptionPolicyDefinition + { + public ContainerBuilder Attach(); + public ClientEncryptionPolicyDefinition WithIncludedPath(ClientEncryptionIncludedPath path); + } + public class CompositeIndexDefinition + { + public T Attach(); + public CompositeIndexDefinition Path(string path); + public CompositeIndexDefinition Path(string path, CompositePathSortOrder sortOrder); + } + public class ComputedPropertiesDefinition + { + public T Attach(); + public ComputedPropertiesDefinition WithComputedProperty(string name, string query); + } + public class ConflictResolutionDefinition + { + public ContainerBuilder Attach(); + public ConflictResolutionDefinition WithCustomStoredProcedureResolution(string conflictResolutionProcedure); + public ConflictResolutionDefinition WithLastWriterWinsResolution(string conflictResolutionPath); + } + public class ContainerBuilder : ContainerDefinition + { + protected ContainerBuilder(); + public ContainerBuilder(Database database, string name, string partitionKeyPath); + public new ContainerProperties Build(); + public Task CreateAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public ChangeFeedPolicyDefinition WithChangeFeedPolicy(TimeSpan retention); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(int policyFormatVersion); + public ConflictResolutionDefinition WithConflictResolution(); + public UniqueKeyDefinition WithUniqueKey(); + } + public abstract class ContainerDefinition where T : ContainerDefinition + { + public ContainerDefinition(); + public ContainerProperties Build(); + public ComputedPropertiesDefinition WithComputedProperties(); + public T WithDefaultTimeToLive(int defaultTtlInSeconds); + public T WithDefaultTimeToLive(TimeSpan defaultTtlTimeSpan); + public IndexingPolicyDefinition WithIndexingPolicy(); + public T WithPartitionKeyDefinitionVersion(PartitionKeyDefinitionVersion partitionKeyDefinitionVersion); + public T WithTimeToLivePropertyPath(string propertyPath); + } + public class CosmosClientBuilder + { + public CosmosClientBuilder(string connectionString); + public CosmosClientBuilder(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential); + public CosmosClientBuilder(string accountEndpoint, TokenCredential tokenCredential); + public CosmosClientBuilder(string accountEndpoint, string authKeyOrResourceToken); + public CosmosClientBuilder AddCustomHandlers(params RequestHandler[] customHandlers); + public CosmosClient Build(); + public Task BuildAndInitializeAsync(IReadOnlyList> containers, CancellationToken cancellationToken=default(CancellationToken)); + public CosmosClientBuilder WithApplicationName(string applicationName); + public CosmosClientBuilder WithApplicationPreferredRegions(IReadOnlyList applicationPreferredRegions); + public CosmosClientBuilder WithApplicationRegion(string applicationRegion); + public CosmosClientBuilder WithBulkExecution(bool enabled); + public CosmosClientBuilder WithConnectionModeDirect(); + public CosmosClientBuilder WithConnectionModeDirect(Nullable idleTcpConnectionTimeout=default(Nullable), Nullable openTcpConnectionTimeout=default(Nullable), Nullable maxRequestsPerTcpConnection=default(Nullable), Nullable maxTcpConnectionsPerEndpoint=default(Nullable), Nullable portReuseMode=default(Nullable), Nullable enableTcpConnectionEndpointRediscovery=default(Nullable)); + public CosmosClientBuilder WithConnectionModeGateway(Nullable maxConnectionLimit=default(Nullable), IWebProxy webProxy=null); + public CosmosClientBuilder WithConsistencyLevel(ConsistencyLevel consistencyLevel); + public CosmosClientBuilder WithContentResponseOnWrite(bool contentResponseOnWrite); + public CosmosClientBuilder WithCustomSerializer(CosmosSerializer cosmosJsonSerializer); + public CosmosClientBuilder WithDistributedTracing(bool isEnabled=true); + public CosmosClientBuilder WithHttpClientFactory(Func httpClientFactory); + public CosmosClientBuilder WithLimitToEndpoint(bool limitToEndpoint); + public CosmosClientBuilder WithRequestTimeout(TimeSpan requestTimeout); + public CosmosClientBuilder WithSerializerOptions(CosmosSerializationOptions cosmosSerializerOptions); + public CosmosClientBuilder WithThrottlingRetryOptions(TimeSpan maxRetryWaitTimeOnThrottledRequests, int maxRetryAttemptsOnThrottledRequests); + } + public class IndexingPolicyDefinition + { + public IndexingPolicyDefinition(); + public T Attach(); + public IndexingPolicyDefinition WithAutomaticIndexing(bool enabled); + public CompositeIndexDefinition> WithCompositeIndex(); + public PathsDefinition> WithExcludedPaths(); + public PathsDefinition> WithIncludedPaths(); + public IndexingPolicyDefinition WithIndexingMode(IndexingMode indexingMode); + public SpatialIndexDefinition> WithSpatialIndex(); + } + public class PathsDefinition + { + public T Attach(); + public PathsDefinition Path(string path); + } + public class SpatialIndexDefinition + { + public T Attach(); + public SpatialIndexDefinition Path(string path); + public SpatialIndexDefinition Path(string path, params SpatialType[] spatialTypes); + } + public class UniqueKeyDefinition + { + public ContainerBuilder Attach(); + public UniqueKeyDefinition Path(string path); + } +} +namespace Microsoft.Azure.Cosmos.Linq +{ + public static class CosmosLinq + { + public static object InvokeUserDefinedFunction(string udfName, params object[] arguments); + } + public static class CosmosLinqExtensions + { + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> CountAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static bool IsArray(this object obj); + public static bool IsBool(this object obj); + public static bool IsDefined(this object obj); + public static bool IsNull(this object obj); + public static bool IsNumber(this object obj); + public static bool IsObject(this object obj); + public static bool IsPrimitive(this object obj); + public static bool IsString(this object obj); + public static Task> MaxAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> MinAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static FeedIterator ToFeedIterator(this IQueryable query); + public static QueryDefinition ToQueryDefinition(this IQueryable query); + public static QueryDefinition ToQueryDefinition(this IQueryable query, IDictionary namedParameters); + public static FeedIterator ToStreamIterator(this IQueryable query); + } +} +namespace Microsoft.Azure.Cosmos.Scripts +{ + public abstract class Scripts + { + protected Scripts(); + public abstract Task CreateStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ExecuteStoredProcedureAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, Stream streamPayload, PartitionKey partitionKey, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetStoredProcedureQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class StoredProcedureExecuteResponse : Response + { + protected StoredProcedureExecuteResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public virtual string ScriptLog { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + } + public class StoredProcedureProperties + { + public StoredProcedureProperties(); + public StoredProcedureProperties(string id, string body); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class StoredProcedureRequestOptions : RequestOptions + { + public StoredProcedureRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public bool EnableScriptLogging { get; set; } + public string SessionToken { get; set; } + } + public class StoredProcedureResponse : Response + { + protected StoredProcedureResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override StoredProcedureProperties Resource { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator StoredProcedureProperties (StoredProcedureResponse response); + } + public enum TriggerOperation : short + { + All = (short)0, + Create = (short)1, + Delete = (short)3, + Replace = (short)4, + Update = (short)2, + } + public class TriggerProperties + { + public TriggerProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + public TriggerOperation TriggerOperation { get; set; } + public TriggerType TriggerType { get; set; } + } + public class TriggerResponse : Response + { + protected TriggerResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override TriggerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator TriggerProperties (TriggerResponse response); + } + public enum TriggerType : byte + { + Post = (byte)1, + Pre = (byte)0, + } + public class UserDefinedFunctionProperties + { + public UserDefinedFunctionProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + } + public class UserDefinedFunctionResponse : Response + { + protected UserDefinedFunctionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserDefinedFunctionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator UserDefinedFunctionProperties (UserDefinedFunctionResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Spatial +{ + public sealed class BoundingBox : IEquatable + { + public BoundingBox(Position min, Position max); + public Position Max { get; } + public Position Min { get; } + public bool Equals(BoundingBox other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public abstract class Crs + { + protected Crs(CrsType type); + public static Crs Default { get; } + public CrsType Type { get; } + public static Crs Unspecified { get; } + public static LinkedCrs Linked(string href); + public static LinkedCrs Linked(string href, string type); + public static NamedCrs Named(string name); + } + public enum CrsType + { + Linked = 1, + Named = 0, + Unspecified = 2, + } + public abstract class Geometry + { + protected Geometry(GeometryType type, GeometryParams geometryParams); + public IDictionary AdditionalProperties { get; } + public BoundingBox BoundingBox { get; } + public Crs Crs { get; } + public GeometryType Type { get; } + public double Distance(Geometry to); + public override bool Equals(object obj); + public override int GetHashCode(); + public bool Intersects(Geometry geometry2); + public bool IsValid(); + public GeometryValidationResult IsValidDetailed(); + public bool Within(Geometry outer); + } + public class GeometryParams + { + public GeometryParams(); + public IDictionary AdditionalProperties { get; set; } + public BoundingBox BoundingBox { get; set; } + public Crs Crs { get; set; } + } + public enum GeometryShape + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public enum GeometryType + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public class GeometryValidationResult + { + public GeometryValidationResult(); + public bool IsValid { get; } + public string Reason { get; } + } + public sealed class LinearRing : IEquatable + { + public LinearRing(IList coordinates); + public ReadOnlyCollection Positions { get; } + public bool Equals(LinearRing other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LineString : Geometry, IEquatable + { + public LineString(IList coordinates); + public LineString(IList coordinates, GeometryParams geometryParams); + public ReadOnlyCollection Positions { get; } + public bool Equals(LineString other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LinkedCrs : Crs, IEquatable + { + public string Href { get; } + public string HrefType { get; } + public bool Equals(LinkedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class MultiPolygon : Geometry, IEquatable + { + public MultiPolygon(IList polygons); + public MultiPolygon(IList polygons, GeometryParams geometryParams); + public ReadOnlyCollection Polygons { get; } + public bool Equals(MultiPolygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class NamedCrs : Crs, IEquatable + { + public string Name { get; } + public bool Equals(NamedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Point : Geometry, IEquatable + { + public Point(Position position); + public Point(Position position, GeometryParams geometryParams); + public Point(double longitude, double latitude); + public Position Position { get; } + public bool Equals(Point other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Polygon : Geometry, IEquatable + { + public Polygon(IList rings); + public Polygon(IList rings, GeometryParams geometryParams); + public Polygon(IList externalRingPositions); + public ReadOnlyCollection Rings { get; } + public bool Equals(Polygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class PolygonCoordinates : IEquatable + { + public PolygonCoordinates(IList rings); + public ReadOnlyCollection Rings { get; } + public bool Equals(PolygonCoordinates other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Position : IEquatable + { + public Position(IList coordinates); + public Position(double longitude, double latitude); + public Position(double longitude, double latitude, Nullable altitude); + public Nullable Altitude { get; } + public ReadOnlyCollection Coordinates { get; } + public double Latitude { get; } + public double Longitude { get; } + public bool Equals(Position other); + public override bool Equals(object obj); + public override int GetHashCode(); + } +} diff --git a/Microsoft.Azure.Cosmos/contracts/API_3.35.1.txt b/Microsoft.Azure.Cosmos/contracts/API_3.35.1.txt new file mode 100644 index 0000000000..c0dc3e280f --- /dev/null +++ b/Microsoft.Azure.Cosmos/contracts/API_3.35.1.txt @@ -0,0 +1,1502 @@ +namespace Microsoft.Azure.Cosmos +{ + public class AccountConsistency + { + public AccountConsistency(); + public ConsistencyLevel DefaultConsistencyLevel { get; } + public int MaxStalenessIntervalInSeconds { get; } + public int MaxStalenessPrefix { get; } + } + public class AccountProperties + { + public AccountConsistency Consistency { get; } + public string ETag { get; } + public string Id { get; } + public IEnumerable ReadableRegions { get; } + public IEnumerable WritableRegions { get; } + } + public class AccountRegion + { + public AccountRegion(); + public string Endpoint { get; } + public string Name { get; } + } + public sealed class BoundingBoxProperties + { + public BoundingBoxProperties(); + public double Xmax { get; set; } + public double Xmin { get; set; } + public double Ymax { get; set; } + public double Ymin { get; set; } + } + public abstract class ChangeFeedEstimator + { + protected ChangeFeedEstimator(); + public abstract FeedIterator GetCurrentStateIterator(ChangeFeedEstimatorRequestOptions changeFeedEstimatorRequestOptions=null); + } + public sealed class ChangeFeedEstimatorRequestOptions + { + public ChangeFeedEstimatorRequestOptions(); + public Nullable MaxItemCount { get; set; } + } + public abstract class ChangeFeedMode + { + public static ChangeFeedMode Incremental { get; } + public static ChangeFeedMode LatestVersion { get; } + } + public abstract class ChangeFeedProcessor + { + protected ChangeFeedProcessor(); + public abstract Task StartAsync(); + public abstract Task StopAsync(); + } + public class ChangeFeedProcessorBuilder + { + public ChangeFeedProcessor Build(); + public ChangeFeedProcessorBuilder WithErrorNotification(Container.ChangeFeedMonitorErrorDelegate errorDelegate); + public ChangeFeedProcessorBuilder WithInstanceName(string instanceName); + public ChangeFeedProcessorBuilder WithLeaseAcquireNotification(Container.ChangeFeedMonitorLeaseAcquireDelegate acquireDelegate); + public ChangeFeedProcessorBuilder WithLeaseConfiguration(Nullable acquireInterval=default(Nullable), Nullable expirationInterval=default(Nullable), Nullable renewInterval=default(Nullable)); + public ChangeFeedProcessorBuilder WithLeaseContainer(Container leaseContainer); + public ChangeFeedProcessorBuilder WithLeaseReleaseNotification(Container.ChangeFeedMonitorLeaseReleaseDelegate releaseDelegate); + public ChangeFeedProcessorBuilder WithMaxItems(int maxItemCount); + public ChangeFeedProcessorBuilder WithPollInterval(TimeSpan pollInterval); + public ChangeFeedProcessorBuilder WithStartTime(DateTime startTime); + } + public abstract class ChangeFeedProcessorContext + { + protected ChangeFeedProcessorContext(); + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract Headers Headers { get; } + public abstract string LeaseToken { get; } + } + public sealed class ChangeFeedProcessorState + { + public ChangeFeedProcessorState(string leaseToken, long estimatedLag, string instanceName); + public long EstimatedLag { get; } + public string InstanceName { get; } + public string LeaseToken { get; } + } + public class ChangeFeedProcessorUserException : Exception + { + public ChangeFeedProcessorUserException(Exception originalException, ChangeFeedProcessorContext context); + protected ChangeFeedProcessorUserException(SerializationInfo info, StreamingContext context); + public ChangeFeedProcessorContext ChangeFeedProcessorContext { get; } + public override void GetObjectData(SerializationInfo info, StreamingContext context); + } + public sealed class ChangeFeedRequestOptions : RequestOptions + { + public ChangeFeedRequestOptions(); + public new string IfMatchEtag { get; set; } + public new string IfNoneMatchEtag { get; set; } + public Nullable PageSizeHint { get; set; } + } + public abstract class ChangeFeedStartFrom + { + public static ChangeFeedStartFrom Beginning(); + public static ChangeFeedStartFrom Beginning(FeedRange feedRange); + public static ChangeFeedStartFrom ContinuationToken(string continuationToken); + public static ChangeFeedStartFrom Now(); + public static ChangeFeedStartFrom Now(FeedRange feedRange); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc, FeedRange feedRange); + } + public sealed class ClientEncryptionIncludedPath + { + public ClientEncryptionIncludedPath(); + public string ClientEncryptionKeyId { get; set; } + public string EncryptionAlgorithm { get; set; } + public string EncryptionType { get; set; } + public string Path { get; set; } + } + public abstract class ClientEncryptionKey + { + protected ClientEncryptionKey(); + public abstract string Id { get; } + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class ClientEncryptionKeyProperties : IEquatable + { + protected ClientEncryptionKeyProperties(); + public ClientEncryptionKeyProperties(string id, string encryptionAlgorithm, byte[] wrappedDataEncryptionKey, EncryptionKeyWrapMetadata encryptionKeyWrapMetadata); + public Nullable CreatedTime { get; } + public string EncryptionAlgorithm { get; } + public EncryptionKeyWrapMetadata EncryptionKeyWrapMetadata { get; } + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public virtual string SelfLink { get; } + public byte[] WrappedDataEncryptionKey { get; } + public bool Equals(ClientEncryptionKeyProperties other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public class ClientEncryptionKeyResponse : Response + { + protected ClientEncryptionKeyResponse(); + public override string ActivityId { get; } + public virtual ClientEncryptionKey ClientEncryptionKey { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ClientEncryptionKeyProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ClientEncryptionKey (ClientEncryptionKeyResponse response); + } + public sealed class ClientEncryptionPolicy + { + public ClientEncryptionPolicy(IEnumerable includedPaths); + public ClientEncryptionPolicy(IEnumerable includedPaths, int policyFormatVersion); + public IEnumerable IncludedPaths { get; } + public int PolicyFormatVersion { get; } + } + public sealed class CompositePath + { + public CompositePath(); + public CompositePathSortOrder Order { get; set; } + public string Path { get; set; } + } + public enum CompositePathSortOrder + { + Ascending = 0, + Descending = 1, + } + public class ConflictProperties + { + public ConflictProperties(); + public string Id { get; } + public OperationKind OperationKind { get; } + public string SelfLink { get; } + } + public enum ConflictResolutionMode + { + Custom = 1, + LastWriterWins = 0, + } + public class ConflictResolutionPolicy + { + public ConflictResolutionPolicy(); + public ConflictResolutionMode Mode { get; set; } + public string ResolutionPath { get; set; } + public string ResolutionProcedure { get; set; } + } + public abstract class Conflicts + { + protected Conflicts(); + public abstract Task DeleteAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetConflictQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract T ReadConflictContent(ConflictProperties conflict); + public abstract Task> ReadCurrentAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum ConnectionMode + { + Direct = 1, + Gateway = 0, + } + public enum ConsistencyLevel + { + BoundedStaleness = 1, + ConsistentPrefix = 4, + Eventual = 3, + Session = 2, + Strong = 0, + } + public abstract class Container + { + protected Container(); + public abstract Conflicts Conflicts { get; } + public abstract Database Database { get; } + public abstract string Id { get; } + public abstract Scripts Scripts { get; } + public abstract Task> CreateItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch CreateTransactionalBatch(PartitionKey partitionKey); + public abstract Task DeleteContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> DeleteItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ChangeFeedEstimator GetChangeFeedEstimator(string processorName, Container leaseContainer); + public abstract ChangeFeedProcessorBuilder GetChangeFeedEstimatorBuilder(string processorName, Container.ChangesEstimationHandler estimationDelegate, Nullable estimationPeriod=default(Nullable)); + public abstract FeedIterator GetChangeFeedIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedStreamHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedStreamHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangesHandler onChangesDelegate); + public abstract FeedIterator GetChangeFeedStreamIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract Task> GetFeedRangesAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract IOrderedQueryable GetItemLinqQueryable(bool allowSynchronousQueryExecution=false, string continuationToken=null, QueryRequestOptions requestOptions=null, CosmosLinqSerializerOptions linqSerializerOptions=null); + public abstract FeedIterator GetItemQueryIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task> PatchItemAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task PatchItemStreamAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadManyItemsAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadManyItemsStreamAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerStreamAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReplaceItemAsync(T item, string id, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceItemStreamAsync(Stream streamPayload, string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> UpsertItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public delegate Task ChangeFeedHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, IReadOnlyCollection changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangeFeedHandler(ChangeFeedProcessorContext context, IReadOnlyCollection changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedMonitorErrorDelegate(string leaseToken, Exception exception); + public delegate Task ChangeFeedMonitorLeaseAcquireDelegate(string leaseToken); + public delegate Task ChangeFeedMonitorLeaseReleaseDelegate(string leaseToken); + public delegate Task ChangeFeedStreamHandler(ChangeFeedProcessorContext context, Stream changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedStreamHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, Stream changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangesEstimationHandler(long estimatedPendingChanges, CancellationToken cancellationToken); + public delegate Task ChangesHandler(IReadOnlyCollection changes, CancellationToken cancellationToken); + } + public class ContainerProperties + { + public ContainerProperties(); + public ContainerProperties(string id, IReadOnlyList partitionKeyPaths); + public ContainerProperties(string id, string partitionKeyPath); + public Nullable AnalyticalStoreTimeToLiveInSeconds { get; set; } + public ClientEncryptionPolicy ClientEncryptionPolicy { get; set; } + public ConflictResolutionPolicy ConflictResolutionPolicy { get; set; } + public Nullable DefaultTimeToLive { get; set; } + public string ETag { get; } + public GeospatialConfig GeospatialConfig { get; set; } + public string Id { get; set; } + public IndexingPolicy IndexingPolicy { get; set; } + public Nullable LastModified { get; } + public Nullable PartitionKeyDefinitionVersion { get; set; } + public string PartitionKeyPath { get; set; } + public IReadOnlyList PartitionKeyPaths { get; set; } + public string SelfLink { get; } + public string TimeToLivePropertyPath { get; set; } + public UniqueKeyPolicy UniqueKeyPolicy { get; set; } + } + public class ContainerRequestOptions : RequestOptions + { + public ContainerRequestOptions(); + public bool PopulateQuotaInfo { get; set; } + } + public class ContainerResponse : Response + { + protected ContainerResponse(); + public override string ActivityId { get; } + public virtual Container Container { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ContainerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Container (ContainerResponse response); + } + public class CosmosClient : IDisposable + { + protected CosmosClient(); + public CosmosClient(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, TokenCredential tokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string connectionString, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, string authKeyOrResourceToken, CosmosClientOptions clientOptions=null); + public virtual CosmosClientOptions ClientOptions { get; } + public virtual Uri Endpoint { get; } + public virtual CosmosResponseFactory ResponseFactory { get; } + public static Task CreateAndInitializeAsync(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, TokenCredential tokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string connectionString, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, string authKeyOrResourceToken, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseStreamAsync(DatabaseProperties databaseProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual Container GetContainer(string databaseId, string containerId); + public virtual Database GetDatabase(string id); + public virtual FeedIterator GetDatabaseQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual Task ReadAccountAsync(); + } + public class CosmosClientOptions + { + public CosmosClientOptions(); + public bool AllowBulkExecution { get; set; } + public string ApplicationName { get; set; } + public IReadOnlyList ApplicationPreferredRegions { get; set; } + public string ApplicationRegion { get; set; } + public ConnectionMode ConnectionMode { get; set; } + public Nullable ConsistencyLevel { get; set; } + public Collection CustomHandlers { get; } + public Nullable EnableContentResponseOnWrite { get; set; } + public bool EnableTcpConnectionEndpointRediscovery { get; set; } + public int GatewayModeMaxConnectionLimit { get; set; } + public Func HttpClientFactory { get; set; } + public Nullable IdleTcpConnectionTimeout { get; set; } + public bool LimitToEndpoint { get; set; } + public Nullable MaxRequestsPerTcpConnection { get; set; } + public Nullable MaxRetryAttemptsOnRateLimitedRequests { get; set; } + public Nullable MaxRetryWaitTimeOnRateLimitedRequests { get; set; } + public Nullable MaxTcpConnectionsPerEndpoint { get; set; } + public Nullable OpenTcpConnectionTimeout { get; set; } + public Nullable PortReuseMode { get; set; } + public TimeSpan RequestTimeout { get; set; } + public CosmosSerializer Serializer { get; set; } + public CosmosSerializationOptions SerializerOptions { get; set; } + public Func ServerCertificateCustomValidationCallback { get; set; } + public Nullable TokenCredentialBackgroundRefreshInterval { get; set; } + public IWebProxy WebProxy { get; set; } + } + public abstract class CosmosDiagnostics + { + protected CosmosDiagnostics(); + public virtual TimeSpan GetClientElapsedTime(); + public abstract IReadOnlyList> GetContactedRegions(); + public virtual int GetFailedRequestCount(); + public virtual Nullable GetStartTimeUtc(); + public abstract override string ToString(); + } + public class CosmosException : Exception + { + public CosmosException(string message, HttpStatusCode statusCode, int subStatusCode, string activityId, double requestCharge); + public virtual string ActivityId { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual Headers Headers { get; } + public override string Message { get; } + public virtual double RequestCharge { get; } + public virtual string ResponseBody { get; } + public virtual Nullable RetryAfter { get; } + public override string StackTrace { get; } + public virtual HttpStatusCode StatusCode { get; } + public virtual int SubStatusCode { get; } + public override string ToString(); + public virtual bool TryGetHeader(string headerName, out string value); + } + public sealed class CosmosLinqSerializerOptions + { + public CosmosLinqSerializerOptions(); + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public class CosmosOperationCanceledException : OperationCanceledException + { + public CosmosOperationCanceledException(OperationCanceledException originalException, CosmosDiagnostics diagnostics); + protected CosmosOperationCanceledException(SerializationInfo info, StreamingContext context); + public override IDictionary Data { get; } + public CosmosDiagnostics Diagnostics { get; } + public override string HelpLink { get; set; } + public override string Message { get; } + public override string Source { get; set; } + public override string StackTrace { get; } + public override Exception GetBaseException(); + public override void GetObjectData(SerializationInfo info, StreamingContext context); + public override string ToString(); + } + public enum CosmosPropertyNamingPolicy + { + CamelCase = 1, + Default = 0, + } + public abstract class CosmosResponseFactory + { + protected CosmosResponseFactory(); + public abstract FeedResponse CreateItemFeedResponse(ResponseMessage responseMessage); + public abstract ItemResponse CreateItemResponse(ResponseMessage responseMessage); + public abstract StoredProcedureExecuteResponse CreateStoredProcedureExecuteResponse(ResponseMessage responseMessage); + } + public sealed class CosmosSerializationOptions + { + public CosmosSerializationOptions(); + public bool IgnoreNullValues { get; set; } + public bool Indented { get; set; } + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public abstract class CosmosSerializer + { + protected CosmosSerializer(); + public abstract T FromStream(Stream stream); + public abstract Stream ToStream(T input); + } + public abstract class Database + { + protected Database(); + public abstract CosmosClient Client { get; } + public abstract string Id { get; } + public abstract Task CreateClientEncryptionKeyAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ContainerBuilder DefineContainer(string name, string partitionKeyPath); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ClientEncryptionKey GetClientEncryptionKey(string id); + public abstract FeedIterator GetClientEncryptionKeyQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Container GetContainer(string id); + public abstract FeedIterator GetContainerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract User GetUser(string id); + public abstract FeedIterator GetUserQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class DatabaseProperties + { + public DatabaseProperties(); + public DatabaseProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class DatabaseResponse : Response + { + protected DatabaseResponse(); + public override string ActivityId { get; } + public virtual Database Database { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override DatabaseProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Database (DatabaseResponse response); + } + public enum DataType + { + LineString = 3, + MultiPolygon = 5, + Number = 0, + Point = 2, + Polygon = 4, + String = 1, + } + public class DedicatedGatewayRequestOptions + { + public DedicatedGatewayRequestOptions(); + public Nullable MaxIntegratedCacheStaleness { get; set; } + } + public class EncryptionKeyWrapMetadata : IEquatable + { + public EncryptionKeyWrapMetadata(EncryptionKeyWrapMetadata source); + public EncryptionKeyWrapMetadata(string type, string name, string value, string algorithm); + public string Algorithm { get; } + public string Name { get; } + public string Type { get; } + public string Value { get; } + public bool Equals(EncryptionKeyWrapMetadata other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class ExcludedPath + { + public ExcludedPath(); + public string Path { get; set; } + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task> ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedRange + { + protected FeedRange(); + public static FeedRange FromJsonString(string toStringValue); + public static FeedRange FromPartitionKey(PartitionKey partitionKey); + public abstract string ToJsonString(); + } + public abstract class FeedResponse : IEnumerable, IEnumerable + { + protected FeedResponse(); + public override string ActivityId { get; } + public abstract string ContinuationToken { get; } + public abstract int Count { get; } + public override string ETag { get; } + public abstract string IndexMetrics { get; } + public override double RequestCharge { get; } + public abstract IEnumerator GetEnumerator(); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public sealed class GeospatialConfig + { + public GeospatialConfig(); + public GeospatialConfig(GeospatialType geospatialType); + public GeospatialType GeospatialType { get; set; } + } + public enum GeospatialType + { + Geography = 0, + Geometry = 1, + } + public class Headers : IEnumerable + { + public Headers(); + public virtual string ActivityId { get; } + public virtual string ContentLength { get; set; } + public virtual string ContentType { get; } + public virtual string ContinuationToken { get; } + public virtual string ETag { get; } + public virtual string this[string headerName] { get; set; } + public virtual string Location { get; } + public virtual double RequestCharge { get; } + public virtual string Session { get; } + public virtual void Add(string headerName, IEnumerable values); + public virtual void Add(string headerName, string value); + public virtual string[] AllKeys(); + public virtual string Get(string headerName); + public virtual IEnumerator GetEnumerator(); + public virtual T GetHeaderValue(string headerName); + public virtual string GetValueOrDefault(string headerName); + public virtual void Remove(string headerName); + public virtual void Set(string headerName, string value); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + public virtual bool TryGetValue(string headerName, out string value); + } + public sealed class IncludedPath + { + public IncludedPath(); + public string Path { get; set; } + } + public enum IndexingDirective + { + Default = 0, + Exclude = 2, + Include = 1, + } + public enum IndexingMode + { + Consistent = 0, + Lazy = 1, + None = 2, + } + public sealed class IndexingPolicy + { + public IndexingPolicy(); + public bool Automatic { get; set; } + public Collection> CompositeIndexes { get; } + public Collection ExcludedPaths { get; } + public Collection IncludedPaths { get; } + public IndexingMode IndexingMode { get; set; } + public Collection SpatialIndexes { get; } + } + public enum IndexKind + { + Hash = 0, + Range = 1, + Spatial = 2, + } + public class ItemRequestOptions : RequestOptions + { + public ItemRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + public IEnumerable PostTriggers { get; set; } + public IEnumerable PreTriggers { get; set; } + public string SessionToken { get; set; } + } + public class ItemResponse : Response + { + protected ItemResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public override HttpStatusCode StatusCode { get; } + } + public enum OperationKind + { + Create = 1, + Delete = 3, + Invalid = 0, + Read = 4, + Replace = 2, + } + public struct PartitionKey : IEquatable + { + public static readonly PartitionKey None; + public static readonly PartitionKey Null; + public static readonly string SystemKeyName; + public static readonly string SystemKeyPath; + public PartitionKey(bool partitionKeyValue); + public PartitionKey(double partitionKeyValue); + public PartitionKey(string partitionKeyValue); + public bool Equals(PartitionKey other); + public override bool Equals(object obj); + public override int GetHashCode(); + public static bool operator ==(PartitionKey left, PartitionKey right); + public static bool operator !=(PartitionKey left, PartitionKey right); + public override string ToString(); + } + public sealed class PartitionKeyBuilder + { + public PartitionKeyBuilder(); + public PartitionKeyBuilder Add(bool val); + public PartitionKeyBuilder Add(double val); + public PartitionKeyBuilder Add(string val); + public PartitionKeyBuilder AddNoneType(); + public PartitionKeyBuilder AddNullValue(); + public PartitionKey Build(); + } + public enum PartitionKeyDefinitionVersion + { + V1 = 1, + V2 = 2, + } + public sealed class PatchItemRequestOptions : ItemRequestOptions + { + public PatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public abstract class PatchOperation + { + protected PatchOperation(); + public virtual string From { get; set; } + public abstract PatchOperationType OperationType { get; } + public abstract string Path { get; } + public static PatchOperation Add(string path, T value); + public static PatchOperation Increment(string path, double value); + public static PatchOperation Increment(string path, long value); + public static PatchOperation Move(string from, string path); + public static PatchOperation Remove(string path); + public static PatchOperation Replace(string path, T value); + public static PatchOperation Set(string path, T value); + public virtual bool TrySerializeValueParameter(CosmosSerializer cosmosSerializer, out Stream valueParam); + } + public enum PatchOperationType + { + Add = 0, + Increment = 4, + Move = 5, + Remove = 1, + Replace = 2, + Set = 3, + } + public abstract class PatchOperation : PatchOperation + { + protected PatchOperation(); + public abstract T Value { get; } + } + public abstract class Permission + { + protected Permission(); + public abstract string Id { get; } + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadAsync(Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum PermissionMode : byte + { + All = (byte)2, + Read = (byte)1, + } + public class PermissionProperties + { + public PermissionProperties(string id, PermissionMode permissionMode, Container container, PartitionKey resourcePartitionKey, string itemId); + public PermissionProperties(string id, PermissionMode permissionMode, Container container, Nullable resourcePartitionKey=default(Nullable)); + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public PermissionMode PermissionMode { get; } + public Nullable ResourcePartitionKey { get; set; } + public string ResourceUri { get; } + public string SelfLink { get; } + public string Token { get; } + } + public class PermissionResponse : Response + { + protected PermissionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public virtual Permission Permission { get; } + public override double RequestCharge { get; } + public override PermissionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Permission (PermissionResponse response); + } + public enum PortReuseMode + { + PrivatePortPool = 1, + ReuseUnicastPort = 0, + } + public class QueryDefinition + { + public QueryDefinition(string query); + public string QueryText { get; } + public IReadOnlyList> GetQueryParameters(); + public QueryDefinition WithParameter(string name, object value); + public QueryDefinition WithParameterStream(string name, Stream valueStream); + } + public class QueryRequestOptions : RequestOptions + { + public QueryRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableLowPrecisionOrderBy { get; set; } + public Nullable EnableScanInQuery { get; set; } + public Nullable MaxBufferedItemCount { get; set; } + public Nullable MaxConcurrency { get; set; } + public Nullable MaxItemCount { get; set; } + public Nullable PartitionKey { get; set; } + public Nullable PopulateIndexMetrics { get; set; } + public Nullable ResponseContinuationTokenLimitInKb { get; set; } + public string SessionToken { get; set; } + } + public class ReadManyRequestOptions : RequestOptions + { + public ReadManyRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public static class Regions + { + public const string AustraliaCentral = "Australia Central"; + public const string AustraliaCentral2 = "Australia Central 2"; + public const string AustraliaEast = "Australia East"; + public const string AustraliaSoutheast = "Australia Southeast"; + public const string BrazilSouth = "Brazil South"; + public const string BrazilSoutheast = "Brazil Southeast"; + public const string CanadaCentral = "Canada Central"; + public const string CanadaEast = "Canada East"; + public const string CentralIndia = "Central India"; + public const string CentralUS = "Central US"; + public const string CentralUSEUAP = "Central US EUAP"; + public const string ChinaEast = "China East"; + public const string ChinaEast2 = "China East 2"; + public const string ChinaEast3 = "China East 3"; + public const string ChinaNorth = "China North"; + public const string ChinaNorth2 = "China North 2"; + public const string ChinaNorth3 = "China North 3"; + public const string EastAsia = "East Asia"; + public const string EastUS = "East US"; + public const string EastUS2 = "East US 2"; + public const string EastUS2EUAP = "East US 2 EUAP"; + public const string EastUSSLV = "East US SLV"; + public const string FranceCentral = "France Central"; + public const string FranceSouth = "France South"; + public const string GermanyCentral = "Germany Central"; + public const string GermanyNorth = "Germany North"; + public const string GermanyNortheast = "Germany Northeast"; + public const string GermanyWestCentral = "Germany West Central"; + public const string IsraelCentral = "Israel Central"; + public const string ItalyNorth = "Italy North"; + public const string JapanEast = "Japan East"; + public const string JapanWest = "Japan West"; + public const string JioIndiaCentral = "Jio India Central"; + public const string JioIndiaWest = "Jio India West"; + public const string KoreaCentral = "Korea Central"; + public const string KoreaSouth = "Korea South"; + public const string MalaysiaSouth = "Malaysia South"; + public const string NorthCentralUS = "North Central US"; + public const string NorthEurope = "North Europe"; + public const string NorwayEast = "Norway East"; + public const string NorwayWest = "Norway West"; + public const string PolandCentral = "Poland Central"; + public const string QatarCentral = "Qatar Central"; + public const string SouthAfricaNorth = "South Africa North"; + public const string SouthAfricaWest = "South Africa West"; + public const string SouthCentralUS = "South Central US"; + public const string SoutheastAsia = "Southeast Asia"; + public const string SouthIndia = "South India"; + public const string SwedenCentral = "Sweden Central"; + public const string SwedenSouth = "Sweden South"; + public const string SwitzerlandNorth = "Switzerland North"; + public const string SwitzerlandWest = "Switzerland West"; + public const string UAECentral = "UAE Central"; + public const string UAENorth = "UAE North"; + public const string UKSouth = "UK South"; + public const string UKWest = "UK West"; + public const string USDoDCentral = "USDoD Central"; + public const string USDoDEast = "USDoD East"; + public const string USGovArizona = "USGov Arizona"; + public const string USGovTexas = "USGov Texas"; + public const string USGovVirginia = "USGov Virginia"; + public const string USNatEast = "USNat East"; + public const string USNatWest = "USNat West"; + public const string USSecEast = "USSec East"; + public const string USSecWest = "USSec West"; + public const string WestCentralUS = "West Central US"; + public const string WestEurope = "West Europe"; + public const string WestIndia = "West India"; + public const string WestUS = "West US"; + public const string WestUS2 = "West US 2"; + public const string WestUS3 = "West US 3"; + } + public abstract class RequestHandler + { + protected RequestHandler(); + public RequestHandler InnerHandler { get; set; } + public virtual Task SendAsync(RequestMessage request, CancellationToken cancellationToken); + } + public class RequestMessage : IDisposable + { + public RequestMessage(); + public RequestMessage(HttpMethod method, Uri requestUri); + public virtual Stream Content { get; set; } + public virtual Headers Headers { get; } + public virtual HttpMethod Method { get; } + public virtual Dictionary Properties { get; } + public virtual Uri RequestUri { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + } + public class RequestOptions + { + public RequestOptions(); + public Action AddRequestHeaders { get; set; } + public string IfMatchEtag { get; set; } + public string IfNoneMatchEtag { get; set; } + public IReadOnlyDictionary Properties { get; set; } + public RequestOptions ShallowCopy(); + } + public class ResponseMessage : IDisposable + { + public ResponseMessage(); + public ResponseMessage(HttpStatusCode statusCode, RequestMessage requestMessage=null, string errorMessage=null); + public virtual Stream Content { get; set; } + public virtual string ContinuationToken { get; } + public virtual CosmosDiagnostics Diagnostics { get; set; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public string IndexMetrics { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual RequestMessage RequestMessage { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual ResponseMessage EnsureSuccessStatusCode(); + } + public abstract class Response + { + protected Response(); + public abstract string ActivityId { get; } + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract string ETag { get; } + public abstract Headers Headers { get; } + public abstract double RequestCharge { get; } + public abstract T Resource { get; } + public abstract HttpStatusCode StatusCode { get; } + public static implicit operator T (Response response); + } + public sealed class SpatialPath + { + public SpatialPath(); + public BoundingBoxProperties BoundingBox { get; set; } + public string Path { get; set; } + public Collection SpatialTypes { get; } + } + public enum SpatialType + { + LineString = 1, + MultiPolygon = 3, + Point = 0, + Polygon = 2, + } + public class ThroughputProperties + { + public Nullable AutoscaleMaxThroughput { get; } + public string ETag { get; } + public Nullable LastModified { get; } + public string SelfLink { get; } + public Nullable Throughput { get; } + public static ThroughputProperties CreateAutoscaleThroughput(int autoscaleMaxThroughput); + public static ThroughputProperties CreateManualThroughput(int throughput); + } + public class ThroughputResponse : Response + { + protected ThroughputResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public Nullable IsReplacePending { get; } + public Nullable MinThroughput { get; } + public override double RequestCharge { get; } + public override ThroughputProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ThroughputProperties (ThroughputResponse response); + } + public abstract class TransactionalBatch + { + protected TransactionalBatch(); + public abstract TransactionalBatch CreateItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch CreateItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch DeleteItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract Task ExecuteAsync(TransactionalBatchRequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch PatchItem(string id, IReadOnlyList patchOperations, TransactionalBatchPatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReadItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItemStream(string id, Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItem(string id, T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + } + public class TransactionalBatchItemRequestOptions : RequestOptions + { + public TransactionalBatchItemRequestOptions(); + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + } + public class TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual string ETag { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual Stream ResourceStream { get; } + public virtual TimeSpan RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + } + public class TransactionalBatchOperationResult : TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual T Resource { get; set; } + } + public class TransactionalBatchPatchItemRequestOptions : TransactionalBatchItemRequestOptions + { + public TransactionalBatchPatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public class TransactionalBatchRequestOptions : RequestOptions + { + public TransactionalBatchRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public class TransactionalBatchResponse : IDisposable, IEnumerable, IEnumerable, IReadOnlyCollection, IReadOnlyList + { + protected TransactionalBatchResponse(); + public virtual string ActivityId { get; } + public virtual int Count { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual TransactionalBatchOperationResult this[int index] { get; } + public virtual double RequestCharge { get; } + public virtual Nullable RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual IEnumerator GetEnumerator(); + public virtual TransactionalBatchOperationResult GetOperationResultAtIndex(int index); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public class UniqueKey + { + public UniqueKey(); + public Collection Paths { get; } + } + public sealed class UniqueKeyPolicy + { + public UniqueKeyPolicy(); + public Collection UniqueKeys { get; } + } + public abstract class User + { + protected User(); + public abstract string Id { get; } + public abstract Task CreatePermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Permission GetPermission(string id); + public abstract FeedIterator GetPermissionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetPermissionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(UserProperties userProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertPermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class UserProperties + { + protected UserProperties(); + public UserProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class UserResponse : Response + { + protected UserResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public virtual User User { get; } + public static implicit operator User (UserResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Fluent +{ + public sealed class ClientEncryptionPolicyDefinition + { + public ContainerBuilder Attach(); + public ClientEncryptionPolicyDefinition WithIncludedPath(ClientEncryptionIncludedPath path); + } + public class CompositeIndexDefinition + { + public T Attach(); + public CompositeIndexDefinition Path(string path); + public CompositeIndexDefinition Path(string path, CompositePathSortOrder sortOrder); + } + public class ConflictResolutionDefinition + { + public ContainerBuilder Attach(); + public ConflictResolutionDefinition WithCustomStoredProcedureResolution(string conflictResolutionProcedure); + public ConflictResolutionDefinition WithLastWriterWinsResolution(string conflictResolutionPath); + } + public class ContainerBuilder : ContainerDefinition + { + protected ContainerBuilder(); + public ContainerBuilder(Database database, string name, string partitionKeyPath); + public new ContainerProperties Build(); + public Task CreateAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(int policyFormatVersion); + public ConflictResolutionDefinition WithConflictResolution(); + public UniqueKeyDefinition WithUniqueKey(); + } + public abstract class ContainerDefinition where T : ContainerDefinition + { + public ContainerDefinition(); + public ContainerProperties Build(); + public T WithDefaultTimeToLive(int defaultTtlInSeconds); + public T WithDefaultTimeToLive(TimeSpan defaultTtlTimeSpan); + public IndexingPolicyDefinition WithIndexingPolicy(); + public T WithPartitionKeyDefinitionVersion(PartitionKeyDefinitionVersion partitionKeyDefinitionVersion); + public T WithTimeToLivePropertyPath(string propertyPath); + } + public class CosmosClientBuilder + { + public CosmosClientBuilder(string connectionString); + public CosmosClientBuilder(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential); + public CosmosClientBuilder(string accountEndpoint, TokenCredential tokenCredential); + public CosmosClientBuilder(string accountEndpoint, string authKeyOrResourceToken); + public CosmosClientBuilder AddCustomHandlers(params RequestHandler[] customHandlers); + public CosmosClient Build(); + public Task BuildAndInitializeAsync(IReadOnlyList> containers, CancellationToken cancellationToken=default(CancellationToken)); + public CosmosClientBuilder WithApplicationName(string applicationName); + public CosmosClientBuilder WithApplicationPreferredRegions(IReadOnlyList applicationPreferredRegions); + public CosmosClientBuilder WithApplicationRegion(string applicationRegion); + public CosmosClientBuilder WithBulkExecution(bool enabled); + public CosmosClientBuilder WithConnectionModeDirect(); + public CosmosClientBuilder WithConnectionModeDirect(Nullable idleTcpConnectionTimeout=default(Nullable), Nullable openTcpConnectionTimeout=default(Nullable), Nullable maxRequestsPerTcpConnection=default(Nullable), Nullable maxTcpConnectionsPerEndpoint=default(Nullable), Nullable portReuseMode=default(Nullable), Nullable enableTcpConnectionEndpointRediscovery=default(Nullable)); + public CosmosClientBuilder WithConnectionModeGateway(Nullable maxConnectionLimit=default(Nullable), IWebProxy webProxy=null); + public CosmosClientBuilder WithConsistencyLevel(ConsistencyLevel consistencyLevel); + public CosmosClientBuilder WithContentResponseOnWrite(bool contentResponseOnWrite); + public CosmosClientBuilder WithCustomSerializer(CosmosSerializer cosmosJsonSerializer); + public CosmosClientBuilder WithHttpClientFactory(Func httpClientFactory); + public CosmosClientBuilder WithLimitToEndpoint(bool limitToEndpoint); + public CosmosClientBuilder WithRequestTimeout(TimeSpan requestTimeout); + public CosmosClientBuilder WithSerializerOptions(CosmosSerializationOptions cosmosSerializerOptions); + public CosmosClientBuilder WithThrottlingRetryOptions(TimeSpan maxRetryWaitTimeOnThrottledRequests, int maxRetryAttemptsOnThrottledRequests); + } + public class IndexingPolicyDefinition + { + public IndexingPolicyDefinition(); + public T Attach(); + public IndexingPolicyDefinition WithAutomaticIndexing(bool enabled); + public CompositeIndexDefinition> WithCompositeIndex(); + public PathsDefinition> WithExcludedPaths(); + public PathsDefinition> WithIncludedPaths(); + public IndexingPolicyDefinition WithIndexingMode(IndexingMode indexingMode); + public SpatialIndexDefinition> WithSpatialIndex(); + } + public class PathsDefinition + { + public T Attach(); + public PathsDefinition Path(string path); + } + public class SpatialIndexDefinition + { + public T Attach(); + public SpatialIndexDefinition Path(string path); + public SpatialIndexDefinition Path(string path, params SpatialType[] spatialTypes); + } + public class UniqueKeyDefinition + { + public ContainerBuilder Attach(); + public UniqueKeyDefinition Path(string path); + } +} +namespace Microsoft.Azure.Cosmos.Linq +{ + public static class CosmosLinq + { + public static object InvokeUserDefinedFunction(string udfName, params object[] arguments); + } + public static class CosmosLinqExtensions + { + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> CountAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static bool IsArray(this object obj); + public static bool IsBool(this object obj); + public static bool IsDefined(this object obj); + public static bool IsNull(this object obj); + public static bool IsNumber(this object obj); + public static bool IsObject(this object obj); + public static bool IsPrimitive(this object obj); + public static bool IsString(this object obj); + public static Task> MaxAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> MinAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static FeedIterator ToFeedIterator(this IQueryable query); + public static QueryDefinition ToQueryDefinition(this IQueryable query); + public static FeedIterator ToStreamIterator(this IQueryable query); + } +} +namespace Microsoft.Azure.Cosmos.Scripts +{ + public abstract class Scripts + { + protected Scripts(); + public abstract Task CreateStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ExecuteStoredProcedureAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, Stream streamPayload, PartitionKey partitionKey, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetStoredProcedureQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class StoredProcedureExecuteResponse : Response + { + protected StoredProcedureExecuteResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public virtual string ScriptLog { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + } + public class StoredProcedureProperties + { + public StoredProcedureProperties(); + public StoredProcedureProperties(string id, string body); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class StoredProcedureRequestOptions : RequestOptions + { + public StoredProcedureRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public bool EnableScriptLogging { get; set; } + public string SessionToken { get; set; } + } + public class StoredProcedureResponse : Response + { + protected StoredProcedureResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override StoredProcedureProperties Resource { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator StoredProcedureProperties (StoredProcedureResponse response); + } + public enum TriggerOperation : short + { + All = (short)0, + Create = (short)1, + Delete = (short)3, + Replace = (short)4, + Update = (short)2, + } + public class TriggerProperties + { + public TriggerProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + public TriggerOperation TriggerOperation { get; set; } + public TriggerType TriggerType { get; set; } + } + public class TriggerResponse : Response + { + protected TriggerResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override TriggerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator TriggerProperties (TriggerResponse response); + } + public enum TriggerType : byte + { + Post = (byte)1, + Pre = (byte)0, + } + public class UserDefinedFunctionProperties + { + public UserDefinedFunctionProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + } + public class UserDefinedFunctionResponse : Response + { + protected UserDefinedFunctionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserDefinedFunctionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator UserDefinedFunctionProperties (UserDefinedFunctionResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Spatial +{ + public sealed class BoundingBox : IEquatable + { + public BoundingBox(Position min, Position max); + public Position Max { get; } + public Position Min { get; } + public bool Equals(BoundingBox other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public abstract class Crs + { + protected Crs(CrsType type); + public static Crs Default { get; } + public CrsType Type { get; } + public static Crs Unspecified { get; } + public static LinkedCrs Linked(string href); + public static LinkedCrs Linked(string href, string type); + public static NamedCrs Named(string name); + } + public enum CrsType + { + Linked = 1, + Named = 0, + Unspecified = 2, + } + public abstract class Geometry + { + protected Geometry(GeometryType type, GeometryParams geometryParams); + public IDictionary AdditionalProperties { get; } + public BoundingBox BoundingBox { get; } + public Crs Crs { get; } + public GeometryType Type { get; } + public double Distance(Geometry to); + public override bool Equals(object obj); + public override int GetHashCode(); + public bool Intersects(Geometry geometry2); + public bool IsValid(); + public GeometryValidationResult IsValidDetailed(); + public bool Within(Geometry outer); + } + public class GeometryParams + { + public GeometryParams(); + public IDictionary AdditionalProperties { get; set; } + public BoundingBox BoundingBox { get; set; } + public Crs Crs { get; set; } + } + public enum GeometryShape + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public enum GeometryType + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public class GeometryValidationResult + { + public GeometryValidationResult(); + public bool IsValid { get; } + public string Reason { get; } + } + public sealed class LinearRing : IEquatable + { + public LinearRing(IList coordinates); + public ReadOnlyCollection Positions { get; } + public bool Equals(LinearRing other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LineString : Geometry, IEquatable + { + public LineString(IList coordinates); + public LineString(IList coordinates, GeometryParams geometryParams); + public ReadOnlyCollection Positions { get; } + public bool Equals(LineString other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LinkedCrs : Crs, IEquatable + { + public string Href { get; } + public string HrefType { get; } + public bool Equals(LinkedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class MultiPolygon : Geometry, IEquatable + { + public MultiPolygon(IList polygons); + public MultiPolygon(IList polygons, GeometryParams geometryParams); + public ReadOnlyCollection Polygons { get; } + public bool Equals(MultiPolygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class NamedCrs : Crs, IEquatable + { + public string Name { get; } + public bool Equals(NamedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Point : Geometry, IEquatable + { + public Point(Position position); + public Point(Position position, GeometryParams geometryParams); + public Point(double longitude, double latitude); + public Position Position { get; } + public bool Equals(Point other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Polygon : Geometry, IEquatable + { + public Polygon(IList rings); + public Polygon(IList rings, GeometryParams geometryParams); + public Polygon(IList externalRingPositions); + public ReadOnlyCollection Rings { get; } + public bool Equals(Polygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class PolygonCoordinates : IEquatable + { + public PolygonCoordinates(IList rings); + public ReadOnlyCollection Rings { get; } + public bool Equals(PolygonCoordinates other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Position : IEquatable + { + public Position(IList coordinates); + public Position(double longitude, double latitude); + public Position(double longitude, double latitude, Nullable altitude); + public Nullable Altitude { get; } + public ReadOnlyCollection Coordinates { get; } + public double Latitude { get; } + public double Longitude { get; } + public bool Equals(Position other); + public override bool Equals(object obj); + public override int GetHashCode(); + } +} diff --git a/Microsoft.Azure.Cosmos/contracts/API_3.35.2-preview.txt b/Microsoft.Azure.Cosmos/contracts/API_3.35.2-preview.txt new file mode 100644 index 0000000000..6c989053fd --- /dev/null +++ b/Microsoft.Azure.Cosmos/contracts/API_3.35.2-preview.txt @@ -0,0 +1,1563 @@ +namespace Microsoft.Azure.Cosmos +{ + public class AccountConsistency + { + public AccountConsistency(); + public ConsistencyLevel DefaultConsistencyLevel { get; } + public int MaxStalenessIntervalInSeconds { get; } + public int MaxStalenessPrefix { get; } + } + public class AccountProperties + { + public AccountConsistency Consistency { get; } + public string ETag { get; } + public string Id { get; } + public IEnumerable ReadableRegions { get; } + public IEnumerable WritableRegions { get; } + } + public class AccountRegion + { + public AccountRegion(); + public string Endpoint { get; } + public string Name { get; } + } + public sealed class BoundingBoxProperties + { + public BoundingBoxProperties(); + public double Xmax { get; set; } + public double Xmin { get; set; } + public double Ymax { get; set; } + public double Ymin { get; set; } + } + public abstract class ChangeFeedEstimator + { + protected ChangeFeedEstimator(); + public abstract FeedIterator GetCurrentStateIterator(ChangeFeedEstimatorRequestOptions changeFeedEstimatorRequestOptions=null); + } + public sealed class ChangeFeedEstimatorRequestOptions + { + public ChangeFeedEstimatorRequestOptions(); + public Nullable MaxItemCount { get; set; } + } + public class ChangeFeedItemChange + { + public ChangeFeedItemChange(); + public T Current { get; set; } + public ChangeFeedMetadata Metadata { get; set; } + public T Previous { get; set; } + } + public class ChangeFeedMetadata + { + public ChangeFeedMetadata(DateTime conflictResolutionTimestamp, long lsn, ChangeFeedOperationType operationType, long previousLsn); + public DateTime ConflictResolutionTimestamp { get; } + public bool IsTimeToLiveExpired { get; } + public long Lsn { get; } + public ChangeFeedOperationType OperationType { get; } + public long PreviousLsn { get; } + } + public abstract class ChangeFeedMode + { + public static ChangeFeedMode AllVersionsAndDeletes { get; } + public static ChangeFeedMode Incremental { get; } + public static ChangeFeedMode LatestVersion { get; } + } + public enum ChangeFeedOperationType + { + Create = 0, + Delete = 2, + Replace = 1, + } + public sealed class ChangeFeedPolicy + { + public ChangeFeedPolicy(); + public static TimeSpan FullFidelityNoRetention { get; } + public TimeSpan FullFidelityRetention { get; set; } + } + public abstract class ChangeFeedProcessor + { + protected ChangeFeedProcessor(); + public abstract Task StartAsync(); + public abstract Task StopAsync(); + } + public class ChangeFeedProcessorBuilder + { + public ChangeFeedProcessor Build(); + public ChangeFeedProcessorBuilder WithErrorNotification(Container.ChangeFeedMonitorErrorDelegate errorDelegate); + public ChangeFeedProcessorBuilder WithInstanceName(string instanceName); + public ChangeFeedProcessorBuilder WithLeaseAcquireNotification(Container.ChangeFeedMonitorLeaseAcquireDelegate acquireDelegate); + public ChangeFeedProcessorBuilder WithLeaseConfiguration(Nullable acquireInterval=default(Nullable), Nullable expirationInterval=default(Nullable), Nullable renewInterval=default(Nullable)); + public ChangeFeedProcessorBuilder WithLeaseContainer(Container leaseContainer); + public ChangeFeedProcessorBuilder WithLeaseReleaseNotification(Container.ChangeFeedMonitorLeaseReleaseDelegate releaseDelegate); + public ChangeFeedProcessorBuilder WithMaxItems(int maxItemCount); + public ChangeFeedProcessorBuilder WithPollInterval(TimeSpan pollInterval); + public ChangeFeedProcessorBuilder WithStartTime(DateTime startTime); + } + public abstract class ChangeFeedProcessorContext + { + protected ChangeFeedProcessorContext(); + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract Headers Headers { get; } + public abstract string LeaseToken { get; } + } + public sealed class ChangeFeedProcessorState + { + public ChangeFeedProcessorState(string leaseToken, long estimatedLag, string instanceName); + public long EstimatedLag { get; } + public string InstanceName { get; } + public string LeaseToken { get; } + } + public class ChangeFeedProcessorUserException : Exception + { + public ChangeFeedProcessorUserException(Exception originalException, ChangeFeedProcessorContext context); + protected ChangeFeedProcessorUserException(SerializationInfo info, StreamingContext context); + public ChangeFeedProcessorContext ChangeFeedProcessorContext { get; } + public override void GetObjectData(SerializationInfo info, StreamingContext context); + } + public sealed class ChangeFeedRequestOptions : RequestOptions + { + public ChangeFeedRequestOptions(); + public new string IfMatchEtag { get; set; } + public new string IfNoneMatchEtag { get; set; } + public Nullable PageSizeHint { get; set; } + } + public abstract class ChangeFeedStartFrom + { + public static ChangeFeedStartFrom Beginning(); + public static ChangeFeedStartFrom Beginning(FeedRange feedRange); + public static ChangeFeedStartFrom ContinuationToken(string continuationToken); + public static ChangeFeedStartFrom Now(); + public static ChangeFeedStartFrom Now(FeedRange feedRange); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc, FeedRange feedRange); + } + public sealed class ClientEncryptionIncludedPath + { + public ClientEncryptionIncludedPath(); + public string ClientEncryptionKeyId { get; set; } + public string EncryptionAlgorithm { get; set; } + public string EncryptionType { get; set; } + public string Path { get; set; } + } + public abstract class ClientEncryptionKey + { + protected ClientEncryptionKey(); + public abstract string Id { get; } + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class ClientEncryptionKeyProperties : IEquatable + { + protected ClientEncryptionKeyProperties(); + public ClientEncryptionKeyProperties(string id, string encryptionAlgorithm, byte[] wrappedDataEncryptionKey, EncryptionKeyWrapMetadata encryptionKeyWrapMetadata); + public Nullable CreatedTime { get; } + public string EncryptionAlgorithm { get; } + public EncryptionKeyWrapMetadata EncryptionKeyWrapMetadata { get; } + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public virtual string SelfLink { get; } + public byte[] WrappedDataEncryptionKey { get; } + public bool Equals(ClientEncryptionKeyProperties other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public class ClientEncryptionKeyResponse : Response + { + protected ClientEncryptionKeyResponse(); + public override string ActivityId { get; } + public virtual ClientEncryptionKey ClientEncryptionKey { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ClientEncryptionKeyProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ClientEncryptionKey (ClientEncryptionKeyResponse response); + } + public sealed class ClientEncryptionPolicy + { + public ClientEncryptionPolicy(IEnumerable includedPaths); + public ClientEncryptionPolicy(IEnumerable includedPaths, int policyFormatVersion); + public IEnumerable IncludedPaths { get; } + public int PolicyFormatVersion { get; } + } + public sealed class CompositePath + { + public CompositePath(); + public CompositePathSortOrder Order { get; set; } + public string Path { get; set; } + } + public enum CompositePathSortOrder + { + Ascending = 0, + Descending = 1, + } + public sealed class ComputedProperty + { + public ComputedProperty(); + public string Name { get; set; } + public string Query { get; set; } + } + public class ConflictProperties + { + public ConflictProperties(); + public string Id { get; } + public OperationKind OperationKind { get; } + public string SelfLink { get; } + } + public enum ConflictResolutionMode + { + Custom = 1, + LastWriterWins = 0, + } + public class ConflictResolutionPolicy + { + public ConflictResolutionPolicy(); + public ConflictResolutionMode Mode { get; set; } + public string ResolutionPath { get; set; } + public string ResolutionProcedure { get; set; } + } + public abstract class Conflicts + { + protected Conflicts(); + public abstract Task DeleteAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetConflictQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract T ReadConflictContent(ConflictProperties conflict); + public abstract Task> ReadCurrentAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum ConnectionMode + { + Direct = 1, + Gateway = 0, + } + public enum ConsistencyLevel + { + BoundedStaleness = 1, + ConsistentPrefix = 4, + Eventual = 3, + Session = 2, + Strong = 0, + } + public abstract class Container + { + protected Container(); + public abstract Conflicts Conflicts { get; } + public abstract Database Database { get; } + public abstract string Id { get; } + public abstract Scripts Scripts { get; } + public abstract Task> CreateItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch CreateTransactionalBatch(PartitionKey partitionKey); + public abstract Task DeleteAllItemsByPartitionKeyStreamAsync(PartitionKey partitionKey, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> DeleteItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ChangeFeedEstimator GetChangeFeedEstimator(string processorName, Container leaseContainer); + public abstract ChangeFeedProcessorBuilder GetChangeFeedEstimatorBuilder(string processorName, Container.ChangesEstimationHandler estimationDelegate, Nullable estimationPeriod=default(Nullable)); + public abstract FeedIterator GetChangeFeedIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedStreamHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedStreamHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangesHandler onChangesDelegate); + public abstract FeedIterator GetChangeFeedStreamIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract Task> GetFeedRangesAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract IOrderedQueryable GetItemLinqQueryable(bool allowSynchronousQueryExecution=false, string continuationToken=null, QueryRequestOptions requestOptions=null, CosmosLinqSerializerOptions linqSerializerOptions=null); + public abstract FeedIterator GetItemQueryIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task> GetPartitionKeyRangesAsync(FeedRange feedRange, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> PatchItemAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task PatchItemStreamAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadManyItemsAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadManyItemsStreamAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerStreamAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReplaceItemAsync(T item, string id, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceItemStreamAsync(Stream streamPayload, string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> UpsertItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public delegate Task ChangeFeedHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, IReadOnlyCollection changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangeFeedHandler(ChangeFeedProcessorContext context, IReadOnlyCollection changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedMonitorErrorDelegate(string leaseToken, Exception exception); + public delegate Task ChangeFeedMonitorLeaseAcquireDelegate(string leaseToken); + public delegate Task ChangeFeedMonitorLeaseReleaseDelegate(string leaseToken); + public delegate Task ChangeFeedStreamHandler(ChangeFeedProcessorContext context, Stream changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedStreamHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, Stream changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangesEstimationHandler(long estimatedPendingChanges, CancellationToken cancellationToken); + public delegate Task ChangesHandler(IReadOnlyCollection changes, CancellationToken cancellationToken); + } + public class ContainerProperties + { + public ContainerProperties(); + public ContainerProperties(string id, IReadOnlyList partitionKeyPaths); + public ContainerProperties(string id, string partitionKeyPath); + public Nullable AnalyticalStoreTimeToLiveInSeconds { get; set; } + public ChangeFeedPolicy ChangeFeedPolicy { get; set; } + public ClientEncryptionPolicy ClientEncryptionPolicy { get; set; } + public Collection ComputedProperties { get; set; } + public ConflictResolutionPolicy ConflictResolutionPolicy { get; set; } + public Nullable DefaultTimeToLive { get; set; } + public string ETag { get; } + public GeospatialConfig GeospatialConfig { get; set; } + public string Id { get; set; } + public IndexingPolicy IndexingPolicy { get; set; } + public Nullable LastModified { get; } + public Nullable PartitionKeyDefinitionVersion { get; set; } + public string PartitionKeyPath { get; set; } + public IReadOnlyList PartitionKeyPaths { get; set; } + public string SelfLink { get; } + public string TimeToLivePropertyPath { get; set; } + public UniqueKeyPolicy UniqueKeyPolicy { get; set; } + } + public class ContainerRequestOptions : RequestOptions + { + public ContainerRequestOptions(); + public bool PopulateQuotaInfo { get; set; } + } + public class ContainerResponse : Response + { + protected ContainerResponse(); + public override string ActivityId { get; } + public virtual Container Container { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ContainerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Container (ContainerResponse response); + } + public class CosmosClient : IDisposable + { + protected CosmosClient(); + public CosmosClient(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, TokenCredential tokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string connectionString, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, string authKeyOrResourceToken, CosmosClientOptions clientOptions=null); + public virtual CosmosClientOptions ClientOptions { get; } + public virtual Uri Endpoint { get; } + public virtual CosmosResponseFactory ResponseFactory { get; } + public static Task CreateAndInitializeAsync(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, TokenCredential tokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string connectionString, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, string authKeyOrResourceToken, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseStreamAsync(DatabaseProperties databaseProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual Container GetContainer(string databaseId, string containerId); + public virtual Database GetDatabase(string id); + public virtual FeedIterator GetDatabaseQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual Task ReadAccountAsync(); + } + public class CosmosClientOptions + { + public CosmosClientOptions(); + public bool AllowBulkExecution { get; set; } + public string ApplicationName { get; set; } + public IReadOnlyList ApplicationPreferredRegions { get; set; } + public string ApplicationRegion { get; set; } + public ConnectionMode ConnectionMode { get; set; } + public Nullable ConsistencyLevel { get; set; } + public Collection CustomHandlers { get; } + public Nullable EnableContentResponseOnWrite { get; set; } + public bool EnableTcpConnectionEndpointRediscovery { get; set; } + public int GatewayModeMaxConnectionLimit { get; set; } + public Func HttpClientFactory { get; set; } + public Nullable IdleTcpConnectionTimeout { get; set; } + public bool IsDistributedTracingEnabled { get; set; } + public bool LimitToEndpoint { get; set; } + public Nullable MaxRequestsPerTcpConnection { get; set; } + public Nullable MaxRetryAttemptsOnRateLimitedRequests { get; set; } + public Nullable MaxRetryWaitTimeOnRateLimitedRequests { get; set; } + public Nullable MaxTcpConnectionsPerEndpoint { get; set; } + public Nullable OpenTcpConnectionTimeout { get; set; } + public Nullable PortReuseMode { get; set; } + public TimeSpan RequestTimeout { get; set; } + public CosmosSerializer Serializer { get; set; } + public CosmosSerializationOptions SerializerOptions { get; set; } + public Func ServerCertificateCustomValidationCallback { get; set; } + public Nullable TokenCredentialBackgroundRefreshInterval { get; set; } + public IWebProxy WebProxy { get; set; } + } + public abstract class CosmosDiagnostics + { + protected CosmosDiagnostics(); + public virtual TimeSpan GetClientElapsedTime(); + public abstract IReadOnlyList> GetContactedRegions(); + public virtual int GetFailedRequestCount(); + public virtual Nullable GetStartTimeUtc(); + public abstract override string ToString(); + } + public class CosmosException : Exception + { + public CosmosException(string message, HttpStatusCode statusCode, int subStatusCode, string activityId, double requestCharge); + public virtual string ActivityId { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual Headers Headers { get; } + public override string Message { get; } + public virtual double RequestCharge { get; } + public virtual string ResponseBody { get; } + public virtual Nullable RetryAfter { get; } + public override string StackTrace { get; } + public virtual HttpStatusCode StatusCode { get; } + public virtual int SubStatusCode { get; } + public override string ToString(); + public virtual bool TryGetHeader(string headerName, out string value); + } + public sealed class CosmosLinqSerializerOptions + { + public CosmosLinqSerializerOptions(); + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public class CosmosOperationCanceledException : OperationCanceledException + { + public CosmosOperationCanceledException(OperationCanceledException originalException, CosmosDiagnostics diagnostics); + protected CosmosOperationCanceledException(SerializationInfo info, StreamingContext context); + public override IDictionary Data { get; } + public CosmosDiagnostics Diagnostics { get; } + public override string HelpLink { get; set; } + public override string Message { get; } + public override string Source { get; set; } + public override string StackTrace { get; } + public override Exception GetBaseException(); + public override void GetObjectData(SerializationInfo info, StreamingContext context); + public override string ToString(); + } + public enum CosmosPropertyNamingPolicy + { + CamelCase = 1, + Default = 0, + } + public abstract class CosmosResponseFactory + { + protected CosmosResponseFactory(); + public abstract FeedResponse CreateItemFeedResponse(ResponseMessage responseMessage); + public abstract ItemResponse CreateItemResponse(ResponseMessage responseMessage); + public abstract StoredProcedureExecuteResponse CreateStoredProcedureExecuteResponse(ResponseMessage responseMessage); + } + public sealed class CosmosSerializationOptions + { + public CosmosSerializationOptions(); + public bool IgnoreNullValues { get; set; } + public bool Indented { get; set; } + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public abstract class CosmosSerializer + { + protected CosmosSerializer(); + public abstract T FromStream(Stream stream); + public abstract Stream ToStream(T input); + } + public abstract class Database + { + protected Database(); + public abstract CosmosClient Client { get; } + public abstract string Id { get; } + public abstract Task CreateClientEncryptionKeyAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ContainerBuilder DefineContainer(string name, string partitionKeyPath); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ClientEncryptionKey GetClientEncryptionKey(string id); + public abstract FeedIterator GetClientEncryptionKeyQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Container GetContainer(string id); + public abstract FeedIterator GetContainerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract User GetUser(string id); + public abstract FeedIterator GetUserQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class DatabaseProperties + { + public DatabaseProperties(); + public DatabaseProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class DatabaseResponse : Response + { + protected DatabaseResponse(); + public override string ActivityId { get; } + public virtual Database Database { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override DatabaseProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Database (DatabaseResponse response); + } + public enum DataType + { + LineString = 3, + MultiPolygon = 5, + Number = 0, + Point = 2, + Polygon = 4, + String = 1, + } + public class DedicatedGatewayRequestOptions + { + public DedicatedGatewayRequestOptions(); + public Nullable BypassIntegratedCache { get; set; } + public Nullable MaxIntegratedCacheStaleness { get; set; } + } + public class EncryptionKeyWrapMetadata : IEquatable + { + public EncryptionKeyWrapMetadata(EncryptionKeyWrapMetadata source); + public EncryptionKeyWrapMetadata(string type, string name, string value, string algorithm); + public string Algorithm { get; } + public string Name { get; } + public string Type { get; } + public string Value { get; } + public bool Equals(EncryptionKeyWrapMetadata other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class ExcludedPath + { + public ExcludedPath(); + public string Path { get; set; } + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task> ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedRange + { + protected FeedRange(); + public static FeedRange FromJsonString(string toStringValue); + public static FeedRange FromPartitionKey(PartitionKey partitionKey); + public abstract string ToJsonString(); + } + public abstract class FeedResponse : IEnumerable, IEnumerable + { + protected FeedResponse(); + public override string ActivityId { get; } + public abstract string ContinuationToken { get; } + public abstract int Count { get; } + public override string ETag { get; } + public abstract string IndexMetrics { get; } + public override double RequestCharge { get; } + public abstract IEnumerator GetEnumerator(); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public sealed class GeospatialConfig + { + public GeospatialConfig(); + public GeospatialConfig(GeospatialType geospatialType); + public GeospatialType GeospatialType { get; set; } + } + public enum GeospatialType + { + Geography = 0, + Geometry = 1, + } + public class Headers : IEnumerable + { + public Headers(); + public virtual string ActivityId { get; } + public virtual string ContentLength { get; set; } + public virtual string ContentType { get; } + public virtual string ContinuationToken { get; } + public virtual string ETag { get; } + public virtual string this[string headerName] { get; set; } + public virtual string Location { get; } + public virtual double RequestCharge { get; } + public virtual string Session { get; } + public virtual void Add(string headerName, IEnumerable values); + public virtual void Add(string headerName, string value); + public virtual string[] AllKeys(); + public virtual string Get(string headerName); + public virtual IEnumerator GetEnumerator(); + public virtual T GetHeaderValue(string headerName); + public virtual string GetValueOrDefault(string headerName); + public virtual void Remove(string headerName); + public virtual void Set(string headerName, string value); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + public virtual bool TryGetValue(string headerName, out string value); + } + public sealed class IncludedPath + { + public IncludedPath(); + public string Path { get; set; } + } + public enum IndexingDirective + { + Default = 0, + Exclude = 2, + Include = 1, + } + public enum IndexingMode + { + Consistent = 0, + Lazy = 1, + None = 2, + } + public sealed class IndexingPolicy + { + public IndexingPolicy(); + public bool Automatic { get; set; } + public Collection> CompositeIndexes { get; } + public Collection ExcludedPaths { get; } + public Collection IncludedPaths { get; } + public IndexingMode IndexingMode { get; set; } + public Collection SpatialIndexes { get; } + } + public enum IndexKind + { + Hash = 0, + Range = 1, + Spatial = 2, + } + public class ItemRequestOptions : RequestOptions + { + public ItemRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + public IEnumerable PostTriggers { get; set; } + public IEnumerable PreTriggers { get; set; } + public string SessionToken { get; set; } + } + public class ItemResponse : Response + { + protected ItemResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public override HttpStatusCode StatusCode { get; } + } + public enum OperationKind + { + Create = 1, + Delete = 3, + Invalid = 0, + Read = 4, + Replace = 2, + } + public struct PartitionKey : IEquatable + { + public static readonly PartitionKey None; + public static readonly PartitionKey Null; + public static readonly string SystemKeyName; + public static readonly string SystemKeyPath; + public PartitionKey(bool partitionKeyValue); + public PartitionKey(double partitionKeyValue); + public PartitionKey(string partitionKeyValue); + public bool Equals(PartitionKey other); + public override bool Equals(object obj); + public override int GetHashCode(); + public static bool operator ==(PartitionKey left, PartitionKey right); + public static bool operator !=(PartitionKey left, PartitionKey right); + public override string ToString(); + } + public sealed class PartitionKeyBuilder + { + public PartitionKeyBuilder(); + public PartitionKeyBuilder Add(bool val); + public PartitionKeyBuilder Add(double val); + public PartitionKeyBuilder Add(string val); + public PartitionKeyBuilder AddNoneType(); + public PartitionKeyBuilder AddNullValue(); + public PartitionKey Build(); + } + public enum PartitionKeyDefinitionVersion + { + V1 = 1, + V2 = 2, + } + public sealed class PatchItemRequestOptions : ItemRequestOptions + { + public PatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public abstract class PatchOperation + { + protected PatchOperation(); + public virtual string From { get; set; } + public abstract PatchOperationType OperationType { get; } + public abstract string Path { get; } + public static PatchOperation Add(string path, T value); + public static PatchOperation Increment(string path, double value); + public static PatchOperation Increment(string path, long value); + public static PatchOperation Move(string from, string path); + public static PatchOperation Remove(string path); + public static PatchOperation Replace(string path, T value); + public static PatchOperation Set(string path, T value); + public virtual bool TrySerializeValueParameter(CosmosSerializer cosmosSerializer, out Stream valueParam); + } + public enum PatchOperationType + { + Add = 0, + Increment = 4, + Move = 5, + Remove = 1, + Replace = 2, + Set = 3, + } + public abstract class PatchOperation : PatchOperation + { + protected PatchOperation(); + public abstract T Value { get; } + } + public abstract class Permission + { + protected Permission(); + public abstract string Id { get; } + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadAsync(Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum PermissionMode : byte + { + All = (byte)2, + Read = (byte)1, + } + public class PermissionProperties + { + public PermissionProperties(string id, PermissionMode permissionMode, Container container, PartitionKey resourcePartitionKey, string itemId); + public PermissionProperties(string id, PermissionMode permissionMode, Container container, Nullable resourcePartitionKey=default(Nullable)); + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public PermissionMode PermissionMode { get; } + public Nullable ResourcePartitionKey { get; set; } + public string ResourceUri { get; } + public string SelfLink { get; } + public string Token { get; } + } + public class PermissionResponse : Response + { + protected PermissionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public virtual Permission Permission { get; } + public override double RequestCharge { get; } + public override PermissionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Permission (PermissionResponse response); + } + public enum PortReuseMode + { + PrivatePortPool = 1, + ReuseUnicastPort = 0, + } + public enum PriorityLevel + { + High = 1, + Low = 2, + } + public class QueryDefinition + { + public QueryDefinition(string query); + public string QueryText { get; } + public IReadOnlyList> GetQueryParameters(); + public QueryDefinition WithParameter(string name, object value); + public QueryDefinition WithParameterStream(string name, Stream valueStream); + } + public class QueryRequestOptions : RequestOptions + { + public QueryRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableLowPrecisionOrderBy { get; set; } + public bool EnableOptimisticDirectExecution { get; set; } + public Nullable EnableScanInQuery { get; set; } + public Nullable MaxBufferedItemCount { get; set; } + public Nullable MaxConcurrency { get; set; } + public Nullable MaxItemCount { get; set; } + public Nullable PartitionKey { get; set; } + public Nullable PopulateIndexMetrics { get; set; } + public Nullable ResponseContinuationTokenLimitInKb { get; set; } + public string SessionToken { get; set; } + } + public class ReadManyRequestOptions : RequestOptions + { + public ReadManyRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public static class Regions + { + public const string AustraliaCentral = "Australia Central"; + public const string AustraliaCentral2 = "Australia Central 2"; + public const string AustraliaEast = "Australia East"; + public const string AustraliaSoutheast = "Australia Southeast"; + public const string BrazilSouth = "Brazil South"; + public const string BrazilSoutheast = "Brazil Southeast"; + public const string CanadaCentral = "Canada Central"; + public const string CanadaEast = "Canada East"; + public const string CentralIndia = "Central India"; + public const string CentralUS = "Central US"; + public const string CentralUSEUAP = "Central US EUAP"; + public const string ChinaEast = "China East"; + public const string ChinaEast2 = "China East 2"; + public const string ChinaEast3 = "China East 3"; + public const string ChinaNorth = "China North"; + public const string ChinaNorth2 = "China North 2"; + public const string ChinaNorth3 = "China North 3"; + public const string EastAsia = "East Asia"; + public const string EastUS = "East US"; + public const string EastUS2 = "East US 2"; + public const string EastUS2EUAP = "East US 2 EUAP"; + public const string EastUSSLV = "East US SLV"; + public const string FranceCentral = "France Central"; + public const string FranceSouth = "France South"; + public const string GermanyCentral = "Germany Central"; + public const string GermanyNorth = "Germany North"; + public const string GermanyNortheast = "Germany Northeast"; + public const string GermanyWestCentral = "Germany West Central"; + public const string IsraelCentral = "Israel Central"; + public const string ItalyNorth = "Italy North"; + public const string JapanEast = "Japan East"; + public const string JapanWest = "Japan West"; + public const string JioIndiaCentral = "Jio India Central"; + public const string JioIndiaWest = "Jio India West"; + public const string KoreaCentral = "Korea Central"; + public const string KoreaSouth = "Korea South"; + public const string MalaysiaSouth = "Malaysia South"; + public const string NorthCentralUS = "North Central US"; + public const string NorthEurope = "North Europe"; + public const string NorwayEast = "Norway East"; + public const string NorwayWest = "Norway West"; + public const string PolandCentral = "Poland Central"; + public const string QatarCentral = "Qatar Central"; + public const string SouthAfricaNorth = "South Africa North"; + public const string SouthAfricaWest = "South Africa West"; + public const string SouthCentralUS = "South Central US"; + public const string SoutheastAsia = "Southeast Asia"; + public const string SouthIndia = "South India"; + public const string SwedenCentral = "Sweden Central"; + public const string SwedenSouth = "Sweden South"; + public const string SwitzerlandNorth = "Switzerland North"; + public const string SwitzerlandWest = "Switzerland West"; + public const string UAECentral = "UAE Central"; + public const string UAENorth = "UAE North"; + public const string UKSouth = "UK South"; + public const string UKWest = "UK West"; + public const string USDoDCentral = "USDoD Central"; + public const string USDoDEast = "USDoD East"; + public const string USGovArizona = "USGov Arizona"; + public const string USGovTexas = "USGov Texas"; + public const string USGovVirginia = "USGov Virginia"; + public const string USNatEast = "USNat East"; + public const string USNatWest = "USNat West"; + public const string USSecEast = "USSec East"; + public const string USSecWest = "USSec West"; + public const string WestCentralUS = "West Central US"; + public const string WestEurope = "West Europe"; + public const string WestIndia = "West India"; + public const string WestUS = "West US"; + public const string WestUS2 = "West US 2"; + public const string WestUS3 = "West US 3"; + } + public abstract class RequestHandler + { + protected RequestHandler(); + public RequestHandler InnerHandler { get; set; } + public virtual Task SendAsync(RequestMessage request, CancellationToken cancellationToken); + } + public class RequestMessage : IDisposable + { + public RequestMessage(); + public RequestMessage(HttpMethod method, Uri requestUri); + public virtual Stream Content { get; set; } + public virtual Headers Headers { get; } + public virtual HttpMethod Method { get; } + public virtual Dictionary Properties { get; } + public virtual Uri RequestUri { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + } + public class RequestOptions + { + public RequestOptions(); + public Action AddRequestHeaders { get; set; } + public string IfMatchEtag { get; set; } + public string IfNoneMatchEtag { get; set; } + public Nullable PriorityLevel { get; set; } + public IReadOnlyDictionary Properties { get; set; } + public RequestOptions ShallowCopy(); + } + public class ResponseMessage : IDisposable + { + public ResponseMessage(); + public ResponseMessage(HttpStatusCode statusCode, RequestMessage requestMessage=null, string errorMessage=null); + public virtual Stream Content { get; set; } + public virtual string ContinuationToken { get; } + public virtual CosmosDiagnostics Diagnostics { get; set; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public string IndexMetrics { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual RequestMessage RequestMessage { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual ResponseMessage EnsureSuccessStatusCode(); + } + public abstract class Response + { + protected Response(); + public abstract string ActivityId { get; } + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract string ETag { get; } + public abstract Headers Headers { get; } + public abstract double RequestCharge { get; } + public abstract T Resource { get; } + public abstract HttpStatusCode StatusCode { get; } + public static implicit operator T (Response response); + } + public sealed class SpatialPath + { + public SpatialPath(); + public BoundingBoxProperties BoundingBox { get; set; } + public string Path { get; set; } + public Collection SpatialTypes { get; } + } + public enum SpatialType + { + LineString = 1, + MultiPolygon = 3, + Point = 0, + Polygon = 2, + } + public class ThroughputProperties + { + public Nullable AutoscaleMaxThroughput { get; } + public string ETag { get; } + public Nullable LastModified { get; } + public string SelfLink { get; } + public Nullable Throughput { get; } + public static ThroughputProperties CreateAutoscaleThroughput(int autoscaleMaxThroughput); + public static ThroughputProperties CreateManualThroughput(int throughput); + } + public class ThroughputResponse : Response + { + protected ThroughputResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public Nullable IsReplacePending { get; } + public Nullable MinThroughput { get; } + public override double RequestCharge { get; } + public override ThroughputProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ThroughputProperties (ThroughputResponse response); + } + public abstract class TransactionalBatch + { + protected TransactionalBatch(); + public abstract TransactionalBatch CreateItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch CreateItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch DeleteItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract Task ExecuteAsync(TransactionalBatchRequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch PatchItem(string id, IReadOnlyList patchOperations, TransactionalBatchPatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReadItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItemStream(string id, Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItem(string id, T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + } + public class TransactionalBatchItemRequestOptions : RequestOptions + { + public TransactionalBatchItemRequestOptions(); + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + } + public class TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual string ETag { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual Stream ResourceStream { get; } + public virtual TimeSpan RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + } + public class TransactionalBatchOperationResult : TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual T Resource { get; set; } + } + public class TransactionalBatchPatchItemRequestOptions : TransactionalBatchItemRequestOptions + { + public TransactionalBatchPatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public class TransactionalBatchRequestOptions : RequestOptions + { + public TransactionalBatchRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public class TransactionalBatchResponse : IDisposable, IEnumerable, IEnumerable, IReadOnlyCollection, IReadOnlyList + { + protected TransactionalBatchResponse(); + public virtual string ActivityId { get; } + public virtual int Count { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual TransactionalBatchOperationResult this[int index] { get; } + public virtual double RequestCharge { get; } + public virtual Nullable RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual IEnumerator GetEnumerator(); + public virtual TransactionalBatchOperationResult GetOperationResultAtIndex(int index); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public class UniqueKey + { + public UniqueKey(); + public Collection Paths { get; } + } + public sealed class UniqueKeyPolicy + { + public UniqueKeyPolicy(); + public Collection UniqueKeys { get; } + } + public abstract class User + { + protected User(); + public abstract string Id { get; } + public abstract Task CreatePermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Permission GetPermission(string id); + public abstract FeedIterator GetPermissionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetPermissionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(UserProperties userProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertPermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class UserProperties + { + protected UserProperties(); + public UserProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class UserResponse : Response + { + protected UserResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public virtual User User { get; } + public static implicit operator User (UserResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Fluent +{ + public class ChangeFeedPolicyDefinition + { + public ContainerBuilder Attach(); + } + public sealed class ClientEncryptionPolicyDefinition + { + public ContainerBuilder Attach(); + public ClientEncryptionPolicyDefinition WithIncludedPath(ClientEncryptionIncludedPath path); + } + public class CompositeIndexDefinition + { + public T Attach(); + public CompositeIndexDefinition Path(string path); + public CompositeIndexDefinition Path(string path, CompositePathSortOrder sortOrder); + } + public class ComputedPropertiesDefinition + { + public T Attach(); + public ComputedPropertiesDefinition WithComputedProperty(string name, string query); + } + public class ConflictResolutionDefinition + { + public ContainerBuilder Attach(); + public ConflictResolutionDefinition WithCustomStoredProcedureResolution(string conflictResolutionProcedure); + public ConflictResolutionDefinition WithLastWriterWinsResolution(string conflictResolutionPath); + } + public class ContainerBuilder : ContainerDefinition + { + protected ContainerBuilder(); + public ContainerBuilder(Database database, string name, string partitionKeyPath); + public new ContainerProperties Build(); + public Task CreateAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public ChangeFeedPolicyDefinition WithChangeFeedPolicy(TimeSpan retention); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(int policyFormatVersion); + public ConflictResolutionDefinition WithConflictResolution(); + public UniqueKeyDefinition WithUniqueKey(); + } + public abstract class ContainerDefinition where T : ContainerDefinition + { + public ContainerDefinition(); + public ContainerProperties Build(); + public ComputedPropertiesDefinition WithComputedProperties(); + public T WithDefaultTimeToLive(int defaultTtlInSeconds); + public T WithDefaultTimeToLive(TimeSpan defaultTtlTimeSpan); + public IndexingPolicyDefinition WithIndexingPolicy(); + public T WithPartitionKeyDefinitionVersion(PartitionKeyDefinitionVersion partitionKeyDefinitionVersion); + public T WithTimeToLivePropertyPath(string propertyPath); + } + public class CosmosClientBuilder + { + public CosmosClientBuilder(string connectionString); + public CosmosClientBuilder(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential); + public CosmosClientBuilder(string accountEndpoint, TokenCredential tokenCredential); + public CosmosClientBuilder(string accountEndpoint, string authKeyOrResourceToken); + public CosmosClientBuilder AddCustomHandlers(params RequestHandler[] customHandlers); + public CosmosClient Build(); + public Task BuildAndInitializeAsync(IReadOnlyList> containers, CancellationToken cancellationToken=default(CancellationToken)); + public CosmosClientBuilder WithApplicationName(string applicationName); + public CosmosClientBuilder WithApplicationPreferredRegions(IReadOnlyList applicationPreferredRegions); + public CosmosClientBuilder WithApplicationRegion(string applicationRegion); + public CosmosClientBuilder WithBulkExecution(bool enabled); + public CosmosClientBuilder WithConnectionModeDirect(); + public CosmosClientBuilder WithConnectionModeDirect(Nullable idleTcpConnectionTimeout=default(Nullable), Nullable openTcpConnectionTimeout=default(Nullable), Nullable maxRequestsPerTcpConnection=default(Nullable), Nullable maxTcpConnectionsPerEndpoint=default(Nullable), Nullable portReuseMode=default(Nullable), Nullable enableTcpConnectionEndpointRediscovery=default(Nullable)); + public CosmosClientBuilder WithConnectionModeGateway(Nullable maxConnectionLimit=default(Nullable), IWebProxy webProxy=null); + public CosmosClientBuilder WithConsistencyLevel(ConsistencyLevel consistencyLevel); + public CosmosClientBuilder WithContentResponseOnWrite(bool contentResponseOnWrite); + public CosmosClientBuilder WithCustomSerializer(CosmosSerializer cosmosJsonSerializer); + public CosmosClientBuilder WithDistributedTracing(bool isEnabled=true); + public CosmosClientBuilder WithHttpClientFactory(Func httpClientFactory); + public CosmosClientBuilder WithLimitToEndpoint(bool limitToEndpoint); + public CosmosClientBuilder WithRequestTimeout(TimeSpan requestTimeout); + public CosmosClientBuilder WithSerializerOptions(CosmosSerializationOptions cosmosSerializerOptions); + public CosmosClientBuilder WithThrottlingRetryOptions(TimeSpan maxRetryWaitTimeOnThrottledRequests, int maxRetryAttemptsOnThrottledRequests); + } + public class IndexingPolicyDefinition + { + public IndexingPolicyDefinition(); + public T Attach(); + public IndexingPolicyDefinition WithAutomaticIndexing(bool enabled); + public CompositeIndexDefinition> WithCompositeIndex(); + public PathsDefinition> WithExcludedPaths(); + public PathsDefinition> WithIncludedPaths(); + public IndexingPolicyDefinition WithIndexingMode(IndexingMode indexingMode); + public SpatialIndexDefinition> WithSpatialIndex(); + } + public class PathsDefinition + { + public T Attach(); + public PathsDefinition Path(string path); + } + public class SpatialIndexDefinition + { + public T Attach(); + public SpatialIndexDefinition Path(string path); + public SpatialIndexDefinition Path(string path, params SpatialType[] spatialTypes); + } + public class UniqueKeyDefinition + { + public ContainerBuilder Attach(); + public UniqueKeyDefinition Path(string path); + } +} +namespace Microsoft.Azure.Cosmos.Linq +{ + public static class CosmosLinq + { + public static object InvokeUserDefinedFunction(string udfName, params object[] arguments); + } + public static class CosmosLinqExtensions + { + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> CountAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static bool IsArray(this object obj); + public static bool IsBool(this object obj); + public static bool IsDefined(this object obj); + public static bool IsNull(this object obj); + public static bool IsNumber(this object obj); + public static bool IsObject(this object obj); + public static bool IsPrimitive(this object obj); + public static bool IsString(this object obj); + public static Task> MaxAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> MinAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static FeedIterator ToFeedIterator(this IQueryable query); + public static QueryDefinition ToQueryDefinition(this IQueryable query); + public static QueryDefinition ToQueryDefinition(this IQueryable query, IDictionary namedParameters); + public static FeedIterator ToStreamIterator(this IQueryable query); + } +} +namespace Microsoft.Azure.Cosmos.Scripts +{ + public abstract class Scripts + { + protected Scripts(); + public abstract Task CreateStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ExecuteStoredProcedureAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, Stream streamPayload, PartitionKey partitionKey, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetStoredProcedureQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class StoredProcedureExecuteResponse : Response + { + protected StoredProcedureExecuteResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public virtual string ScriptLog { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + } + public class StoredProcedureProperties + { + public StoredProcedureProperties(); + public StoredProcedureProperties(string id, string body); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class StoredProcedureRequestOptions : RequestOptions + { + public StoredProcedureRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public bool EnableScriptLogging { get; set; } + public string SessionToken { get; set; } + } + public class StoredProcedureResponse : Response + { + protected StoredProcedureResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override StoredProcedureProperties Resource { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator StoredProcedureProperties (StoredProcedureResponse response); + } + public enum TriggerOperation : short + { + All = (short)0, + Create = (short)1, + Delete = (short)3, + Replace = (short)4, + Update = (short)2, + } + public class TriggerProperties + { + public TriggerProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + public TriggerOperation TriggerOperation { get; set; } + public TriggerType TriggerType { get; set; } + } + public class TriggerResponse : Response + { + protected TriggerResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override TriggerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator TriggerProperties (TriggerResponse response); + } + public enum TriggerType : byte + { + Post = (byte)1, + Pre = (byte)0, + } + public class UserDefinedFunctionProperties + { + public UserDefinedFunctionProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + } + public class UserDefinedFunctionResponse : Response + { + protected UserDefinedFunctionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserDefinedFunctionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator UserDefinedFunctionProperties (UserDefinedFunctionResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Spatial +{ + public sealed class BoundingBox : IEquatable + { + public BoundingBox(Position min, Position max); + public Position Max { get; } + public Position Min { get; } + public bool Equals(BoundingBox other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public abstract class Crs + { + protected Crs(CrsType type); + public static Crs Default { get; } + public CrsType Type { get; } + public static Crs Unspecified { get; } + public static LinkedCrs Linked(string href); + public static LinkedCrs Linked(string href, string type); + public static NamedCrs Named(string name); + } + public enum CrsType + { + Linked = 1, + Named = 0, + Unspecified = 2, + } + public abstract class Geometry + { + protected Geometry(GeometryType type, GeometryParams geometryParams); + public IDictionary AdditionalProperties { get; } + public BoundingBox BoundingBox { get; } + public Crs Crs { get; } + public GeometryType Type { get; } + public double Distance(Geometry to); + public override bool Equals(object obj); + public override int GetHashCode(); + public bool Intersects(Geometry geometry2); + public bool IsValid(); + public GeometryValidationResult IsValidDetailed(); + public bool Within(Geometry outer); + } + public class GeometryParams + { + public GeometryParams(); + public IDictionary AdditionalProperties { get; set; } + public BoundingBox BoundingBox { get; set; } + public Crs Crs { get; set; } + } + public enum GeometryShape + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public enum GeometryType + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public class GeometryValidationResult + { + public GeometryValidationResult(); + public bool IsValid { get; } + public string Reason { get; } + } + public sealed class LinearRing : IEquatable + { + public LinearRing(IList coordinates); + public ReadOnlyCollection Positions { get; } + public bool Equals(LinearRing other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LineString : Geometry, IEquatable + { + public LineString(IList coordinates); + public LineString(IList coordinates, GeometryParams geometryParams); + public ReadOnlyCollection Positions { get; } + public bool Equals(LineString other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LinkedCrs : Crs, IEquatable + { + public string Href { get; } + public string HrefType { get; } + public bool Equals(LinkedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class MultiPolygon : Geometry, IEquatable + { + public MultiPolygon(IList polygons); + public MultiPolygon(IList polygons, GeometryParams geometryParams); + public ReadOnlyCollection Polygons { get; } + public bool Equals(MultiPolygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class NamedCrs : Crs, IEquatable + { + public string Name { get; } + public bool Equals(NamedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Point : Geometry, IEquatable + { + public Point(Position position); + public Point(Position position, GeometryParams geometryParams); + public Point(double longitude, double latitude); + public Position Position { get; } + public bool Equals(Point other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Polygon : Geometry, IEquatable + { + public Polygon(IList rings); + public Polygon(IList rings, GeometryParams geometryParams); + public Polygon(IList externalRingPositions); + public ReadOnlyCollection Rings { get; } + public bool Equals(Polygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class PolygonCoordinates : IEquatable + { + public PolygonCoordinates(IList rings); + public ReadOnlyCollection Rings { get; } + public bool Equals(PolygonCoordinates other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Position : IEquatable + { + public Position(IList coordinates); + public Position(double longitude, double latitude); + public Position(double longitude, double latitude, Nullable altitude); + public Nullable Altitude { get; } + public ReadOnlyCollection Coordinates { get; } + public double Latitude { get; } + public double Longitude { get; } + public bool Equals(Position other); + public override bool Equals(object obj); + public override int GetHashCode(); + } +} diff --git a/Microsoft.Azure.Cosmos/contracts/API_3.35.2.txt b/Microsoft.Azure.Cosmos/contracts/API_3.35.2.txt new file mode 100644 index 0000000000..c0dc3e280f --- /dev/null +++ b/Microsoft.Azure.Cosmos/contracts/API_3.35.2.txt @@ -0,0 +1,1502 @@ +namespace Microsoft.Azure.Cosmos +{ + public class AccountConsistency + { + public AccountConsistency(); + public ConsistencyLevel DefaultConsistencyLevel { get; } + public int MaxStalenessIntervalInSeconds { get; } + public int MaxStalenessPrefix { get; } + } + public class AccountProperties + { + public AccountConsistency Consistency { get; } + public string ETag { get; } + public string Id { get; } + public IEnumerable ReadableRegions { get; } + public IEnumerable WritableRegions { get; } + } + public class AccountRegion + { + public AccountRegion(); + public string Endpoint { get; } + public string Name { get; } + } + public sealed class BoundingBoxProperties + { + public BoundingBoxProperties(); + public double Xmax { get; set; } + public double Xmin { get; set; } + public double Ymax { get; set; } + public double Ymin { get; set; } + } + public abstract class ChangeFeedEstimator + { + protected ChangeFeedEstimator(); + public abstract FeedIterator GetCurrentStateIterator(ChangeFeedEstimatorRequestOptions changeFeedEstimatorRequestOptions=null); + } + public sealed class ChangeFeedEstimatorRequestOptions + { + public ChangeFeedEstimatorRequestOptions(); + public Nullable MaxItemCount { get; set; } + } + public abstract class ChangeFeedMode + { + public static ChangeFeedMode Incremental { get; } + public static ChangeFeedMode LatestVersion { get; } + } + public abstract class ChangeFeedProcessor + { + protected ChangeFeedProcessor(); + public abstract Task StartAsync(); + public abstract Task StopAsync(); + } + public class ChangeFeedProcessorBuilder + { + public ChangeFeedProcessor Build(); + public ChangeFeedProcessorBuilder WithErrorNotification(Container.ChangeFeedMonitorErrorDelegate errorDelegate); + public ChangeFeedProcessorBuilder WithInstanceName(string instanceName); + public ChangeFeedProcessorBuilder WithLeaseAcquireNotification(Container.ChangeFeedMonitorLeaseAcquireDelegate acquireDelegate); + public ChangeFeedProcessorBuilder WithLeaseConfiguration(Nullable acquireInterval=default(Nullable), Nullable expirationInterval=default(Nullable), Nullable renewInterval=default(Nullable)); + public ChangeFeedProcessorBuilder WithLeaseContainer(Container leaseContainer); + public ChangeFeedProcessorBuilder WithLeaseReleaseNotification(Container.ChangeFeedMonitorLeaseReleaseDelegate releaseDelegate); + public ChangeFeedProcessorBuilder WithMaxItems(int maxItemCount); + public ChangeFeedProcessorBuilder WithPollInterval(TimeSpan pollInterval); + public ChangeFeedProcessorBuilder WithStartTime(DateTime startTime); + } + public abstract class ChangeFeedProcessorContext + { + protected ChangeFeedProcessorContext(); + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract Headers Headers { get; } + public abstract string LeaseToken { get; } + } + public sealed class ChangeFeedProcessorState + { + public ChangeFeedProcessorState(string leaseToken, long estimatedLag, string instanceName); + public long EstimatedLag { get; } + public string InstanceName { get; } + public string LeaseToken { get; } + } + public class ChangeFeedProcessorUserException : Exception + { + public ChangeFeedProcessorUserException(Exception originalException, ChangeFeedProcessorContext context); + protected ChangeFeedProcessorUserException(SerializationInfo info, StreamingContext context); + public ChangeFeedProcessorContext ChangeFeedProcessorContext { get; } + public override void GetObjectData(SerializationInfo info, StreamingContext context); + } + public sealed class ChangeFeedRequestOptions : RequestOptions + { + public ChangeFeedRequestOptions(); + public new string IfMatchEtag { get; set; } + public new string IfNoneMatchEtag { get; set; } + public Nullable PageSizeHint { get; set; } + } + public abstract class ChangeFeedStartFrom + { + public static ChangeFeedStartFrom Beginning(); + public static ChangeFeedStartFrom Beginning(FeedRange feedRange); + public static ChangeFeedStartFrom ContinuationToken(string continuationToken); + public static ChangeFeedStartFrom Now(); + public static ChangeFeedStartFrom Now(FeedRange feedRange); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc, FeedRange feedRange); + } + public sealed class ClientEncryptionIncludedPath + { + public ClientEncryptionIncludedPath(); + public string ClientEncryptionKeyId { get; set; } + public string EncryptionAlgorithm { get; set; } + public string EncryptionType { get; set; } + public string Path { get; set; } + } + public abstract class ClientEncryptionKey + { + protected ClientEncryptionKey(); + public abstract string Id { get; } + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class ClientEncryptionKeyProperties : IEquatable + { + protected ClientEncryptionKeyProperties(); + public ClientEncryptionKeyProperties(string id, string encryptionAlgorithm, byte[] wrappedDataEncryptionKey, EncryptionKeyWrapMetadata encryptionKeyWrapMetadata); + public Nullable CreatedTime { get; } + public string EncryptionAlgorithm { get; } + public EncryptionKeyWrapMetadata EncryptionKeyWrapMetadata { get; } + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public virtual string SelfLink { get; } + public byte[] WrappedDataEncryptionKey { get; } + public bool Equals(ClientEncryptionKeyProperties other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public class ClientEncryptionKeyResponse : Response + { + protected ClientEncryptionKeyResponse(); + public override string ActivityId { get; } + public virtual ClientEncryptionKey ClientEncryptionKey { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ClientEncryptionKeyProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ClientEncryptionKey (ClientEncryptionKeyResponse response); + } + public sealed class ClientEncryptionPolicy + { + public ClientEncryptionPolicy(IEnumerable includedPaths); + public ClientEncryptionPolicy(IEnumerable includedPaths, int policyFormatVersion); + public IEnumerable IncludedPaths { get; } + public int PolicyFormatVersion { get; } + } + public sealed class CompositePath + { + public CompositePath(); + public CompositePathSortOrder Order { get; set; } + public string Path { get; set; } + } + public enum CompositePathSortOrder + { + Ascending = 0, + Descending = 1, + } + public class ConflictProperties + { + public ConflictProperties(); + public string Id { get; } + public OperationKind OperationKind { get; } + public string SelfLink { get; } + } + public enum ConflictResolutionMode + { + Custom = 1, + LastWriterWins = 0, + } + public class ConflictResolutionPolicy + { + public ConflictResolutionPolicy(); + public ConflictResolutionMode Mode { get; set; } + public string ResolutionPath { get; set; } + public string ResolutionProcedure { get; set; } + } + public abstract class Conflicts + { + protected Conflicts(); + public abstract Task DeleteAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetConflictQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract T ReadConflictContent(ConflictProperties conflict); + public abstract Task> ReadCurrentAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum ConnectionMode + { + Direct = 1, + Gateway = 0, + } + public enum ConsistencyLevel + { + BoundedStaleness = 1, + ConsistentPrefix = 4, + Eventual = 3, + Session = 2, + Strong = 0, + } + public abstract class Container + { + protected Container(); + public abstract Conflicts Conflicts { get; } + public abstract Database Database { get; } + public abstract string Id { get; } + public abstract Scripts Scripts { get; } + public abstract Task> CreateItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch CreateTransactionalBatch(PartitionKey partitionKey); + public abstract Task DeleteContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> DeleteItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ChangeFeedEstimator GetChangeFeedEstimator(string processorName, Container leaseContainer); + public abstract ChangeFeedProcessorBuilder GetChangeFeedEstimatorBuilder(string processorName, Container.ChangesEstimationHandler estimationDelegate, Nullable estimationPeriod=default(Nullable)); + public abstract FeedIterator GetChangeFeedIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedStreamHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedStreamHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangesHandler onChangesDelegate); + public abstract FeedIterator GetChangeFeedStreamIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract Task> GetFeedRangesAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract IOrderedQueryable GetItemLinqQueryable(bool allowSynchronousQueryExecution=false, string continuationToken=null, QueryRequestOptions requestOptions=null, CosmosLinqSerializerOptions linqSerializerOptions=null); + public abstract FeedIterator GetItemQueryIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task> PatchItemAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task PatchItemStreamAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadManyItemsAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadManyItemsStreamAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerStreamAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReplaceItemAsync(T item, string id, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceItemStreamAsync(Stream streamPayload, string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> UpsertItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public delegate Task ChangeFeedHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, IReadOnlyCollection changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangeFeedHandler(ChangeFeedProcessorContext context, IReadOnlyCollection changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedMonitorErrorDelegate(string leaseToken, Exception exception); + public delegate Task ChangeFeedMonitorLeaseAcquireDelegate(string leaseToken); + public delegate Task ChangeFeedMonitorLeaseReleaseDelegate(string leaseToken); + public delegate Task ChangeFeedStreamHandler(ChangeFeedProcessorContext context, Stream changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedStreamHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, Stream changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangesEstimationHandler(long estimatedPendingChanges, CancellationToken cancellationToken); + public delegate Task ChangesHandler(IReadOnlyCollection changes, CancellationToken cancellationToken); + } + public class ContainerProperties + { + public ContainerProperties(); + public ContainerProperties(string id, IReadOnlyList partitionKeyPaths); + public ContainerProperties(string id, string partitionKeyPath); + public Nullable AnalyticalStoreTimeToLiveInSeconds { get; set; } + public ClientEncryptionPolicy ClientEncryptionPolicy { get; set; } + public ConflictResolutionPolicy ConflictResolutionPolicy { get; set; } + public Nullable DefaultTimeToLive { get; set; } + public string ETag { get; } + public GeospatialConfig GeospatialConfig { get; set; } + public string Id { get; set; } + public IndexingPolicy IndexingPolicy { get; set; } + public Nullable LastModified { get; } + public Nullable PartitionKeyDefinitionVersion { get; set; } + public string PartitionKeyPath { get; set; } + public IReadOnlyList PartitionKeyPaths { get; set; } + public string SelfLink { get; } + public string TimeToLivePropertyPath { get; set; } + public UniqueKeyPolicy UniqueKeyPolicy { get; set; } + } + public class ContainerRequestOptions : RequestOptions + { + public ContainerRequestOptions(); + public bool PopulateQuotaInfo { get; set; } + } + public class ContainerResponse : Response + { + protected ContainerResponse(); + public override string ActivityId { get; } + public virtual Container Container { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ContainerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Container (ContainerResponse response); + } + public class CosmosClient : IDisposable + { + protected CosmosClient(); + public CosmosClient(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, TokenCredential tokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string connectionString, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, string authKeyOrResourceToken, CosmosClientOptions clientOptions=null); + public virtual CosmosClientOptions ClientOptions { get; } + public virtual Uri Endpoint { get; } + public virtual CosmosResponseFactory ResponseFactory { get; } + public static Task CreateAndInitializeAsync(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, TokenCredential tokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string connectionString, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, string authKeyOrResourceToken, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseStreamAsync(DatabaseProperties databaseProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual Container GetContainer(string databaseId, string containerId); + public virtual Database GetDatabase(string id); + public virtual FeedIterator GetDatabaseQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual Task ReadAccountAsync(); + } + public class CosmosClientOptions + { + public CosmosClientOptions(); + public bool AllowBulkExecution { get; set; } + public string ApplicationName { get; set; } + public IReadOnlyList ApplicationPreferredRegions { get; set; } + public string ApplicationRegion { get; set; } + public ConnectionMode ConnectionMode { get; set; } + public Nullable ConsistencyLevel { get; set; } + public Collection CustomHandlers { get; } + public Nullable EnableContentResponseOnWrite { get; set; } + public bool EnableTcpConnectionEndpointRediscovery { get; set; } + public int GatewayModeMaxConnectionLimit { get; set; } + public Func HttpClientFactory { get; set; } + public Nullable IdleTcpConnectionTimeout { get; set; } + public bool LimitToEndpoint { get; set; } + public Nullable MaxRequestsPerTcpConnection { get; set; } + public Nullable MaxRetryAttemptsOnRateLimitedRequests { get; set; } + public Nullable MaxRetryWaitTimeOnRateLimitedRequests { get; set; } + public Nullable MaxTcpConnectionsPerEndpoint { get; set; } + public Nullable OpenTcpConnectionTimeout { get; set; } + public Nullable PortReuseMode { get; set; } + public TimeSpan RequestTimeout { get; set; } + public CosmosSerializer Serializer { get; set; } + public CosmosSerializationOptions SerializerOptions { get; set; } + public Func ServerCertificateCustomValidationCallback { get; set; } + public Nullable TokenCredentialBackgroundRefreshInterval { get; set; } + public IWebProxy WebProxy { get; set; } + } + public abstract class CosmosDiagnostics + { + protected CosmosDiagnostics(); + public virtual TimeSpan GetClientElapsedTime(); + public abstract IReadOnlyList> GetContactedRegions(); + public virtual int GetFailedRequestCount(); + public virtual Nullable GetStartTimeUtc(); + public abstract override string ToString(); + } + public class CosmosException : Exception + { + public CosmosException(string message, HttpStatusCode statusCode, int subStatusCode, string activityId, double requestCharge); + public virtual string ActivityId { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual Headers Headers { get; } + public override string Message { get; } + public virtual double RequestCharge { get; } + public virtual string ResponseBody { get; } + public virtual Nullable RetryAfter { get; } + public override string StackTrace { get; } + public virtual HttpStatusCode StatusCode { get; } + public virtual int SubStatusCode { get; } + public override string ToString(); + public virtual bool TryGetHeader(string headerName, out string value); + } + public sealed class CosmosLinqSerializerOptions + { + public CosmosLinqSerializerOptions(); + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public class CosmosOperationCanceledException : OperationCanceledException + { + public CosmosOperationCanceledException(OperationCanceledException originalException, CosmosDiagnostics diagnostics); + protected CosmosOperationCanceledException(SerializationInfo info, StreamingContext context); + public override IDictionary Data { get; } + public CosmosDiagnostics Diagnostics { get; } + public override string HelpLink { get; set; } + public override string Message { get; } + public override string Source { get; set; } + public override string StackTrace { get; } + public override Exception GetBaseException(); + public override void GetObjectData(SerializationInfo info, StreamingContext context); + public override string ToString(); + } + public enum CosmosPropertyNamingPolicy + { + CamelCase = 1, + Default = 0, + } + public abstract class CosmosResponseFactory + { + protected CosmosResponseFactory(); + public abstract FeedResponse CreateItemFeedResponse(ResponseMessage responseMessage); + public abstract ItemResponse CreateItemResponse(ResponseMessage responseMessage); + public abstract StoredProcedureExecuteResponse CreateStoredProcedureExecuteResponse(ResponseMessage responseMessage); + } + public sealed class CosmosSerializationOptions + { + public CosmosSerializationOptions(); + public bool IgnoreNullValues { get; set; } + public bool Indented { get; set; } + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public abstract class CosmosSerializer + { + protected CosmosSerializer(); + public abstract T FromStream(Stream stream); + public abstract Stream ToStream(T input); + } + public abstract class Database + { + protected Database(); + public abstract CosmosClient Client { get; } + public abstract string Id { get; } + public abstract Task CreateClientEncryptionKeyAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ContainerBuilder DefineContainer(string name, string partitionKeyPath); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ClientEncryptionKey GetClientEncryptionKey(string id); + public abstract FeedIterator GetClientEncryptionKeyQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Container GetContainer(string id); + public abstract FeedIterator GetContainerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract User GetUser(string id); + public abstract FeedIterator GetUserQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class DatabaseProperties + { + public DatabaseProperties(); + public DatabaseProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class DatabaseResponse : Response + { + protected DatabaseResponse(); + public override string ActivityId { get; } + public virtual Database Database { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override DatabaseProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Database (DatabaseResponse response); + } + public enum DataType + { + LineString = 3, + MultiPolygon = 5, + Number = 0, + Point = 2, + Polygon = 4, + String = 1, + } + public class DedicatedGatewayRequestOptions + { + public DedicatedGatewayRequestOptions(); + public Nullable MaxIntegratedCacheStaleness { get; set; } + } + public class EncryptionKeyWrapMetadata : IEquatable + { + public EncryptionKeyWrapMetadata(EncryptionKeyWrapMetadata source); + public EncryptionKeyWrapMetadata(string type, string name, string value, string algorithm); + public string Algorithm { get; } + public string Name { get; } + public string Type { get; } + public string Value { get; } + public bool Equals(EncryptionKeyWrapMetadata other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class ExcludedPath + { + public ExcludedPath(); + public string Path { get; set; } + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task> ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedRange + { + protected FeedRange(); + public static FeedRange FromJsonString(string toStringValue); + public static FeedRange FromPartitionKey(PartitionKey partitionKey); + public abstract string ToJsonString(); + } + public abstract class FeedResponse : IEnumerable, IEnumerable + { + protected FeedResponse(); + public override string ActivityId { get; } + public abstract string ContinuationToken { get; } + public abstract int Count { get; } + public override string ETag { get; } + public abstract string IndexMetrics { get; } + public override double RequestCharge { get; } + public abstract IEnumerator GetEnumerator(); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public sealed class GeospatialConfig + { + public GeospatialConfig(); + public GeospatialConfig(GeospatialType geospatialType); + public GeospatialType GeospatialType { get; set; } + } + public enum GeospatialType + { + Geography = 0, + Geometry = 1, + } + public class Headers : IEnumerable + { + public Headers(); + public virtual string ActivityId { get; } + public virtual string ContentLength { get; set; } + public virtual string ContentType { get; } + public virtual string ContinuationToken { get; } + public virtual string ETag { get; } + public virtual string this[string headerName] { get; set; } + public virtual string Location { get; } + public virtual double RequestCharge { get; } + public virtual string Session { get; } + public virtual void Add(string headerName, IEnumerable values); + public virtual void Add(string headerName, string value); + public virtual string[] AllKeys(); + public virtual string Get(string headerName); + public virtual IEnumerator GetEnumerator(); + public virtual T GetHeaderValue(string headerName); + public virtual string GetValueOrDefault(string headerName); + public virtual void Remove(string headerName); + public virtual void Set(string headerName, string value); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + public virtual bool TryGetValue(string headerName, out string value); + } + public sealed class IncludedPath + { + public IncludedPath(); + public string Path { get; set; } + } + public enum IndexingDirective + { + Default = 0, + Exclude = 2, + Include = 1, + } + public enum IndexingMode + { + Consistent = 0, + Lazy = 1, + None = 2, + } + public sealed class IndexingPolicy + { + public IndexingPolicy(); + public bool Automatic { get; set; } + public Collection> CompositeIndexes { get; } + public Collection ExcludedPaths { get; } + public Collection IncludedPaths { get; } + public IndexingMode IndexingMode { get; set; } + public Collection SpatialIndexes { get; } + } + public enum IndexKind + { + Hash = 0, + Range = 1, + Spatial = 2, + } + public class ItemRequestOptions : RequestOptions + { + public ItemRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + public IEnumerable PostTriggers { get; set; } + public IEnumerable PreTriggers { get; set; } + public string SessionToken { get; set; } + } + public class ItemResponse : Response + { + protected ItemResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public override HttpStatusCode StatusCode { get; } + } + public enum OperationKind + { + Create = 1, + Delete = 3, + Invalid = 0, + Read = 4, + Replace = 2, + } + public struct PartitionKey : IEquatable + { + public static readonly PartitionKey None; + public static readonly PartitionKey Null; + public static readonly string SystemKeyName; + public static readonly string SystemKeyPath; + public PartitionKey(bool partitionKeyValue); + public PartitionKey(double partitionKeyValue); + public PartitionKey(string partitionKeyValue); + public bool Equals(PartitionKey other); + public override bool Equals(object obj); + public override int GetHashCode(); + public static bool operator ==(PartitionKey left, PartitionKey right); + public static bool operator !=(PartitionKey left, PartitionKey right); + public override string ToString(); + } + public sealed class PartitionKeyBuilder + { + public PartitionKeyBuilder(); + public PartitionKeyBuilder Add(bool val); + public PartitionKeyBuilder Add(double val); + public PartitionKeyBuilder Add(string val); + public PartitionKeyBuilder AddNoneType(); + public PartitionKeyBuilder AddNullValue(); + public PartitionKey Build(); + } + public enum PartitionKeyDefinitionVersion + { + V1 = 1, + V2 = 2, + } + public sealed class PatchItemRequestOptions : ItemRequestOptions + { + public PatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public abstract class PatchOperation + { + protected PatchOperation(); + public virtual string From { get; set; } + public abstract PatchOperationType OperationType { get; } + public abstract string Path { get; } + public static PatchOperation Add(string path, T value); + public static PatchOperation Increment(string path, double value); + public static PatchOperation Increment(string path, long value); + public static PatchOperation Move(string from, string path); + public static PatchOperation Remove(string path); + public static PatchOperation Replace(string path, T value); + public static PatchOperation Set(string path, T value); + public virtual bool TrySerializeValueParameter(CosmosSerializer cosmosSerializer, out Stream valueParam); + } + public enum PatchOperationType + { + Add = 0, + Increment = 4, + Move = 5, + Remove = 1, + Replace = 2, + Set = 3, + } + public abstract class PatchOperation : PatchOperation + { + protected PatchOperation(); + public abstract T Value { get; } + } + public abstract class Permission + { + protected Permission(); + public abstract string Id { get; } + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadAsync(Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum PermissionMode : byte + { + All = (byte)2, + Read = (byte)1, + } + public class PermissionProperties + { + public PermissionProperties(string id, PermissionMode permissionMode, Container container, PartitionKey resourcePartitionKey, string itemId); + public PermissionProperties(string id, PermissionMode permissionMode, Container container, Nullable resourcePartitionKey=default(Nullable)); + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public PermissionMode PermissionMode { get; } + public Nullable ResourcePartitionKey { get; set; } + public string ResourceUri { get; } + public string SelfLink { get; } + public string Token { get; } + } + public class PermissionResponse : Response + { + protected PermissionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public virtual Permission Permission { get; } + public override double RequestCharge { get; } + public override PermissionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Permission (PermissionResponse response); + } + public enum PortReuseMode + { + PrivatePortPool = 1, + ReuseUnicastPort = 0, + } + public class QueryDefinition + { + public QueryDefinition(string query); + public string QueryText { get; } + public IReadOnlyList> GetQueryParameters(); + public QueryDefinition WithParameter(string name, object value); + public QueryDefinition WithParameterStream(string name, Stream valueStream); + } + public class QueryRequestOptions : RequestOptions + { + public QueryRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableLowPrecisionOrderBy { get; set; } + public Nullable EnableScanInQuery { get; set; } + public Nullable MaxBufferedItemCount { get; set; } + public Nullable MaxConcurrency { get; set; } + public Nullable MaxItemCount { get; set; } + public Nullable PartitionKey { get; set; } + public Nullable PopulateIndexMetrics { get; set; } + public Nullable ResponseContinuationTokenLimitInKb { get; set; } + public string SessionToken { get; set; } + } + public class ReadManyRequestOptions : RequestOptions + { + public ReadManyRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public static class Regions + { + public const string AustraliaCentral = "Australia Central"; + public const string AustraliaCentral2 = "Australia Central 2"; + public const string AustraliaEast = "Australia East"; + public const string AustraliaSoutheast = "Australia Southeast"; + public const string BrazilSouth = "Brazil South"; + public const string BrazilSoutheast = "Brazil Southeast"; + public const string CanadaCentral = "Canada Central"; + public const string CanadaEast = "Canada East"; + public const string CentralIndia = "Central India"; + public const string CentralUS = "Central US"; + public const string CentralUSEUAP = "Central US EUAP"; + public const string ChinaEast = "China East"; + public const string ChinaEast2 = "China East 2"; + public const string ChinaEast3 = "China East 3"; + public const string ChinaNorth = "China North"; + public const string ChinaNorth2 = "China North 2"; + public const string ChinaNorth3 = "China North 3"; + public const string EastAsia = "East Asia"; + public const string EastUS = "East US"; + public const string EastUS2 = "East US 2"; + public const string EastUS2EUAP = "East US 2 EUAP"; + public const string EastUSSLV = "East US SLV"; + public const string FranceCentral = "France Central"; + public const string FranceSouth = "France South"; + public const string GermanyCentral = "Germany Central"; + public const string GermanyNorth = "Germany North"; + public const string GermanyNortheast = "Germany Northeast"; + public const string GermanyWestCentral = "Germany West Central"; + public const string IsraelCentral = "Israel Central"; + public const string ItalyNorth = "Italy North"; + public const string JapanEast = "Japan East"; + public const string JapanWest = "Japan West"; + public const string JioIndiaCentral = "Jio India Central"; + public const string JioIndiaWest = "Jio India West"; + public const string KoreaCentral = "Korea Central"; + public const string KoreaSouth = "Korea South"; + public const string MalaysiaSouth = "Malaysia South"; + public const string NorthCentralUS = "North Central US"; + public const string NorthEurope = "North Europe"; + public const string NorwayEast = "Norway East"; + public const string NorwayWest = "Norway West"; + public const string PolandCentral = "Poland Central"; + public const string QatarCentral = "Qatar Central"; + public const string SouthAfricaNorth = "South Africa North"; + public const string SouthAfricaWest = "South Africa West"; + public const string SouthCentralUS = "South Central US"; + public const string SoutheastAsia = "Southeast Asia"; + public const string SouthIndia = "South India"; + public const string SwedenCentral = "Sweden Central"; + public const string SwedenSouth = "Sweden South"; + public const string SwitzerlandNorth = "Switzerland North"; + public const string SwitzerlandWest = "Switzerland West"; + public const string UAECentral = "UAE Central"; + public const string UAENorth = "UAE North"; + public const string UKSouth = "UK South"; + public const string UKWest = "UK West"; + public const string USDoDCentral = "USDoD Central"; + public const string USDoDEast = "USDoD East"; + public const string USGovArizona = "USGov Arizona"; + public const string USGovTexas = "USGov Texas"; + public const string USGovVirginia = "USGov Virginia"; + public const string USNatEast = "USNat East"; + public const string USNatWest = "USNat West"; + public const string USSecEast = "USSec East"; + public const string USSecWest = "USSec West"; + public const string WestCentralUS = "West Central US"; + public const string WestEurope = "West Europe"; + public const string WestIndia = "West India"; + public const string WestUS = "West US"; + public const string WestUS2 = "West US 2"; + public const string WestUS3 = "West US 3"; + } + public abstract class RequestHandler + { + protected RequestHandler(); + public RequestHandler InnerHandler { get; set; } + public virtual Task SendAsync(RequestMessage request, CancellationToken cancellationToken); + } + public class RequestMessage : IDisposable + { + public RequestMessage(); + public RequestMessage(HttpMethod method, Uri requestUri); + public virtual Stream Content { get; set; } + public virtual Headers Headers { get; } + public virtual HttpMethod Method { get; } + public virtual Dictionary Properties { get; } + public virtual Uri RequestUri { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + } + public class RequestOptions + { + public RequestOptions(); + public Action AddRequestHeaders { get; set; } + public string IfMatchEtag { get; set; } + public string IfNoneMatchEtag { get; set; } + public IReadOnlyDictionary Properties { get; set; } + public RequestOptions ShallowCopy(); + } + public class ResponseMessage : IDisposable + { + public ResponseMessage(); + public ResponseMessage(HttpStatusCode statusCode, RequestMessage requestMessage=null, string errorMessage=null); + public virtual Stream Content { get; set; } + public virtual string ContinuationToken { get; } + public virtual CosmosDiagnostics Diagnostics { get; set; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public string IndexMetrics { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual RequestMessage RequestMessage { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual ResponseMessage EnsureSuccessStatusCode(); + } + public abstract class Response + { + protected Response(); + public abstract string ActivityId { get; } + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract string ETag { get; } + public abstract Headers Headers { get; } + public abstract double RequestCharge { get; } + public abstract T Resource { get; } + public abstract HttpStatusCode StatusCode { get; } + public static implicit operator T (Response response); + } + public sealed class SpatialPath + { + public SpatialPath(); + public BoundingBoxProperties BoundingBox { get; set; } + public string Path { get; set; } + public Collection SpatialTypes { get; } + } + public enum SpatialType + { + LineString = 1, + MultiPolygon = 3, + Point = 0, + Polygon = 2, + } + public class ThroughputProperties + { + public Nullable AutoscaleMaxThroughput { get; } + public string ETag { get; } + public Nullable LastModified { get; } + public string SelfLink { get; } + public Nullable Throughput { get; } + public static ThroughputProperties CreateAutoscaleThroughput(int autoscaleMaxThroughput); + public static ThroughputProperties CreateManualThroughput(int throughput); + } + public class ThroughputResponse : Response + { + protected ThroughputResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public Nullable IsReplacePending { get; } + public Nullable MinThroughput { get; } + public override double RequestCharge { get; } + public override ThroughputProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ThroughputProperties (ThroughputResponse response); + } + public abstract class TransactionalBatch + { + protected TransactionalBatch(); + public abstract TransactionalBatch CreateItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch CreateItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch DeleteItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract Task ExecuteAsync(TransactionalBatchRequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch PatchItem(string id, IReadOnlyList patchOperations, TransactionalBatchPatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReadItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItemStream(string id, Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItem(string id, T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + } + public class TransactionalBatchItemRequestOptions : RequestOptions + { + public TransactionalBatchItemRequestOptions(); + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + } + public class TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual string ETag { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual Stream ResourceStream { get; } + public virtual TimeSpan RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + } + public class TransactionalBatchOperationResult : TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual T Resource { get; set; } + } + public class TransactionalBatchPatchItemRequestOptions : TransactionalBatchItemRequestOptions + { + public TransactionalBatchPatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public class TransactionalBatchRequestOptions : RequestOptions + { + public TransactionalBatchRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public class TransactionalBatchResponse : IDisposable, IEnumerable, IEnumerable, IReadOnlyCollection, IReadOnlyList + { + protected TransactionalBatchResponse(); + public virtual string ActivityId { get; } + public virtual int Count { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual TransactionalBatchOperationResult this[int index] { get; } + public virtual double RequestCharge { get; } + public virtual Nullable RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual IEnumerator GetEnumerator(); + public virtual TransactionalBatchOperationResult GetOperationResultAtIndex(int index); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public class UniqueKey + { + public UniqueKey(); + public Collection Paths { get; } + } + public sealed class UniqueKeyPolicy + { + public UniqueKeyPolicy(); + public Collection UniqueKeys { get; } + } + public abstract class User + { + protected User(); + public abstract string Id { get; } + public abstract Task CreatePermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Permission GetPermission(string id); + public abstract FeedIterator GetPermissionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetPermissionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(UserProperties userProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertPermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class UserProperties + { + protected UserProperties(); + public UserProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class UserResponse : Response + { + protected UserResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public virtual User User { get; } + public static implicit operator User (UserResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Fluent +{ + public sealed class ClientEncryptionPolicyDefinition + { + public ContainerBuilder Attach(); + public ClientEncryptionPolicyDefinition WithIncludedPath(ClientEncryptionIncludedPath path); + } + public class CompositeIndexDefinition + { + public T Attach(); + public CompositeIndexDefinition Path(string path); + public CompositeIndexDefinition Path(string path, CompositePathSortOrder sortOrder); + } + public class ConflictResolutionDefinition + { + public ContainerBuilder Attach(); + public ConflictResolutionDefinition WithCustomStoredProcedureResolution(string conflictResolutionProcedure); + public ConflictResolutionDefinition WithLastWriterWinsResolution(string conflictResolutionPath); + } + public class ContainerBuilder : ContainerDefinition + { + protected ContainerBuilder(); + public ContainerBuilder(Database database, string name, string partitionKeyPath); + public new ContainerProperties Build(); + public Task CreateAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(int policyFormatVersion); + public ConflictResolutionDefinition WithConflictResolution(); + public UniqueKeyDefinition WithUniqueKey(); + } + public abstract class ContainerDefinition where T : ContainerDefinition + { + public ContainerDefinition(); + public ContainerProperties Build(); + public T WithDefaultTimeToLive(int defaultTtlInSeconds); + public T WithDefaultTimeToLive(TimeSpan defaultTtlTimeSpan); + public IndexingPolicyDefinition WithIndexingPolicy(); + public T WithPartitionKeyDefinitionVersion(PartitionKeyDefinitionVersion partitionKeyDefinitionVersion); + public T WithTimeToLivePropertyPath(string propertyPath); + } + public class CosmosClientBuilder + { + public CosmosClientBuilder(string connectionString); + public CosmosClientBuilder(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential); + public CosmosClientBuilder(string accountEndpoint, TokenCredential tokenCredential); + public CosmosClientBuilder(string accountEndpoint, string authKeyOrResourceToken); + public CosmosClientBuilder AddCustomHandlers(params RequestHandler[] customHandlers); + public CosmosClient Build(); + public Task BuildAndInitializeAsync(IReadOnlyList> containers, CancellationToken cancellationToken=default(CancellationToken)); + public CosmosClientBuilder WithApplicationName(string applicationName); + public CosmosClientBuilder WithApplicationPreferredRegions(IReadOnlyList applicationPreferredRegions); + public CosmosClientBuilder WithApplicationRegion(string applicationRegion); + public CosmosClientBuilder WithBulkExecution(bool enabled); + public CosmosClientBuilder WithConnectionModeDirect(); + public CosmosClientBuilder WithConnectionModeDirect(Nullable idleTcpConnectionTimeout=default(Nullable), Nullable openTcpConnectionTimeout=default(Nullable), Nullable maxRequestsPerTcpConnection=default(Nullable), Nullable maxTcpConnectionsPerEndpoint=default(Nullable), Nullable portReuseMode=default(Nullable), Nullable enableTcpConnectionEndpointRediscovery=default(Nullable)); + public CosmosClientBuilder WithConnectionModeGateway(Nullable maxConnectionLimit=default(Nullable), IWebProxy webProxy=null); + public CosmosClientBuilder WithConsistencyLevel(ConsistencyLevel consistencyLevel); + public CosmosClientBuilder WithContentResponseOnWrite(bool contentResponseOnWrite); + public CosmosClientBuilder WithCustomSerializer(CosmosSerializer cosmosJsonSerializer); + public CosmosClientBuilder WithHttpClientFactory(Func httpClientFactory); + public CosmosClientBuilder WithLimitToEndpoint(bool limitToEndpoint); + public CosmosClientBuilder WithRequestTimeout(TimeSpan requestTimeout); + public CosmosClientBuilder WithSerializerOptions(CosmosSerializationOptions cosmosSerializerOptions); + public CosmosClientBuilder WithThrottlingRetryOptions(TimeSpan maxRetryWaitTimeOnThrottledRequests, int maxRetryAttemptsOnThrottledRequests); + } + public class IndexingPolicyDefinition + { + public IndexingPolicyDefinition(); + public T Attach(); + public IndexingPolicyDefinition WithAutomaticIndexing(bool enabled); + public CompositeIndexDefinition> WithCompositeIndex(); + public PathsDefinition> WithExcludedPaths(); + public PathsDefinition> WithIncludedPaths(); + public IndexingPolicyDefinition WithIndexingMode(IndexingMode indexingMode); + public SpatialIndexDefinition> WithSpatialIndex(); + } + public class PathsDefinition + { + public T Attach(); + public PathsDefinition Path(string path); + } + public class SpatialIndexDefinition + { + public T Attach(); + public SpatialIndexDefinition Path(string path); + public SpatialIndexDefinition Path(string path, params SpatialType[] spatialTypes); + } + public class UniqueKeyDefinition + { + public ContainerBuilder Attach(); + public UniqueKeyDefinition Path(string path); + } +} +namespace Microsoft.Azure.Cosmos.Linq +{ + public static class CosmosLinq + { + public static object InvokeUserDefinedFunction(string udfName, params object[] arguments); + } + public static class CosmosLinqExtensions + { + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> CountAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static bool IsArray(this object obj); + public static bool IsBool(this object obj); + public static bool IsDefined(this object obj); + public static bool IsNull(this object obj); + public static bool IsNumber(this object obj); + public static bool IsObject(this object obj); + public static bool IsPrimitive(this object obj); + public static bool IsString(this object obj); + public static Task> MaxAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> MinAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static FeedIterator ToFeedIterator(this IQueryable query); + public static QueryDefinition ToQueryDefinition(this IQueryable query); + public static FeedIterator ToStreamIterator(this IQueryable query); + } +} +namespace Microsoft.Azure.Cosmos.Scripts +{ + public abstract class Scripts + { + protected Scripts(); + public abstract Task CreateStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ExecuteStoredProcedureAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, Stream streamPayload, PartitionKey partitionKey, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetStoredProcedureQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class StoredProcedureExecuteResponse : Response + { + protected StoredProcedureExecuteResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public virtual string ScriptLog { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + } + public class StoredProcedureProperties + { + public StoredProcedureProperties(); + public StoredProcedureProperties(string id, string body); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class StoredProcedureRequestOptions : RequestOptions + { + public StoredProcedureRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public bool EnableScriptLogging { get; set; } + public string SessionToken { get; set; } + } + public class StoredProcedureResponse : Response + { + protected StoredProcedureResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override StoredProcedureProperties Resource { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator StoredProcedureProperties (StoredProcedureResponse response); + } + public enum TriggerOperation : short + { + All = (short)0, + Create = (short)1, + Delete = (short)3, + Replace = (short)4, + Update = (short)2, + } + public class TriggerProperties + { + public TriggerProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + public TriggerOperation TriggerOperation { get; set; } + public TriggerType TriggerType { get; set; } + } + public class TriggerResponse : Response + { + protected TriggerResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override TriggerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator TriggerProperties (TriggerResponse response); + } + public enum TriggerType : byte + { + Post = (byte)1, + Pre = (byte)0, + } + public class UserDefinedFunctionProperties + { + public UserDefinedFunctionProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + } + public class UserDefinedFunctionResponse : Response + { + protected UserDefinedFunctionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserDefinedFunctionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator UserDefinedFunctionProperties (UserDefinedFunctionResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Spatial +{ + public sealed class BoundingBox : IEquatable + { + public BoundingBox(Position min, Position max); + public Position Max { get; } + public Position Min { get; } + public bool Equals(BoundingBox other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public abstract class Crs + { + protected Crs(CrsType type); + public static Crs Default { get; } + public CrsType Type { get; } + public static Crs Unspecified { get; } + public static LinkedCrs Linked(string href); + public static LinkedCrs Linked(string href, string type); + public static NamedCrs Named(string name); + } + public enum CrsType + { + Linked = 1, + Named = 0, + Unspecified = 2, + } + public abstract class Geometry + { + protected Geometry(GeometryType type, GeometryParams geometryParams); + public IDictionary AdditionalProperties { get; } + public BoundingBox BoundingBox { get; } + public Crs Crs { get; } + public GeometryType Type { get; } + public double Distance(Geometry to); + public override bool Equals(object obj); + public override int GetHashCode(); + public bool Intersects(Geometry geometry2); + public bool IsValid(); + public GeometryValidationResult IsValidDetailed(); + public bool Within(Geometry outer); + } + public class GeometryParams + { + public GeometryParams(); + public IDictionary AdditionalProperties { get; set; } + public BoundingBox BoundingBox { get; set; } + public Crs Crs { get; set; } + } + public enum GeometryShape + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public enum GeometryType + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public class GeometryValidationResult + { + public GeometryValidationResult(); + public bool IsValid { get; } + public string Reason { get; } + } + public sealed class LinearRing : IEquatable + { + public LinearRing(IList coordinates); + public ReadOnlyCollection Positions { get; } + public bool Equals(LinearRing other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LineString : Geometry, IEquatable + { + public LineString(IList coordinates); + public LineString(IList coordinates, GeometryParams geometryParams); + public ReadOnlyCollection Positions { get; } + public bool Equals(LineString other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LinkedCrs : Crs, IEquatable + { + public string Href { get; } + public string HrefType { get; } + public bool Equals(LinkedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class MultiPolygon : Geometry, IEquatable + { + public MultiPolygon(IList polygons); + public MultiPolygon(IList polygons, GeometryParams geometryParams); + public ReadOnlyCollection Polygons { get; } + public bool Equals(MultiPolygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class NamedCrs : Crs, IEquatable + { + public string Name { get; } + public bool Equals(NamedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Point : Geometry, IEquatable + { + public Point(Position position); + public Point(Position position, GeometryParams geometryParams); + public Point(double longitude, double latitude); + public Position Position { get; } + public bool Equals(Point other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Polygon : Geometry, IEquatable + { + public Polygon(IList rings); + public Polygon(IList rings, GeometryParams geometryParams); + public Polygon(IList externalRingPositions); + public ReadOnlyCollection Rings { get; } + public bool Equals(Polygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class PolygonCoordinates : IEquatable + { + public PolygonCoordinates(IList rings); + public ReadOnlyCollection Rings { get; } + public bool Equals(PolygonCoordinates other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Position : IEquatable + { + public Position(IList coordinates); + public Position(double longitude, double latitude); + public Position(double longitude, double latitude, Nullable altitude); + public Nullable Altitude { get; } + public ReadOnlyCollection Coordinates { get; } + public double Latitude { get; } + public double Longitude { get; } + public bool Equals(Position other); + public override bool Equals(object obj); + public override int GetHashCode(); + } +} diff --git a/Microsoft.Azure.Cosmos/src/ChangeFeed/Pagination/ChangeFeedPaginationOptions.cs b/Microsoft.Azure.Cosmos/src/ChangeFeed/Pagination/ChangeFeedPaginationOptions.cs index 8579c6de42..85a2895774 100644 --- a/Microsoft.Azure.Cosmos/src/ChangeFeed/Pagination/ChangeFeedPaginationOptions.cs +++ b/Microsoft.Azure.Cosmos/src/ChangeFeed/Pagination/ChangeFeedPaginationOptions.cs @@ -33,16 +33,19 @@ public ChangeFeedPaginationOptions( JsonSerializationFormat? jsonSerializationFormat = null, Dictionary additionalHeaders = null, ChangeFeedQuerySpec changeFeedQuerySpec = null) - : base(pageSizeHint, jsonSerializationFormat, additionalHeaders) + : base(pageSizeHint, additionalHeaders) { this.Mode = mode ?? throw new ArgumentNullException(nameof(mode)); this.ChangeFeedQuerySpec = changeFeedQuerySpec; + this.JsonSerializationFormat = jsonSerializationFormat; } public ChangeFeedMode Mode { get; } public ChangeFeedQuerySpec ChangeFeedQuerySpec { get; } + public JsonSerializationFormat? JsonSerializationFormat { get; } + protected override ImmutableHashSet BannedAdditionalHeaders => BannedHeaders; } } diff --git a/Microsoft.Azure.Cosmos/src/ClientResources.Designer.cs b/Microsoft.Azure.Cosmos/src/ClientResources.Designer.cs index 7ea2672d6c..3736d0fbbd 100644 --- a/Microsoft.Azure.Cosmos/src/ClientResources.Designer.cs +++ b/Microsoft.Azure.Cosmos/src/ClientResources.Designer.cs @@ -582,6 +582,24 @@ internal static string StringCompareToInvalidOperator { } } + /// + /// Looks up a localized string similar to Invalid operator for string.Compare(). Valid operators are ('==', '<', '<=', '>' or '>='). + /// + internal static string StringCompareInvalidOperator { + get { + return ResourceManager.GetString("StringCompareInvalidOperator", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The right hand side of string.Compare() comparison must be constant '0'. + /// + internal static string StringCompareInvalidConstant { + get { + return ResourceManager.GetString("StringCompareInvalidConstant", resourceCulture); + } + } + /// /// Looks up a localized string similar to Token refresh in progress.. /// diff --git a/Microsoft.Azure.Cosmos/src/ClientResources.resx b/Microsoft.Azure.Cosmos/src/ClientResources.resx index ae00e80a78..7a3e336e2a 100644 --- a/Microsoft.Azure.Cosmos/src/ClientResources.resx +++ b/Microsoft.Azure.Cosmos/src/ClientResources.resx @@ -268,11 +268,17 @@ Failed to deserialize response returned by server. - The right hand side of string.CompareTo() comparison must be constant '0' + The right-hand side of String.CompareTo() comparison must be constant '0'. + + + The right-hand side of String.Compare() comparison must be constant '0'. Invalid operator for string.CompareTo(). Vaid operators are ('==', '<', '<=', '>' or '>=') + + Invalid operator for string.Compare(). Vaid operators are ('==', '<', '<=', '>' or '>=') + Token refresh in progress. diff --git a/Microsoft.Azure.Cosmos/src/ConnectionPolicy.cs b/Microsoft.Azure.Cosmos/src/ConnectionPolicy.cs index 7abfd76deb..9193abedef 100644 --- a/Microsoft.Azure.Cosmos/src/ConnectionPolicy.cs +++ b/Microsoft.Azure.Cosmos/src/ConnectionPolicy.cs @@ -459,6 +459,18 @@ public Func HttpClientFactory set; } + /// + /// Gets or sets the boolean flag to enable replica validation. + /// + /// + /// The default value for this parameter is false. + /// + public bool? EnableAdvancedReplicaSelectionForTcp + { + get; + set; + } + /// /// (Direct/TCP) This is an advanced setting that controls the number of TCP connections that will be opened eagerly to each Cosmos DB back-end. /// diff --git a/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs b/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs index 1fce195915..330738c00b 100644 --- a/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs +++ b/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs @@ -346,6 +346,17 @@ public ConnectionMode ConnectionMode /// public bool? EnableContentResponseOnWrite { get; set; } + /// + /// Gets or sets the advanced replica selection flag. The advanced replica selection logic keeps track of the replica connection + /// status, and based on status, it prioritizes the replicas which show healthy stable connections, so that the requests can be sent + /// confidently to the particular replica. This helps the cosmos client to become more resilient and effective to any connectivity issues. + /// The default value for this parameter is 'false'. + /// + /// + /// This is optimal for latency-sensitive workloads. Does not apply if is used. + /// + internal bool? EnableAdvancedReplicaSelectionForTcp { get; set; } + /// /// (Direct/TCP) Controls the amount of idle time after which unused connections are closed. /// @@ -758,6 +769,7 @@ internal virtual ConnectionPolicy GetConnectionPolicy(int clientId) EnablePartitionLevelFailover = this.EnablePartitionLevelFailover, PortReuseMode = this.portReuseMode, EnableTcpConnectionEndpointRediscovery = this.EnableTcpConnectionEndpointRediscovery, + EnableAdvancedReplicaSelectionForTcp = this.EnableAdvancedReplicaSelectionForTcp, HttpClientFactory = this.httpClientFactory, ServerCertificateCustomValidationCallback = this.ServerCertificateCustomValidationCallback }; diff --git a/Microsoft.Azure.Cosmos/src/DocumentClient.cs b/Microsoft.Azure.Cosmos/src/DocumentClient.cs index 068bb5b857..c7aeb07a6f 100644 --- a/Microsoft.Azure.Cosmos/src/DocumentClient.cs +++ b/Microsoft.Azure.Cosmos/src/DocumentClient.cs @@ -113,6 +113,8 @@ internal partial class DocumentClient : IDisposable, IAuthorizationTokenProvider private const string DefaultInitTaskKey = "InitTaskKey"; private readonly bool IsLocalQuorumConsistency = false; + private readonly bool isReplicaAddressValidationEnabled; + //Auth internal readonly AuthorizationTokenProvider cosmosAuthorization; @@ -231,7 +233,7 @@ public DocumentClient(Uri serviceEndpoint, this.Initialize(serviceEndpoint, connectionPolicy, desiredConsistencyLevel); this.initTaskCache = new AsyncCacheNonBlocking(cancellationToken: this.cancellationTokenSource.Token); - + this.isReplicaAddressValidationEnabled = ConfigurationManager.IsReplicaAddressValidationEnabled(connectionPolicy); } /// @@ -6700,7 +6702,8 @@ private void CreateStoreModel(bool subscribeRntbdStatus) this.ConnectionPolicy.EnableReadRequestsFallback ?? (this.accountServiceConfiguration.DefaultConsistencyLevel != Documents.ConsistencyLevel.BoundedStaleness), !this.enableRntbdChannel, this.UseMultipleWriteLocations && (this.accountServiceConfiguration.DefaultConsistencyLevel != Documents.ConsistencyLevel.Strong), - true); + true, + enableReplicaValidation: this.isReplicaAddressValidationEnabled); if (subscribeRntbdStatus) { diff --git a/Microsoft.Azure.Cosmos/src/FeedOptions.cs b/Microsoft.Azure.Cosmos/src/FeedOptions.cs index 6f4cae7e0d..4d6ce52f41 100644 --- a/Microsoft.Azure.Cosmos/src/FeedOptions.cs +++ b/Microsoft.Azure.Cosmos/src/FeedOptions.cs @@ -24,7 +24,7 @@ public FeedOptions() { } - internal FeedOptions(FeedOptions options) + public FeedOptions(FeedOptions options) { if (options == null) { @@ -65,10 +65,10 @@ internal FeedOptions(FeedOptions options) this.EndId = options.EndId; this.StartEpk = options.StartEpk; this.EndEpk = options.EndEpk; - this.ContentSerializationFormat = options.ContentSerializationFormat; this.EnableGroupBy = options.EnableGroupBy; this.MergeStaticId = options.MergeStaticId; this.Properties = options.Properties; + this.SupportedSerializationFormats = options.SupportedSerializationFormats; } /// @@ -282,7 +282,7 @@ internal FeedOptions(FeedOptions options) /// /// Option is true if query tracing is enabled; otherwise, false. /// - internal bool? EmitVerboseTracesInQuery { get; set; } + public bool? EmitVerboseTracesInQuery { get; set; } /// /// Gets or sets the schema rid which could be used to filter the document feed response @@ -292,7 +292,7 @@ internal FeedOptions(FeedOptions options) /// By default, it is null which means no filtering will be applied. /// Otherwise, it must be a valid resource id of Schema resource. /// - internal string FilterBySchemaResourceId { get; set; } + public string FilterBySchemaResourceId { get; set; } /// /// Gets or sets the request option for document query requests in the Azure Cosmos DB service. @@ -359,65 +359,62 @@ internal FeedOptions(FeedOptions options) /// /// Gets or sets the flag that tells the backend to forces the query to perform a scan (at a request level). /// - internal bool ForceQueryScan { get; set; } + public bool ForceQueryScan { get; set; } /// /// Gets or sets the EnumerationDirection /// To be used along with Read feed operation /// - internal EnumerationDirection? EnumerationDirection { get; set; } + public EnumerationDirection? EnumerationDirection { get; set; } /// /// Gets or sets the ReadFeedKeyType /// To be used along with Read feed operation /// - internal ReadFeedKeyType? ReadFeedKeyType { get; set; } + public ReadFeedKeyType? ReadFeedKeyType { get; set; } /// /// Gets or sets the StartId /// To be used along with Read feed operation /// - internal string StartId { get; set; } + public string StartId { get; set; } /// /// Gets or sets the EndId /// To be used along with Read feed operation /// - internal string EndId { get; set; } + public string EndId { get; set; } /// /// Gets or sets the StartEpk /// To be used along with Read feed operation /// - internal string StartEpk { get; set; } + public string StartEpk { get; set; } /// /// Gets or sets the EndEpk /// To be used along with Read feed operation /// - internal string EndEpk { get; set; } + public string EndEpk { get; set; } /// - /// Gets or sets the ContentSerializationFormat for the feed (query/read feed) operation in the Azure Cosmos DB service. + /// Gets or sets the SupportedSerializationFormats for the query response from the service. /// - /// - /// If the document is stored in a different serialization format then the one requested, then there will be a rewrite over the wire, but the source document will be untouched. - /// - internal ContentSerializationFormat? ContentSerializationFormat { get; set; } + public SupportedSerializationFormats? SupportedSerializationFormats { get; set; } - internal bool EnableGroupBy { get; set; } + public bool EnableGroupBy { get; set; } /// /// Gets or sets the MergeStaticId. /// To be used along with Read feed operation when Static Column merge is desired. /// - internal string MergeStaticId { get; set; } + public string MergeStaticId { get; set; } /// /// Gets or sets the custom serialization options for query /// - internal CosmosSerializationFormatOptions CosmosSerializationFormatOptions { get; set; } + public CosmosSerializationFormatOptions CosmosSerializationFormatOptions { get; set; } - internal IDictionary Properties { get; set; } + public IDictionary Properties { get; set; } } } diff --git a/Microsoft.Azure.Cosmos/src/Headers/CosmosMessageHeadersInternal.cs b/Microsoft.Azure.Cosmos/src/Headers/CosmosMessageHeadersInternal.cs index f12595d832..1cbf9b54e6 100644 --- a/Microsoft.Azure.Cosmos/src/Headers/CosmosMessageHeadersInternal.cs +++ b/Microsoft.Azure.Cosmos/src/Headers/CosmosMessageHeadersInternal.cs @@ -159,6 +159,12 @@ public virtual string ContentSerializationFormat set => this.SetProperty(HttpConstants.HttpHeaders.ContentSerializationFormat, value); } + public virtual string SupportedSerializationFormats + { + get => this.GetValueOrDefault(HttpConstants.HttpHeaders.SupportedSerializationFormats); + set => this.SetProperty(HttpConstants.HttpHeaders.SupportedSerializationFormats, value); + } + public virtual string ReadFeedKeyType { get => this.GetValueOrDefault(HttpConstants.HttpHeaders.ReadFeedKeyType); diff --git a/Microsoft.Azure.Cosmos/src/Headers/StoreRequestHeaders.cs b/Microsoft.Azure.Cosmos/src/Headers/StoreRequestHeaders.cs index 68086095f7..b907363685 100644 --- a/Microsoft.Azure.Cosmos/src/Headers/StoreRequestHeaders.cs +++ b/Microsoft.Azure.Cosmos/src/Headers/StoreRequestHeaders.cs @@ -76,6 +76,12 @@ public override string ContentSerializationFormat set => this.requestNameValueCollection.ContentSerializationFormat = value; } + public override string SupportedSerializationFormats + { + get => this.requestNameValueCollection.SupportedSerializationFormats; + set => this.requestNameValueCollection.SupportedSerializationFormats = value; + } + public override string ReadFeedKeyType { get => this.requestNameValueCollection.ReadFeedKeyType; diff --git a/Microsoft.Azure.Cosmos/src/HttpClient/CosmosHttpClientCore.cs b/Microsoft.Azure.Cosmos/src/HttpClient/CosmosHttpClientCore.cs index c29c3a5b94..0e7cc30c9e 100644 --- a/Microsoft.Azure.Cosmos/src/HttpClient/CosmosHttpClientCore.cs +++ b/Microsoft.Azure.Cosmos/src/HttpClient/CosmosHttpClientCore.cs @@ -438,8 +438,7 @@ private static bool IsOutOfRetries( DateTime startDateTimeUtc, IEnumerator<(TimeSpan requestTimeout, TimeSpan delayForNextRequest)> timeoutEnumerator) { - return (DateTime.UtcNow - startDateTimeUtc) > timeoutPolicy.MaximumRetryTimeLimit || // Maximum of time for all retries - !timeoutEnumerator.MoveNext(); // No more retries are configured + return !timeoutEnumerator.MoveNext(); // No more retries are configured } private async Task ExecuteHttpHelperAsync( diff --git a/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicy.cs b/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicy.cs index fa2fc25bf7..42742f86c1 100644 --- a/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicy.cs +++ b/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicy.cs @@ -11,7 +11,6 @@ namespace Microsoft.Azure.Cosmos internal abstract class HttpTimeoutPolicy { public abstract string TimeoutPolicyName { get; } - public abstract TimeSpan MaximumRetryTimeLimit { get; } public abstract int TotalRetryCount { get; } public abstract IEnumerator<(TimeSpan requestTimeout, TimeSpan delayForNextRequest)> GetTimeoutEnumerator(); public abstract bool IsSafeToRetry(HttpMethod httpMethod); diff --git a/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicyControlPlaneRead.cs b/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicyControlPlaneRead.cs index 757134a576..9f85ba33ab 100644 --- a/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicyControlPlaneRead.cs +++ b/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicyControlPlaneRead.cs @@ -25,8 +25,6 @@ private HttpTimeoutPolicyControlPlaneRead() public override string TimeoutPolicyName => HttpTimeoutPolicyControlPlaneRead.Name; - public override TimeSpan MaximumRetryTimeLimit => CosmosHttpClient.GatewayRequestTimeout; - public override int TotalRetryCount => this.TimeoutsAndDelays.Count; public override IEnumerator<(TimeSpan requestTimeout, TimeSpan delayForNextRequest)> GetTimeoutEnumerator() diff --git a/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicyControlPlaneRetriableHotPath.cs b/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicyControlPlaneRetriableHotPath.cs index 8dbb8a2a44..53a7c78e9e 100644 --- a/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicyControlPlaneRetriableHotPath.cs +++ b/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicyControlPlaneRetriableHotPath.cs @@ -29,8 +29,6 @@ private HttpTimeoutPolicyControlPlaneRetriableHotPath(bool shouldThrow503OnTimeo public override string TimeoutPolicyName => HttpTimeoutPolicyControlPlaneRetriableHotPath.Name; - public override TimeSpan MaximumRetryTimeLimit => CosmosHttpClient.GatewayRequestTimeout; - public override int TotalRetryCount => this.TimeoutsAndDelays.Count; public override IEnumerator<(TimeSpan requestTimeout, TimeSpan delayForNextRequest)> GetTimeoutEnumerator() diff --git a/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicyDefault.cs b/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicyDefault.cs index 974509c70c..69a83707a1 100644 --- a/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicyDefault.cs +++ b/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicyDefault.cs @@ -29,8 +29,6 @@ private HttpTimeoutPolicyDefault(bool shouldThrow503OnTimeout) public override string TimeoutPolicyName => HttpTimeoutPolicyDefault.Name; - public override TimeSpan MaximumRetryTimeLimit => CosmosHttpClient.GatewayRequestTimeout; - public override int TotalRetryCount => this.TimeoutsAndDelays.Count; public override IEnumerator<(TimeSpan requestTimeout, TimeSpan delayForNextRequest)> GetTimeoutEnumerator() diff --git a/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicyNoRetry.cs b/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicyNoRetry.cs index 595498aec2..65ea12144b 100644 --- a/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicyNoRetry.cs +++ b/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicyNoRetry.cs @@ -24,8 +24,6 @@ private HttpTimeoutPolicyNoRetry() public override string TimeoutPolicyName => HttpTimeoutPolicyNoRetry.Name; - public override TimeSpan MaximumRetryTimeLimit => TimeSpan.Zero; - public override int TotalRetryCount => 0; public override IEnumerator<(TimeSpan requestTimeout, TimeSpan delayForNextRequest)> GetTimeoutEnumerator() diff --git a/Microsoft.Azure.Cosmos/src/Linq/ExpressionToSQL.cs b/Microsoft.Azure.Cosmos/src/Linq/ExpressionToSQL.cs index 112f86be39..beeff94dc3 100644 --- a/Microsoft.Azure.Cosmos/src/Linq/ExpressionToSQL.cs +++ b/Microsoft.Azure.Cosmos/src/Linq/ExpressionToSQL.cs @@ -457,6 +457,11 @@ private static SqlScalarExpression VisitBinary(BinaryExpression inputExpression, { return ExpressionToSql.VisitStringCompareTo(methodCallExpression, constantExpression, inputExpression.NodeType, reverseNodeType, context); } + + if (TryMatchStringCompare(methodCallExpression, constantExpression, inputExpression.NodeType)) + { + return ExpressionToSql.VisitStringCompare(methodCallExpression, constantExpression, inputExpression.NodeType, reverseNodeType, context); + } } SqlScalarExpression left = ExpressionToSql.VisitScalarExpression(inputExpression.Left, context); @@ -615,32 +620,90 @@ private static SqlScalarExpression VisitStringCompareTo( { if (reverseNodeType) { + compareOperator = ReverseExpressionTypeForStrings(compareOperator, ClientResources.StringCompareToInvalidOperator); + } + + SqlBinaryScalarOperatorKind op = GetBinaryOperatorKind(compareOperator, null); + + SqlScalarExpression leftExpression = ExpressionToSql.VisitNonSubqueryScalarExpression(left.Object, context); + SqlScalarExpression rightExpression = ExpressionToSql.VisitNonSubqueryScalarExpression(left.Arguments[0], context); + + return SqlBinaryScalarExpression.Create(op, leftExpression, rightExpression); + } + + private static ExpressionType ReverseExpressionTypeForStrings(ExpressionType compareOperator, string errorMessage) + { + switch (compareOperator) + { + case ExpressionType.Equal: + // do nothing + break; + case ExpressionType.GreaterThan: + compareOperator = ExpressionType.LessThan; + break; + case ExpressionType.GreaterThanOrEqual: + compareOperator = ExpressionType.LessThanOrEqual; + break; + case ExpressionType.LessThan: + compareOperator = ExpressionType.GreaterThan; + break; + case ExpressionType.LessThanOrEqual: + compareOperator = ExpressionType.GreaterThanOrEqual; + break; + default: + throw new DocumentQueryException(string.Format(CultureInfo.CurrentCulture, errorMessage)); + } + + return compareOperator; + } + + private static bool TryMatchStringCompare(MethodCallExpression left, ConstantExpression right, ExpressionType compareOperator) + { + if (left.Method.Equals(typeof(string).GetMethod("Compare", new Type[] { typeof(string), typeof(string) })) && left.Arguments.Count == 2) + { + // operator can only be =, >, >=, <, <= switch (compareOperator) { case ExpressionType.Equal: - // do nothing - break; case ExpressionType.GreaterThan: - compareOperator = ExpressionType.LessThan; - break; case ExpressionType.GreaterThanOrEqual: - compareOperator = ExpressionType.LessThanOrEqual; - break; case ExpressionType.LessThan: - compareOperator = ExpressionType.GreaterThan; - break; case ExpressionType.LessThanOrEqual: - compareOperator = ExpressionType.GreaterThanOrEqual; break; default: - throw new DocumentQueryException(string.Format(CultureInfo.CurrentCulture, ClientResources.StringCompareToInvalidOperator)); + throw new DocumentQueryException(string.Format(CultureInfo.CurrentCulture, ClientResources.StringCompareInvalidOperator)); + } + + // the constant value should be zero, otherwise we can't determine how to translate the expression + // it could be either integer or nullable integer + if (!(right.Type == typeof(int) && (int)right.Value == 0) && + !(right.Type == typeof(int?) && ((int?)right.Value).HasValue && ((int?)right.Value).Value == 0)) + { + throw new DocumentQueryException(string.Format(CultureInfo.CurrentCulture, ClientResources.StringCompareInvalidConstant)); } + + return true; + } + + return false; + } + + private static SqlScalarExpression VisitStringCompare( + MethodCallExpression left, + ConstantExpression right, + ExpressionType compareOperator, + bool reverseNodeType, + TranslationContext context) + { + if (reverseNodeType) + { + compareOperator = ReverseExpressionTypeForStrings(compareOperator, ClientResources.StringCompareInvalidOperator); } SqlBinaryScalarOperatorKind op = GetBinaryOperatorKind(compareOperator, null); - SqlScalarExpression leftExpression = ExpressionToSql.VisitNonSubqueryScalarExpression(left.Object, context); - SqlScalarExpression rightExpression = ExpressionToSql.VisitNonSubqueryScalarExpression(left.Arguments[0], context); + SqlScalarExpression leftExpression = ExpressionToSql.VisitNonSubqueryScalarExpression(left.Arguments[0], context); + SqlScalarExpression rightExpression = ExpressionToSql.VisitNonSubqueryScalarExpression(left.Arguments[1], context); return SqlBinaryScalarExpression.Create(op, leftExpression, rightExpression); } @@ -742,6 +805,12 @@ private static SqlScalarExpression VisitMemberAccess(MemberExpression inputExpre SqlScalarExpression memberExpression = ExpressionToSql.VisitScalarExpression(inputExpression.Expression, context); string memberName = inputExpression.Member.GetMemberName(context.linqSerializerOptions); + // If the resulting memberName is null, then the indexer should be on the root of the object. + if (memberName == null) + { + return memberExpression; + } + // if expression is nullable if (inputExpression.Expression.Type.IsNullable()) { diff --git a/Microsoft.Azure.Cosmos/src/Linq/TypeSystem.cs b/Microsoft.Azure.Cosmos/src/Linq/TypeSystem.cs index 34d771bf56..7c8e62d69c 100644 --- a/Microsoft.Azure.Cosmos/src/Linq/TypeSystem.cs +++ b/Microsoft.Azure.Cosmos/src/Linq/TypeSystem.cs @@ -25,6 +25,14 @@ public static Type GetElementType(Type type) public static string GetMemberName(this MemberInfo memberInfo, CosmosLinqSerializerOptions linqSerializerOptions = null) { string memberName = null; + + // Check if Newtonsoft JsonExtensionDataAttribute is present on the member, if so, return empty member name. + JsonExtensionDataAttribute jsonExtensionDataAttribute = memberInfo.GetCustomAttribute(true); + if (jsonExtensionDataAttribute != null && jsonExtensionDataAttribute.ReadData) + { + return null; + } + // Json.Net honors JsonPropertyAttribute more than DataMemberAttribute // So we check for JsonPropertyAttribute first. JsonPropertyAttribute jsonPropertyAttribute = memberInfo.GetCustomAttribute(true); diff --git a/Microsoft.Azure.Cosmos/src/Microsoft.Azure.Cosmos.csproj b/Microsoft.Azure.Cosmos/src/Microsoft.Azure.Cosmos.csproj index f1bdac977d..bd125c58ba 100644 --- a/Microsoft.Azure.Cosmos/src/Microsoft.Azure.Cosmos.csproj +++ b/Microsoft.Azure.Cosmos/src/Microsoft.Azure.Cosmos.csproj @@ -45,7 +45,7 @@ - + @@ -96,6 +96,11 @@ True SystemStrings.tt + + True + True + RMResources.resx + diff --git a/Microsoft.Azure.Cosmos/src/Pagination/NetworkAttachedDocumentContainer.cs b/Microsoft.Azure.Cosmos/src/Pagination/NetworkAttachedDocumentContainer.cs index 7d8683c3fe..8420cb0540 100644 --- a/Microsoft.Azure.Cosmos/src/Pagination/NetworkAttachedDocumentContainer.cs +++ b/Microsoft.Azure.Cosmos/src/Pagination/NetworkAttachedDocumentContainer.cs @@ -192,11 +192,6 @@ public async Task> MonadicReadFeedAsync( request.Headers.ContinuationToken = ((CosmosString)readFeedContinuationState.ContinuationToken).Value; } - if (readFeedPaginationOptions.JsonSerializationFormat.HasValue) - { - request.Headers.ContentSerializationFormat = readFeedPaginationOptions.JsonSerializationFormat.Value.ToContentSerializationFormatString(); - } - foreach (KeyValuePair kvp in readFeedPaginationOptions.AdditionalHeaders) { request.Headers[kvp.Key] = kvp.Value; diff --git a/Microsoft.Azure.Cosmos/src/Pagination/PaginationOptions.cs b/Microsoft.Azure.Cosmos/src/Pagination/PaginationOptions.cs index 5558f2be24..593d761ec0 100644 --- a/Microsoft.Azure.Cosmos/src/Pagination/PaginationOptions.cs +++ b/Microsoft.Azure.Cosmos/src/Pagination/PaginationOptions.cs @@ -23,11 +23,9 @@ internal abstract class PaginationOptions protected PaginationOptions( int? pageSizeLimit = null, - JsonSerializationFormat? jsonSerializationFormat = null, Dictionary additionalHeaders = null) { this.PageSizeLimit = pageSizeLimit; - this.JsonSerializationFormat = jsonSerializationFormat; this.AdditionalHeaders = additionalHeaders != null ? additionalHeaders.ToImmutableDictionary() : EmptyDictionary; foreach (string key in this.AdditionalHeaders.Keys) @@ -41,8 +39,6 @@ protected PaginationOptions( public int? PageSizeLimit { get; } - public JsonSerializationFormat? JsonSerializationFormat { get; } - public ImmutableDictionary AdditionalHeaders { get; } protected abstract ImmutableHashSet BannedAdditionalHeaders { get; } diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/Pagination/QueryPaginationOptions.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/Pagination/QueryPaginationOptions.cs index c285135feb..c985158828 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/Pagination/QueryPaginationOptions.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/Pagination/QueryPaginationOptions.cs @@ -32,9 +32,8 @@ internal sealed class QueryPaginationOptions : PaginationOptions public QueryPaginationOptions( int? pageSizeHint = null, bool optimisticDirectExecute = false, - JsonSerializationFormat? jsonSerializationFormat = null, Dictionary additionalHeaders = null) - : base(pageSizeHint, jsonSerializationFormat, additionalHeaders) + : base(pageSizeHint, additionalHeaders) { this.OptimisticDirectExecute = optimisticDirectExecute; } diff --git a/Microsoft.Azure.Cosmos/src/Query/v2Query/DocumentQueryExecutionContextBase.cs b/Microsoft.Azure.Cosmos/src/Query/v2Query/DocumentQueryExecutionContextBase.cs index ec4e6d9185..053c951f6c 100644 --- a/Microsoft.Azure.Cosmos/src/Query/v2Query/DocumentQueryExecutionContextBase.cs +++ b/Microsoft.Azure.Cosmos/src/Query/v2Query/DocumentQueryExecutionContextBase.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.Cosmos.Query { using System; using System.Collections.Generic; + using System.ComponentModel; using System.Globalization; using System.IO; using System.Linq; @@ -31,6 +32,8 @@ namespace Microsoft.Azure.Cosmos.Query internal abstract class DocumentQueryExecutionContextBase : IDocumentQueryExecutionContext { + public static readonly string DefaultSupportedSerializationFormats = string.Join(",", SupportedSerializationFormats.JsonText, SupportedSerializationFormats.CosmosBinary); + public readonly struct InitParams { public IDocumentQueryClient Client { get; } @@ -326,14 +329,7 @@ await this.Client.EnsureValidOverwriteAsync( requestHeaders.Set(HttpConstants.HttpHeaders.MergeStaticId, this.feedOptions.MergeStaticId); } - if (this.feedOptions.CosmosSerializationFormatOptions != null) - { - requestHeaders[HttpConstants.HttpHeaders.ContentSerializationFormat] = this.feedOptions.CosmosSerializationFormatOptions.ContentSerializationFormat; - } - else if (this.feedOptions.ContentSerializationFormat.HasValue) - { - requestHeaders[HttpConstants.HttpHeaders.ContentSerializationFormat] = this.feedOptions.ContentSerializationFormat.Value.ToString(); - } + requestHeaders[HttpConstants.HttpHeaders.SupportedSerializationFormats] = this.feedOptions.SupportedSerializationFormats?.ToString() ?? DefaultSupportedSerializationFormats; return requestHeaders; } @@ -688,23 +684,7 @@ private DocumentFeedResponse GetFeedResponse( { content = memoryStream.ToArray(); } - - IJsonNavigator jsonNavigator = null; - - // Use the users custom navigator first. If it returns null back try the - // internal navigator. - if (this.feedOptions.CosmosSerializationFormatOptions != null) - { - jsonNavigator = this.feedOptions.CosmosSerializationFormatOptions.CreateCustomNavigatorCallback(content); - if (jsonNavigator == null) - { - throw new InvalidOperationException("The CosmosSerializationOptions did not return a JSON navigator."); - } - } - else - { - jsonNavigator = JsonNavigator.Create(content); - } + IJsonNavigator jsonNavigator = JsonNavigator.Create(content); string resourceName = this.GetRootNodeName(documentServiceRequest.ResourceType); diff --git a/Microsoft.Azure.Cosmos/src/Query/v3Query/CosmosQueryClientCore.cs b/Microsoft.Azure.Cosmos/src/Query/v3Query/CosmosQueryClientCore.cs index 1c5a9ef21f..cce1a5268a 100644 --- a/Microsoft.Azure.Cosmos/src/Query/v3Query/CosmosQueryClientCore.cs +++ b/Microsoft.Azure.Cosmos/src/Query/v3Query/CosmosQueryClientCore.cs @@ -155,7 +155,6 @@ public override async Task> ExecuteItemQueryAsync( cancellationToken: cancellationToken); return CosmosQueryClientCore.GetCosmosElementResponse( - requestOptions, resourceType, message, trace); @@ -297,7 +296,6 @@ public override void ClearSessionTokenCache(string collectionFullName) } private static TryCatch GetCosmosElementResponse( - QueryRequestOptions requestOptions, ResourceType resourceType, ResponseMessage cosmosResponseMessage, ITrace trace) @@ -336,8 +334,7 @@ private static TryCatch GetCosmosElementResponse( long responseLengthBytes = memoryStream.Length; CosmosArray documents = CosmosQueryClientCore.ParseElementsFromRestStream( memoryStream, - resourceType, - requestOptions.CosmosSerializationFormatOptions); + resourceType); QueryState queryState; if (cosmosResponseMessage.Headers.ContinuationToken != null) @@ -444,12 +441,10 @@ private Task GetRoutingMapProviderAsync() /// /// The memory stream response for the query REST response Azure Cosmos /// The resource type - /// The custom serialization options. This allows custom serialization types like BSON, JSON, or other formats /// An array of CosmosElements parsed from the response body. public static CosmosArray ParseElementsFromRestStream( Stream stream, - ResourceType resourceType, - CosmosSerializationFormatOptions cosmosSerializationOptions) + ResourceType resourceType) { if (!(stream is MemoryStream memoryStream)) { @@ -478,20 +473,7 @@ public static CosmosArray ParseElementsFromRestStream( // You want to create a CosmosElement for each document in "Documents". ReadOnlyMemory content = memoryStream.TryGetBuffer(out ArraySegment buffer) ? buffer : (ReadOnlyMemory)memoryStream.ToArray(); - IJsonNavigator jsonNavigator; - if (cosmosSerializationOptions != null) - { - // Use the users custom navigator - jsonNavigator = cosmosSerializationOptions.CreateCustomNavigatorCallback(content); - if (jsonNavigator == null) - { - throw new InvalidOperationException("The CosmosSerializationOptions did not return a JSON navigator."); - } - } - else - { - jsonNavigator = JsonNavigator.Create(content); - } + IJsonNavigator jsonNavigator = JsonNavigator.Create(content); string resourceName = resourceType switch { diff --git a/Microsoft.Azure.Cosmos/src/RMResources.Designer.cs b/Microsoft.Azure.Cosmos/src/RMResources.Designer.cs index e5b6582760..294ed6c3ad 100644 --- a/Microsoft.Azure.Cosmos/src/RMResources.Designer.cs +++ b/Microsoft.Azure.Cosmos/src/RMResources.Designer.cs @@ -8,10 +8,11 @@ // //------------------------------------------------------------------------------ -namespace Microsoft.Azure.Documents { +namespace Microsoft.Azure.Documents +{ using System; - - + + /// /// A strongly-typed resource class, for looking up localized strings, etc. /// @@ -19,3700 +20,4549 @@ namespace Microsoft.Azure.Documents { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class RMResources { - + internal class RMResources + { + private static global::System.Resources.ResourceManager resourceMan; - + private static global::System.Globalization.CultureInfo resourceCulture; - + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal RMResources() { + internal RMResources() + { } - + /// /// Returns the cached ResourceManager instance used by this class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.Azure.Cosmos.RMResources", typeof(RMResources).Assembly); + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if (object.ReferenceEquals(resourceMan, null)) + { +#if COSMOSCLIENT + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.Azure.Documents.RMResources", typeof(RMResources).Assembly); +#else + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.Azure.Documents.RMResources", typeof(RMResources).GetAssembly()); +#endif resourceMan = temp; } return resourceMan; } } - + /// /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { + internal static global::System.Globalization.CultureInfo Culture + { + get + { return resourceCulture; } - set { + set + { resourceCulture = value; } } - - /// - /// Looks up a localized string similar to The given request [{0} {1}] cannot be authorized by AAD token in data plane. Learn more: https://aka.ms/cosmos-native-rbac.. - /// - internal static string AadAuthActionNotSupported { - get { - return ResourceManager.GetString("AadAuthActionNotSupported", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Request for Read DatabaseAccount is blocked because principal [{0}] does not have required RBAC permissions to perform action [{1}] on any scope. Learn more: https://aka.ms/cosmos-native-rbac.. - /// - internal static string AadAuthDatabaseAccountRequestBlocked { - get { - return ResourceManager.GetString("AadAuthDatabaseAccountRequestBlocked", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Failed to validate AAD identity since the authenticator is unavailable.. - /// - internal static string AadAuthenticatorNotAvailable { - get { - return ResourceManager.GetString("AadAuthenticatorNotAvailable", resourceCulture); - } - } - + /// - /// Looks up a localized string similar to This could be because the user's group memberships were not present in the AAD token.. + /// Looks up a localized string similar to {0} api is not supported for this database account. /// - internal static string AadAuthGroupExpansionNeeded { - get { - return ResourceManager.GetString("AadAuthGroupExpansionNeeded", resourceCulture); + internal static string ApiTypeForbidden + { + get + { + return ResourceManager.GetString("ApiTypeForbidden", resourceCulture); } } - + /// - /// Looks up a localized string similar to Failed to validate AAD identity since the authorizer is unavailable.. + /// Looks up a localized string similar to {0} should have {1} argument.. /// - internal static string AadAuthorizerNotAvailable { - get { - return ResourceManager.GetString("AadAuthorizerNotAvailable", resourceCulture); + internal static string ArgumentRequired + { + get + { + return ResourceManager.GetString("ArgumentRequired", resourceCulture); } } - + /// - /// Looks up a localized string similar to Failed to update the AAD Public Keys with value {0}. Exception: {1}.. + /// Looks up a localized string similar to Auto-Scale Setting Change With User Auth Is Disallowed.. /// - internal static string AadAuthPublicKeysFailedToUpdate { - get { - return ResourceManager.GetString("AadAuthPublicKeysFailedToUpdate", resourceCulture); + internal static string AutoScaleSettingChangeWithUserAuthIsDisallowed + { + get + { + return ResourceManager.GetString("AutoScaleSettingChangeWithUserAuthIsDisallowed", resourceCulture); } } - + /// - /// Looks up a localized string similar to Request is blocked because principal [{0}] does not have required RBAC permissions to perform action [{1}] on resource [{2}]. Learn more: https://aka.ms/cosmos-native-rbac.. + /// Looks up a localized string similar to The given request [{0} {1}] cannot be authorized by AAD token in data plane. Learn more: https://aka.ms/cosmos-native-rbac.. /// - internal static string AadAuthRequestBlocked { - get { - return ResourceManager.GetString("AadAuthRequestBlocked", resourceCulture); + internal static string AadAuthActionNotSupported + { + get + { + return ResourceManager.GetString("AadAuthActionNotSupported", resourceCulture); } } - + /// - /// Looks up a localized string similar to Local Authorization is disabled. Use an AAD token to authorize all requests.. + /// Looks up a localized string similar to Failed to validate AAD identity since the authenticator is unavailable.. /// - internal static string AadLocalAuthDisabled { - get { - return ResourceManager.GetString("AadLocalAuthDisabled", resourceCulture); + internal static string AadAuthenticatorNotAvailable + { + get + { + return ResourceManager.GetString("AadAuthenticatorNotAvailable", resourceCulture); } } - + /// - /// Looks up a localized string similar to Add or Remove region operation failed.. + /// Looks up a localized string similar to Request for Read DatabaseAccount is blocked because principal [{0}] does not have required RBAC permissions to perform action [{1}] on any scope. Learn more: https://aka.ms/cosmos-native-rbac.. /// - internal static string AddRemoveRegionOperationFailed { - get { - return ResourceManager.GetString("AddRemoveRegionOperationFailed", resourceCulture); + internal static string AadAuthDatabaseAccountRequestBlocked + { + get + { + return ResourceManager.GetString("AadAuthDatabaseAccountRequestBlocked", resourceCulture); } } - + /// - /// Looks up a localized string similar to Analytical Storage is not supported on this account type.. + /// Looks up a localized string similar to This could be because the user's group memberships were not present in the AAD token.. /// - internal static string AnalyticalStoreNotSupported { - get { - return ResourceManager.GetString("AnalyticalStoreNotSupported", resourceCulture); + internal static string AadAuthGroupExpansionNeeded + { + get + { + return ResourceManager.GetString("AadAuthGroupExpansionNeeded", resourceCulture); } } - + /// - /// Looks up a localized string similar to {0} api is not supported for this database account. + /// Looks up a localized string similar to Request is blocked because principal [{0}] does not have required RBAC permissions to perform action [{1}] on resource [{2}]. Learn more: https://aka.ms/cosmos-native-rbac.. /// - internal static string ApiTypeForbidden { - get { - return ResourceManager.GetString("ApiTypeForbidden", resourceCulture); + internal static string AadAuthRequestBlocked + { + get + { + return ResourceManager.GetString("AadAuthRequestBlocked", resourceCulture); } } - + /// - /// Looks up a localized string similar to {0} should have {1} argument.. + /// Looks up a localized string similar to Failed to validate AAD identity since the authorizer is unavailable.. /// - internal static string ArgumentRequired { - get { - return ResourceManager.GetString("ArgumentRequired", resourceCulture); + internal static string AadAuthorizerNotAvailable + { + get + { + return ResourceManager.GetString("AadAuthorizerNotAvailable", resourceCulture); } } - + /// - /// Looks up a localized string similar to Autopilot autoupgrade is not supported for non-partitioned collections.. + /// Looks up a localized string similar to Failed to update the AAD Public Keys with value {0}. Exception: {1}.. /// - internal static string AutopilotAutoUpgradeUnsupportedNonPartitionedCollection { - get { - return ResourceManager.GetString("AutopilotAutoUpgradeUnsupportedNonPartitionedCollection", resourceCulture); + internal static string AadAuthPublicKeysFailedToUpdate + { + get + { + return ResourceManager.GetString("AadAuthPublicKeysFailedToUpdate", resourceCulture); } } - + /// - /// Looks up a localized string similar to Autopilot tier and AutoPilotSettings cannot both be specified.. + /// Looks up a localized string similar to SAS Token Authentication is disabled for this account. Please contact Azure Support [https://azure.microsoft.com/support] to enable it.. /// - internal static string AutoPilotTierAndAutoPilotSettingsCannotBeSpecifiedBoth { - get { - return ResourceManager.GetString("AutoPilotTierAndAutoPilotSettingsCannotBeSpecifiedBoth", resourceCulture); + internal static string SasTokenAuthDisabled + { + get + { + return ResourceManager.GetString("SasTokenAuthDisabled", resourceCulture); } } - + /// - /// Looks up a localized string similar to Auto-Scale Setting Change With User Auth Is Disallowed.. + /// Looks up a localized string similar to Local Authorization is disabled. Use an AAD token to authorize all requests.. /// - internal static string AutoScaleSettingChangeWithUserAuthIsDisallowed { - get { - return ResourceManager.GetString("AutoScaleSettingChangeWithUserAuthIsDisallowed", resourceCulture); + internal static string AadLocalAuthDisabled + { + get + { + return ResourceManager.GetString("AadLocalAuthDisabled", resourceCulture); } } - + /// /// Looks up a localized string similar to At this time, only write operations made from the MongoDB SDKs are supported. Modifications to MongoDB collections using other SDKs is temporarily blocked.. /// - internal static string BadClientMongo { - get { + internal static string BadClientMongo + { + get + { return ResourceManager.GetString("BadClientMongo", resourceCulture); } } - + /// /// Looks up a localized string similar to Invalid response from upstream server or upstream server request failed.. /// - internal static string BadGateway { - get { + internal static string BadGateway + { + get + { return ResourceManager.GetString("BadGateway", resourceCulture); } } - + /// /// Looks up a localized string similar to One of the input values is invalid.. /// - internal static string BadRequest { - get { + internal static string BadRequest + { + get + { return ResourceManager.GetString("BadRequest", resourceCulture); } } - + /// /// Looks up a localized string similar to Request url is invalid.. /// - internal static string BadUrl { - get { + internal static string BadUrl + { + get + { return ResourceManager.GetString("BadUrl", resourceCulture); } } - - /// - /// Looks up a localized string similar to The container create request is not allowed since it does not contain the Cassandra conflict resolution policy specified for the container {0}.. - /// - internal static string CannotCreateContainerWithoutCassandraConflictPolicy { - get { - return ResourceManager.GetString("CannotCreateContainerWithoutCassandraConflictPolicy", resourceCulture); - } - } - + /// /// Looks up a localized string similar to Cannot offline a write region that has zero read regions configured. There needs to be atleast one read region to failover to.. /// - internal static string CannotOfflineWriteRegionWithNoReadRegions { - get { + internal static string CannotOfflineWriteRegionWithNoReadRegions + { + get + { return ResourceManager.GetString("CannotOfflineWriteRegionWithNoReadRegions", resourceCulture); } } - - /// - /// Looks up a localized string similar to The container replace request is not allowed since it removes the schema policy from the container {0}.. - /// - internal static string CannotRemoveSchemaPolicyFromContainer { - get { - return ResourceManager.GetString("CannotRemoveSchemaPolicyFromContainer", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The container replace request is not allowed since it removes the Cassandra conflict resolution policy from the container {0}.. - /// - internal static string CannotReplaceCassandraConflictPolicyFromContainer { - get { - return ResourceManager.GetString("CannotReplaceCassandraConflictPolicyFromContainer", resourceCulture); - } - } - + /// /// Looks up a localized string similar to Cannot specify partition key range or partition key for resource that is not partitioned.. /// - internal static string CannotSpecifyPKRangeForNonPartitionedResource { - get { + internal static string CannotSpecifyPKRangeForNonPartitionedResource + { + get + { return ResourceManager.GetString("CannotSpecifyPKRangeForNonPartitionedResource", resourceCulture); } } - - /// - /// Looks up a localized string similar to CassandraConnector not supported for this account type.. - /// - internal static string CassandraConnectorNotSupported { - get { - return ResourceManager.GetString("CassandraConnectorNotSupported", resourceCulture); - } - } - + /// /// Looks up a localized string similar to StartTime cannot have DateTimeKind.Unspecified.. /// - internal static string ChangeFeedOptionsStartTimeWithUnspecifiedDateTimeKind { - get { + internal static string ChangeFeedOptionsStartTimeWithUnspecifiedDateTimeKind + { + get + { return ResourceManager.GetString("ChangeFeedOptionsStartTimeWithUnspecifiedDateTimeKind", resourceCulture); } } - + /// /// Looks up a localized string similar to Channel is closed. /// - internal static string ChannelClosed { - get { + internal static string ChannelClosed + { + get + { return ResourceManager.GetString("ChannelClosed", resourceCulture); } } - + /// /// Looks up a localized string similar to The channel multiplexer has shut down.. /// - internal static string ChannelMultiplexerClosedTransportError { - get { + internal static string ChannelMultiplexerClosedTransportError + { + get + { return ResourceManager.GetString("ChannelMultiplexerClosedTransportError", resourceCulture); } } - + /// /// Looks up a localized string similar to The transport client failed to open a connection. See the inner exception for details.. /// - internal static string ChannelOpenFailedTransportError { - get { + internal static string ChannelOpenFailedTransportError + { + get + { return ResourceManager.GetString("ChannelOpenFailedTransportError", resourceCulture); } } - + /// /// Looks up a localized string similar to The transport client timed out when opening a connection. See the inner exception for details.. /// - internal static string ChannelOpenTimeoutTransportError { - get { + internal static string ChannelOpenTimeoutTransportError + { + get + { return ResourceManager.GetString("ChannelOpenTimeoutTransportError", resourceCulture); } } - - /// - /// Looks up a localized string similar to The TCP channel timed out on waiting to open.. - /// - internal static string ChannelWaitingToOpenTimeoutException { - get { - return ResourceManager.GetString("ChannelWaitingToOpenTimeoutException", resourceCulture); - } - } - + /// - /// Looks up a localized string similar to Service is currently unavailable. More info: https://aka.ms/cosmosdb-tsg-service-unavailable. There is high CPU detected on your client machine. Requests are more likely to timeout when CPU exceeds 90%.. + /// Looks up a localized string similar to There is high CPU detected on your client machine. Requests are more likely to timeout when CPU exceeds 90%. /// - internal static string Client_CPUOverload { - get { + internal static string Client_CPUOverload + { + get + { return ResourceManager.GetString("Client_CPUOverload", resourceCulture); } } - + /// - /// Looks up a localized string similar to Service is currently unavailable. More info: https://aka.ms/cosmosdb-tsg-service-unavailable. Thread starvation or thread-pool blocking detected.. + /// Looks up a localized string similar to Thread starvation or thread-pool blocking detected. /// - internal static string Client_ThreadStarvation { - get { + internal static string Client_ThreadStarvation + { + get + { return ResourceManager.GetString("Client_ThreadStarvation", resourceCulture); } } - + /// - /// Looks up a localized string similar to The request failed because the client was unable to establish connections to {0} endpoints across {1} regions. The client CPU was overloaded during the attempted request. More info: https://aka.ms/CosmosDB/sql/errors/net/high-cpu. + /// Looks up a localized string similar to The request failed because the client was unable to establish connections to {0} endpoints across {1} regions. The client CPU was overloaded during the attempted request.. /// - internal static string ClientCpuOverload { - get { + internal static string ClientCpuOverload + { + get + { return ResourceManager.GetString("ClientCpuOverload", resourceCulture); } } - + /// /// Looks up a localized string similar to The request failed because the client was unable to establish connections to {0} endpoints across {1} regions. The client CPU has thread starvation.. /// - internal static string ClientCpuThreadStarvation { - get { + internal static string ClientCpuThreadStarvation + { + get + { return ResourceManager.GetString("ClientCpuThreadStarvation", resourceCulture); } } - + /// - /// Looks up a localized string similar to The request failed because the client was unable to establish connections to {0} endpoints across {1} regions. Please check for client resource starvation issues and verify connectivity between client and server. More info: https://aka.ms/cosmosdb-tsg-service-unavailable. + /// Looks up a localized string similar to The request failed because the client was unable to establish connections to {0} endpoints across {1} regions. Please check for client resource starvation issues and verify connectivity between client and server.. /// - internal static string ClientUnavailable { - get { + internal static string ClientUnavailable + { + get + { return ResourceManager.GetString("ClientUnavailable", resourceCulture); } } - - /// - /// Looks up a localized string similar to Collection is not yet available for read. Please retry in some time.. - /// - internal static string CollectionCreateInProgress { - get { - return ResourceManager.GetString("CollectionCreateInProgress", resourceCulture); - } - } - + /// /// Looks up a localized string similar to Collection create request conflicted with ongoing add region or failover operation. Ensure to complete region configuration before creating collection.. /// - internal static string CollectionCreateTopologyConflict { - get { + internal static string CollectionCreateTopologyConflict + { + get + { return ResourceManager.GetString("CollectionCreateTopologyConflict", resourceCulture); } } - + /// /// Looks up a localized string similar to Throughput of this collection cannot be more than {0}, as was provisioned during collection creation time.. /// - internal static string CollectionThroughputCannotBeMoreThan { - get { + internal static string CollectionThroughputCannotBeMoreThan + { + get + { return ResourceManager.GetString("CollectionThroughputCannotBeMoreThan", resourceCulture); } } - + /// /// Looks up a localized string similar to Failed to connect to the remote endpoint.. /// - internal static string ConnectFailedTransportError { - get { + internal static string ConnectFailedTransportError + { + get + { return ResourceManager.GetString("ConnectFailedTransportError", resourceCulture); } } - + /// /// Looks up a localized string similar to The connection failed.. /// - internal static string ConnectionBrokenTransportError { - get { + internal static string ConnectionBrokenTransportError + { + get + { return ResourceManager.GetString("ConnectionBrokenTransportError", resourceCulture); } } - - /// - /// Looks up a localized string similar to Connection is too busy. Please retry after sometime or open more connections.. - /// - internal static string ConnectionIsBusy { - get { - return ResourceManager.GetString("ConnectionIsBusy", resourceCulture); - } - } - + /// /// Looks up a localized string similar to The connection attempt timed out.. /// - internal static string ConnectTimeoutTransportError { - get { + internal static string ConnectTimeoutTransportError + { + get + { return ResourceManager.GetString("ConnectTimeoutTransportError", resourceCulture); } } - + /// /// Looks up a localized string similar to Correlation ID not found in response. /// - internal static string CorrelationIDNotFoundInResponse { - get { + internal static string CorrelationIDNotFoundInResponse + { + get + { return ResourceManager.GetString("CorrelationIDNotFoundInResponse", resourceCulture); } } - + /// /// Looks up a localized string similar to Invalid CORS rule. At least one allowed origin is required.. /// - internal static string CorsAllowedOriginsEmptyList { - get { + internal static string CorsAllowedOriginsEmptyList + { + get + { return ResourceManager.GetString("CorsAllowedOriginsEmptyList", resourceCulture); } } - + /// /// Looks up a localized string similar to InvalidCORS rule. The origin '{0}' is an invalid origin. A valid rigin should not include a uri path.. /// - internal static string CorsAllowedOriginsInvalidPath { - get { + internal static string CorsAllowedOriginsInvalidPath + { + get + { return ResourceManager.GetString("CorsAllowedOriginsInvalidPath", resourceCulture); } } - + /// /// Looks up a localized string similar to Invalid CORS rule. The origin '{0}' is not a well formed origin... /// - internal static string CorsAllowedOriginsMalformedUri { - get { + internal static string CorsAllowedOriginsMalformedUri + { + get + { return ResourceManager.GetString("CorsAllowedOriginsMalformedUri", resourceCulture); } } - + /// /// Looks up a localized string similar to Invalid CORS rule. Wildcards are not supported.. /// - internal static string CorsAllowedOriginsWildcardsNotSupported { - get { + internal static string CorsAllowedOriginsWildcardsNotSupported + { + get + { return ResourceManager.GetString("CorsAllowedOriginsWildcardsNotSupported", resourceCulture); } } - + /// /// Looks up a localized string similar to Invalid CORS rules. Only one rule is supported.. /// - internal static string CorsTooManyRules { - get { + internal static string CorsTooManyRules + { + get + { return ResourceManager.GetString("CorsTooManyRules", resourceCulture); } } - + /// /// Looks up a localized string similar to Value specified in the "{0}" header is incompatible with value specified in the "{1}" header of the request.. /// - internal static string CrossPartitionContinuationAndIndex { - get { + internal static string CrossPartitionContinuationAndIndex + { + get + { return ResourceManager.GetString("CrossPartitionContinuationAndIndex", resourceCulture); } } - + /// /// Looks up a localized string similar to Cross partition query is required but disabled. Please set x-ms-documentdb-query-enablecrosspartition to true, specify x-ms-documentdb-partitionkey, or revise your query to avoid this exception.. /// - internal static string CrossPartitionQueryDisabled { - get { + internal static string CrossPartitionQueryDisabled + { + get + { return ResourceManager.GetString("CrossPartitionQueryDisabled", resourceCulture); } } - + /// /// Looks up a localized string similar to Cross-tenant CMK is not supported with First Party identities as Default identities. Please use an User Assigned identity instead.. /// - internal static string CrossTenantCMKNotSupportedWithFirstPartyIdentity { - get { + internal static string CrossTenantCMKNotSupportedWithFirstPartyIdentity + { + get + { return ResourceManager.GetString("CrossTenantCMKNotSupportedWithFirstPartyIdentity", resourceCulture); } } - + /// /// Looks up a localized string similar to Cross-tenant CMK is not supported with System Assigned identities as Default identities. Please use an User Assigned Identity instead.. /// - internal static string CrossTenantCMKNotSupportedWithSystemAssignedIdentity { - get { + internal static string CrossTenantCMKNotSupportedWithSystemAssignedIdentity + { + get + { return ResourceManager.GetString("CrossTenantCMKNotSupportedWithSystemAssignedIdentity", resourceCulture); } } - + /// /// Looks up a localized string similar to Database Account {0} does not exist. /// - internal static string DatabaseAccountNotFound { - get { + internal static string DatabaseAccountNotFound + { + get + { return ResourceManager.GetString("DatabaseAccountNotFound", resourceCulture); } } - + /// /// Looks up a localized string similar to Database create request conflicted with ongoing add region or failover operation. Ensure to complete region configuration before creating collection... /// - internal static string DatabaseCreateTopologyConflict { - get { + internal static string DatabaseCreateTopologyConflict + { + get + { return ResourceManager.GetString("DatabaseCreateTopologyConflict", resourceCulture); } } - - /// - /// Looks up a localized string similar to "Operation '{0}' on resource '{1}' is not allowed through Azure Cosmos DB endpoint. Please switch on such operations for your account, or perform this operation through Azure Resource Manager, Azure Portal, Azure CLI or Azure Powershell". - /// - internal static string DataPlaneOperationNotAllowed { - get { - return ResourceManager.GetString("DataPlaneOperationNotAllowed", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to DataTransfer service is not available in region [{0}].. - /// - internal static string DataTransferStateStoreNotResolved { - get { - return ResourceManager.GetString("DataTransferStateStoreNotResolved", resourceCulture); - } - } - + /// /// Looks up a localized string similar to Expecting DateTime value.. /// - internal static string DateTimeConverterInvalidDateTime { - get { + internal static string DateTimeConverterInvalidDateTime + { + get + { return ResourceManager.GetString("DateTimeConverterInvalidDateTime", resourceCulture); } } - + /// /// Looks up a localized string similar to Expecting reader to read Integer. /// - internal static string DateTimeConverterInvalidReaderValue { - get { + internal static string DateTimeConverterInvalidReaderValue + { + get + { return ResourceManager.GetString("DateTimeConverterInvalidReaderValue", resourceCulture); } } - + /// /// Looks up a localized string similar to Expecting reader value to be compatible with double conversion.. /// - internal static string DateTimeConveterInvalidReaderDoubleValue { - get { + internal static string DateTimeConveterInvalidReaderDoubleValue + { + get + { return ResourceManager.GetString("DateTimeConveterInvalidReaderDoubleValue", resourceCulture); } } - + + /// + /// Looks up a localized string similar to Error occurred while deserializing content '{0}'.. + /// + internal static string DeserializationError + { + get + { + return ResourceManager.GetString("DeserializationError", resourceCulture); + } + } + /// /// Looks up a localized string similar to The given default identity for {0} is not valid. The format for the default identity is not valid, please use 'FirstPartyIdentity'/'SystemAssignedIdentity'/'UserAssignedIdentity=<UA_resource_id>'. /// - internal static string DefaultIdentityNotValidFormat { - get { + internal static string DefaultIdentityNotValidFormat + { + get + { return ResourceManager.GetString("DefaultIdentityNotValidFormat", resourceCulture); } } - + /// /// Looks up a localized string similar to The given default identity for {0} is not valid. The default identity points to a delegated identity that does not exist in {0}.. /// - internal static string DefaultIdentityWithoutCorrespondingDelegatedIdentity { - get { + internal static string DefaultIdentityWithoutCorrespondingDelegatedIdentity + { + get + { return ResourceManager.GetString("DefaultIdentityWithoutCorrespondingDelegatedIdentity", resourceCulture); } } - + /// /// Looks up a localized string similar to The given default identity for {0} is not valid. The default identity points to a system identity that does not exist in {0}.. /// - internal static string DefaultIdentityWithoutCorrespondingSystemIdentity { - get { + internal static string DefaultIdentityWithoutCorrespondingSystemIdentity + { + get + { return ResourceManager.GetString("DefaultIdentityWithoutCorrespondingSystemIdentity", resourceCulture); } } - + /// /// Looks up a localized string similar to The given default identity for {0} is not valid. The default identity points to an user identity that does not exist in {0}.. /// - internal static string DefaultIdentityWithoutCorrespondingUserIdentity { - get { + internal static string DefaultIdentityWithoutCorrespondingUserIdentity + { + get + { return ResourceManager.GetString("DefaultIdentityWithoutCorrespondingUserIdentity", resourceCulture); } } - - /// - /// Looks up a localized string similar to Error occurred while deserializing content '{0}'.. - /// - internal static string DeserializationError { - get { - return ResourceManager.GetString("DeserializationError", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Cannot set DisableKeyBasedMetadataWriteAccess on this account type.. - /// - internal static string DisableKeyBasedMetadataWriteAccessNotSupported { - get { - return ResourceManager.GetString("DisableKeyBasedMetadataWriteAccessNotSupported", resourceCulture); - } - } - + /// /// Looks up a localized string similar to DNS resolution failed.. /// - internal static string DnsResolutionFailedTransportError { - get { + internal static string DnsResolutionFailedTransportError + { + get + { return ResourceManager.GetString("DnsResolutionFailedTransportError", resourceCulture); } } - + /// /// Looks up a localized string similar to DNS resolution timed out.. /// - internal static string DnsResolutionTimeoutTransportError { - get { + internal static string DnsResolutionTimeoutTransportError + { + get + { return ResourceManager.GetString("DnsResolutionTimeoutTransportError", resourceCulture); } } - + /// /// Looks up a localized string similar to Document Query Execution Context is done.. /// - internal static string DocumentQueryExecutionContextIsDone { - get { + internal static string DocumentQueryExecutionContextIsDone + { + get + { return ResourceManager.GetString("DocumentQueryExecutionContextIsDone", resourceCulture); } } - + /// /// Looks up a localized string similar to Service is currently unavailable, please retry after a while. If this problem persists please contact support.. /// - internal static string DocumentServiceUnavailable { - get { + internal static string DocumentServiceUnavailable + { + get + { return ResourceManager.GetString("DocumentServiceUnavailable", resourceCulture); } } - + /// /// Looks up a localized string similar to Duplicate correlation id generated. /// - internal static string DuplicateCorrelationIdGenerated { - get { + internal static string DuplicateCorrelationIdGenerated + { + get + { return ResourceManager.GetString("DuplicateCorrelationIdGenerated", resourceCulture); } } - + /// - /// Looks up a localized string similar to There cannot be duplicate physical partition ids in x-ms-cosmos-source-partition-throughput-info header.. + /// Looks up a localized string similar to Empty Virtual Network Resource Guid. /// - internal static string DuplicatePhysicalPartitionIdInSourcePartitionThroughputInfo { - get { - return ResourceManager.GetString("DuplicatePhysicalPartitionIdInSourcePartitionThroughputInfo", resourceCulture); + internal static string EmptyVirtualNetworkResourceGuid + { + get + { + return ResourceManager.GetString("EmptyVirtualNetworkResourceGuid", resourceCulture); } } - + /// - /// Looks up a localized string similar to There cannot be duplicate physical partition ids in x-ms-cosmos-target-partition-throughput-info header.. + /// Looks up a localized string similar to Specified Virtual Network Rules list is empty. /// - internal static string DuplicatePhysicalPartitionIdInTargetPartitionThroughputInfo { - get { - return ResourceManager.GetString("DuplicatePhysicalPartitionIdInTargetPartitionThroughputInfo", resourceCulture); + internal static string EmptyVirtualNetworkRulesSpecified + { + get + { + return ResourceManager.GetString("EmptyVirtualNetworkRulesSpecified", resourceCulture); } } - + /// - /// Looks up a localized string similar to Empty Virtual Network Resource Guid. + /// Looks up a localized string similar to Cannot set EnableAnalyticsStorage on an account with EnableServerless. /// - internal static string EmptyVirtualNetworkResourceGuid { - get { - return ResourceManager.GetString("EmptyVirtualNetworkResourceGuid", resourceCulture); + internal static string EnableAnalyticsStorageAndEnableServerlessNotSupported + { + get + { + return ResourceManager.GetString("EnableAnalyticsStorageAndEnableServerlessNotSupported", resourceCulture); } } - + /// - /// Looks up a localized string similar to Specified Virtual Network Rules list is empty. + /// Looks up a localized string similar to The value of offer throughput policy specified is invalid. /// - internal static string EmptyVirtualNetworkRulesSpecified { - get { - return ResourceManager.GetString("EmptyVirtualNetworkRulesSpecified", resourceCulture); + internal static string InvalidThroughputPolicy + { + get + { + return ResourceManager.GetString("InvalidThroughputPolicy", resourceCulture); } } - + /// - /// Looks up a localized string similar to Serverless accounts do not support multiple write locations(i.e. EnableMultipleWriteLocations=true).. + /// Looks up a localized string similar to Cannot set EnableMultipleWriteLocations on an account with EnableServerless. /// - internal static string EnableMultipleWriteLocationsAndEnableServerlessNotSupported { - get { + internal static string EnableMultipleWriteLocationsAndEnableServerlessNotSupported + { + get + { return ResourceManager.GetString("EnableMultipleWriteLocationsAndEnableServerlessNotSupported", resourceCulture); } } - + /// /// Looks up a localized string similar to Accounts configured with default consistency level as 'Strong' cannot be enabled for multiple write locations(i.e. EnableMultipleWriteLocations=true). Consider relaxing default consistency level of the account to enable multiple write locations.. /// - internal static string EnableMultipleWriteLocationsAndStrongConsistencyNotSupported { - get { + internal static string EnableMultipleWriteLocationsAndStrongConsistencyNotSupported + { + get + { return ResourceManager.GetString("EnableMultipleWriteLocationsAndStrongConsistencyNotSupported", resourceCulture); } } - + /// - /// Looks up a localized string similar to "Availability Zone on a multi region account requires multi master to be enabled. Please enable Multi-Master on the database account to proceed.". + /// Looks up a localized string similar to Availability Zone on a multi region account requires multi master to be enabled. Please enable Multi-Master on the database account to proceed.. /// - internal static string EnableMultipleWriteLocationsBeforeAddingRegion { - get { + internal static string EnableMultipleWriteLocationsBeforeAddingRegion + { + get + { return ResourceManager.GetString("EnableMultipleWriteLocationsBeforeAddingRegion", resourceCulture); } } - + /// - /// Looks up a localized string similar to This account already has EnableMultipleWriteLocations flag set to {0}".. + /// Looks up a localized string similar to This account already has EnableMultipleWriteLocations flag set to {0}".. /// - internal static string EnableMultipleWriteLocationsNotModified { - get { + internal static string EnableMultipleWriteLocationsNotModified + { + get + { return ResourceManager.GetString("EnableMultipleWriteLocationsNotModified", resourceCulture); } } - + /// - /// Looks up a localized string similar to Cannot set EnableMultipleWriteLocations on this account type.. + /// Looks up a localized string similar to Cannot add regions to an account with EnableServerless. /// - internal static string EnableMultipleWriteLocationsNotSupported { - get { - return ResourceManager.GetString("EnableMultipleWriteLocationsNotSupported", resourceCulture); + internal static string EnableMultiRegionAndEnableServerlessNotSupported + { + get + { + return ResourceManager.GetString("EnableMultiRegionAndEnableServerlessNotSupported", resourceCulture); } } - + /// - /// Looks up a localized string similar to Serverless accounts do not support multiple regions.. + /// Looks up a localized string similar to Restore is not Supported on this account type. /// - internal static string EnableMultiRegionAndEnableServerlessNotSupported { - get { - return ResourceManager.GetString("EnableMultiRegionAndEnableServerlessNotSupported", resourceCulture); + internal static string PitrNotSupported + { + get + { + return ResourceManager.GetString("PitrNotSupported", resourceCulture); } } - + /// - /// Looks up a localized string similar to Cannot add regions to this account type.. + /// Looks up a localized string similar to Cannot add regions to this account type. /// - internal static string EnableMultiRegionNotSupported { - get { + internal static string EnableMultiRegionNotSupported + { + get + { return ResourceManager.GetString("EnableMultiRegionNotSupported", resourceCulture); } } - + /// - /// Looks up a localized string similar to Unable to retrieve address of endpoint '{0}' from the address '{1}'. + /// Looks up a localized string similar to Cannot set EnableMultipleWriteLocations on this account type. /// - internal static string EndpointNotFound { - get { - return ResourceManager.GetString("EndpointNotFound", resourceCulture); + internal static string EnableMultipleWriteLocationsNotSupported + { + get + { + return ResourceManager.GetString("EnableMultipleWriteLocationsNotSupported", resourceCulture); } } - + /// - /// Looks up a localized string similar to Entity with the specified id already exists in the system.. + /// Looks up a localized string similar to Cannot set DisableKeyBasedMetadataWriteAccess on this account type. /// - internal static string EntityAlreadyExists { - get { - return ResourceManager.GetString("EntityAlreadyExists", resourceCulture); + internal static string DisableKeyBasedMetadataWriteAccessNotSupported + { + get + { + return ResourceManager.GetString("DisableKeyBasedMetadataWriteAccessNotSupported", resourceCulture); } } - + /// - /// Looks up a localized string similar to Message: {0}. + /// Looks up a localized string similar to MaterializedViews is not supported on this account type. /// - internal static string ExceptionMessage { - get { - return ResourceManager.GetString("ExceptionMessage", resourceCulture); + internal static string MaterializedViewsNotSupported + { + get + { + return ResourceManager.GetString("MaterializedViewsNotSupported", resourceCulture); } } - + /// - /// Looks up a localized string similar to {0}, Local IP: {1}. + /// Looks up a localized string similar to Full Fidelity Change Feed is not supported on this account type. /// - internal static string ExceptionMessageAddIpAddress { - get { - return ResourceManager.GetString("ExceptionMessageAddIpAddress", resourceCulture); + internal static string FullFidelityChangeFeedNotSupported + { + get + { + return ResourceManager.GetString("FullFidelityChangeFeedNotSupported", resourceCulture); } } - + /// - /// Looks up a localized string similar to {0}, Request URI: {1}, RequestStats: {2}, SDK: {3}. + /// Looks up a localized string similar to CassandraConnector not supported for this account type. /// - internal static string ExceptionMessageAddRequestUri { - get { - return ResourceManager.GetString("ExceptionMessageAddRequestUri", resourceCulture); + internal static string CassandraConnectorNotSupported + { + get + { + return ResourceManager.GetString("CassandraConnectorNotSupported", resourceCulture); } } - + /// - /// Looks up a localized string similar to Cannot perform failover as it is disabled for the account.. + /// Looks up a localized string similar to Free Tier is not supported on this account type. /// - internal static string FailoverDisabled { - get { - return ResourceManager.GetString("FailoverDisabled", resourceCulture); + internal static string FreeTierNotSupported + { + get + { + return ResourceManager.GetString("FreeTierNotSupported", resourceCulture); } } - + /// - /// Looks up a localized string similar to Feature {0} is not supported for Multi-region Account. + /// Looks up a localized string similar to Cannot set IpRangeFilter values on this account type. /// - internal static string FeatureNotSupportedForMultiRegionAccount { - get { - return ResourceManager.GetString("FeatureNotSupportedForMultiRegionAccount", resourceCulture); + internal static string IpRangeFilterNotSupported + { + get + { + return ResourceManager.GetString("IpRangeFilterNotSupported", resourceCulture); } } - + /// - /// Looks up a localized string similar to Feature {0} is not supported in {1} region. + /// Looks up a localized string similar to Analytical Storage is not supported on this account type. /// - internal static string FeatureNotSupportedInRegion { - get { - return ResourceManager.GetString("FeatureNotSupportedInRegion", resourceCulture); + internal static string AnalyticalStoreNotSupported + { + get + { + return ResourceManager.GetString("AnalyticalStoreNotSupported", resourceCulture); } } - + /// - /// Looks up a localized string similar to {0} is not supported for the target subscription. + /// Looks up a localized string similar to Cannot set VirtualNetworkFilter on this account type. /// - internal static string FeatureNotSupportedOnSubscription { - get { - return ResourceManager.GetString("FeatureNotSupportedOnSubscription", resourceCulture); + internal static string VirtualNetworkFilterNotSupported + { + get + { + return ResourceManager.GetString("VirtualNetworkFilterNotSupported", resourceCulture); } } - + /// - /// Looks up a localized string similar to Federation {0} in region {1} is not found. + /// Looks up a localized string similar to Serverless offer is not supported on this account type. /// - internal static string FederationEntityNotFound { - get { - return ResourceManager.GetString("FederationEntityNotFound", resourceCulture); + internal static string ServerlessNotSupported + { + get + { + return ResourceManager.GetString("ServerlessNotSupported", resourceCulture); } } - + /// - /// Looks up a localized string similar to Unexpected status code for first Azure Key Vault Access. First request to get Azure Key Vault metadata should always return Unauthorized.. + /// Looks up a localized string similar to Unable to retrieve address of endpoint '{0}' from the address '{1}'. /// - internal static string FirstKeyVaultAccessAttemptShouldBeUnauthorized { - get { - return ResourceManager.GetString("FirstKeyVaultAccessAttemptShouldBeUnauthorized", resourceCulture); + internal static string EndpointNotFound + { + get + { + return ResourceManager.GetString("EndpointNotFound", resourceCulture); } } - + /// - /// Looks up a localized string similar to Request is blocked by your Cosmos DB account firewall settings. More info: https://aka.ms/cosmosdb-tsg-forbidden. + /// Looks up a localized string similar to Entity with the specified id already exists in the system.. /// - internal static string Forbidden { - get { - return ResourceManager.GetString("Forbidden", resourceCulture); + internal static string EntityAlreadyExists + { + get + { + return ResourceManager.GetString("EntityAlreadyExists", resourceCulture); } } - + /// - /// Looks up a localized string similar to Request received through private endpoint. It is blocked because either your account does not have private endpoint configured, or it is not from the private endpoint that your account is configured with. More info: https://aka.ms/cosmosdb-tsg-forbidden. + /// Looks up a localized string similar to Message: {0}. /// - internal static string ForbiddenPrivateEndpoint { - get { - return ResourceManager.GetString("ForbiddenPrivateEndpoint", resourceCulture); + internal static string ExceptionMessage + { + get + { + return ResourceManager.GetString("ExceptionMessage", resourceCulture); } } - + /// - /// Looks up a localized string similar to Request originated from IP {0} through public internet. This is blocked by your Cosmos DB account firewall settings. More info: https://aka.ms/cosmosdb-tsg-forbidden. + /// Looks up a localized string similar to {0}, Local IP: {1}. /// - internal static string ForbiddenPublicIpv4 { - get { - return ResourceManager.GetString("ForbiddenPublicIpv4", resourceCulture); + internal static string ExceptionMessageAddIpAddress + { + get + { + return ResourceManager.GetString("ExceptionMessageAddIpAddress", resourceCulture); } } - + /// - /// Looks up a localized string similar to Request originated from VNET through service endpoint. This is blocked by your Cosmos DB account firewall settings. More info: https://aka.ms/cosmosdb-tsg-forbidden. + /// Looks up a localized string similar to {0}, Request URI: {1}, RequestStats: {2}, SDK: {3}. /// - internal static string ForbiddenServiceEndpoint { - get { - return ResourceManager.GetString("ForbiddenServiceEndpoint", resourceCulture); + internal static string ExceptionMessageAddRequestUri + { + get + { + return ResourceManager.GetString("ExceptionMessageAddRequestUri", resourceCulture); } } - + /// - /// Looks up a localized string similar to Free tier has already been applied to another Azure Cosmos DB account in this subscription. To apply free tier to this account, you can select another subscription for this account or delete the existing free tier account. You can have up to one free tier account per subscription.. + /// Looks up a localized string similar to Feature {0} is not supported for Multi-region Account. /// - internal static string FreeTierAppliedBefore { - get { - return ResourceManager.GetString("FreeTierAppliedBefore", resourceCulture); + internal static string FeatureNotSupportedForMultiRegionAccount + { + get + { + return ResourceManager.GetString("FeatureNotSupportedForMultiRegionAccount", resourceCulture); } } - + /// - /// Looks up a localized string similar to Free Tier is not supported on this account type.. + /// Looks up a localized string similar to Feature {0} is not supported in {1} region. /// - internal static string FreeTierNotSupported { - get { - return ResourceManager.GetString("FreeTierNotSupported", resourceCulture); + internal static string FeatureNotSupportedInRegion + { + get + { + return ResourceManager.GetString("FeatureNotSupportedInRegion", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} is not supported for the target subscription. + /// + internal static string FeatureNotSupportedOnSubscription + { + get + { + return ResourceManager.GetString("FeatureNotSupportedOnSubscription", resourceCulture); } } - + /// - /// Looks up a localized string similar to Free tier is not supported for Internal subscriptions.. + /// Looks up a localized string similar to MaterializedViews is not supported on this account type. /// - internal static string FreeTierNotSupportedForInternalSubscription { - get { - return ResourceManager.GetString("FreeTierNotSupportedForInternalSubscription", resourceCulture); + internal static string MaterializedViewsNotSupportedOnZoneRedundantAccount + { + get + { + return ResourceManager.GetString("MaterializedViewsNotSupportedOnZoneRedundantAccount", resourceCulture); } } - + /// - /// Looks up a localized string similar to Cannot update FreeTier property for existing account.. + /// Looks up a localized string similar to Federation {0} in region {1} is not found. /// - internal static string FreeTierUpdateNotSupported { - get { - return ResourceManager.GetString("FreeTierUpdateNotSupported", resourceCulture); + internal static string FederationEntityNotFound + { + get + { + return ResourceManager.GetString("FederationEntityNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Request is blocked by your Cosmos DB account firewall settings.. + /// + internal static string Forbidden + { + get + { + return ResourceManager.GetString("Forbidden", resourceCulture); } } - + /// - /// Looks up a localized string similar to Full Fidelity Change Feed is not supported on this account type.. + /// Looks up a localized string similar to Request originated from IP {0} through public internet. + /// This is blocked by your Cosmos DB account firewall settings. More info: https://aka.ms/cosmosdb-tsg-forbidden. /// - internal static string FullFidelityChangeFeedNotSupported { - get { - return ResourceManager.GetString("FullFidelityChangeFeedNotSupported", resourceCulture); + internal static string ForbiddenPublicIpv4 + { + get + { + return ResourceManager.GetString("ForbiddenPublicIpv4", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Request originated from VNET through service endpoint. + /// This is blocked by your Cosmos DB account firewall settings. More info: https://aka.ms/cosmosdb-tsg-forbidden. + /// + internal static string ForbiddenServiceEndpoint + { + get + { + return ResourceManager.GetString("ForbiddenServiceEndpoint", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Request received through private endpoint. + /// It is blocked because either your account does not have private endpoint configured, + /// or it is not from the private endpoint that your account is configured with. + /// More info: https://aka.ms/cosmosdb-tsg-forbidden. + /// + internal static string ForbiddenPrivateEndpoint + { + get + { + return ResourceManager.GetString("ForbiddenPrivateEndpoint", resourceCulture); } } - + /// /// Looks up a localized string similar to Attempt to process the request timed out at remote server.. /// - internal static string GatewayTimedout { - get { + internal static string GatewayTimedout + { + get + { return ResourceManager.GetString("GatewayTimedout", resourceCulture); } } - + /// /// Looks up a localized string similar to Database and Write Location are not matching. /// - internal static string GlobalAndWriteRegionMisMatch { - get { + internal static string GlobalAndWriteRegionMisMatch + { + get + { return ResourceManager.GetString("GlobalAndWriteRegionMisMatch", resourceCulture); } } - + /// /// Looks up a localized string similar to Global Strong write barrier has not been met for the request.. /// - internal static string GlobalStrongWriteBarrierNotMet { - get { + internal static string GlobalStrongWriteBarrierNotMet + { + get + { return ResourceManager.GetString("GlobalStrongWriteBarrierNotMet", resourceCulture); } } - + /// /// Looks up a localized string similar to The requested resource is no longer available at the server.. /// - internal static string Gone { - get { + internal static string Gone + { + get + { return ResourceManager.GetString("Gone", resourceCulture); } } - - /// - /// Looks up a localized string similar to GraphAPICompute Service cannot be deleted.. - /// - internal static string GremlinV2ServiceDeleteNotSupported { - get { - return ResourceManager.GetString("GremlinV2ServiceDeleteNotSupported", resourceCulture); - } - } - + /// /// Looks up a localized string similar to Failed to generate id for resourceType = {0}, partitionIndex = {1}, serviceIndex = {2}, partitionCount = {3}.. /// - internal static string IdGenerationFailed { - get { + internal static string IdGenerationFailed + { + get + { return ResourceManager.GetString("IdGenerationFailed", resourceCulture); } } - + /// /// Looks up a localized string similar to Routing map is not complete.. /// - internal static string IncompleteRoutingMap { - get { + internal static string IncompleteRoutingMap + { + get + { return ResourceManager.GetString("IncompleteRoutingMap", resourceCulture); } } - - /// - /// Looks up a localized string similar to For containers migrated from fixed to unlimited, scale operation can be performed only if the container has documents populated with partition key. Please retry the throughput scale operation after populating documents with partition key. Please see https://aka.ms/migrate-to-partitioned-collection for more information.. - /// - internal static string InsufficientPartitionedDataForOfferThroughput { - get { - return ResourceManager.GetString("InsufficientPartitionedDataForOfferThroughput", resourceCulture); - } - } - + /// /// Looks up a localized string similar to Insufficient permissions provided in the authorization header for the corresponding request. Please retry with another authorization header.. /// - internal static string InsufficientPermissions { - get { + internal static string InsufficientPermissions + { + get + { return ResourceManager.GetString("InsufficientPermissions", resourceCulture); } } - + /// /// Looks up a localized string similar to Unable to continue without atleast a single token in the resource tokens input collection.. /// - internal static string InsufficientResourceTokens { - get { + internal static string InsufficientResourceTokens + { + get + { return ResourceManager.GetString("InsufficientResourceTokens", resourceCulture); } } - + /// /// Looks up a localized string similar to Unknown server error occurred when processing this request.. /// - internal static string InternalServerError { - get { + internal static string InternalServerError + { + get + { return ResourceManager.GetString("InternalServerError", resourceCulture); } } - + /// /// Looks up a localized string similar to Invalid API version. Ensure a valid x-ms-version header value is passed. Please update to the latest version of Azure Cosmos DB SDK.. /// - internal static string InvalidAPIVersion { - get { + internal static string InvalidAPIVersion + { + get + { return ResourceManager.GetString("InvalidAPIVersion", resourceCulture); } } - + /// /// Looks up a localized string similar to Invalid API version for {0}. Ensure a valid x-ms-version header value is passed. Please update to the latest version of Azure Cosmos DB SDK.. /// - internal static string InvalidAPIVersionForFeature { - get { + internal static string InvalidAPIVersionForFeature + { + get + { return ResourceManager.GetString("InvalidAPIVersionForFeature", resourceCulture); } } - + /// /// Looks up a localized string similar to AudienceKind is Invalid. /// - internal static string InvalidAudienceKind { - get { + internal static string InvalidAudienceKind + { + get + { return ResourceManager.GetString("InvalidAudienceKind", resourceCulture); } } - + /// /// Looks up a localized string similar to Invalid Audience Resource Type. /// - internal static string InvalidAudienceResourceType { - get { + internal static string InvalidAudienceResourceType + { + get + { return ResourceManager.GetString("InvalidAudienceResourceType", resourceCulture); } } - + /// /// Looks up a localized string similar to Authorization header doesn't confirm to the required format. Please verify and try again.. /// - internal static string InvalidAuthHeaderFormat { - get { + internal static string InvalidAuthHeaderFormat + { + get + { return ResourceManager.GetString("InvalidAuthHeaderFormat", resourceCulture); } } - + /// /// Looks up a localized string similar to The backend response was not in the correct format.. /// - internal static string InvalidBackendResponse { - get { + internal static string InvalidBackendResponse + { + get + { return ResourceManager.GetString("InvalidBackendResponse", resourceCulture); } } - - /// - /// Looks up a localized string similar to The value of BackgroundTaskMaxAllowedThroughputPercent specified is invalid. Please specify a valid percentage.. - /// - internal static string InvalidBackgroundTaskMaxAllowedThroughputPercent { - get { - return ResourceManager.GetString("InvalidBackgroundTaskMaxAllowedThroughputPercent", resourceCulture); - } - } - + /// /// Looks up a localized string similar to "{0} capability cannot be specified with {1} .". /// - internal static string InvalidCapabilityCombination { - get { + internal static string InvalidCapabilityCombination + { + get + { return ResourceManager.GetString("InvalidCapabilityCombination", resourceCulture); } } - + /// /// Looks up a localized string similar to The resource name presented contains invalid character '{0}'.. /// - internal static string InvalidCharacterInResourceName { - get { + internal static string InvalidCharacterInResourceName + { + get + { return ResourceManager.GetString("InvalidCharacterInResourceName", resourceCulture); } } - + /// /// Looks up a localized string similar to Invalid mode '{0}' for setting '{1}'. Mode expected is '{2}'.. /// - internal static string InvalidConflictResolutionMode { - get { + internal static string InvalidConflictResolutionMode + { + get + { return ResourceManager.GetString("InvalidConflictResolutionMode", resourceCulture); } } - + /// /// Looks up a localized string similar to ConsistencyLevel {0} specified in the request is invalid when service is configured with consistency level {1}. Ensure the request consistency level is not stronger than the service consistency level.. /// - internal static string InvalidConsistencyLevel { - get { + internal static string InvalidConsistencyLevel + { + get + { return ResourceManager.GetString("InvalidConsistencyLevel", resourceCulture); } } - + /// /// Looks up a localized string similar to Invalid Continuation Token. /// - internal static string InvalidContinuationToken { - get { + internal static string InvalidContinuationToken + { + get + { return ResourceManager.GetString("InvalidContinuationToken", resourceCulture); } } - + /// /// Looks up a localized string similar to The specified document collection is invalid... /// - internal static string InvalidDatabase { - get { + internal static string InvalidDatabase + { + get + { return ResourceManager.GetString("InvalidDatabase", resourceCulture); } } - + /// /// Looks up a localized string similar to The input date header is invalid format. Please pass in RFC 1123 style date format.. /// - internal static string InvalidDateHeader { - get { + internal static string InvalidDateHeader + { + get + { return ResourceManager.GetString("InvalidDateHeader", resourceCulture); } } - + /// /// Looks up a localized string similar to The specified document collection is invalid.. /// - internal static string InvalidDocumentCollection { - get { + internal static string InvalidDocumentCollection + { + get + { return ResourceManager.GetString("InvalidDocumentCollection", resourceCulture); } } - + /// /// Looks up a localized string similar to Cannot enable 'enableMultipleWriteLocations' without also enabling 'canEnableMultipleWriteLocations'.. /// - internal static string InvalidEnableMultipleWriteLocations { - get { + internal static string InvalidEnableMultipleWriteLocations + { + get + { return ResourceManager.GetString("InvalidEnableMultipleWriteLocations", resourceCulture); } } - + /// /// Looks up a localized string similar to Invalid value {0} passed for enum {1}. /// - internal static string InvalidEnumValue { - get { + internal static string InvalidEnumValue + { + get + { return ResourceManager.GetString("InvalidEnumValue", resourceCulture); } } - + /// /// Looks up a localized string similar to Failover priority value {0} supplied for region {1} is invalid. /// - internal static string InvalidFailoverPriority { - get { + internal static string InvalidFailoverPriority + { + get + { return ResourceManager.GetString("InvalidFailoverPriority", resourceCulture); } } - + + /// - /// Looks up a localized string similar to Federation cap action is not currently supported.. + /// Looks up a localized string similar to Federation cap action is not currently supported. /// - internal static string InvalidFederationCapAction { - get { + internal static string InvalidFederationCapAction + { + get + { return ResourceManager.GetString("InvalidFederationCapAction", resourceCulture); } } - - /// - /// Looks up a localized string similar to Partition key path {0} is invalid for Gremlin API. The path cannot be '/id', '/label' or a nested path such as '/key/path'.. - /// - internal static string InvalidGremlinPartitionKey { - get { - return ResourceManager.GetString("InvalidGremlinPartitionKey", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to GroupId {0} is not supported. - /// - internal static string InvalidGroupId { - get { - return ResourceManager.GetString("InvalidGroupId", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Only one groupId is supported. - /// - internal static string InvalidGroupIdCount { - get { - return ResourceManager.GetString("InvalidGroupIdCount", resourceCulture); - } - } - + /// /// Looks up a localized string similar to Value '{0}' specified for the header '{1}' is invalid. . /// - internal static string InvalidHeaderValue { - get { + internal static string InvalidHeaderValue + { + get + { return ResourceManager.GetString("InvalidHeaderValue", resourceCulture); } } - + /// /// Looks up a localized string similar to The specified value {0} of the index kind is invalid.. /// - internal static string InvalidIndexKindValue { - get { + internal static string InvalidIndexKindValue + { + get + { return ResourceManager.GetString("InvalidIndexKindValue", resourceCulture); } } - + /// /// Looks up a localized string similar to The index spec format is invalid.. /// - internal static string InvalidIndexSpecFormat { - get { + internal static string InvalidIndexSpecFormat + { + get + { return ResourceManager.GetString("InvalidIndexSpecFormat", resourceCulture); } } - + /// /// Looks up a localized string similar to Received invalid index transformation progress values from all the replicas.. /// - internal static string InvalidIndexTransformationProgressValues { - get { + internal static string InvalidIndexTransformationProgressValues + { + get + { return ResourceManager.GetString("InvalidIndexTransformationProgressValues", resourceCulture); } } - + /// - /// Looks up a localized string similar to The provided Azure Key Vault resource secret URI does not follow the expected format.. + /// Looks up a localized string similar to List of supplied locations is invalid. /// - internal static string InvalidKeyVaulSecretURI { - get { - return ResourceManager.GetString("InvalidKeyVaulSecretURI", resourceCulture); + internal static string InvalidLocations + { + get + { + return ResourceManager.GetString("InvalidLocations", resourceCulture); } } - + /// - /// Looks up a localized string similar to The provided Azure Key Vault resource key or cert URI does not follow the expected format.. + /// Looks up a localized string similar to Only one manualPrivateLinkServiceConnection or one privateLinkServiceConnection is supported. /// - internal static string InvalidKeyVaultKeyAndCertURI { - get { - return ResourceManager.GetString("InvalidKeyVaultKeyAndCertURI", resourceCulture); + internal static string InvalidPrivateLinkServiceConnections + { + get + { + return ResourceManager.GetString("InvalidPrivateLinkServiceConnections", resourceCulture); } } - + /// - /// Looks up a localized string similar to List of supplied locations is invalid. + /// Looks up a localized string similar to Only one privateLinkServiceProxy is supported. /// - internal static string InvalidLocations { - get { - return ResourceManager.GetString("InvalidLocations", resourceCulture); + internal static string InvalidPrivateLinkServiceProxies + { + get + { + return ResourceManager.GetString("InvalidPrivateLinkServiceProxies", resourceCulture); } } - + /// - /// Looks up a localized string similar to MaxStalenessInterval should be greater than or equal to {0} sec and less than or equal to {1} sec. + /// Looks up a localized string similar to Only one groupId is supported. /// - internal static string InvalidMaxStalenessInterval { - get { - return ResourceManager.GetString("InvalidMaxStalenessInterval", resourceCulture); + internal static string InvalidGroupIdCount + { + get + { + return ResourceManager.GetString("InvalidGroupIdCount", resourceCulture); } } - + /// - /// Looks up a localized string similar to MaxStalenessPrefix should be greater than or equal to {0} and less than or equal to {1}. + /// Looks up a localized string similar to GroupId {0} is not supported. /// - internal static string InvalidMaxStalenessPrefix { - get { - return ResourceManager.GetString("InvalidMaxStalenessPrefix", resourceCulture); + internal static string InvalidGroupId + { + get + { + return ResourceManager.GetString("InvalidGroupId", resourceCulture); } } - + /// - /// Looks up a localized string similar to Collection name '{0}' is invalid for MongoDB API.. + /// Looks up a localized string similar to MaxStalenessInterval should be greater than or equal to {0} sec and less than or equal to {1} sec. /// - internal static string InvalidMongoCollectionName { - get { - return ResourceManager.GetString("InvalidMongoCollectionName", resourceCulture); + internal static string InvalidMaxStalenessInterval + { + get + { + return ResourceManager.GetString("InvalidMaxStalenessInterval", resourceCulture); } } - + /// - /// Looks up a localized string similar to Database name '{0}' is invalid for MongoDB API.. + /// Looks up a localized string similar to MaxStalenessPrefix should be greater than or equal to {0} and less than or equal to {1}. /// - internal static string InvalidMongoDatabaseName { - get { - return ResourceManager.GetString("InvalidMongoDatabaseName", resourceCulture); + internal static string InvalidMaxStalenessPrefix + { + get + { + return ResourceManager.GetString("InvalidMaxStalenessPrefix", resourceCulture); } } - + /// - /// Looks up a localized string similar to Partition key path {0} is invalid for MongoDB API.. + /// Looks up a localized string similar to The value of offer throughput specified exceeded supported maximum throughput for Fixed size container. Please enter value less than {0}.. /// - internal static string InvalidMongoPartitionKey { - get { - return ResourceManager.GetString("InvalidMongoPartitionKey", resourceCulture); + internal static string InvalidNonPartitionedOfferThroughput + { + get + { + return ResourceManager.GetString("InvalidNonPartitionedOfferThroughput", resourceCulture); } } - + /// - /// Looks up a localized string similar to The expected scope array should be of length 1. Instead received scope with length {0}.. + /// Looks up a localized string similar to The container doesn't have enough data populated with partition key information. Please retry the throughput scale operation after inserting data with partition key information. /// - internal static string InvalidMSALScopeLength { - get { - return ResourceManager.GetString("InvalidMSALScopeLength", resourceCulture); + internal static string InsufficientPartitionedDataForOfferThroughput + { + get + { + return ResourceManager.GetString("InsufficientPartitionedDataForOfferThroughput", resourceCulture); } } - + /// - /// Looks up a localized string similar to The value of offer throughput specified exceeded supported maximum throughput for Fixed size container. Please enter value less than {0}.. + /// Looks up a localized string similar to The value of offer IsAutoScaleEnabled specified is invalid. Please specify a boolean value.. /// - internal static string InvalidNonPartitionedOfferThroughput { - get { - return ResourceManager.GetString("InvalidNonPartitionedOfferThroughput", resourceCulture); + internal static string InvalidOfferIsAutoScaleEnabled + { + get + { + return ResourceManager.GetString("InvalidOfferIsAutoScaleEnabled", resourceCulture); } } - + /// - /// Looks up a localized string similar to The value of OfferAutoScaleMode specified is invalid. Please specify a valid auto scale mode.. + /// Looks up a localized string similar to The value of OfferAutoScaleMode specified is invalid. Please specfy a valid auto scale mode. /// - internal static string InvalidOfferAutoScaleMode { - get { + internal static string InvalidOfferAutoScaleMode + { + get + { return ResourceManager.GetString("InvalidOfferAutoScaleMode", resourceCulture); } } - - /// - /// Looks up a localized string similar to Reading or replacing offers is not supported for serverless accounts.. - /// - internal static string InvalidOfferCRUDForServerless { - get { - return ResourceManager.GetString("InvalidOfferCRUDForServerless", resourceCulture); + + internal static string OfferAutopilotNotSupportedForNonPartitionedCollections + { + get + { + return ResourceManager.GetString("OfferAutopilotNotSupportedForNonPartitionedCollections", resourceCulture); } } - + /// - /// Looks up a localized string similar to The value of offer IsAutoScaleEnabled specified is invalid. Please specify a boolean value.. + /// Looks up a localized string similar to Autopilot is currently not supported on shared throughput database. /// - internal static string InvalidOfferIsAutoScaleEnabled { - get { - return ResourceManager.GetString("InvalidOfferIsAutoScaleEnabled", resourceCulture); + internal static string OfferAutopilotNotSupportedOnSharedThroughputDatabase + { + get + { + return ResourceManager.GetString("OfferAutopilotNotSupportedOnSharedThroughputDatabase", resourceCulture); } } - + /// /// Looks up a localized string similar to The value of offer IsRUPerMinuteThroughputEnabled specified is invalid. Please specify a boolean value.. /// - internal static string InvalidOfferIsRUPerMinuteThroughputEnabled { - get { + internal static string InvalidOfferIsRUPerMinuteThroughputEnabled + { + get + { return ResourceManager.GetString("InvalidOfferIsRUPerMinuteThroughputEnabled", resourceCulture); } } - + + /// + /// Looks up a localized string similar to The value of offer BackgroundTaskMaxAllowedThroughputPercent specified is invalid. Please specify a double value.. + /// + internal static string InvalidBackgroundTaskMaxAllowedThroughputPercent + { + get + { + return ResourceManager.GetString("InvalidBackgroundTaskMaxAllowedThroughputPercent", resourceCulture); + } + } + /// /// Looks up a localized string similar to The value of offer throughput specified is invalid. Please enter valid positive integer.. /// - internal static string InvalidOfferThroughput { - get { + internal static string InvalidOfferThroughput + { + get + { return ResourceManager.GetString("InvalidOfferThroughput", resourceCulture); } } - + /// /// Looks up a localized string similar to OfferType {0} specified in the request is invalid. Please refer to offer documentation and specify a valid offer type.. /// - internal static string InvalidOfferType { - get { + internal static string InvalidOfferType + { + get + { return ResourceManager.GetString("InvalidOfferType", resourceCulture); } } - + /// /// Looks up a localized string similar to The required field Content is missing in Offer version v2.. /// - internal static string InvalidOfferV2Input { - get { + internal static string InvalidOfferV2Input + { + get + { return ResourceManager.GetString("InvalidOfferV2Input", resourceCulture); } } - + + /// + /// Looks up a localized string similar to Offer read/replace is not supported for serverless accounts. + /// + internal static string InvalidOfferCRUDForServerless + { + get + { + return ResourceManager.GetString("InvalidOfferCRUDForServerless", resourceCulture); + } + } + /// /// Looks up a localized string similar to Resource {0} is invalid for adding owner resource record. /// - internal static string InvalidOwnerResourceType { - get { + internal static string InvalidOwnerResourceType + { + get + { return ResourceManager.GetString("InvalidOwnerResourceType", resourceCulture); } } - + /// /// Looks up a localized string similar to The input PageSize {0} is invalid. Ensure to pass a valid page size which must be a positive integer or -1 for a dynamic page size.. /// - internal static string InvalidPageSize { - get { + internal static string InvalidPageSize + { + get + { return ResourceManager.GetString("InvalidPageSize", resourceCulture); } } - + /// /// Looks up a localized string similar to Partition key {0} is invalid.. /// - internal static string InvalidPartitionKey { - get { + internal static string InvalidPartitionKey + { + get + { return ResourceManager.GetString("InvalidPartitionKey", resourceCulture); } } - + /// /// Looks up a localized string similar to x-ms-documentdb-partitionkeyrangeid header contains invalid value '{0}'.. /// - internal static string InvalidPartitionKeyRangeIdHeader { - get { + internal static string InvalidPartitionKeyRangeIdHeader + { + get + { return ResourceManager.GetString("InvalidPartitionKeyRangeIdHeader", resourceCulture); } } - + /// /// Looks up a localized string similar to The permission mode provided in the authorization token doesn't provide sufficient permissions.. /// - internal static string InvalidPermissionMode { - get { + internal static string InvalidPermissionMode + { + get + { return ResourceManager.GetString("InvalidPermissionMode", resourceCulture); } } - + /// - /// Looks up a localized string similar to Policy type is invalid.. + /// Looks up a localized string similar to Invalid policy type found.. /// - internal static string InvalidPolicyType { - get { + internal static string InvalidPolicyType + { + get + { return ResourceManager.GetString("InvalidPolicyType", resourceCulture); } } - - /// - /// Looks up a localized string similar to Only one manualPrivateLinkServiceConnection or one privateLinkServiceConnection is supported. - /// - internal static string InvalidPrivateLinkServiceConnections { - get { - return ResourceManager.GetString("InvalidPrivateLinkServiceConnections", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Only one privateLinkServiceProxy is supported. - /// - internal static string InvalidPrivateLinkServiceProxies { - get { - return ResourceManager.GetString("InvalidPrivateLinkServiceProxies", resourceCulture); - } - } - /// /// Looks up a localized string similar to Command is not supported by backend. /// - internal static string InvalidProxyCommand { - get { + internal static string InvalidProxyCommand + { + get + { return ResourceManager.GetString("InvalidProxyCommand", resourceCulture); } } - + /// /// Looks up a localized string similar to Query '{0}' specified is either invalid or unsupported.. /// - internal static string InvalidQuery { - get { + internal static string InvalidQuery + { + get + { return ResourceManager.GetString("InvalidQuery", resourceCulture); } } - + /// /// Looks up a localized string similar to Value '{0}' specified for the query '{1}' is invalid.. /// - internal static string InvalidQueryValue { - get { + internal static string InvalidQueryValue + { + get + { return ResourceManager.GetString("InvalidQueryValue", resourceCulture); } } - + /// /// Looks up a localized string similar to Compared session tokens '{0}' and '{1}' has unexpected regions. . /// - internal static string InvalidRegionsInSessionToken { - get { + internal static string InvalidRegionsInSessionToken + { + get + { return ResourceManager.GetString("InvalidRegionsInSessionToken", resourceCulture); } } - + /// /// Looks up a localized string similar to Strong consistency level cannot be specified with async replication. Either change the replication policy 'AsyncReplication' to false or relax the consistency level.. /// - internal static string InvalidReplicationAndConsistencyCombination { - get { + internal static string InvalidReplicationAndConsistencyCombination + { + get + { return ResourceManager.GetString("InvalidReplicationAndConsistencyCombination", resourceCulture); } } - - /// - /// Looks up a localized string similar to The requested scope is not a well formed URI string.. - /// - internal static string InvalidRequestedScopeFormat { - get { - return ResourceManager.GetString("InvalidRequestedScopeFormat", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The request path {0} is invalid.. - /// - internal static string InvalidRequestUrl { - get { - return ResourceManager.GetString("InvalidRequestUrl", resourceCulture); - } - } - + /// /// Looks up a localized string similar to Failed to parse the value '{0}' as ResourceId.. /// - internal static string InvalidResourceID { - get { + internal static string InvalidResourceID + { + get + { return ResourceManager.GetString("InvalidResourceID", resourceCulture); } } - + /// /// Looks up a localized string similar to Value for {0} should be greater than 0. /// - internal static string InvalidResourceIdBatchSize { - get { + internal static string InvalidResourceIdBatchSize + { + get + { return ResourceManager.GetString("InvalidResourceIdBatchSize", resourceCulture); } } - + /// /// Looks up a localized string similar to Resource kind {0} is invalid. /// - internal static string InvalidResourceKind { - get { + internal static string InvalidResourceKind + { + get + { return ResourceManager.GetString("InvalidResourceKind", resourceCulture); } } - + /// /// Looks up a localized string similar to Requested ResourceType {0} passed as generic argument should be same as the one specified by ResourceType member {1}. /// - internal static string InvalidResourceType { - get { + internal static string InvalidResourceType + { + get + { return ResourceManager.GetString("InvalidResourceType", resourceCulture); } } - + /// /// Looks up a localized string similar to Resource Url path {0} is invalid.. /// - internal static string InvalidResourceUrlPath { - get { + internal static string InvalidResourceUrlPath + { + get + { return ResourceManager.GetString("InvalidResourceUrlPath", resourceCulture); } } - + /// /// Looks up a localized string similar to The value '{0}' specified for query '{1}' is invalid.. /// - internal static string InvalidResourceUrlQuery { - get { + internal static string InvalidResourceUrlQuery + { + get + { return ResourceManager.GetString("InvalidResourceUrlQuery", resourceCulture); } } - + /// /// Looks up a localized string similar to The input continuation token size limit {0} is invalid. Please pass in a valid continuation token size limit which must be a positive integer.. /// - internal static string InvalidResponseContinuationTokenLimit { - get { + internal static string InvalidResponseContinuationTokenLimit + { + get + { return ResourceManager.GetString("InvalidResponseContinuationTokenLimit", resourceCulture); } } - - /// - /// Looks up a localized string similar to The requested scope is not https.. - /// - internal static string InvalidSchemeInScope { - get { - return ResourceManager.GetString("InvalidSchemeInScope", resourceCulture); - } - } - + /// /// Looks up a localized string similar to Script request has invalid body.. /// - internal static string InvalidScriptResource { - get { + internal static string InvalidScriptResource + { + get + { return ResourceManager.GetString("InvalidScriptResource", resourceCulture); } } - + /// /// Looks up a localized string similar to The session token provided '{0}' is invalid.. /// - internal static string InvalidSessionToken { - get { + internal static string InvalidSessionToken + { + get + { return ResourceManager.GetString("InvalidSessionToken", resourceCulture); } } - + /// /// Looks up a localized string similar to The resource name can't end with space.. /// - internal static string InvalidSpaceEndingInResourceName { - get { + internal static string InvalidSpaceEndingInResourceName + { + get + { return ResourceManager.GetString("InvalidSpaceEndingInResourceName", resourceCulture); } } - + /// /// Looks up a localized string similar to Staleness Policy specified is invalid. Ensure both MaxPrefix and MaxStalenessIntervalInSeconds are both 0 or both not zero.. /// - internal static string InvalidStalenessPolicy { - get { + internal static string InvalidStalenessPolicy + { + get + { return ResourceManager.GetString("InvalidStalenessPolicy", resourceCulture); } } - + /// /// Looks up a localized string similar to Storage Service index {0} for media account {1} must be within byte range (inclusive).. /// - internal static string InvalidStorageServiceMediaIndex { - get { + internal static string InvalidStorageServiceMediaIndex + { + get + { return ResourceManager.GetString("InvalidStorageServiceMediaIndex", resourceCulture); } } - + /// - /// Looks up a localized string similar to Invalid store type specified {0}.. + /// Looks up a localized string similar to Cannot disable 'canEnableMultipleWriteLocations' flag once it has been enabled.. /// - internal static string InvalidStoreTypeSpecified { - get { - return ResourceManager.GetString("InvalidStoreTypeSpecified", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Subpartitioning is only supported for atmost 3 partition paths . - /// - internal static string InvalidSubPartitionKeyLength { - get { - return ResourceManager.GetString("InvalidSubPartitionKeyLength", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Subpartitioning is only supported for Hash V2. . - /// - internal static string InvalidSubPartitionKeyVersion { - get { - return ResourceManager.GetString("InvalidSubPartitionKeyVersion", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Cannot disable 'canEnableMultipleWriteLocations' flag once it has been enabled.. - /// - internal static string InvalidSwitchOffCanEnableMultipleWriteLocations { - get { + internal static string InvalidSwitchOffCanEnableMultipleWriteLocations + { + get + { return ResourceManager.GetString("InvalidSwitchOffCanEnableMultipleWriteLocations", resourceCulture); } } - + /// /// Looks up a localized string similar to Cannot enable 'canEnableMultipleWriteLocations' flag once account has been created with it disabled.. /// - internal static string InvalidSwitchOnCanEnableMultipleWriteLocations { - get { + internal static string InvalidSwitchOnCanEnableMultipleWriteLocations + { + get + { return ResourceManager.GetString("InvalidSwitchOnCanEnableMultipleWriteLocations", resourceCulture); } } - - /// - /// Looks up a localized string similar to Only system database account delete is supported through this endpoint. Supplied account {0} . - /// - internal static string InvalidSystemDatabaseAccountDelete { - get { - return ResourceManager.GetString("InvalidSystemDatabaseAccountDelete", resourceCulture); - } - } - + /// /// Looks up a localized string similar to Target for the request is invalid. /// - internal static string InvalidTarget { - get { + internal static string InvalidTarget + { + get + { return ResourceManager.GetString("InvalidTarget", resourceCulture); } } - - /// - /// Looks up a localized string similar to The value of offer throughput policy specified is invalid.. - /// - internal static string InvalidThroughputPolicy { - get { - return ResourceManager.GetString("InvalidThroughputPolicy", resourceCulture); - } - } - + /// /// Looks up a localized string similar to The authorization token is not valid at the current time. Please create another token and retry (token start time: {0}, token expiry time: {1}, current server time: {2}).. /// - internal static string InvalidTokenTimeRange { - get { + internal static string InvalidTokenTimeRange + { + get + { return ResourceManager.GetString("InvalidTokenTimeRange", resourceCulture); } } - - /// - /// Looks up a localized string similar to The potential total throughput of this operation exceeds the total throughput limit set for this account. Aborting request.. - /// - internal static string InvalidTotalThroughputLimitUpdate { - get { - return ResourceManager.GetString("InvalidTotalThroughputLimitUpdate", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Invalid type system '{0}' specified for container {1}.. - /// - internal static string InvalidTypeSystemPolicy { - get { - return ResourceManager.GetString("InvalidTypeSystemPolicy", resourceCulture); - } - } - + /// - /// Looks up a localized string similar to Please provide non-negative value for UpdateMaxthroughputEverProvisioned.. + /// Looks up a localized string similar to Request url is invalid.. /// - internal static string InvalidUpdateMaxthroughputEverProvisioned { - get { - return ResourceManager.GetString("InvalidUpdateMaxthroughputEverProvisioned", resourceCulture); + internal static string InvalidUrl + { + get + { + return ResourceManager.GetString("InvalidUrl", resourceCulture); } } - + /// - /// Looks up a localized string similar to Request url is invalid.. + /// Looks up a localized string similar to The request path {0} is invalid.. /// - internal static string InvalidUrl { - get { - return ResourceManager.GetString("InvalidUrl", resourceCulture); + internal static string InvalidRequestUrl + { + get + { + return ResourceManager.GetString("InvalidRequestUrl", resourceCulture); } } - + /// /// Looks up a localized string similar to System key can only access replica root. /// - internal static string InvalidUseSystemKey { - get { + internal static string InvalidUseSystemKey + { + get + { return ResourceManager.GetString("InvalidUseSystemKey", resourceCulture); } } - + /// /// Looks up a localized string similar to Invalid version format for {0}. Input Version {1}. /// - internal static string InvalidVersionFormat { - get { + internal static string InvalidVersionFormat + { + get + { return ResourceManager.GetString("InvalidVersionFormat", resourceCulture); } } - - /// - /// Looks up a localized string similar to The requested scope contains unexpected segments.. - /// - internal static string InvalildScopeSegments { - get { - return ResourceManager.GetString("InvalildScopeSegments", resourceCulture); - } - } - + /// /// Looks up a localized string similar to IpAddress {0} is blocked by Policy. /// - internal static string IpAddressBlockedByPolicy { - get { + internal static string IpAddressBlockedByPolicy + { + get + { return ResourceManager.GetString("IpAddressBlockedByPolicy", resourceCulture); } } - - /// - /// Looks up a localized string similar to Cannot set IpRangeFilter values on this account type.. - /// - internal static string IpRangeFilterNotSupported { - get { - return ResourceManager.GetString("IpRangeFilterNotSupported", resourceCulture); - } - } - + /// /// Looks up a localized string similar to Not allowed to force delete federation in this environment.. /// - internal static string IsForceDeleteFederationAllowed { - get { + internal static string IsForceDeleteFederationAllowed + { + get + { return ResourceManager.GetString("IsForceDeleteFederationAllowed", resourceCulture); } } - + /// /// Looks up a localized string similar to Tried to write a JSON end array (“]“) symbol without a matching array start symbol (“[“).. /// - internal static string JsonArrayNotStarted { - get { + internal static string JsonArrayNotStarted + { + get + { return ResourceManager.GetString("JsonArrayNotStarted", resourceCulture); } } - + /// /// Looks up a localized string similar to Invalid escape character in JSON.. /// - internal static string JsonInvalidEscapedCharacter { - get { + internal static string JsonInvalidEscapedCharacter + { + get + { return ResourceManager.GetString("JsonInvalidEscapedCharacter", resourceCulture); } } - + /// /// Looks up a localized string similar to Invalid number in JSON.. /// - internal static string JsonInvalidNumber { - get { + internal static string JsonInvalidNumber + { + get + { return ResourceManager.GetString("JsonInvalidNumber", resourceCulture); } } - + /// /// Looks up a localized string similar to Invalid parameter in JSON.. /// - internal static string JsonInvalidParameter { - get { + internal static string JsonInvalidParameter + { + get + { return ResourceManager.GetString("JsonInvalidParameter", resourceCulture); } } - + /// /// Looks up a localized string similar to Invalid string character in JSON.. /// - internal static string JsonInvalidStringCharacter { - get { + internal static string JsonInvalidStringCharacter + { + get + { return ResourceManager.GetString("JsonInvalidStringCharacter", resourceCulture); } } - + /// /// Looks up a localized string similar to Encountered an element that is not a valid JSON value (false / null / true / object / array / number / string). /// - internal static string JsonInvalidToken { - get { + internal static string JsonInvalidToken + { + get + { return ResourceManager.GetString("JsonInvalidToken", resourceCulture); } } - + /// /// Looks up a localized string similar to Invalid Unicode escape sequence in JSON.. /// - internal static string JsonInvalidUnicodeEscape { - get { + internal static string JsonInvalidUnicodeEscape + { + get + { return ResourceManager.GetString("JsonInvalidUnicodeEscape", resourceCulture); } } - + /// /// Looks up a localized string similar to Exceeded the maximum level of nesting for JSON.. /// - internal static string JsonMaxNestingExceeded { - get { + internal static string JsonMaxNestingExceeded + { + get + { return ResourceManager.GetString("JsonMaxNestingExceeded", resourceCulture); } } - + /// /// Looks up a localized string similar to Missing a closing quote (") in JSON.. /// - internal static string JsonMissingClosingQuote { - get { + internal static string JsonMissingClosingQuote + { + get + { return ResourceManager.GetString("JsonMissingClosingQuote", resourceCulture); } } - + /// /// Looks up a localized string similar to Missing an end array ("]") symbol in JSON.. /// - internal static string JsonMissingEndArray { - get { + internal static string JsonMissingEndArray + { + get + { return ResourceManager.GetString("JsonMissingEndArray", resourceCulture); } } - + /// /// Looks up a localized string similar to Missing an end object ("}") symbol in JSON.. /// - internal static string JsonMissingEndObject { - get { + internal static string JsonMissingEndObject + { + get + { return ResourceManager.GetString("JsonMissingEndObject", resourceCulture); } } - + /// /// Looks up a localized string similar to Missing a name separator (":") in JSON.. /// - internal static string JsonMissingNameSeparator { - get { + internal static string JsonMissingNameSeparator + { + get + { return ResourceManager.GetString("JsonMissingNameSeparator", resourceCulture); } } - + /// /// Looks up a localized string similar to Missing a JSON property.. /// - internal static string JsonMissingProperty { - get { + internal static string JsonMissingProperty + { + get + { return ResourceManager.GetString("JsonMissingProperty", resourceCulture); } } - + /// /// Looks up a localized string similar to Encountered a JSON property name without a corresponding property value. /// - internal static string JsonNotComplete { - get { + internal static string JsonNotComplete + { + get + { return ResourceManager.GetString("JsonNotComplete", resourceCulture); } } - + /// /// Looks up a localized string similar to Encountered a value that was not a JSON field name.. /// - internal static string JsonNotFieldnameToken { - get { + internal static string JsonNotFieldnameToken + { + get + { return ResourceManager.GetString("JsonNotFieldnameToken", resourceCulture); } } - + /// /// Looks up a localized string similar to Encountered a value that was not a JSON number.. /// - internal static string JsonNotNumberToken { - get { + internal static string JsonNotNumberToken + { + get + { return ResourceManager.GetString("JsonNotNumberToken", resourceCulture); } } - + /// /// Looks up a localized string similar to Encountered a value that was not a JSON string.. /// - internal static string JsonNotStringToken { - get { + internal static string JsonNotStringToken + { + get + { return ResourceManager.GetString("JsonNotStringToken", resourceCulture); } } - + /// /// Looks up a localized string similar to Encountered a number that exceeded the range for JSON numbers.. /// - internal static string JsonNumberOutOfRange { - get { + internal static string JsonNumberOutOfRange + { + get + { return ResourceManager.GetString("JsonNumberOutOfRange", resourceCulture); } } - + /// /// Looks up a localized string similar to Encountered a number that was too long for a JSON number.. /// - internal static string JsonNumberTooLong { - get { + internal static string JsonNumberTooLong + { + get + { return ResourceManager.GetString("JsonNumberTooLong", resourceCulture); } } - + /// /// Looks up a localized string similar to Tried to write a JSON object end symbol ("}") without first opening with a JSON object start symbol ("{").. /// - internal static string JsonObjectNotStarted { - get { + internal static string JsonObjectNotStarted + { + get + { return ResourceManager.GetString("JsonObjectNotStarted", resourceCulture); } } - + /// /// Looks up a localized string similar to Encountered a JSON property name after another JSON property name.. /// - internal static string JsonPropertyAlreadyAdded { - get { + internal static string JsonPropertyAlreadyAdded + { + get + { return ResourceManager.GetString("JsonPropertyAlreadyAdded", resourceCulture); } } - + /// /// Looks up a localized string similar to Either a JSON property array or object was not started.. /// - internal static string JsonPropertyArrayOrObjectNotStarted { - get { + internal static string JsonPropertyArrayOrObjectNotStarted + { + get + { return ResourceManager.GetString("JsonPropertyArrayOrObjectNotStarted", resourceCulture); } } - + /// /// Looks up a localized string similar to Read a JSON end array ("]") symbol without a matching JSON start array symbol ("[").. /// - internal static string JsonUnexpectedEndArray { - get { + internal static string JsonUnexpectedEndArray + { + get + { return ResourceManager.GetString("JsonUnexpectedEndArray", resourceCulture); } } - + /// /// Looks up a localized string similar to Read a JSON end object ("}") symbol without a matching JSON start object symbol ("{").. /// - internal static string JsonUnexpectedEndObject { - get { + internal static string JsonUnexpectedEndObject + { + get + { return ResourceManager.GetString("JsonUnexpectedEndObject", resourceCulture); } } - + /// /// Looks up a localized string similar to Read a JSON name separator (":") symbol without a corresponding field name.. /// - internal static string JsonUnexpectedNameSeparator { - get { + internal static string JsonUnexpectedNameSeparator + { + get + { return ResourceManager.GetString("JsonUnexpectedNameSeparator", resourceCulture); } } - + /// /// Looks up a localized string similar to Encountered an unexpected JSON token.. /// - internal static string JsonUnexpectedToken { - get { + internal static string JsonUnexpectedToken + { + get + { return ResourceManager.GetString("JsonUnexpectedToken", resourceCulture); } } - + /// /// Looks up a localized string similar to Read a JSON name separator (",") symbol without a preceding JSON value.. /// - internal static string JsonUnexpectedValueSeparator { - get { + internal static string JsonUnexpectedValueSeparator + { + get + { return ResourceManager.GetString("JsonUnexpectedValueSeparator", resourceCulture); } } - - /// - /// Looks up a localized string similar to Failed to acquire the access token needed to access the Azure Key Vault resource. Please verify that the tenant has all corresponding permissions assigned.. - /// - internal static string KeyVaultAadClientCredentialsGrantFailure { - get { - return ResourceManager.GetString("KeyVaultAadClientCredentialsGrantFailure", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Could not find any secret with the .pem extension related to the provided certificate.. - /// - internal static string KeyVaultCertificateException { - get { - return ResourceManager.GetString("KeyVaultCertificateException", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The remote name could not be resolved for the Azure Key Vault resource. Please provide a valid URI for an existing Key vault.. - /// - internal static string KeyVaultDNSNotResolved { - get { - return ResourceManager.GetString("KeyVaultDNSNotResolved", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The Input provided is not a valid base 64 string.. - /// - internal static string KeyVaultInvalidInputBytes { - get { - return ResourceManager.GetString("KeyVaultInvalidInputBytes", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Error contacting the Azure Key Vault resource. Please try again.. - /// - internal static string KeyVaultServiceUnavailable { - get { - return ResourceManager.GetString("KeyVaultServiceUnavailable", resourceCulture); - } - } - + /// /// Looks up a localized string similar to The resource that is being accessed is locked.. /// - internal static string Locked { - get { + internal static string Locked + { + get + { return ResourceManager.GetString("Locked", resourceCulture); } } - - /// - /// Looks up a localized string similar to MaterializedViews is not supported on this account type.. - /// - internal static string MaterializedViewsNotSupported { - get { - return ResourceManager.GetString("MaterializedViewsNotSupported", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Materialized Views are not supported on account with zone redundant region. - /// - internal static string MaterializedViewsNotSupportedOnZoneRedundantAccount { - get { - return ResourceManager.GetString("MaterializedViewsNotSupportedOnZoneRedundantAccount", resourceCulture); - } - } - + /// /// Looks up a localized string similar to Current maximum throughput per collection is {0}. Please contact Azure support to increase it.. /// - internal static string MaximumRULimitExceeded { - get { + internal static string MaximumRULimitExceeded + { + get + { return ResourceManager.GetString("MaximumRULimitExceeded", resourceCulture); } } - + /// /// Looks up a localized string similar to Cannot find messageId header. /// - internal static string MessageIdHeaderMissing { - get { + internal static string MessageIdHeaderMissing + { + get + { return ResourceManager.GetString("MessageIdHeaderMissing", resourceCulture); } } - + /// /// Looks up a localized string similar to The requested verb is not supported.. /// - internal static string MethodNotAllowed { - get { + internal static string MethodNotAllowed + { + get + { return ResourceManager.GetString("MethodNotAllowed", resourceCulture); } } - + /// - /// Looks up a localized string similar to The input authorization token can't serve the request. The wrong key is being used or the expected payload is not built as per the protocol. For more info: https://aka.ms/cosmosdb-tsg-unauthorized. Server used the following payload to sign: '{0}'. + /// Looks up a localized string similar to The input authorization token can't serve the request. Please check that the expected payload is built as per the protocol, and check the key being used. Server used the following payload to sign: '{0}'. /// - internal static string MismatchToken { - get { + internal static string MismatchToken + { + get + { return ResourceManager.GetString("MismatchToken", resourceCulture); } } - + /// /// Looks up a localized string similar to Required Header authorization is missing. Ensure a valid Authorization token is passed.. /// - internal static string MissingAuthHeader { - get { + internal static string MissingAuthHeader + { + get + { return ResourceManager.GetString("MissingAuthHeader", resourceCulture); } } - + /// /// Looks up a localized string similar to Authorization token mandates Date headers. Please pass in RFC 1123 style date format.. /// - internal static string MissingDateForAuthorization { - get { + internal static string MissingDateForAuthorization + { + get + { return ResourceManager.GetString("MissingDateForAuthorization", resourceCulture); } } - + /// /// Looks up a localized string similar to PartitionKey value must be supplied for this operation.. /// - internal static string MissingPartitionKeyValue { - get { + internal static string MissingPartitionKeyValue + { + get + { return ResourceManager.GetString("MissingPartitionKeyValue", resourceCulture); } } - + /// /// Looks up a localized string similar to Required property {0} is not specified in the request.. /// - internal static string MissingProperty { - get { + internal static string MissingProperty + { + get + { return ResourceManager.GetString("MissingProperty", resourceCulture); } } - + /// /// Looks up a localized string similar to Required header '{0}' is not specified in the request.. /// - internal static string MissingRequiredHeader { - get { + internal static string MissingRequiredHeader + { + get + { return ResourceManager.GetString("MissingRequiredHeader", resourceCulture); } } - + /// /// Looks up a localized string similar to Required query variable '{0}' is not specified in the request.. /// - internal static string MissingRequiredQuery { - get { + internal static string MissingRequiredQuery + { + get + { return ResourceManager.GetString("MissingRequiredQuery", resourceCulture); } } - - /// - /// Looks up a localized string similar to "The create request is not allowed since it does not specify the schema for container '{0}'.. - /// - internal static string MissingSchemaPolicyOnContainer { - get { - return ResourceManager.GetString("MissingSchemaPolicyOnContainer", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Type system must be specified for the container {0}.. - /// - internal static string MissingTypeSystemPolicy { - get { - return ResourceManager.GetString("MissingTypeSystemPolicy", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Auto upgrade policy is not supported for MongDB resources.. - /// - internal static string MongoClientAutoUpgradeNotSupported { - get { - return ResourceManager.GetString("MongoClientAutoUpgradeNotSupported", resourceCulture); - } - } - + /// /// Looks up a localized string similar to This account already has one backup interval capability.. /// - internal static string MoreThanOneBackupIntervalCapability { - get { + internal static string MoreThanOneBackupIntervalCapability + { + get + { return ResourceManager.GetString("MoreThanOneBackupIntervalCapability", resourceCulture); } } - + /// /// Looks up a localized string similar to This account already has one backup retention capability.. /// - internal static string MoreThanOneBackupRetentionCapability { - get { + internal static string MoreThanOneBackupRetentionCapability + { + get + { return ResourceManager.GetString("MoreThanOneBackupRetentionCapability", resourceCulture); } } - + /// /// Looks up a localized string similar to Atleast single region must be specified in PreferredLocation list when automatic failover is disabled.. /// - internal static string MustHaveNonZeroPreferredRegionWhenAutomaticFailoverDisabled { - get { + internal static string MustHaveNonZeroPreferredRegionWhenAutomaticFailoverDisabled + { + get + { return ResourceManager.GetString("MustHaveNonZeroPreferredRegionWhenAutomaticFailoverDisabled", resourceCulture); } } - + /// /// Looks up a localized string similar to NamingProperty {0} not found. /// - internal static string NamingPropertyNotFound { - get { + internal static string NamingPropertyNotFound + { + get + { return ResourceManager.GetString("NamingPropertyNotFound", resourceCulture); } } - + /// /// Looks up a localized string similar to Property '{0}' integer value must be greater than or equal to zero.. /// - internal static string NegativeInteger { - get { + internal static string NegativeInteger + { + get + { return ResourceManager.GetString("NegativeInteger", resourceCulture); } } - + /// /// Looks up a localized string similar to No graft point. /// - internal static string NoGraftPoint { - get { + internal static string NoGraftPoint + { + get + { return ResourceManager.GetString("NoGraftPoint", resourceCulture); } } - + /// - /// Looks up a localized string similar to Entity with the specified id does not exist in the system. More info: https://aka.ms/cosmosdb-tsg-not-found. + /// Looks up a localized string similar to Entity with the specified id does not exist in the system.. /// - internal static string NotFound { - get { + internal static string NotFound + { + get + { return ResourceManager.GetString("NotFound", resourceCulture); } } - - /// - /// Looks up a localized string similar to Autopilot of non-partitioned collections is not supported. Please specify a partition key.. - /// - internal static string OfferAutopilotNotSupportedForNonPartitionedCollections { - get { - return ResourceManager.GetString("OfferAutopilotNotSupportedForNonPartitionedCollections", resourceCulture); - } - } - + /// - /// Looks up a localized string similar to Autopilot is currently not supported on shared throughput database.. + /// Looks up a localized string similar to GraphAPICompute Service cannot be deleted. /// - internal static string OfferAutopilotNotSupportedOnSharedThroughputDatabase { - get { - return ResourceManager.GetString("OfferAutopilotNotSupportedOnSharedThroughputDatabase", resourceCulture); + internal static string GremlinV2ServiceDeleteNotSupported + { + get + { + return ResourceManager.GetString("GremlinV2ServiceDeleteNotSupported", resourceCulture); } } - + /// /// Looks up a localized string similar to Offer replace request conflicted.. /// - internal static string OfferReplaceTopologyConflict { - get { + internal static string OfferReplaceTopologyConflict + { + get + { return ResourceManager.GetString("OfferReplaceTopologyConflict", resourceCulture); } } - + /// /// Looks up a localized string similar to Cannot replace an offer with version {0} with version {1}. /// - internal static string OfferReplaceWithSpecifiedVersionsNotSupported { - get { + internal static string OfferReplaceWithSpecifiedVersionsNotSupported + { + get + { return ResourceManager.GetString("OfferReplaceWithSpecifiedVersionsNotSupported", resourceCulture); } } - + + /// + /// Looks up a localized string similar to Offer type and throughput cannot both be specified.. + /// + internal static string OfferTypeAndThroughputCannotBeSpecifiedBoth + { + get + { + return ResourceManager.GetString("OfferTypeAndThroughputCannotBeSpecifiedBoth", resourceCulture); + } + } + /// /// Looks up a localized string similar to Offer throughput and autopilot settings cannot both be specified.. /// - internal static string OfferThroughputAndAutoPilotSettingsCannotBeSpecifiedBoth { - get { + internal static string OfferThroughputAndAutoPilotSettingsCannotBeSpecifiedBoth + { + get + { return ResourceManager.GetString("OfferThroughputAndAutoPilotSettingsCannotBeSpecifiedBoth", resourceCulture); } } - + /// - /// Looks up a localized string similar to Offer type and throughput cannot both be specified.. + /// Looks up a localized string similar to Autopilot tier and AutoPilotSettings cannot both be specified.. /// - internal static string OfferTypeAndThroughputCannotBeSpecifiedBoth { - get { - return ResourceManager.GetString("OfferTypeAndThroughputCannotBeSpecifiedBoth", resourceCulture); + internal static string AutoPilotTierAndAutoPilotSettingsCannotBeSpecifiedBoth + { + get + { + return ResourceManager.GetString("AutoPilotTierAndAutoPilotSettingsCannotBeSpecifiedBoth", resourceCulture); } } - + + /// + /// Looks up a localized string similar to Autopilot autoupgrade is not supported for non-partitioned collections.. + /// + internal static string AutopilotAutoUpgradeUnsupportedNonPartitionedCollection + { + get + { + return ResourceManager.GetString("AutopilotAutoUpgradeUnsupportedNonPartitionedCollection", resourceCulture); + } + } + /// /// Looks up a localized string similar to Requested Operation Status = {0} is invalid.. /// - internal static string OperationRequestedStatusIsInvalid { - get { + internal static string OperationRequestedStatusIsInvalid + { + get + { return ResourceManager.GetString("OperationRequestedStatusIsInvalid", resourceCulture); } } - + /// /// Looks up a localized string similar to Selected partition is full, please try insert in different partition.. /// - internal static string PartitionIsFull { - get { + internal static string PartitionIsFull + { + get + { return ResourceManager.GetString("PartitionIsFull", resourceCulture); } } - + /// /// Looks up a localized string similar to Either PartitionKey or EffectivePartitionKey are expected.. /// - internal static string PartitionKeyAndEffectivePartitionKeyBothSpecified { - get { + internal static string PartitionKeyAndEffectivePartitionKeyBothSpecified + { + get + { return ResourceManager.GetString("PartitionKeyAndEffectivePartitionKeyBothSpecified", resourceCulture); } } - + /// /// Looks up a localized string similar to PartitionKey and PartitionKeyRangeId cannot be specified at the same time in ChangeFeedOptions.. /// - internal static string PartitionKeyAndPartitionKeyRangeRangeIdBothSpecified { - get { + internal static string PartitionKeyAndPartitionKeyRangeRangeIdBothSpecified + { + get + { return ResourceManager.GetString("PartitionKeyAndPartitionKeyRangeRangeIdBothSpecified", resourceCulture); } } - + /// /// Looks up a localized string similar to Partition key provided either doesn't correspond to definition in the collection or doesn't match partition key field values specified in the document.. /// - internal static string PartitionKeyMismatch { - get { + internal static string PartitionKeyMismatch + { + get + { return ResourceManager.GetString("PartitionKeyMismatch", resourceCulture); } } - + /// /// Looks up a localized string similar to PartitionKeyRangeId is absent in the context.. /// - internal static string PartitionKeyRangeIdAbsentInContext { - get { + internal static string PartitionKeyRangeIdAbsentInContext + { + get + { return ResourceManager.GetString("PartitionKeyRangeIdAbsentInContext", resourceCulture); } } - + /// /// Looks up a localized string similar to For partitioned collection, either ChangeFeedOptions.PartitionKeyRangeId or ChangeFeedOptions.PartitionKey must be specified.. /// - internal static string PartitionKeyRangeIdOrPartitionKeyMustBeSpecified { - get { + internal static string PartitionKeyRangeIdOrPartitionKeyMustBeSpecified + { + get + { return ResourceManager.GetString("PartitionKeyRangeIdOrPartitionKeyMustBeSpecified", resourceCulture); } } - + /// /// Looks up a localized string similar to PartitionKeyRange with id '{0}' in collection '{1}' doesn't exist.. /// - internal static string PartitionKeyRangeNotFound { - get { + internal static string PartitionKeyRangeNotFound + { + get + { return ResourceManager.GetString("PartitionKeyRangeNotFound", resourceCulture); } } - - /// - /// Looks up a localized string similar to There cannot be a common physical partition id both in x-ms-cosmos-target-partition-throughput-info and x-ms-cosmos-source-partition-throughput-info header. Encountered {0}. - /// - internal static string PhysicalPartitionIdinTargetAndSourcePartitionThroughputInfo { - get { - return ResourceManager.GetString("PhysicalPartitionIdinTargetAndSourcePartitionThroughputInfo", resourceCulture); - } - } - + /// - /// Looks up a localized string similar to One of the source or target physical partition id doesn't exist.. + /// Looks up a localized string similar to Property '{0}' integer value must be greater than zero.. /// - internal static string PhysicalPartitionIdinTargetOrSourceDoesNotExist { - get { - return ResourceManager.GetString("PhysicalPartitionIdinTargetOrSourceDoesNotExist", resourceCulture); + internal static string PositiveInteger + { + get + { + return ResourceManager.GetString("PositiveInteger", resourceCulture); } } - + /// - /// Looks up a localized string similar to Pitr is not supported on this account type.. + /// Looks up a localized string similar to Operation cannot be performed because one of the specified precondition is not met.. /// - internal static string PitrNotSupported { - get { - return ResourceManager.GetString("PitrNotSupported", resourceCulture); + internal static string PreconditionFailed + { + get + { + return ResourceManager.GetString("PreconditionFailed", resourceCulture); } } - + /// - /// Looks up a localized string similar to Property '{0}' integer value must be greater than zero.. + /// Looks up a localized string similar to Database account was created successfully, but the following regions failed to be added to account: \n. /// - internal static string PositiveInteger { - get { - return ResourceManager.GetString("PositiveInteger", resourceCulture); + internal static string PrimarySuceededButAdditionalRegionsFailed + { + get + { + return ResourceManager.GetString("PrimarySuceededButAdditionalRegionsFailed", resourceCulture); } } - + /// - /// Looks up a localized string similar to Operation cannot be performed because one of the specified precondition is not met.. + /// Looks up a localized string similar to Database account creation failed. Operation Id : {0}, Error : {1}. /// - internal static string PreconditionFailed { - get { - return ResourceManager.GetString("PreconditionFailed", resourceCulture); + internal static string PrimaryWriteRegionFailedFormat + { + get + { + return ResourceManager.GetString("PrimaryWriteRegionFailedFormat", resourceCulture); } } - + /// - /// Looks up a localized string similar to Unable to resolve primary endpoint for partition {0} for service {1}.. + /// Looks up a localized string similar to {0} : Operation Id : {1}, Error : {2}\n. /// - internal static string PrimaryNotFound { - get { - return ResourceManager.GetString("PrimaryNotFound", resourceCulture); + internal static string SecondaryRegionsFailedFormat + { + get + { + return ResourceManager.GetString("SecondaryRegionsFailedFormat", resourceCulture); } } - + /// - /// Looks up a localized string similar to Database account was created successfully, but the following regions failed to be added to account: < br/ >. + /// Looks up a localized string similar to Add or Remove region operation failed. /// - internal static string PrimarySuceededButAdditionalRegionsFailed { - get { - return ResourceManager.GetString("PrimarySuceededButAdditionalRegionsFailed", resourceCulture); + internal static string AddRemoveRegionOperationFailed + { + get + { + return ResourceManager.GetString("AddRemoveRegionOperationFailed", resourceCulture); } } - + /// - /// Looks up a localized string similar to Database account creation failed. Operation Id: {0}, Error : {1}. + /// Looks up a localized string similar to Unable to resolve primary endpoint for partition {0} for service {1}.. /// - internal static string PrimaryWriteRegionFailedFormat { - get { - return ResourceManager.GetString("PrimaryWriteRegionFailedFormat", resourceCulture); + internal static string PrimaryNotFound + { + get + { + return ResourceManager.GetString("PrimaryNotFound", resourceCulture); } } - + /// /// Looks up a localized string similar to Property {0} can not be assigned to null.. /// - internal static string PropertyCannotBeNull { - get { + internal static string PropertyCannotBeNull + { + get + { return ResourceManager.GetString("PropertyCannotBeNull", resourceCulture); } } - + /// /// Looks up a localized string similar to Property '{0}' is not found in the document.. /// - internal static string PropertyNotFound { - get { + internal static string PropertyNotFound + { + get + { return ResourceManager.GetString("PropertyNotFound", resourceCulture); } } - + /// /// Looks up a localized string similar to Reached the pre-approved storage limit for the database account. Please contact Azure support to increase this limit.. /// - internal static string ProvisionLimit { - get { + internal static string ProvisionLimit + { + get + { return ResourceManager.GetString("ProvisionLimit", resourceCulture); } } - - /// - /// Looks up a localized string similar to Request is blocked because ResourceId [{0}] cannot be resolved. Principal = [{1}], Action = [{2}], ResourceType = [{3}].. - /// - internal static string RbacCannotResolveResourceRid { - get { - return ResourceManager.GetString("RbacCannotResolveResourceRid", resourceCulture); - } - } - + /// /// Looks up a localized string similar to Cannot authorize request since the [Action] to authorize was not found.. /// - internal static string RbacMissingAction { - get { + internal static string RbacMissingAction + { + get + { return ResourceManager.GetString("RbacMissingAction", resourceCulture); } } - + /// /// Looks up a localized string similar to Cannot authorize request since the [User ID] to authorize was not found.. /// - internal static string RbacMissingUserId { - get { + internal static string RbacMissingUserId + { + get + { return ResourceManager.GetString("RbacMissingUserId", resourceCulture); } } - + + /// + /// Looks up a localized string similar to Request is blocked because ResourceId [{0}] cannot be resolved. Principal = [{1}], Action = [{2}], ResourceType = [{3}].. + /// + internal static string RbacCannotResolveResourceRid + { + get + { + return ResourceManager.GetString("RbacCannotResolveResourceRid", resourceCulture); + } + } + /// /// Looks up a localized string similar to Read Quorum size of {0} is not met for the request.. /// - internal static string ReadQuorumNotMet { - get { + internal static string ReadQuorumNotMet + { + get + { return ResourceManager.GetString("ReadQuorumNotMet", resourceCulture); } } - + /// /// Looks up a localized string similar to The read session is not available for the input session token.. /// - internal static string ReadSessionNotAvailable { - get { + internal static string ReadSessionNotAvailable + { + get + { return ResourceManager.GetString("ReadSessionNotAvailable", resourceCulture); } } - + /// /// Looks up a localized string similar to Failed to read the server response.. /// - internal static string ReceiveFailedTransportError { - get { + internal static string ReceiveFailedTransportError + { + get + { return ResourceManager.GetString("ReceiveFailedTransportError", resourceCulture); } } - + /// /// Looks up a localized string similar to The remote system closed the connection.. /// - internal static string ReceiveStreamClosedTransportError { - get { + internal static string ReceiveStreamClosedTransportError + { + get + { return ResourceManager.GetString("ReceiveStreamClosedTransportError", resourceCulture); } } - + /// /// Looks up a localized string similar to The request timed out while waiting for a server response.. /// - internal static string ReceiveTimeoutTransportError { - get { + internal static string ReceiveTimeoutTransportError + { + get + { return ResourceManager.GetString("ReceiveTimeoutTransportError", resourceCulture); } } - + /// /// Looks up a localized string similar to Cannot remove write region for account {0}. Please issue delete on the account to remove write region. /// - internal static string RemoveWriteRegionNotSupported { - get { + internal static string RemoveWriteRegionNotSupported + { + get + { return ResourceManager.GetString("RemoveWriteRegionNotSupported", resourceCulture); } } - + /// /// Looks up a localized string similar to Replica at index '{0}' is currently unavailable.. /// - internal static string ReplicaAtIndexNotAvailable { - get { + internal static string ReplicaAtIndexNotAvailable + { + get + { return ResourceManager.GetString("ReplicaAtIndexNotAvailable", resourceCulture); } } - + /// /// Looks up a localized string similar to Consistency Level '{0}' requested via header '{1}' is not supported by this service endpoint. Please contact the service administrator.. /// - internal static string RequestConsistencyLevelNotSupported { - get { + internal static string RequestConsistencyLevelNotSupported + { + get + { return ResourceManager.GetString("RequestConsistencyLevelNotSupported", resourceCulture); } } - + /// /// Looks up a localized string similar to The size of the response exceeded the maximum allowed size, limit the response size by specifying smaller value for '{0}' header.. /// - internal static string RequestEntityTooLarge { - get { + internal static string RequestEntityTooLarge + { + get + { return ResourceManager.GetString("RequestEntityTooLarge", resourceCulture); } } - + /// - /// Looks up a localized string similar to Request timed out. More info: https://aka.ms/cosmosdb-tsg-request-timeout. + /// Looks up a localized string similar to Request timed out.. /// - internal static string RequestTimeout { - get { + internal static string RequestTimeout + { + get + { return ResourceManager.GetString("RequestTimeout", resourceCulture); } } - + /// /// Looks up a localized string similar to The request timed out. See the inner exception for details.. /// - internal static string RequestTimeoutTransportError { - get { + internal static string RequestTimeoutTransportError + { + get + { return ResourceManager.GetString("RequestTimeoutTransportError", resourceCulture); } } - + /// /// Looks up a localized string similar to The size of the request exceeded the maximum allowed size.. /// - internal static string RequestTooLarge { - get { + internal static string RequestTooLarge + { + get + { return ResourceManager.GetString("RequestTooLarge", resourceCulture); } } - + /// /// Looks up a localized string similar to Resource id cannot be empty.. /// - internal static string ResourceIdCannotBeEmpty { - get { + internal static string ResourceIdCannotBeEmpty + { + get + { return ResourceManager.GetString("ResourceIdCannotBeEmpty", resourceCulture); } } - + /// /// Looks up a localized string similar to ResourceId {0} of type {1} is not a valid resource Id.. /// - internal static string ResourceIdNotValid { - get { + internal static string ResourceIdNotValid + { + get + { return ResourceManager.GetString("ResourceIdNotValid", resourceCulture); } } - + /// /// Looks up a localized string similar to ResourceIdPolicy {0} is not supported. /// - internal static string ResourceIdPolicyNotSupported { - get { + internal static string ResourceIdPolicyNotSupported + { + get + { return ResourceManager.GetString("ResourceIdPolicyNotSupported", resourceCulture); } } - + /// /// Looks up a localized string similar to Resource type {0} is not supported by ResourceIdPartitioner. /// - internal static string ResourceTypeNotSupported { - get { + internal static string ResourceTypeNotSupported + { + get + { return ResourceManager.GetString("ResourceTypeNotSupported", resourceCulture); } } - + /// /// Looks up a localized string similar to Retry the request.. /// - internal static string RetryWith { - get { + internal static string RetryWith + { + get + { return ResourceManager.GetString("RetryWith", resourceCulture); } } - - /// - /// Looks up a localized string similar to Revoke/Grant is not allowed as the Account status is: {0}.. - /// - internal static string RevokeRegrantNotAllowed { - get { - return ResourceManager.GetString("RevokeRegrantNotAllowed", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to SAS Token Authentication is disabled for this account. Please contact Azure Support [https://azure.microsoft.com/support] to enable it.. - /// - internal static string SasTokenAuthDisabled { - get { - return ResourceManager.GetString("SasTokenAuthDisabled", resourceCulture); - } - } - + /// /// Looks up a localized string similar to Changing id of a script in collections with multiple partitions is not supported.. /// - internal static string ScriptRenameInMultiplePartitionsIsNotSupported { - get { + internal static string ScriptRenameInMultiplePartitionsIsNotSupported + { + get + { return ResourceManager.GetString("ScriptRenameInMultiplePartitionsIsNotSupported", resourceCulture); } } - + /// /// Looks up a localized string similar to Unable to resolve secondary endpoint for partition {0} for service {1}.. /// - internal static string SecondariesNotFound { - get { + internal static string SecondariesNotFound + { + get + { return ResourceManager.GetString("SecondariesNotFound", resourceCulture); } } - - /// - /// Looks up a localized string similar to {0} : Operation Id : {1}, Error : {2} < br/ >. - /// - internal static string SecondaryRegionsFailedFormat { - get { - return ResourceManager.GetString("SecondaryRegionsFailedFormat", resourceCulture); - } - } - + /// /// Looks up a localized string similar to Sending the request failed.. /// - internal static string SendFailedTransportError { - get { + internal static string SendFailedTransportError + { + get + { return ResourceManager.GetString("SendFailedTransportError", resourceCulture); } } - + /// /// Looks up a localized string similar to Acquiring the send stream lock timed out.. /// - internal static string SendLockTimeoutTransportError { - get { + internal static string SendLockTimeoutTransportError + { + get + { return ResourceManager.GetString("SendLockTimeoutTransportError", resourceCulture); } } - + /// /// Looks up a localized string similar to Sending the request timed out.. /// - internal static string SendTimeoutTransportError { - get { + internal static string SendTimeoutTransportError + { + get + { return ResourceManager.GetString("SendTimeoutTransportError", resourceCulture); } } - + /// - /// Looks up a localized string similar to Service is currently unavailable. More info: https://aka.ms/cosmosdb-tsg-service-unavailable. Partition reconfiguration exceeded retry limit. Please contact support with the full exception.. + /// Looks up a localized string similar to Partition reconfiguration exceeded retry limit. Please contact support with the full exception. /// - internal static string Server_CompletingPartitionMigrationExceededRetryLimit { - get { + internal static string Server_CompletingPartitionMigrationExceededRetryLimit + { + get + { return ResourceManager.GetString("Server_CompletingPartitionMigrationExceededRetryLimit", resourceCulture); } } - + /// - /// Looks up a localized string similar to Service is currently unavailable. More info: https://aka.ms/cosmosdb-tsg-service-unavailable. Unhandled partition split. Please contact support with the full exception.. + /// Looks up a localized string similar to Unhandled partition split. Please contact support with the full exception. /// - internal static string Server_CompletingSplitExceededRetryLimit { - get { + internal static string Server_CompletingSplitExceededRetryLimit + { + get + { return ResourceManager.GetString("Server_CompletingSplitExceededRetryLimit", resourceCulture); } } - + /// - /// Looks up a localized string similar to Service is currently unavailable. More info: https://aka.ms/cosmosdb-tsg-service-unavailable. Could not achieve backend quorum for Strong or Bounded Staleness after barrier requests.. + /// Looks up a localized string similar to Could not achieve backend quorum for Strong or Bounded Staleness after barrier requests. /// - internal static string Server_GlobalStrongWriteBarrierNotMet { - get { + internal static string Server_GlobalStrongWriteBarrierNotMet + { + get + { return ResourceManager.GetString("Server_GlobalStrongWriteBarrierNotMet", resourceCulture); } } - + /// - /// Looks up a localized string similar to Service is currently unavailable. More info: https://aka.ms/cosmosdb-tsg-service-unavailable. Container was re-created, exceeded retries to resolve new identifier. Please contact support with the full exception.. + /// Looks up a localized string similar to Container was re-created, exceeded retries to resolve new identifier. Please contact support with the full exception. /// - internal static string Server_NameCacheIsStaleExceededRetryLimit { - get { + internal static string Server_NameCacheIsStaleExceededRetryLimit + { + get + { return ResourceManager.GetString("Server_NameCacheIsStaleExceededRetryLimit", resourceCulture); } } - + /// - /// Looks up a localized string similar to Service is currently unavailable. More info: https://aka.ms/cosmosdb-tsg-service-unavailable. Store (backend) returned an invalid response. Please contact support with the full exception. . + /// Looks up a localized string similar to Store (backend) returned an invalid response. Please contact support with the full exception. /// - internal static string Server_NoValidStoreResponse { - get { + internal static string Server_NoValidStoreResponse + { + get + { return ResourceManager.GetString("Server_NoValidStoreResponse", resourceCulture); } } - + /// - /// Looks up a localized string similar to Service is currently unavailable. More info: https://aka.ms/cosmosdb-tsg-service-unavailable. Unhandled partition split. Please contact support with the full exception.. + /// Looks up a localized string similar to Unhandled partition split. Please contact support with the full exception. /// - internal static string Server_PartitionKeyRangeGoneExceededRetryLimit { - get { + internal static string Server_PartitionKeyRangeGoneExceededRetryLimit + { + get + { return ResourceManager.GetString("Server_PartitionKeyRangeGoneExceededRetryLimit", resourceCulture); } } - + /// - /// Looks up a localized string similar to Service is currently unavailable. More info: https://aka.ms/cosmosdb-tsg-service-unavailable. Could not achieve backend quorum. . + /// Looks up a localized string similar to Could not achieve backend quorum. /// - internal static string Server_ReadQuorumNotMet { - get { + internal static string Server_ReadQuorumNotMet + { + get + { return ResourceManager.GetString("Server_ReadQuorumNotMet", resourceCulture); } } - + /// - /// Looks up a localized string similar to Service is currently unavailable. More info: https://aka.ms/cosmosdb-tsg-service-unavailable. Server returned a 410 response.. + /// Looks up a localized string similar to Server returned a 410 response. /// - internal static string ServerGenerated410 { - get { + internal static string ServerGenerated410 + { + get + { return ResourceManager.GetString("ServerGenerated410", resourceCulture); } } - + /// - /// Looks up a localized string similar to Service is currently unavailable. More info: https://aka.ms/cosmosdb-tsg-service-unavailable. Server returned a 503 response.. + /// Looks up a localized string similar to Server returned a 503 response. /// - internal static string ServerGenerated503 { - get { + internal static string ServerGenerated503 + { + get + { return ResourceManager.GetString("ServerGenerated503", resourceCulture); } } - - /// - /// Looks up a localized string similar to Serverless offer is not supported on this account type.. - /// - internal static string ServerlessNotSupported { - get { - return ResourceManager.GetString("ServerlessNotSupported", resourceCulture); - } - } - + /// /// Looks up a localized string similar to The response body length is too large. Body length: {0} bytes. Connection: {1}. /// - internal static string ServerResponseBodyTooLargeError { - get { + internal static string ServerResponseBodyTooLargeError + { + get + { return ResourceManager.GetString("ServerResponseBodyTooLargeError", resourceCulture); } } - + /// /// Looks up a localized string similar to The response total header length is too large. Header length: {0} bytes. Connection: {1}. /// - internal static string ServerResponseHeaderTooLargeError { - get { + internal static string ServerResponseHeaderTooLargeError + { + get + { return ResourceManager.GetString("ServerResponseHeaderTooLargeError", resourceCulture); } } - + /// /// Looks up a localized string similar to Invalid response total header length. Expected {0} bytes. Received {1} bytes. Connection: {2}. /// - internal static string ServerResponseInvalidHeaderLengthError { - get { + internal static string ServerResponseInvalidHeaderLengthError + { + get + { return ResourceManager.GetString("ServerResponseInvalidHeaderLengthError", resourceCulture); } } - + /// /// Looks up a localized string similar to The transport request ID is missing from the server response.. /// - internal static string ServerResponseTransportRequestIdMissingError { - get { + internal static string ServerResponseTransportRequestIdMissingError + { + get + { return ResourceManager.GetString("ServerResponseTransportRequestIdMissingError", resourceCulture); } } - + /// /// Looks up a localized string similar to Service at index {0} not found.. /// - internal static string ServiceNotFound { - get { + internal static string ServiceNotFound + { + get + { return ResourceManager.GetString("ServiceNotFound", resourceCulture); } } - + /// /// Looks up a localized string similar to Service reserved bits can not be more than 24. Otherwise it overlaps with the collection/user multiplexing bit. /// - internal static string ServiceReservedBitsOutOfRange { - get { + internal static string ServiceReservedBitsOutOfRange + { + get + { return ResourceManager.GetString("ServiceReservedBitsOutOfRange", resourceCulture); } } - + /// - /// Looks up a localized string similar to Service is currently unavailable. More info: https://aka.ms/cosmosdb-tsg-service-unavailable. + /// Looks up a localized string similar to Service is currently unavailable.. /// - internal static string ServiceUnavailable { - get { + internal static string ServiceUnavailable + { + get + { return ResourceManager.GetString("ServiceUnavailable", resourceCulture); } } - + /// /// Looks up a localized string similar to Could not find service hosting DocumentCollection with ResourceId {0}. /// - internal static string ServiceWithResourceIdNotFound { - get { + internal static string ServiceWithResourceIdNotFound + { + get + { return ResourceManager.GetString("ServiceWithResourceIdNotFound", resourceCulture); } } - + /// /// Looks up a localized string similar to Bounding box must have an even number of coordinates and more than 3.. /// - internal static string SpatialBoundingBoxInvalidCoordinates { - get { + internal static string SpatialBoundingBoxInvalidCoordinates + { + get + { return ResourceManager.GetString("SpatialBoundingBoxInvalidCoordinates", resourceCulture); } } - + /// /// Looks up a localized string similar to Spatial operations can be used in Linq expressions only and are evaluated in Azure CosmosDB server.. /// - internal static string SpatialExtensionMethodsNotImplemented { - get { + internal static string SpatialExtensionMethodsNotImplemented + { + get + { return ResourceManager.GetString("SpatialExtensionMethodsNotImplemented", resourceCulture); } } - + /// /// Looks up a localized string similar to Coordinate Reference System specified in GeoJSON is invalid.. /// - internal static string SpatialFailedToDeserializeCrs { - get { + internal static string SpatialFailedToDeserializeCrs + { + get + { return ResourceManager.GetString("SpatialFailedToDeserializeCrs", resourceCulture); } } - + /// /// Looks up a localized string similar to Failed to deserialize Geometry object because 'type' property is either absent or has invalid value.. /// - internal static string SpatialInvalidGeometryType { - get { + internal static string SpatialInvalidGeometryType + { + get + { return ResourceManager.GetString("SpatialInvalidGeometryType", resourceCulture); } } - + /// /// Looks up a localized string similar to Spatial position must have at least two coordinates.. /// - internal static string SpatialInvalidPosition { - get { + internal static string SpatialInvalidPosition + { + get + { return ResourceManager.GetString("SpatialInvalidPosition", resourceCulture); } } - + /// /// Looks up a localized string similar to SSL negotiation failed.. /// - internal static string SslNegotiationFailedTransportError { - get { + internal static string SslNegotiationFailedTransportError + { + get + { return ResourceManager.GetString("SslNegotiationFailedTransportError", resourceCulture); } } - + /// /// Looks up a localized string similar to SSL negotiation timed out.. /// - internal static string SslNegotiationTimeoutTransportError { - get { + internal static string SslNegotiationTimeoutTransportError + { + get + { return ResourceManager.GetString("SslNegotiationTimeoutTransportError", resourceCulture); } } - + /// /// Looks up a localized string similar to Star and slash should have no arguments.. /// - internal static string StarSlashArgumentError { - get { + internal static string StarSlashArgumentError + { + get + { return ResourceManager.GetString("StarSlashArgumentError", resourceCulture); } } - + /// /// Looks up a localized string similar to Storage analytics is not enabled for this account. Ensure storage analytics is enabled before retrying.. /// - internal static string StorageAnalyticsNotEnabled { - get { + internal static string StorageAnalyticsNotEnabled + { + get + { return ResourceManager.GetString("StorageAnalyticsNotEnabled", resourceCulture); } } - + /// /// Looks up a localized string similar to String agument {0} is null or empty. /// - internal static string StringArgumentNullOrEmpty { - get { + internal static string StringArgumentNullOrEmpty + { + get + { return ResourceManager.GetString("StringArgumentNullOrEmpty", resourceCulture); } } - + /// - /// Looks up a localized string similar to System database account {0} delete is not supported through this endpoint.. + /// Looks up a localized string similar to System database account with name {0} and type {1} not found. /// - internal static string SystemDatabaseAccountDeleteNotSupported { - get { - return ResourceManager.GetString("SystemDatabaseAccountDeleteNotSupported", resourceCulture); + internal static string SystemDatabaseAccountNotFound + { + get + { + return ResourceManager.GetString("SystemDatabaseAccountNotFound", resourceCulture); } } - + /// - /// Looks up a localized string similar to System database account with name {0} and type {1} not found.. + /// Looks up a localized string similar to System database account {0} cannot be created with Continuous backup mode. /// - internal static string SystemDatabaseAccountNotFound { - get { - return ResourceManager.GetString("SystemDatabaseAccountNotFound", resourceCulture); + internal static string SystemDatabaseAccountPitrEnabledNotSupported + { + get + { + return ResourceManager.GetString("SystemDatabaseAccountPitrEnabledNotSupported", resourceCulture); } } - + /// - /// Looks up a localized string similar to System database account {0} cannot be created with Continuous backup mode. + /// Looks up a localized string similar to Continuous backup, synapse link, full fidelity change feed and materialized views are currently not supported with cross tenant customer-managed keys features. /// - internal static string SystemDatabaseAccountPitrEnabledNotSupported { - get { - return ResourceManager.GetString("SystemDatabaseAccountPitrEnabledNotSupported", resourceCulture); + internal static string CrossTenantCMKDatabaseAccountLogstoreFeaturesNotSupported + { + get + { + return ResourceManager.GetString("CrossTenantCMKDatabaseAccountLogstoreFeaturesNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The server encountered an unexpected condition that prevented it from fulfilling the Azure Key Vault resource request. + /// + internal static string UnexpectedExceptionCaughtonKeyVaultAccessClient + { + get + { + return ResourceManager.GetString("UnexpectedExceptionCaughtonKeyVaultAccessClient", resourceCulture); + } + } + + /// + /// The expected scope array should be of length 1. Instead received scope with length {0}. + /// + internal static string InvalidMSALScopeLength + { + get + { + return ResourceManager.GetString("InvalidMSALScopeLength", resourceCulture); + } + } + + /// + /// The requested scope is not a well formed URI string. + /// + internal static string InvalidRequestedScopeFormat + { + get + { + return ResourceManager.GetString("InvalidRequestedScopeFormat", resourceCulture); + } + } + + /// + /// The requested scope is not https. + /// + internal static string InvalidSchemeInScope + { + get + { + return ResourceManager.GetString("InvalidSchemeInScope", resourceCulture); + } + } + + /// + /// The requested scope contains unexpected segments. + /// + internal static string InvalildScopeSegments + { + get + { + return ResourceManager.GetString("InvalildScopeSegments", resourceCulture); } } - + /// - /// Looks up a localized string similar to Service is currently unavailable. More info: https://aka.ms/cosmosdb-tsg-service-unavailable. Network timeout or connectivity failure. . + /// Looks up a localized string similar to Error contacting the Azure Key Vault resource. Please try again. /// - internal static string TimeoutGenerated410 { - get { + internal static string KeyVaultServiceUnavailable + { + get + { + return ResourceManager.GetString("KeyVaultServiceUnavailable", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided Azure Key Vault resource key URI is invalid. Please follow the format: https://{vault-name}.vault.azure.net/keys/{key-name} or https://{vault-name}.vault.azure.net/certificates/{certificate-name} or https://{vault-name}.vault.azure.net/secrets/{secret-name} . + /// + internal static string InvalidKeyVaultKeyAndCertURI + { + get + { + return ResourceManager.GetString("InvalidKeyVaultKeyAndCertURI", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided Azure Key Vault resource key URI is invalid. Please follow the format: https://{vault-name}.vault.azure.net/secrets/{secret-name} . + /// + internal static string InvalidKeyVaulSecretURI + { + get + { + return ResourceManager.GetString("InvalidKeyVaulSecretURI", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The remote name could not be resolved for the Azure Key Vault resource. Please provide a valid URI for an existing Key vault. + /// + internal static string KeyVaultDNSNotResolved + { + get + { + return ResourceManager.GetString("KeyVaultDNSNotResolved", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Could not find any secret with the.pem extension related to the provided certificate. + /// + internal static string KeyVaultCertificateException + { + get + { + return ResourceManager.GetString("KeyVaultCertificateException", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The Input provided is not a valid base 64 string. + /// + internal static string KeyVaultInvalidInputBytes + { + get + { + return ResourceManager.GetString("KeyVaultInvalidInputBytes", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Failed to acquire the access token needed to access the Azure Key Vault resource. Please verify that the tenant has all corresponding permissions assigned. + /// + internal static string KeyVaultAadClientCredentialsGrantFailure + { + get + { + return ResourceManager.GetString("KeyVaultAadClientCredentialsGrantFailure", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The Status Code for the first Azure Key Vault resource access try should be Unauthorized. + /// + internal static string FirstKeyVaultAccessAttemptShouldBeUnauthorized + { + get + { + return ResourceManager.GetString("FirstKeyVaultAccessAttemptShouldBeUnauthorized", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Network timeout or connectivity failure. + /// + internal static string TimeoutGenerated410 + { + get + { return ResourceManager.GetString("TimeoutGenerated410", resourceCulture); } } - + /// /// Looks up a localized string similar to PartitionKey has fewer components than defined the collection resource.. /// - internal static string TooFewPartitionKeyComponents { - get { + internal static string TooFewPartitionKeyComponents + { + get + { return ResourceManager.GetString("TooFewPartitionKeyComponents", resourceCulture); } } - + /// /// Looks up a localized string similar to PartitionKey has more components than defined the collection resource.. /// - internal static string TooManyPartitionKeyComponents { - get { + internal static string TooManyPartitionKeyComponents + { + get + { return ResourceManager.GetString("TooManyPartitionKeyComponents", resourceCulture); } } - + /// /// Looks up a localized string similar to The request rate is too large. Please retry after sometime. Learn more: http://aka.ms/cosmosdb-error-429. /// - internal static string TooManyRequests { - get { + internal static string TooManyRequests + { + get + { return ResourceManager.GetString("TooManyRequests", resourceCulture); } } - + /// /// Looks up a localized string similar to A client transport error occurred: {0}. /// - internal static string TransportExceptionMessage { - get { + internal static string TransportExceptionMessage + { + get + { return ResourceManager.GetString("TransportExceptionMessage", resourceCulture); } } - + /// - /// Looks up a localized string similar to Service is currently unavailable. More info: https://aka.ms/cosmosdb-tsg-service-unavailable. The SDK failed to connect to the service. Please check your networking configuration.. + /// Looks up a localized string similar to The SDK failed to connect to the service. Please check your networking configuration. /// - internal static string TransportGenerated410 { - get { + internal static string TransportGenerated410 + { + get + { return ResourceManager.GetString("TransportGenerated410", resourceCulture); } } - + /// - /// Looks up a localized string similar to Service is currently unavailable. More info: https://aka.ms/cosmosdb-tsg-service-unavailable. Continuous connectivity failures. Client cannot connect after multiple retries. Please check your networking configuration. + /// Looks up a localized string similar to Continuous connectivity failures. Client cannot connect after multiple retries. Please check your networking configuration /// - internal static string TransportGenerated503 { - get { + internal static string TransportGenerated503 + { + get + { return ResourceManager.GetString("TransportGenerated503", resourceCulture); } } - + /// /// Looks up a localized string similar to The transport protocol negotiation timed out. See the inner exception for details.. /// - internal static string TransportNegotiationTimeoutTransportError { - get { + internal static string TransportNegotiationTimeoutTransportError + { + get + { return ResourceManager.GetString("TransportNegotiationTimeoutTransportError", resourceCulture); } } - + + /// + /// Looks up a localized string similar to The TCP channel timed out on waiting to open. + /// + internal static string ChannelWaitingToOpenTimeoutException + { + get + { + return ResourceManager.GetString("ChannelWaitingToOpenTimeoutException", resourceCulture); + } + } + /// /// Looks up a localized string similar to Cannot deserialize PartitionKey value '{0}'. /// - internal static string UnableToDeserializePartitionKeyValue { - get { + internal static string UnableToDeserializePartitionKeyValue + { + get + { return ResourceManager.GetString("UnableToDeserializePartitionKeyValue", resourceCulture); } } - + /// /// Looks up a localized string similar to Unable to find free connection. /// - internal static string UnableToFindFreeConnection { - get { + internal static string UnableToFindFreeConnection + { + get + { return ResourceManager.GetString("UnableToFindFreeConnection", resourceCulture); } } - + /// /// Looks up a localized string similar to Unable to authenticate the request. The request requires valid user authentication.. /// - internal static string Unauthorized { - get { + internal static string Unauthorized + { + get + { return ResourceManager.GetString("Unauthorized", resourceCulture); } } - + /// /// Looks up a localized string similar to Unauthorized Offer Replace Request.. /// - internal static string UnauthorizedOfferReplaceRequest { - get { + internal static string UnauthorizedOfferReplaceRequest + { + get + { return ResourceManager.GetString("UnauthorizedOfferReplaceRequest", resourceCulture); } } - + /// /// Looks up a localized string similar to Unauthorized Auto-Scale Request.. /// - internal static string UnauthorizedRequestForAutoScale { - get { + internal static string UnauthorizedRequestForAutoScale + { + get + { return ResourceManager.GetString("UnauthorizedRequestForAutoScale", resourceCulture); } } - - /// - /// Looks up a localized string similar to Missing '_id' index while creating a MongoDB api collection.. - /// - internal static string UnderscoreIdIndexRequiredForMongo { - get { - return ResourceManager.GetString("UnderscoreIdIndexRequiredForMongo", resourceCulture); - } - } - + /// /// Looks up a localized string similar to Operation not permitted as consistency level is set to {0}. Expected {1}.. /// - internal static string UnexpectedConsistencyLevel { - get { + internal static string UnexpectedConsistencyLevel + { + get + { return ResourceManager.GetString("UnexpectedConsistencyLevel", resourceCulture); } } - - /// - /// Looks up a localized string similar to The server encountered an unexpected condition that prevented it from fulfilling the Azure Key Vault resource request.. - /// - internal static string UnexpectedExceptionCaughtonKeyVaultAccessClient { - get { - return ResourceManager.GetString("UnexpectedExceptionCaughtonKeyVaultAccessClient", resourceCulture); - } - } - + /// /// Looks up a localized string similar to Unexpected JsonSerializationFormat: {0}. /// - internal static string UnexpectedJsonSerializationFormat { - get { + internal static string UnexpectedJsonSerializationFormat + { + get + { return ResourceManager.GetString("UnexpectedJsonSerializationFormat", resourceCulture); } } - + /// /// Looks up a localized string similar to Failed to register JsonTokenType: {0}. /// - internal static string UnexpectedJsonTokenType { - get { + internal static string UnexpectedJsonTokenType + { + get + { return ResourceManager.GetString("UnexpectedJsonTokenType", resourceCulture); } } - + /// /// Looks up a localized string similar to Unexpected offer version {0} from store.. /// - internal static string UnexpectedOfferVersion { - get { + internal static string UnexpectedOfferVersion + { + get + { return ResourceManager.GetString("UnexpectedOfferVersion", resourceCulture); } } - + /// /// Looks up a localized string similar to Unexpected operation type {0} for routing requests for multiple partitions.. /// - internal static string UnexpectedOperationTypeForRoutingRequest { - get { + internal static string UnexpectedOperationTypeForRoutingRequest + { + get + { return ResourceManager.GetString("UnexpectedOperationTypeForRoutingRequest", resourceCulture); } } - + /// /// Looks up a localized string similar to Unexpected operator {0} .. /// - internal static string UnexpectedOperator { - get { + internal static string UnexpectedOperator + { + get + { return ResourceManager.GetString("UnexpectedOperator", resourceCulture); } } - + /// /// Looks up a localized string similar to PartitionKeyRangeId is not expected.. /// - internal static string UnexpectedPartitionKeyRangeId { - get { + internal static string UnexpectedPartitionKeyRangeId + { + get + { return ResourceManager.GetString("UnexpectedPartitionKeyRangeId", resourceCulture); } } - + /// - /// Looks up a localized string similar to Provided Resource Kind {0} to ReEncrypt is not expected. + /// Looks up a localized string similar to Provided Resource Kind {0} to ReEncrypt is not expected.. /// - internal static string UnExpectedResourceKindToReEncrypt { - get { + internal static string UnExpectedResourceKindToReEncrypt + { + get + { return ResourceManager.GetString("UnExpectedResourceKindToReEncrypt", resourceCulture); } } - + /// /// Looks up a localized string similar to ResourceType {0} is unexpected.. /// - internal static string UnexpectedResourceType { - get { + internal static string UnexpectedResourceType + { + get + { return ResourceManager.GetString("UnexpectedResourceType", resourceCulture); } } - + /// /// Looks up a localized string similar to Resource kind {0} is unknown. /// - internal static string UnknownResourceKind { - get { + internal static string UnknownResourceKind + { + get + { return ResourceManager.GetString("UnknownResourceKind", resourceCulture); } } - + /// /// Looks up a localized string similar to Resource type {0} is unknown. /// - internal static string UnknownResourceType { - get { + internal static string UnknownResourceType + { + get + { return ResourceManager.GetString("UnknownResourceType", resourceCulture); } } - + /// /// Looks up a localized string similar to An unknown client transport error has occurred.. /// - internal static string UnknownTransportError { - get { + internal static string UnknownTransportError + { + get + { return ResourceManager.GetString("UnknownTransportError", resourceCulture); } } - + /// /// Looks up a localized string similar to Distict query requires a matching order by in order to return a continuation token. ///If you would like to serve this query through continuation tokens, then please rewrite the query in the form 'SELECT DISTINCT VALUE c.blah FROM c ORDER BY c.blah' and please make sure that there is a range index on 'c.blah'.. /// - internal static string UnorderedDistinctQueryContinuationToken { - get { + internal static string UnorderedDistinctQueryContinuationToken + { + get + { return ResourceManager.GetString("UnorderedDistinctQueryContinuationToken", resourceCulture); } } - - /// - /// Looks up a localized string similar to AAD tokens are not supported by the Dedicated Gateway endpoint. . - /// - internal static string UnsupportedAadAccessControlType { - get { - return ResourceManager.GetString("UnsupportedAadAccessControlType", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Resource tokens are not supported by the Dedicated Gateway endpoint. . - /// - internal static string UnsupportedAccessControlType { - get { - return ResourceManager.GetString("UnsupportedAccessControlType", resourceCulture); - } - } - + /// /// Looks up a localized string similar to The requested region '{0}' does not support AZ provisioning yet. Please try other regions or disable zone redundancy for this region.. /// - internal static string UnsupportedAzRegion { - get { + internal static string UnsupportedAzRegion + { + get + { return ResourceManager.GetString("UnsupportedAzRegion", resourceCulture); } } - + /// /// Looks up a localized string similar to "{0} capability is not allowed with kind={1}". /// - internal static string UnsupportedCapabilityForKind { - get { + internal static string UnsupportedCapabilityForKind + { + get + { return ResourceManager.GetString("UnsupportedCapabilityForKind", resourceCulture); } } - - /// - /// Looks up a localized string similar to "{0} capability is not compatible with mongo ServerVersion={1} accounts.". - /// - internal static string UnsupportedCapabilityForServerVersion { - get { - return ResourceManager.GetString("UnsupportedCapabilityForServerVersion", resourceCulture); - } - } - + /// - /// Looks up a localized string similar to "Update of {0} capability is not allowed.". + /// Looks up a localized string similar to Update of "{0} capability is not allowed. /// - internal static string UnsupportedCapabilityUpdate { - get { + internal static string UnsupportedCapabilityUpdate + { + get + { return ResourceManager.GetString("UnsupportedCapabilityUpdate", resourceCulture); } } - + /// - /// Looks up a localized string similar to The requested region '{0}' is not supported for '{1}' cluster creation.. + /// Looks up a localized string similar to "{0} capability is not compatible with mongo ServerVersion={1} accounts.". /// - internal static string UnsupportedClusterRegion { - get { - return ResourceManager.GetString("UnsupportedClusterRegion", resourceCulture); + internal static string UnsupportedCapabilityForServerVersion + { + get + { + return ResourceManager.GetString("UnsupportedCapabilityForServerVersion", resourceCulture); } } - + /// /// Looks up a localized string similar to Cannot execute cross partition order-by queries on mix types. Consider using IS_STRING/IS_NUMBER to get around this exception. Expect type: {0}. Actual type: {1}. Item value: {2}.. /// - internal static string UnsupportedCrossPartitionOrderByQueryOnMixedTypes { - get { + internal static string UnsupportedCrossPartitionOrderByQueryOnMixedTypes + { + get + { return ResourceManager.GetString("UnsupportedCrossPartitionOrderByQueryOnMixedTypes", resourceCulture); } } - + /// /// Looks up a localized string similar to The provided cross partition query can not be directly served by the gateway. This is a first chance (internal) exception that all newer clients will know how to handle gracefully. This exception is traced, but unless you see it bubble up as an exception (which only happens on older SDK clients), then you can safely ignore this message.. /// - internal static string UnsupportedCrossPartitionQuery { - get { + internal static string UnsupportedCrossPartitionQuery + { + get + { return ResourceManager.GetString("UnsupportedCrossPartitionQuery", resourceCulture); } } - + /// /// Looks up a localized string similar to Cross partition query with aggregate functions is not supported.. /// - internal static string UnsupportedCrossPartitionQueryWithAggregate { - get { + internal static string UnsupportedCrossPartitionQueryWithAggregate + { + get + { return ResourceManager.GetString("UnsupportedCrossPartitionQueryWithAggregate", resourceCulture); } } - + /// /// Looks up a localized string similar to Unsupported entity type {0}. /// - internal static string UnsupportedEntityType { - get { + internal static string UnsupportedEntityType + { + get + { return ResourceManager.GetString("UnsupportedEntityType", resourceCulture); } } - + /// /// Looks up a localized string similar to Indexing Hints are not supported in this deployment. . /// - internal static string UnsupportedHints { - get { + internal static string UnsupportedHints + { + get + { return ResourceManager.GetString("UnsupportedHints", resourceCulture); } } - + /// /// Looks up a localized string similar to Key type {0} is unsupported. /// - internal static string UnsupportedKeyType { - get { + internal static string UnsupportedKeyType + { + get + { return ResourceManager.GetString("UnsupportedKeyType", resourceCulture); } } - + /// - /// Looks up a localized string similar to The operation is only supported for Serverless accounts, per-partition throughput cannot be updated directly for provisioned accounts.. + /// Looks up a localized string similar to The operation is only supported for Serverless accounts, per-partition throughput cannot be updated directly for provisioned accounts. /// - internal static string UnsupportedOfferOperationForProvisionedThroughput { - get { + internal static string UnsupportedOfferOperationForProvisionedThroughput + { + get + { return ResourceManager.GetString("UnsupportedOfferOperationForProvisionedThroughput", resourceCulture); } } - + /// /// Looks up a localized string similar to The value of offer throughput specified is invalid. Please specify a value between {0} and {1} inclusive in increments of {2}. Please contact https://azure.microsoft.com/support to request limit increases beyond {1} RU/s.. /// - internal static string UnSupportedOfferThroughput { - get { + internal static string UnSupportedOfferThroughput + { + get + { return ResourceManager.GetString("UnSupportedOfferThroughput", resourceCulture); } } - + /// /// Looks up a localized string similar to The value of offer throughput specified is invalid. Please specify a value between {0} and {1}, or between {2} and {3} inclusive in increments of {4}. Please contact https://azure.microsoft.com/support to request limit increases beyond {3} RU/s.. /// - internal static string UnSupportedOfferThroughputWithTwoRanges { - get { + internal static string UnSupportedOfferThroughputWithTwoRanges + { + get + { return ResourceManager.GetString("UnSupportedOfferThroughputWithTwoRanges", resourceCulture); } } - + /// /// Looks up a localized string similar to Offer type is not supported with Offer version 'V2' and above.. /// - internal static string UnsupportedOfferTypeWithV2Offer { - get { + internal static string UnsupportedOfferTypeWithV2Offer + { + get + { return ResourceManager.GetString("UnsupportedOfferTypeWithV2Offer", resourceCulture); } } - + /// /// Looks up a localized string similar to The supplied offer version {0} is not supported. Please specify either a blank version, 'V1' or 'V2'.. /// - internal static string UnsupportedOfferVersion { - get { + internal static string UnsupportedOfferVersion + { + get + { return ResourceManager.GetString("UnsupportedOfferVersion", resourceCulture); } } - - /// - /// Looks up a localized string similar to This partition key definition kind is not supported for partial partition key operations. - /// - internal static string UnsupportedPartitionDefinitionKindForPartialKeyOperations { - get { - return ResourceManager.GetString("UnsupportedPartitionDefinitionKindForPartialKeyOperations", resourceCulture); - } - } - + /// /// Looks up a localized string similar to Unsupported PartitionKey value component '{0}'. Numeric, string, bool, null, Undefined are the only supported types.. /// - internal static string UnsupportedPartitionKeyComponentValue { - get { + internal static string UnsupportedPartitionKeyComponentValue + { + get + { return ResourceManager.GetString("UnsupportedPartitionKeyComponentValue", resourceCulture); } } - + /// /// Looks up a localized string similar to Program requires to run in 64 bit for elastic query feature to work. Please switch your program to 64 bit or use Gateway connectivity mode.. /// - internal static string UnsupportedProgram { - get { + internal static string UnsupportedProgram + { + get + { return ResourceManager.GetString("UnsupportedProgram", resourceCulture); } } - + /// /// Looks up a localized string similar to Value '{0}' specified for protocol is unsupported.. /// - internal static string UnsupportedProtocol { - get { + internal static string UnsupportedProtocol + { + get + { return ResourceManager.GetString("UnsupportedProtocol", resourceCulture); } } - + /// /// Looks up a localized string similar to Query that expects full results from aggregate functions is not supported.. /// - internal static string UnsupportedQueryWithFullResultAggregate { - get { + internal static string UnsupportedQueryWithFullResultAggregate + { + get + { return ResourceManager.GetString("UnsupportedQueryWithFullResultAggregate", resourceCulture); } } - + /// /// Looks up a localized string similar to The requested region '{0}' is not supported.. /// - internal static string UnsupportedRegion { - get { + internal static string UnsupportedRegion + { + get + { return ResourceManager.GetString("UnsupportedRegion", resourceCulture); } } - + + /// + /// Looks up a localized string similar to The requested region '{0}' is not supported for '{1}' cluster creation.. + /// + internal static string UnsupportedClusterRegion + { + get + { + return ResourceManager.GetString("UnsupportedClusterRegion", resourceCulture); + } + } + /// /// Looks up a localized string similar to The requested rollback kind '{0}' is not supported.. /// - internal static string UnsupportedRollbackKind { - get { + internal static string UnsupportedRollbackKind + { + get + { return ResourceManager.GetString("UnsupportedRollbackKind", resourceCulture); } } - + /// /// Looks up a localized string similar to Changing Root Indexing Policy is not supported in this deployment.. /// - internal static string UnsupportedRootPolicyChange { - get { + internal static string UnsupportedRootPolicyChange + { + get + { return ResourceManager.GetString("UnsupportedRootPolicyChange", resourceCulture); } } - + /// /// Looks up a localized string similar to Federation system key kind {0} is invalid. /// - internal static string UnsupportedSystemKeyKind { - get { + internal static string UnsupportedSystemKeyKind + { + get + { return ResourceManager.GetString("UnsupportedSystemKeyKind", resourceCulture); } } - + /// /// Looks up a localized string similar to Unsupported token type {0}. /// - internal static string UnsupportedTokenType { - get { + internal static string UnsupportedTokenType + { + get + { return ResourceManager.GetString("UnsupportedTokenType", resourceCulture); } } - + /// /// Looks up a localized string similar to The Offer Version 'V1' is not supported since the associated collection is already a partitioned collection. Please use offer version 'V2'.. /// - internal static string UnsupportedV1OfferVersion { - get { + internal static string UnsupportedV1OfferVersion + { + get + { return ResourceManager.GetString("UnsupportedV1OfferVersion", resourceCulture); } } - + /// - /// Looks up a localized string similar to Updating offer to autoscale throughput is not allowed. Please invoke migration API to migrate this offer.. + /// Looks up a localized string similar to AAD tokens are not supported by the Dedicated Gateway endpoint. /// - internal static string UpdateToAutoscaleThroughputNotAllowed { - get { - return ResourceManager.GetString("UpdateToAutoscaleThroughputNotAllowed", resourceCulture); + internal static string UnsupportedAadAccessControlType + { + get + { + return ResourceManager.GetString("UnsupportedAadAccessControlType", resourceCulture); } } - + /// - /// Looks up a localized string similar to Updating offer to manually provisioned throughput is not allowed. Please invoke migration API to migrate this offer.. + /// Looks up a localized string similar to Resource tokens are not supported by the Dedicated Gateway endpoint. /// - internal static string UpdateToManualThroughputNotAllowed { - get { - return ResourceManager.GetString("UpdateToManualThroughputNotAllowed", resourceCulture); + internal static string UnsupportedAccessControlType + { + get + { + return ResourceManager.GetString("UnsupportedAccessControlType", resourceCulture); } } - + /// /// Looks up a localized string similar to Upserts for scripts in collections with multiple partitions are not supported.. /// - internal static string UpsertsForScriptsWithMultiplePartitionsAreNotSupported { - get { + internal static string UpsertsForScriptsWithMultiplePartitionsAreNotSupported + { + get + { return ResourceManager.GetString("UpsertsForScriptsWithMultiplePartitionsAreNotSupported", resourceCulture); } } - + /// - /// Looks up a localized string similar to Cannot set VirtualNetworkFilter on this account type.. + /// Looks up a localized string similar to Cannot offline write region when automatic failover is not enabled. /// - internal static string VirtualNetworkFilterNotSupported { - get { - return ResourceManager.GetString("VirtualNetworkFilterNotSupported", resourceCulture); + internal static string WriteRegionAutomaticFailoverNotEnabled + { + get + { + return ResourceManager.GetString("WriteRegionAutomaticFailoverNotEnabled", resourceCulture); } } - + /// - /// Looks up a localized string similar to Cannot offline write region when automatic failover is not enabled. + /// Looks up a localized string similar to Cannot perform failover as it is disabled for the account. /// - internal static string WriteRegionAutomaticFailoverNotEnabled { - get { - return ResourceManager.GetString("WriteRegionAutomaticFailoverNotEnabled", resourceCulture); + internal static string FailoverDisabled + { + get + { + return ResourceManager.GetString("FailoverDisabled", resourceCulture); } } - + + /// /// Looks up a localized string similar to Cannot add additional regions, since database account provision failed.. /// - internal static string WriteRegionDoesNotExist { - get { + internal static string WriteRegionDoesNotExist + { + get + { return ResourceManager.GetString("WriteRegionDoesNotExist", resourceCulture); } } - + + /// /// Looks up a localized string similar to Zone Redundant Accounts are not supported in {0} Location yet. Please try other locations.. /// - internal static string ZoneRedundantAccountsNotSupportedInLocation { - get { + internal static string ZoneRedundantAccountsNotSupportedInLocation + { + get + { return ResourceManager.GetString("ZoneRedundantAccountsNotSupportedInLocation", resourceCulture); } } + + /// + /// Looks up a localized string similar to Connection is too busy. Please retry after sometime or open more connections. + /// + internal static string ConnectionIsBusy + { + get + { + return ResourceManager.GetString("ConnectionIsBusy", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Partition key path {0} is invalid for Gremlin API. The path cannot be '/id', '/label' or a nested path such as '/key/path'.. + /// + internal static string InvalidGremlinPartitionKey + { + get + { + return ResourceManager.GetString("InvalidGremlinPartitionKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please provide non-negative value for UpdateMaxthroughputEverProvisioned.. + /// + internal static string InvalidUpdateMaxthroughputEverProvisioned + { + get + { + return ResourceManager.GetString("InvalidUpdateMaxthroughputEverProvisioned", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to "Operation '{0}' on resource '{1}' is not allowed through Azure Cosmos DB endpoint. Please switch on such operations for your account, or perform this operation through Azure Resource Manager, Azure Portal, Azure CLI or Azure Powershell". + /// + internal static string DataPlaneOperationNotAllowed + { + get + { + return ResourceManager.GetString("DataPlaneOperationNotAllowed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Collection is not yet available for read. Please retry in some time.. + /// + internal static string CollectionCreateInProgress + { + get + { + return ResourceManager.GetString("CollectionCreateInProgress", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Free tier has already been applied to another Azure Cosmos DB account in this subscription. To apply free tier to this account, you can select another subscription for this account or delete the existing free tier account. You can have up to one free tier account per subscription.. + /// + internal static string FreeTierAppliedBefore + { + get + { + return ResourceManager.GetString("FreeTierAppliedBefore", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Free tier is not supported for Internal subscriptions.. + /// + internal static string FreeTierNotSupportedForInternalSubscription + { + get + { + return ResourceManager.GetString("FreeTierNotSupportedForInternalSubscription", resourceCulture); + } + } + + /// Looks up a localized string similar to Could not resolve DataTransfer state store account for region [{0}].. + /// + internal static string DataTransferStateStoreNotResolved + { + get + { + return ResourceManager.GetString("DataTransferStateStoreNotResolved", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot update FreeTier property for existing account.. + /// + internal static string FreeTierUpdateNotSupported + { + get + { + return ResourceManager.GetString("FreeTierUpdateNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Subpartitioning is only supported for atmost 3 partition paths . + /// + internal static string InvalidSubPartitionKeyLength + { + get + { + return ResourceManager.GetString("InvalidSubPartitionKeyLength", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Subpartitioning is only supported for Hash V2. . + /// + internal static string InvalidSubPartitionKeyVersion + { + get + { + return ResourceManager.GetString("InvalidSubPartitionKeyVersion", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Missing '_id' index while creating a MongoDB api collection. + /// + internal static string UnderscoreIdIndexRequiredForMongo + { + get + { + return ResourceManager.GetString("UnderscoreIdIndexRequiredForMongo", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Partition key path {0} is invalid for MongoDB API. + /// + internal static string InvalidMongoPartitionKey + { + get + { + return ResourceManager.GetString("InvalidMongoPartitionKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The create request is not allowed since it does not specify the schema for container '{0}'. + /// + internal static string MissingSchemaPolicyOnContainer + { + get + { + return ResourceManager.GetString("MissingSchemaPolicyOnContainer", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The container replace request is not allowed since it removes the schema policy from the container {0}. + /// + internal static string CannotRemoveSchemaPolicyFromContainer + { + get + { + return ResourceManager.GetString("CannotRemoveSchemaPolicyFromContainer", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The container replace request is not allowed since it removes the Cassandra conflict resolution policy from the container {0}. + /// + internal static string CannotReplaceCassandraConflictPolicyFromContainer + { + get + { + return ResourceManager.GetString("CannotReplaceCassandraConflictPolicyFromContainer", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The container create request is not allowed since it does not contain the Cassandra conflict resolution policy specified for the container {0}. + /// + internal static string CannotCreateContainerWithoutCassandraConflictPolicy + { + get + { + return ResourceManager.GetString("CannotCreateContainerWithoutCassandraConflictPolicy", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid type system '{0}' specified for container {1}. + /// + internal static string InvalidTypeSystemPolicy + { + get + { + return ResourceManager.GetString("InvalidTypeSystemPolicy", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Type system must be specified for the container {0}. + /// + internal static string MissingTypeSystemPolicy + { + get + { + return ResourceManager.GetString("MissingTypeSystemPolicy", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Auto upgrade policy is not supported for MongDB resources.. + /// + internal static string MongoClientAutoUpgradeNotSupported + { + get + { + return ResourceManager.GetString("MongoClientAutoUpgradeNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Updating offer to autoscale throughput is not allowed. Please invoke migration API to migrate this offer.. + /// + internal static string UpdateToAutoscaleThroughputNotAllowed + { + get + { + return ResourceManager.GetString("UpdateToAutoscaleThroughputNotAllowed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Updating offer to manually provisioned throughput is not allowed. Please invoke migration API to migrate this offer.. + /// + internal static string UpdateToManualThroughputNotAllowed + { + get + { + return ResourceManager.GetString("UpdateToManualThroughputNotAllowed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to System database account {0} delete is not supported through this endpoint. + /// + internal static string SystemDatabaseAccountDeleteNotSupported + { + get + { + return ResourceManager.GetString("SystemDatabaseAccountDeleteNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Only system database account delete is supported through this endpoint. Supplied account {0}. + /// + internal static string InvalidSystemDatabaseAccountDelete + { + get + { + return ResourceManager.GetString("InvalidSystemDatabaseAccountDelete", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid store type specified {0}. + /// + internal static string InvalidStoreTypeSpecified + { + get + { + return ResourceManager.GetString("InvalidStoreTypeSpecified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Revoke/Grant is not allowed as the Account status is: {0}. + /// + internal static string RevokeRegrantNotAllowed + { + get + { + return ResourceManager.GetString("RevokeRegrantNotAllowed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The potential total throughput of this operation exceeds the total throughput limit set for this account. Aborting request. + /// + internal static string InvalidTotalThroughputLimitUpdate + { + get + { + return ResourceManager.GetString("InvalidTotalThroughputLimitUpdate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to PartitionKey has fewer components than defined the collection resource.. + /// + internal static string UnsupportedPartitionDefinitionKindForPartialKeyOperations + { + get + { + return ResourceManager.GetString("UnsupportedPartitionDefinitionKindForPartialKeyOperations", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to There cannot be duplicate physical partition ids in x-ms-cosmos-target-partition-throughput-info header.. + /// + internal static string DuplicatePhysicalPartitionIdInTargetPartitionThroughputInfo + { + get + { + return ResourceManager.GetString("DuplicatePhysicalPartitionIdInTargetPartitionThroughputInfo", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to There cannot be duplicate physical partition ids in x-ms-cosmos-source-partition-throughput-info header.. + /// + internal static string DuplicatePhysicalPartitionIdInSourcePartitionThroughputInfo + { + get + { + return ResourceManager.GetString("DuplicatePhysicalPartitionIdInSourcePartitionThroughputInfo", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to There cannot be a common physical partition id both in x-ms-cosmos-target-partition-throughput-info and x-ms-cosmos-source-partition-throughput-info header. Encountered {0}. + /// + internal static string PhysicalPartitionIdinTargetAndSourcePartitionThroughputInfo + { + get + { + return ResourceManager.GetString("PhysicalPartitionIdinTargetAndSourcePartitionThroughputInfo", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to One of the source or target physical partition id doesn't exist.. + /// + internal static string PhysicalPartitionIdinTargetOrSourceDoesNotExist + { + get + { + return ResourceManager.GetString("PhysicalPartitionIdinTargetOrSourceDoesNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Collection name '{0}' is invalid for MongoDB API.. + /// + internal static string InvalidMongoCollectionName + { + get + { + return ResourceManager.GetString("InvalidMongoCollectionName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Database name '{0}' is invalid for MongoDB API.. + /// + internal static string InvalidMongoDatabaseName + { + get + { + return ResourceManager.GetString("InvalidMongoDatabaseName", resourceCulture); + } + } } -} +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/ReadFeed/Pagination/ReadFeedPaginationOptions.cs b/Microsoft.Azure.Cosmos/src/ReadFeed/Pagination/ReadFeedPaginationOptions.cs index 757473c02c..ad219dfd99 100644 --- a/Microsoft.Azure.Cosmos/src/ReadFeed/Pagination/ReadFeedPaginationOptions.cs +++ b/Microsoft.Azure.Cosmos/src/ReadFeed/Pagination/ReadFeedPaginationOptions.cs @@ -27,9 +27,8 @@ internal sealed class ReadFeedPaginationOptions : PaginationOptions public ReadFeedPaginationOptions( PaginationDirection? paginationDirection = null, int? pageSizeHint = null, - JsonSerializationFormat? jsonSerializationFormat = null, Dictionary additionalHeaders = null) - : base(pageSizeHint, jsonSerializationFormat, additionalHeaders) + : base(pageSizeHint, additionalHeaders) { this.Direction = paginationDirection; } diff --git a/Microsoft.Azure.Cosmos/src/ReadFeed/ReadFeedCrossFeedRangeAsyncEnumerator.cs b/Microsoft.Azure.Cosmos/src/ReadFeed/ReadFeedCrossFeedRangeAsyncEnumerator.cs index 2f611840f7..95fb8b23cf 100644 --- a/Microsoft.Azure.Cosmos/src/ReadFeed/ReadFeedCrossFeedRangeAsyncEnumerator.cs +++ b/Microsoft.Azure.Cosmos/src/ReadFeed/ReadFeedCrossFeedRangeAsyncEnumerator.cs @@ -45,8 +45,7 @@ public async ValueTask MoveNextAsync() CosmosArray documents = CosmosQueryClientCore.ParseElementsFromRestStream( innerReadFeedPage.Page.Content, - Documents.ResourceType.Document, - cosmosSerializationOptions: null); + Documents.ResourceType.Document); ReadFeedPage page = new ReadFeedPage( documents, innerReadFeedPage.Page.RequestCharge, diff --git a/Microsoft.Azure.Cosmos/src/ReadFeed/ReadFeedIteratorCore.cs b/Microsoft.Azure.Cosmos/src/ReadFeed/ReadFeedIteratorCore.cs index d9b935e758..8a46196a56 100644 --- a/Microsoft.Azure.Cosmos/src/ReadFeed/ReadFeedIteratorCore.cs +++ b/Microsoft.Azure.Cosmos/src/ReadFeed/ReadFeedIteratorCore.cs @@ -9,13 +9,16 @@ namespace Microsoft.Azure.Cosmos.ReadFeed using System.Threading; using System.Threading.Tasks; using Microsoft.Azure.Cosmos.CosmosElements; - using Microsoft.Azure.Cosmos.Diagnostics; + using Microsoft.Azure.Cosmos.Json; using Microsoft.Azure.Cosmos.Pagination; using Microsoft.Azure.Cosmos.Query.Core; + using Microsoft.Azure.Cosmos.Query.Core.Exceptions; using Microsoft.Azure.Cosmos.Query.Core.Monads; using Microsoft.Azure.Cosmos.ReadFeed.Pagination; + using Microsoft.Azure.Cosmos.Resource.CosmosExceptions; using Microsoft.Azure.Cosmos.Routing; using Microsoft.Azure.Cosmos.Tracing; + using Microsoft.Azure.Documents; /// /// Cosmos feed stream iterator. This is used to get the query responses with a Stream content @@ -113,7 +116,25 @@ public ReadFeedIteratorCore( else { CosmosString tokenAsString = (CosmosString)token; - state = ReadFeedState.Continuation(CosmosElement.Parse(tokenAsString.Value)); + try + { + state = ReadFeedState.Continuation(CosmosElement.Parse(tokenAsString.Value)); + } + catch (Exception exception) when (exception.InnerException is JsonParseException) + { + MalformedContinuationTokenException malformedContinuationTokenException = new MalformedContinuationTokenException(exception.Message); + throw CosmosExceptionFactory.CreateBadRequestException( + message: $"Malformed Continuation Token: {tokenAsString}.", + headers: CosmosQueryResponseMessageHeaders.ConvertToQueryHeaders( + new Headers(), + default, + default, + (int)SubStatusCodes.MalformedContinuationToken, + default), + stackTrace: exception.StackTrace, + innerException: malformedContinuationTokenException, + trace: null); + } } FeedRangeState feedRangeState = new FeedRangeState(feedRange, state); diff --git a/Microsoft.Azure.Cosmos/src/RequestOptions/QueryRequestOptions.cs b/Microsoft.Azure.Cosmos/src/RequestOptions/QueryRequestOptions.cs index 60cea5b48c..f723107ede 100644 --- a/Microsoft.Azure.Cosmos/src/RequestOptions/QueryRequestOptions.cs +++ b/Microsoft.Azure.Cosmos/src/RequestOptions/QueryRequestOptions.cs @@ -5,8 +5,10 @@ namespace Microsoft.Azure.Cosmos { using System; + using System.ComponentModel; using System.Text; using Microsoft.Azure.Cosmos.CosmosElements; + using Microsoft.Azure.Cosmos.Query; using Microsoft.Azure.Cosmos.Query.Core; using Microsoft.Azure.Cosmos.Query.Core.Pipeline; using Microsoft.Azure.Documents; @@ -188,6 +190,8 @@ public ConsistencyLevel? ConsistencyLevel internal CosmosSerializationFormatOptions CosmosSerializationFormatOptions { get; set; } + internal SupportedSerializationFormats? SupportedSerializationFormats { get; set; } + internal ExecutionEnvironment? ExecutionEnvironment { get; set; } internal bool? ReturnResultsInDeterministicOrder { get; set; } @@ -240,11 +244,8 @@ internal override void PopulateRequestOptions(RequestMessage request) { request.Headers.Add(HttpConstants.HttpHeaders.ResponseContinuationTokenLimitInKB, this.ResponseContinuationTokenLimitInKb.ToString()); } - - if (this.CosmosSerializationFormatOptions != null) - { - request.Headers.CosmosMessageHeaders.ContentSerializationFormat = this.CosmosSerializationFormatOptions.ContentSerializationFormat; - } + + request.Headers.CosmosMessageHeaders.SupportedSerializationFormats = this.SupportedSerializationFormats?.ToString() ?? DocumentQueryExecutionContextBase.DefaultSupportedSerializationFormats; if (this.StartId != null) { diff --git a/Microsoft.Azure.Cosmos/src/ResourceThrottleRetryPolicy.cs b/Microsoft.Azure.Cosmos/src/ResourceThrottleRetryPolicy.cs index c6187f3e51..a99bc594f7 100644 --- a/Microsoft.Azure.Cosmos/src/ResourceThrottleRetryPolicy.cs +++ b/Microsoft.Azure.Cosmos/src/ResourceThrottleRetryPolicy.cs @@ -52,7 +52,7 @@ public Task ShouldRetryAsync( { if (!this.IsValidThrottleStatusCode(dce.StatusCode)) { - DefaultTrace.TraceError( + DefaultTrace.TraceVerbose( "Operation will NOT be retried. Current attempt {0}, Status Code: {1} ", this.currentAttemptCount, dce.StatusCode); @@ -81,7 +81,7 @@ public Task ShouldRetryAsync( { if (!this.IsValidThrottleStatusCode(cosmosResponseMessage?.StatusCode)) { - DefaultTrace.TraceError( + DefaultTrace.TraceVerbose( "Operation will NOT be retried. Current attempt {0}, Status Code: {1} ", this.currentAttemptCount, cosmosResponseMessage?.StatusCode); diff --git a/Microsoft.Azure.Cosmos/src/Routing/GatewayAddressCache.cs b/Microsoft.Azure.Cosmos/src/Routing/GatewayAddressCache.cs index 14b641959a..a4dbb1d8a3 100644 --- a/Microsoft.Azure.Cosmos/src/Routing/GatewayAddressCache.cs +++ b/Microsoft.Azure.Cosmos/src/Routing/GatewayAddressCache.cs @@ -31,6 +31,11 @@ internal class GatewayAddressCache : IAddressCache, IDisposable private const string AddressResolutionBatchSize = "AddressResolutionBatchSize"; private const int DefaultBatchSize = 50; + // This warmup cache and connection timeout is meant to mimic an indefinite timeframe till which + // a delay task will run, until a cancellation token is requested to cancel the task. The default + // value for this timeout is 45 minutes at the moment. + private static readonly TimeSpan WarmupCacheAndOpenConnectionTimeout = TimeSpan.FromMinutes(45); + private readonly Uri serviceEndpoint; private readonly Uri addressEndpoint; @@ -61,7 +66,8 @@ public GatewayAddressCache( CosmosHttpClient httpClient, IOpenConnectionsHandler openConnectionsHandler, long suboptimalPartitionForceRefreshIntervalInSeconds = 600, - bool enableTcpConnectionEndpointRediscovery = false) + bool enableTcpConnectionEndpointRediscovery = false, + bool replicaAddressValidationEnabled = false) { this.addressEndpoint = new Uri(serviceEndpoint + "/" + Paths.AddressPathSegment); this.protocol = protocol; @@ -85,9 +91,7 @@ public GatewayAddressCache( GatewayAddressCache.ProtocolString(this.protocol)); this.openConnectionsHandler = openConnectionsHandler; - this.isReplicaAddressValidationEnabled = Helpers.GetEnvironmentVariable( - name: Constants.EnvironmentVariables.ReplicaConnectivityValidationEnabled, - defaultValue: false); + this.isReplicaAddressValidationEnabled = replicaAddressValidationEnabled; } public Uri ServiceEndpoint => this.serviceEndpoint; @@ -113,7 +117,7 @@ public async Task OpenConnectionsAsync( bool shouldOpenRntbdChannels, CancellationToken cancellationToken) { - List>> tasks = new (); + List tasks = new (); int batchSize = GatewayAddressCache.DefaultBatchSize; #if !(NETSTANDARD15 || NETSTANDARD16) @@ -147,50 +151,34 @@ public async Task OpenConnectionsAsync( { for (int i = 0; i < partitionKeyRangeIdentities.Count; i += batchSize) { - tasks - .Add(this.GetAddressesAsync( - request: request, - collectionRid: collection.ResourceId, - partitionKeyRangeIds: partitionKeyRangeIdentities.Skip(i).Take(batchSize).Select(range => range.PartitionKeyRangeId))); + tasks.Add( + this.WarmupCachesAndOpenConnectionsAsync( + request: request, + collectionRid: collection.ResourceId, + partitionKeyRangeIds: partitionKeyRangeIdentities.Skip(i).Take(batchSize).Select(range => range.PartitionKeyRangeId), + containerProperties: collection, + shouldOpenRntbdChannels: shouldOpenRntbdChannels, + cancellationToken: cancellationToken)); } } - foreach (TryCatch task in await Task.WhenAll(tasks)) - { - if (task.Failed) - { - continue; - } - - using (DocumentServiceResponse response = task.Result) - { - FeedResource
addressFeed = response.GetResource>(); - - bool inNetworkRequest = this.IsInNetworkRequest(response); - - IEnumerable> addressInfos = - addressFeed.Where(addressInfo => ProtocolFromString(addressInfo.Protocol) == this.protocol) - .GroupBy(address => address.PartitionKeyRangeId, StringComparer.Ordinal) - .Select(group => this.ToPartitionAddressAndRange(collection.ResourceId, @group.ToList(), inNetworkRequest)); + using CancellationTokenSource linkedTokenSource = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); - foreach (Tuple addressInfo in addressInfos) - { - this.serverPartitionAddressCache.Set( - new PartitionKeyRangeIdentity(collection.ResourceId, addressInfo.Item1.PartitionKeyRangeId), - addressInfo.Item2); + // The `timeoutTask` is a background task which adds a delay for a period of WarmupCacheAndOpenConnectionTimeout. The task will + // be cancelled either by - a) when `linkedTokenSource` expires, which means the original `cancellationToken` expires or + // b) the the `linkedTokenSource.Cancel()` is called. + Task timeoutTask = Task.Delay(GatewayAddressCache.WarmupCacheAndOpenConnectionTimeout, linkedTokenSource.Token); + Task resultTask = await Task.WhenAny(Task.WhenAll(tasks), timeoutTask); - // The `shouldOpenRntbdChannels` boolean flag indicates whether the SDK should establish Rntbd connections to the - // backend replica nodes. For the `CosmosClient.CreateAndInitializeAsync()` flow, the flag should be passed as - // `true` so that the Rntbd connections to the backend replicas could be established deterministically. For any - // other flow, the flag should be passed as `false`. - if (this.openConnectionsHandler != null && shouldOpenRntbdChannels) - { - await this.openConnectionsHandler - .TryOpenRntbdChannelsAsync( - addresses: addressInfo.Item2.Get(Protocol.Tcp)?.ReplicaTransportAddressUris); - } - } - } + if (resultTask == timeoutTask) + { + // Operation has been cancelled. + DefaultTrace.TraceWarning("The open connection task was cancelled because the cancellation token was expired. '{0}'", + System.Diagnostics.Trace.CorrelationManager.ActivityId); + } + else + { + linkedTokenSource.Cancel(); } } @@ -350,6 +338,85 @@ public async Task TryGetAddressesAsync( } } + /// + /// Gets the address information from the gateway using the partition key range ids, and warms up the async non blocking cache + /// by inserting them as a key value pair for later lookup. Additionally attempts to establish Rntbd connections to the backend + /// replicas based on `shouldOpenRntbdChannels` boolean flag. + /// + /// An instance of containing the request payload. + /// A string containing the collection ids. + /// An instance of containing the list of partition key range ids. + /// An instance of containing the collection properties. + /// A boolean flag indicating whether Rntbd connections are required to be established to the backend replica nodes. + /// An instance of . + private async Task WarmupCachesAndOpenConnectionsAsync( + DocumentServiceRequest request, + string collectionRid, + IEnumerable partitionKeyRangeIds, + ContainerProperties containerProperties, + bool shouldOpenRntbdChannels, + CancellationToken cancellationToken) + { + TryCatch documentServiceResponseWrapper = await this.GetAddressesAsync( + request: request, + collectionRid: collectionRid, + partitionKeyRangeIds: partitionKeyRangeIds); + + if (documentServiceResponseWrapper.Failed) + { + return; + } + + try + { + using (DocumentServiceResponse response = documentServiceResponseWrapper.Result) + { + FeedResource
addressFeed = response.GetResource>(); + + bool inNetworkRequest = this.IsInNetworkRequest(response); + + IEnumerable> addressInfos = + addressFeed.Where(addressInfo => ProtocolFromString(addressInfo.Protocol) == this.protocol) + .GroupBy(address => address.PartitionKeyRangeId, StringComparer.Ordinal) + .Select(group => this.ToPartitionAddressAndRange(containerProperties.ResourceId, @group.ToList(), inNetworkRequest)); + + List openConnectionTasks = new (); + foreach (Tuple addressInfo in addressInfos) + { + if (cancellationToken.IsCancellationRequested) + { + break; + } + + this.serverPartitionAddressCache.Set( + new PartitionKeyRangeIdentity(containerProperties.ResourceId, addressInfo.Item1.PartitionKeyRangeId), + addressInfo.Item2); + + // The `shouldOpenRntbdChannels` boolean flag indicates whether the SDK should establish Rntbd connections to the + // backend replica nodes. For the `CosmosClient.CreateAndInitializeAsync()` flow, the flag should be passed as + // `true` so that the Rntbd connections to the backend replicas could be established deterministically. For any + // other flow, the flag should be passed as `false`. + if (this.openConnectionsHandler != null && shouldOpenRntbdChannels) + { + openConnectionTasks + .Add(this.openConnectionsHandler + .TryOpenRntbdChannelsAsync( + addresses: addressInfo.Item2.Get(Protocol.Tcp)?.ReplicaTransportAddressUris)); + } + } + + await Task.WhenAll(openConnectionTasks); + } + } + catch (Exception ex) + { + DefaultTrace.TraceWarning("Failed to warm-up caches and open connections for the server addresses: {0} with exception: {1}. '{2}'", + collectionRid, + ex, + System.Diagnostics.Trace.CorrelationManager.ActivityId); + } + } + private static void SetTransportAddressUrisToUnhealthy( PartitionAddressInformation stalePartitionAddressInformation, Lazy> failedEndpoints) diff --git a/Microsoft.Azure.Cosmos/src/Routing/GlobalAddressResolver.cs b/Microsoft.Azure.Cosmos/src/Routing/GlobalAddressResolver.cs index 344f994395..058e9c3ce4 100644 --- a/Microsoft.Azure.Cosmos/src/Routing/GlobalAddressResolver.cs +++ b/Microsoft.Azure.Cosmos/src/Routing/GlobalAddressResolver.cs @@ -27,7 +27,6 @@ namespace Microsoft.Azure.Cosmos.Routing internal sealed class GlobalAddressResolver : IAddressResolverExtension, IDisposable { private const int MaxBackupReadRegions = 3; - private readonly GlobalEndpointManager endpointManager; private readonly GlobalPartitionEndpointManager partitionKeyRangeLocationCache; private readonly Protocol protocol; @@ -39,6 +38,7 @@ internal sealed class GlobalAddressResolver : IAddressResolverExtension, IDispos private readonly CosmosHttpClient httpClient; private readonly ConcurrentDictionary addressCacheByEndpoint; private readonly bool enableTcpConnectionEndpointRediscovery; + private readonly bool isReplicaAddressValidationEnabled; private IOpenConnectionsHandler openConnectionsHandler; public GlobalAddressResolver( @@ -67,6 +67,8 @@ public GlobalAddressResolver( this.enableTcpConnectionEndpointRediscovery = connectionPolicy.EnableTcpConnectionEndpointRediscovery; + this.isReplicaAddressValidationEnabled = ConfigurationManager.IsReplicaAddressValidationEnabled(connectionPolicy); + this.maxEndpoints = maxBackupReadEndpoints + 2; // for write and alternate write endpoint (during failover) this.addressCacheByEndpoint = new ConcurrentDictionary(); @@ -281,7 +283,8 @@ private EndpointCache GetOrAddEndpoint(Uri endpoint) this.serviceConfigReader, this.httpClient, this.openConnectionsHandler, - enableTcpConnectionEndpointRediscovery: this.enableTcpConnectionEndpointRediscovery); + enableTcpConnectionEndpointRediscovery: this.enableTcpConnectionEndpointRediscovery, + replicaAddressValidationEnabled: this.isReplicaAddressValidationEnabled); string location = this.endpointManager.GetLocation(endpoint); AddressResolver addressResolver = new AddressResolver(null, new NullRequestSigner(), location); diff --git a/Microsoft.Azure.Cosmos/src/Serializer/CosmosSerializationFormatOptions.cs b/Microsoft.Azure.Cosmos/src/Serializer/CosmosSerializationFormatOptions.cs index 81ab5fd1e4..8ebefa502a 100644 --- a/Microsoft.Azure.Cosmos/src/Serializer/CosmosSerializationFormatOptions.cs +++ b/Microsoft.Azure.Cosmos/src/Serializer/CosmosSerializationFormatOptions.cs @@ -52,4 +52,4 @@ public CosmosSerializationFormatOptions( this.CreateCustomWriterCallback = createCustomWriter; } } -} +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/CosmosDbEventSource.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/CosmosDbEventSource.cs index 091373b0de..9e8028c0d8 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/CosmosDbEventSource.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/CosmosDbEventSource.cs @@ -35,7 +35,12 @@ public static void RecordDiagnosticsForRequests( Documents.OperationType operationType, OpenTelemetryAttributes response) { - if (DiagnosticsFilterHelper.IsTracingNeeded( + if (!DiagnosticsFilterHelper.IsSuccessfulResponse( + response: response) && CosmosDbEventSource.IsEnabled(EventLevel.Warning)) + { + CosmosDbEventSource.Singleton.FailedRequest(response.Diagnostics.ToString()); + } + else if (DiagnosticsFilterHelper.IsLatencyThresholdCrossed( config: config, operationType: operationType, response: response) && CosmosDbEventSource.IsEnabled(EventLevel.Warning)) @@ -64,5 +69,11 @@ private void LatencyOverThreshold(string message) { this.WriteEvent(2, message); } + + [Event(3, Level = EventLevel.Error)] + private void FailedRequest(string message) + { + this.WriteEvent(3, message); + } } } diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/Filters/DiagnosticsFilterHelper.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/Filters/DiagnosticsFilterHelper.cs index 7649977fa0..60fb86fa5c 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/Filters/DiagnosticsFilterHelper.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/Filters/DiagnosticsFilterHelper.cs @@ -10,12 +10,10 @@ namespace Microsoft.Azure.Cosmos.Telemetry.Diagnostics internal static class DiagnosticsFilterHelper { /// - /// Allow only when either of below is True

- /// 1) Latency is not more than 100/250 (query) ms

- /// 3) HTTP status code is not Success

+ /// Allow only when Latency is not more than 100 (non-query) /250 (query) ms ///
/// true or false - public static bool IsTracingNeeded( + public static bool IsLatencyThresholdCrossed( DistributedTracingOptions config, OperationType operationType, OpenTelemetryAttributes response) @@ -31,7 +29,20 @@ public static bool IsTracingNeeded( latencyThreshold = operationType == OperationType.Query ? DistributedTracingOptions.DefaultQueryTimeoutThreshold : DistributedTracingOptions.DefaultCrudLatencyThreshold; } - return response.Diagnostics.GetClientElapsedTime() > latencyThreshold || !response.StatusCode.IsSuccess(); + return response.Diagnostics.GetClientElapsedTime() > latencyThreshold; + } + + /// + /// Check if response HTTP status code is returning successful + /// + /// true or false + public static bool IsSuccessfulResponse(OpenTelemetryAttributes response) + { + return response.StatusCode.IsSuccess() + || (response.StatusCode == System.Net.HttpStatusCode.NotFound && response.SubStatusCode == 0) + || (response.StatusCode == System.Net.HttpStatusCode.NotModified && response.SubStatusCode == 0) + || (response.StatusCode == System.Net.HttpStatusCode.Conflict && response.SubStatusCode == 0) + || (response.StatusCode == System.Net.HttpStatusCode.PreconditionFailed && response.SubStatusCode == 0); } } } diff --git a/Microsoft.Azure.Cosmos/src/Util/ConfigurationManager.cs b/Microsoft.Azure.Cosmos/src/Util/ConfigurationManager.cs index 4e9e8fde84..216e1295b5 100644 --- a/Microsoft.Azure.Cosmos/src/Util/ConfigurationManager.cs +++ b/Microsoft.Azure.Cosmos/src/Util/ConfigurationManager.cs @@ -7,7 +7,14 @@ namespace Microsoft.Azure.Cosmos using System; internal static class ConfigurationManager - { + { + /// + /// A read-only string containing the environment variablename for enabling replica validation. + /// This will eventually be removed oncereplica valdiatin is enabled by default for both preview + /// and GA. + /// + internal static readonly string ReplicaConnectivityValidationEnabled = "AZURE_COSMOS_REPLICA_VALIDATION_ENABLED"; + public static T GetEnvironmentVariable(string variable, T defaultValue) { string value = Environment.GetEnvironmentVariable(variable); @@ -17,5 +24,33 @@ public static T GetEnvironmentVariable(string variable, T defaultValue) } return (T)Convert.ChangeType(value, typeof(T)); } + + /// + /// Gets the boolean value of the replica validation environment variable. Note that, replica validation + /// is enabled by default for the preview package and disabled for GA at the moment. The user can set the + /// respective environment variable 'AZURE_COSMOS_REPLICA_VALIDATION_ENABLED' to override the value for + /// both preview and GA. The method will eventually be removed, once replica valdiatin is enabled by default + /// for both preview and GA. + /// + /// An instance of containing the client options. + /// A boolean flag indicating if replica validation is enabled. + public static bool IsReplicaAddressValidationEnabled( + ConnectionPolicy connectionPolicy) + { + bool replicaValidationDefaultValue = false; +#if PREVIEW + replicaValidationDefaultValue = true; +#endif + if (connectionPolicy != null + && connectionPolicy.EnableAdvancedReplicaSelectionForTcp.HasValue) + { + return connectionPolicy.EnableAdvancedReplicaSelectionForTcp.Value; + } + + return ConfigurationManager + .GetEnvironmentVariable( + variable: ConfigurationManager.ReplicaConnectivityValidationEnabled, + defaultValue: replicaValidationDefaultValue); + } } } diff --git a/Microsoft.Azure.Cosmos/src/direct/ConsistencyReader.cs b/Microsoft.Azure.Cosmos/src/direct/ConsistencyReader.cs index fd92ee456c..e9db63f927 100644 --- a/Microsoft.Azure.Cosmos/src/direct/ConsistencyReader.cs +++ b/Microsoft.Azure.Cosmos/src/direct/ConsistencyReader.cs @@ -144,12 +144,13 @@ public ConsistencyReader( ISessionContainer sessionContainer, TransportClient transportClient, IServiceConfigurationReader serviceConfigReader, - IAuthorizationTokenProvider authorizationTokenProvider) + IAuthorizationTokenProvider authorizationTokenProvider, + bool enableReplicaValidation) { this.addressSelector = addressSelector; this.serviceConfigReader = serviceConfigReader; this.authorizationTokenProvider = authorizationTokenProvider; - this.storeReader = new StoreReader(transportClient, addressSelector, new AddressEnumerator(), sessionContainer); + this.storeReader = new StoreReader(transportClient, addressSelector, new AddressEnumerator(), sessionContainer, enableReplicaValidation); this.quorumReader = new QuorumReader(transportClient, addressSelector, this.storeReader, serviceConfigReader, authorizationTokenProvider); } diff --git a/Microsoft.Azure.Cosmos/src/direct/ConsistencyWriter.cs b/Microsoft.Azure.Cosmos/src/direct/ConsistencyWriter.cs index 2f10eafe82..e614b51133 100644 --- a/Microsoft.Azure.Cosmos/src/direct/ConsistencyWriter.cs +++ b/Microsoft.Azure.Cosmos/src/direct/ConsistencyWriter.cs @@ -59,7 +59,8 @@ public ConsistencyWriter( TransportClient transportClient, IServiceConfigurationReader serviceConfigReader, IAuthorizationTokenProvider authorizationTokenProvider, - bool useMultipleWriteLocations) + bool useMultipleWriteLocations, + bool enableReplicaValidation) { this.transportClient = transportClient; this.addressSelector = addressSelector; @@ -71,7 +72,8 @@ public ConsistencyWriter( transportClient, addressSelector, new AddressEnumerator(), - sessionContainer: null); //we need store reader only for global strong, no session is needed*/ + sessionContainer: null, + enableReplicaValidation); //we need store reader only for global strong, no session is needed*/ } // Test hook diff --git a/Microsoft.Azure.Cosmos/src/direct/Constants.cs b/Microsoft.Azure.Cosmos/src/direct/Constants.cs index 68a5c15afe..5e39d91a09 100644 --- a/Microsoft.Azure.Cosmos/src/direct/Constants.cs +++ b/Microsoft.Azure.Cosmos/src/direct/Constants.cs @@ -2134,7 +2134,6 @@ public static class EnvironmentVariables { public const string SocketOptionTcpKeepAliveIntervalName = "AZURE_COSMOS_TCP_KEEPALIVE_INTERVAL_SECONDS"; public const string SocketOptionTcpKeepAliveTimeName = "AZURE_COSMOS_TCP_KEEPALIVE_TIME_SECONDS"; - public const string ReplicaConnectivityValidationEnabled = "AZURE_COSMOS_REPLICA_VALIDATION_ENABLED"; public const string AggressiveTimeoutDetectionEnabled = "AZURE_COSMOS_AGGRESSIVE_TIMEOUT_DETECTION_ENABLED"; public const string TimeoutDetectionTimeLimit = "AZURE_COSMOS_TIMEOUT_DETECTION_TIME_LIMIT_IN_SECONDS"; public const string TimeoutDetectionOnWriteThreshold = "AZURE_COSMOS_TIMEOUT_DETECTION_ON_WRITE_THRESHOLD"; diff --git a/Microsoft.Azure.Cosmos/src/direct/CustomTypeExtensions.cs b/Microsoft.Azure.Cosmos/src/direct/CustomTypeExtensions.cs index 7d12d3ec30..40be3a5cc5 100644 --- a/Microsoft.Azure.Cosmos/src/direct/CustomTypeExtensions.cs +++ b/Microsoft.Azure.Cosmos/src/direct/CustomTypeExtensions.cs @@ -35,7 +35,7 @@ internal static class CustomTypeExtensions #if COSMOSCLIENT public const string SDKName = "cosmos-netstandard-sdk"; - public const string SDKVersion = "3.31.2"; + public const string SDKVersion = "3.31.3"; #else public const string SDKName = "documentdb-netcore-sdk"; public const string SDKVersion = "2.14.0"; diff --git a/Microsoft.Azure.Cosmos/src/direct/IStoreClientFactory.cs b/Microsoft.Azure.Cosmos/src/direct/IStoreClientFactory.cs index 8dd2180d12..0ccb0f525a 100644 --- a/Microsoft.Azure.Cosmos/src/direct/IStoreClientFactory.cs +++ b/Microsoft.Azure.Cosmos/src/direct/IStoreClientFactory.cs @@ -17,6 +17,7 @@ StoreClient CreateStoreClient( bool enableReadRequestsFallback = false, bool useFallbackClient = true, bool useMultipleWriteLocations = false, - bool detectClientConnectivityIssues = false); + bool detectClientConnectivityIssues = false, + bool enableReplicaValidation = false); } } diff --git a/Microsoft.Azure.Cosmos/src/direct/ReplicatedResourceClient.cs b/Microsoft.Azure.Cosmos/src/direct/ReplicatedResourceClient.cs index f3b17e7fc6..a5b8a801a4 100644 --- a/Microsoft.Azure.Cosmos/src/direct/ReplicatedResourceClient.cs +++ b/Microsoft.Azure.Cosmos/src/direct/ReplicatedResourceClient.cs @@ -68,13 +68,14 @@ public ReplicatedResourceClient( bool useMultipleWriteLocations, bool detectClientConnectivityIssues, bool disableRetryWithRetryPolicy, + bool enableReplicaValidation, RetryWithConfiguration retryWithConfiguration = null) { this.addressResolver = addressResolver; this.addressSelector = new AddressSelector(addressResolver, protocol); if (protocol != Protocol.Https && protocol != Protocol.Tcp) { - throw new ArgumentOutOfRangeException("protocol"); + throw new ArgumentOutOfRangeException(nameof(protocol)); } this.protocol = protocol; @@ -86,14 +87,16 @@ public ReplicatedResourceClient( sessionContainer, transportClient, serviceConfigReader, - authorizationTokenProvider); + authorizationTokenProvider, + enableReplicaValidation); this.consistencyWriter = new ConsistencyWriter( this.addressSelector, sessionContainer, transportClient, serviceConfigReader, authorizationTokenProvider, - useMultipleWriteLocations); + useMultipleWriteLocations, + enableReplicaValidation); this.enableReadRequestsFallback = enableReadRequestsFallback; this.useMultipleWriteLocations = useMultipleWriteLocations; this.detectClientConnectivityIssues = detectClientConnectivityIssues; diff --git a/Microsoft.Azure.Cosmos/src/direct/StoreClient.cs b/Microsoft.Azure.Cosmos/src/direct/StoreClient.cs index fb390a314c..6610ebe338 100644 --- a/Microsoft.Azure.Cosmos/src/direct/StoreClient.cs +++ b/Microsoft.Azure.Cosmos/src/direct/StoreClient.cs @@ -41,6 +41,7 @@ public StoreClient( bool useMultipleWriteLocations = false, bool detectClientConnectivityIssues = false, bool disableRetryWithRetryPolicy = false, + bool enableReplicaValidation = false, RetryWithConfiguration retryWithConfiguration = null) { this.transportClient = transportClient; @@ -68,7 +69,8 @@ public StoreClient( useMultipleWriteLocations: useMultipleWriteLocations, detectClientConnectivityIssues: detectClientConnectivityIssues, disableRetryWithRetryPolicy: disableRetryWithRetryPolicy, - retryWithConfiguration: retryWithConfiguration); + retryWithConfiguration: retryWithConfiguration, + enableReplicaValidation: enableReplicaValidation); } internal JsonSerializerSettings SerializerSettings { get; set; } diff --git a/Microsoft.Azure.Cosmos/src/direct/StoreClientFactory.cs b/Microsoft.Azure.Cosmos/src/direct/StoreClientFactory.cs index ae790bb843..dc206ad642 100644 --- a/Microsoft.Azure.Cosmos/src/direct/StoreClientFactory.cs +++ b/Microsoft.Azure.Cosmos/src/direct/StoreClientFactory.cs @@ -308,7 +308,8 @@ public StoreClient CreateStoreClient( bool enableReadRequestsFallback = false, bool useFallbackClient = true, bool useMultipleWriteLocations = false, - bool detectClientConnectivityIssues = false) + bool detectClientConnectivityIssues = false, + bool enableReplicaValidation = false) { this.ThrowIfDisposed(); if (useFallbackClient && this.fallbackTransportClient != null) @@ -326,7 +327,8 @@ public StoreClient CreateStoreClient( useMultipleWriteLocations: useMultipleWriteLocations, detectClientConnectivityIssues: detectClientConnectivityIssues, disableRetryWithRetryPolicy: this.disableRetryWithRetryPolicy, - retryWithConfiguration: this.retryWithConfiguration); + retryWithConfiguration: this.retryWithConfiguration, + enableReplicaValidation: enableReplicaValidation); } return new StoreClient( @@ -341,7 +343,8 @@ public StoreClient CreateStoreClient( useMultipleWriteLocations: useMultipleWriteLocations, detectClientConnectivityIssues: detectClientConnectivityIssues, disableRetryWithRetryPolicy: this.disableRetryWithRetryPolicy, - retryWithConfiguration: this.retryWithConfiguration); + retryWithConfiguration: this.retryWithConfiguration, + enableReplicaValidation: enableReplicaValidation); } #region IDisposable diff --git a/Microsoft.Azure.Cosmos/src/direct/StoreReader.cs b/Microsoft.Azure.Cosmos/src/direct/StoreReader.cs index 6ef9b0a4c9..b5c382a8c3 100644 --- a/Microsoft.Azure.Cosmos/src/direct/StoreReader.cs +++ b/Microsoft.Azure.Cosmos/src/direct/StoreReader.cs @@ -6,7 +6,6 @@ namespace Microsoft.Azure.Documents using System; using System.Collections.Generic; using System.Globalization; - using System.Linq; using System.Net; using System.Runtime.CompilerServices; using System.Threading.Tasks; @@ -25,16 +24,15 @@ public StoreReader( TransportClient transportClient, AddressSelector addressSelector, IAddressEnumerator addressEnumerator, - ISessionContainer sessionContainer) + ISessionContainer sessionContainer, + bool enableReplicaValidation) { this.transportClient = transportClient; this.addressSelector = addressSelector; this.addressEnumerator = addressEnumerator ?? throw new ArgumentNullException(nameof(addressEnumerator)); this.sessionContainer = sessionContainer; this.canUseLocalLSNBasedHeaders = VersionUtility.IsLaterThan(HttpConstants.Versions.CurrentVersion, HttpConstants.Versions.v2018_06_18); - this.isReplicaAddressValidationEnabled = Helpers.GetEnvironmentVariable( - name: Constants.EnvironmentVariables.ReplicaConnectivityValidationEnabled, - defaultValue: false); + this.isReplicaAddressValidationEnabled = enableReplicaValidation; } // Test hook diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml index 66edf29c06..fd097032d9 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml @@ -162,7 +162,7 @@ 1001 207 - + \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.QueryAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.QueryAsync.xml index 8b737a419e..d6d638fd47 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.QueryAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.QueryAsync.xml @@ -4,7 +4,8 @@ Query traces = new List(); while (feedIterator.HasMoreResults) @@ -696,7 +697,8 @@ Query Typed feedIterator = (FeedIteratorInternal)container.GetItemQueryIterator( - queryText: "SELECT * FROM c"); + queryText: "SELECT * FROM c", + requestOptions: requestOptions); List traces = new List(); while (feedIterator.HasMoreResults) @@ -1408,7 +1410,8 @@ Query Public API traces = new List(); @@ -2101,7 +2104,8 @@ Query Public API Typed feedIterator = container.GetItemQueryIterator( - queryText: "SELECT * FROM c"); + queryText: "SELECT * FROM c", + requestOptions: requestOptions); List traces = new List(); @@ -2816,7 +2820,8 @@ Lazy currentLazy = Documents.ServiceInteropWrapper.AssembliesExist; Documents.ServiceInteropWrapper.AssembliesExist = new Lazy(() => false); FeedIterator feedIterator = container.GetItemQueryIterator( - queryText: "SELECT * FROM c"); + queryText: "SELECT * FROM c", + requestOptions: requestOptions); List traces = new List(); @@ -3596,7 +3601,8 @@ FeedIterator feedIterator = container.GetItemQueryStreamIterator( feedRange: FeedRangeEpk.FullRange, queryDefinition: new QueryDefinition("SELECT * FROM c"), - continuationToken: null); + continuationToken: null, + requestOptions: requestOptions); List traces = new List(); @@ -4298,7 +4304,8 @@ FeedIterator feedIterator = container.GetItemQueryIterator( feedRange: FeedRangeEpk.FullRange, queryDefinition: new QueryDefinition("SELECT * FROM c"), - continuationToken: null); + continuationToken: null, + requestOptions: requestOptions); List traces = new List(); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqSQLTranslationBaselineTest.ValidateSQLTranslation.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqSQLTranslationBaselineTest.ValidateSQLTranslation.xml index 877754ac74..d22afb37f9 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqSQLTranslationBaselineTest.ValidateSQLTranslation.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqSQLTranslationBaselineTest.ValidateSQLTranslation.xml @@ -268,6 +268,17 @@ FROM root]]> + + + + + + new complex() {NewtonsoftExtensionData = new Dictionary`2() {Void Add(System.String, System.Object)("test", Convert(1.5, Object))}, NetExtensionData = new Dictionary`2() {Void Add(System.String, System.Object)("OtherTest", Convert(1.5, Object))}})]]> + + + diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqSQLTranslationBaselineTest.ValidateSQLTranslationComplexData.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqSQLTranslationBaselineTest.ValidateSQLTranslationComplexData.xml index 04e8ab30fe..a557298543 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqSQLTranslationBaselineTest.ValidateSQLTranslationComplexData.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqSQLTranslationBaselineTest.ValidateSQLTranslationComplexData.xml @@ -166,4 +166,38 @@ FROM root JOIN x0 IN root["dblArray"]]]> + + + + (Convert(p.NewtonsoftExtensionData.get_Item("age"), Int32) > 18)).Select(x => new AnonymousType(Age = Convert(x.NewtonsoftExtensionData.get_Item("age"), Int32)))]]> + + + 18)]]> + + + + + + Convert(p.NewtonsoftExtensionData.get_Item("tags"), String[]).Contains("item-1")).Select(x => Convert(x.NewtonsoftExtensionData.get_Item("tags"), String[]))]]> + + + + + + + + + Convert(p.NewtonsoftExtensionData.get_Item("tags"), String[]).Contains("item-1")).SelectMany(x => Convert(x.NewtonsoftExtensionData.get_Item("tags"), Object[]))]]> + + + + + + \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationBaselineTests.TestStringCompare.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationBaselineTests.TestStringCompare.xml new file mode 100644 index 0000000000..17538ff1d8 --- /dev/null +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationBaselineTests.TestStringCompare.xml @@ -0,0 +1,267 @@ + + + + + (Compare(doc.StringField, doc.StringField2) == 0))]]> + + + + + + + + + + ]]> + (Compare(doc.StringField, doc.StringField2) > 0))]]> + + + + root["StringField2"]) +FROM root]]> + + + + + + =]]> + (Compare(doc.StringField, doc.StringField2) >= 0))]]> + + + + = root["StringField2"]) +FROM root]]> + + + + + + + (Compare(doc.StringField, doc.StringField2) < 0))]]> + + + + + + + + + + + (Compare(doc.StringField, doc.StringField2) <= 0))]]> + + + + + + + + + + + (Compare(doc.StringField, "str") == 0))]]> + + + + + + + + + + ]]> + (Compare(doc.StringField, "str") > 0))]]> + + + + "str") +FROM root]]> + + + + + + =]]> + (Compare(doc.StringField, "str") >= 0))]]> + + + + = "str") +FROM root]]> + + + + + + + (Compare(doc.StringField, "str") < 0))]]> + + + + + + + + + + + (Compare(doc.StringField, "str") <= 0))]]> + + + + + + + + + + + (0 == Compare(doc.StringField, doc.StringField2)))]]> + + + + + + + + + + + (0 < Compare(doc.StringField, doc.StringField2)))]]> + + + + root["StringField2"]) +FROM root]]> + + + + + + + (0 <= Compare(doc.StringField, doc.StringField2)))]]> + + + + = root["StringField2"]) +FROM root]]> + + + + + + reverse operands]]> + (0 > Compare(doc.StringField, doc.StringField2)))]]> + + + + + + + + + + = reverse operands]]> + (0 >= Compare(doc.StringField, doc.StringField2)))]]> + + + + + + + + + + 1]]> + (Compare(doc.StringField, "str") > 1))]]> + + + + + + + + + + (Compare(doc.StringField, "str") == 1))]]> + + + + + + + + + + (Compare(doc.StringField, "str") == -1))]]> + + + + + + + + + + (Compare(doc.StringField, "str") | 0))]]> + + + + ' or '>=')]]> + + + + + + (Compare(doc.StringField, "str") & 0))]]> + + + + ' or '>=')]]> + + + + + + (Compare(doc.StringField, "str") ^ 0))]]> + + + + ' or '>=')]]> + + + + + + (Compare(doc.StringField, 0, "str", 0, 3) == 0))]]> + + + + + + + \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationBaselineTests.TestStringCompareTo.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationBaselineTests.TestStringCompareTo.xml index 979d6f6191..c730415fb6 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationBaselineTests.TestStringCompareTo.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationBaselineTests.TestStringCompareTo.xml @@ -171,7 +171,7 @@ FROM root]]> - + @@ -181,7 +181,7 @@ FROM root]]> - + @@ -191,7 +191,7 @@ FROM root]]> - + diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosBasicQueryTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosBasicQueryTests.cs index 7ae2b28cc6..25ac9a705f 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosBasicQueryTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosBasicQueryTests.cs @@ -240,7 +240,10 @@ public async Task QueryRequestRateTest(bool directMode) requestOptions: new QueryRequestOptions() { MaxItemCount = 1, - MaxConcurrency = 1 + MaxConcurrency = 1, +#if PREVIEW + EnableOptimisticDirectExecution = false +#endif })) { while (feedIterator.HasMoreResults) @@ -268,7 +271,10 @@ public async Task QueryRequestRateTest(bool directMode) requestOptions: new QueryRequestOptions() { MaxItemCount = 1, - MaxConcurrency = 1 + MaxConcurrency = 1, +#if PREVIEW + EnableOptimisticDirectExecution = false +#endif }); // First request should be a success diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosGatewayTimeoutTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosGatewayTimeoutTests.cs index f50319f65f..241b60fb7f 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosGatewayTimeoutTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosGatewayTimeoutTests.cs @@ -81,7 +81,14 @@ public async Task QueryPlanRetryTimeoutTestAsync() } }; - using FeedIterator iterator = gatewayQueryPlanContainer.GetItemQueryIterator("select * From T order by T.status"); + QueryRequestOptions requestOptions = new QueryRequestOptions() + { +#if PREVIEW + EnableOptimisticDirectExecution = false +#endif + }; + + using FeedIterator iterator = gatewayQueryPlanContainer.GetItemQueryIterator("select * From T order by T.status", requestOptions: requestOptions); FeedResponse response = await iterator.ReadNextAsync(); Assert.IsTrue(isQueryRequestFound, "Query plan call back was not called."); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemLinqTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemLinqTests.cs index 28fc3ec61c..b3dc7afa41 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemLinqTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemLinqTests.cs @@ -211,6 +211,32 @@ public async Task ItemLINQQueryTest() Assert.AreEqual(itemList[1].id, queriable.ToList()[0].id); } + [TestMethod] + public void ItemLINQQueryWithInvalidContinuationTokenTest() + { + string malformedString = "Malformed String"; + FeedIterator feedIterator = this.Container.GetItemLinqQueryable().ToFeedIterator(); + + while (feedIterator.HasMoreResults) + { + IOrderedQueryable querable = this.Container.GetItemLinqQueryable( + continuationToken: malformedString); + try + { + FeedIterator iterator = querable.ToFeedIterator(); + } + catch (CosmosException exception) + { + Assert.IsTrue(exception.StatusCode == System.Net.HttpStatusCode.BadRequest); + Assert.IsTrue(exception.SubStatusCode == (int)Documents.SubStatusCodes.MalformedContinuationToken); + Assert.IsTrue(exception.Message.Contains(malformedString)); + return; + } + + Assert.Fail("Should never reach till here, hence ensuring that an exception is always recieved"); + } + } + [TestMethod] public async Task ItemLINQQueryWithContinuationTokenTest() { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemSessionTokenTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemSessionTokenTests.cs index f815eba08e..c76110f1fb 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemSessionTokenTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemSessionTokenTests.cs @@ -366,7 +366,10 @@ public async Task InvalidSessionTokenAfterContainerRecreationAndCollectionCacheR new QueryRequestOptions { ConsistencyLevel = Cosmos.ConsistencyLevel.Session, - PartitionKey = new Cosmos.PartitionKey(pk) + PartitionKey = new Cosmos.PartitionKey(pk), +#if PREVIEW + EnableOptimisticDirectExecution = false +#endif }); int itemCountOldContainer = 0; while (queryIteratorOldContainer.HasMoreResults) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosJsonSerializerTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosJsonSerializerTests.cs index 0be44fbc1c..eadb62da7c 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosJsonSerializerTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosJsonSerializerTests.cs @@ -98,7 +98,11 @@ public async Task TestQueryWithCustomJsonSerializer() fromStreamCount = 0; FeedIterator itemIterator = container.GetItemQueryIterator( - query); + query +#if PREVIEW + , requestOptions: new QueryRequestOptions() { EnableOptimisticDirectExecution = false } +#endif + ); List items = new List(); while (itemIterator.HasMoreResults) { @@ -113,7 +117,11 @@ public async Task TestQueryWithCustomJsonSerializer() // Verify that the custom serializer is actually being used via stream FeedIterator itemStreamIterator = container.GetItemQueryStreamIterator( - query); + query +#if PREVIEW + , requestOptions: new QueryRequestOptions() { EnableOptimisticDirectExecution = false } +#endif + ); while (itemStreamIterator.HasMoreResults) { ResponseMessage response = await itemStreamIterator.ReadNextAsync(); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosReadManyItemsTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosReadManyItemsTests.cs index d215b6b18b..05184d7826 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosReadManyItemsTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosReadManyItemsTests.cs @@ -51,27 +51,58 @@ public async Task Cleanup() } [TestMethod] - public async Task ReadManyTypedTest() + [DataRow(true, DisplayName = "Validates Read Many scenario with advanced replica selection enabled.")] + [DataRow(false, DisplayName = "Validates Read Many scenario with advanced replica selection disabled.")] + public async Task ReadManyTypedTestWithAdvancedReplicaSelection( + bool advancedReplicaSelectionEnabled) { - List<(string, PartitionKey)> itemList = new List<(string, PartitionKey)>(); - for (int i=0; i<10; i++) + CosmosClientOptions clientOptions = new () { - itemList.Add((i.ToString(), new PartitionKey("pk" + i.ToString()))); - } + EnableAdvancedReplicaSelectionForTcp = advancedReplicaSelectionEnabled, + }; - FeedResponse feedResponse= await this.Container.ReadManyItemsAsync(itemList); - Assert.IsNotNull(feedResponse); - Assert.AreEqual(feedResponse.Count, 10); - Assert.IsTrue(feedResponse.Headers.RequestCharge > 0); - Assert.IsNotNull(feedResponse.Diagnostics); + Database database = null; + CosmosClient cosmosClient = TestCommon.CreateCosmosClient(clientOptions); + try + { + database = await cosmosClient.CreateDatabaseAsync("ReadManyTypedTestScenarioDb"); + Container container = await database.CreateContainerAsync("ReadManyTypedTestContainer", "/pk"); - int count = 0; - foreach (ToDoActivity item in feedResponse) + // Create items with different pk values + for (int i = 0; i < 500; i++) + { + ToDoActivity item = ToDoActivity.CreateRandomToDoActivity(); + item.pk = "pk" + i.ToString(); + item.id = i.ToString(); + ItemResponse itemResponse = await container.CreateItemAsync(item); + Assert.AreEqual(HttpStatusCode.Created, itemResponse.StatusCode); + } + + List<(string, PartitionKey)> itemList = new List<(string, PartitionKey)>(); + for (int i = 0; i < 20; i++) + { + itemList.Add((i.ToString(), new PartitionKey("pk" + i.ToString()))); + } + + FeedResponse feedResponse = await container.ReadManyItemsAsync(itemList); + Assert.IsNotNull(feedResponse); + Assert.AreEqual(20, feedResponse.Count); + Assert.IsTrue(feedResponse.Headers.RequestCharge > 0); + Assert.IsNotNull(feedResponse.Diagnostics); + + int count = 0; + foreach (ToDoActivity item in feedResponse) + { + count++; + Assert.IsNotNull(item); + } + Assert.AreEqual(20, count); + } + finally { - count++; - Assert.IsNotNull(item); + await database.DeleteAsync(); + cosmosClient.Dispose(); } - Assert.AreEqual(count, 10); } [TestMethod] diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/FeedToken/QueryFeedTokenTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/FeedToken/QueryFeedTokenTests.cs index df61615fe6..ce9723e7ee 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/FeedToken/QueryFeedTokenTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/FeedToken/QueryFeedTokenTests.cs @@ -101,7 +101,12 @@ public async Task InexistentPKRangeId() FeedIterator feedIterator = container.GetItemQueryIterator( queryDefinition: new QueryDefinition("select * from T where STARTSWITH(T.id, \"BasicItem\")"), feedRange: feedRange, - continuationToken: null); + continuationToken: null + +#if PREVIEW + , requestOptions: new QueryRequestOptions() { EnableOptimisticDirectExecution = false } +#endif + ); CosmosException exception = await Assert.ThrowsExceptionAsync(() => feedIterator.ReadNextAsync()); Assert.AreEqual(HttpStatusCode.Gone, exception.StatusCode); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/HeadersValidationTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/HeadersValidationTests.cs index b24ce5f03b..f9ca3f8ecc 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/HeadersValidationTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/HeadersValidationTests.cs @@ -13,6 +13,7 @@ namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests using System.Net; using System.Text; using System.Threading.Tasks; + using Microsoft.Azure.Cosmos.Json; using Microsoft.Azure.Cosmos.Query.Core; using Microsoft.Azure.Cosmos.Routing; using Microsoft.Azure.Cosmos.Tracing; @@ -164,17 +165,17 @@ private void ValidatePageSize(DocumentClient client) public async Task ValidateConsistencyLevelGateway() { DocumentClient client = TestCommon.CreateClient(true); - await ValidateCosistencyLevel(client); + await ValidateConsistencyLevel(client); } [TestMethod] public async Task ValidateConsistencyLevelRntbd() { DocumentClient client = TestCommon.CreateClient(false, Protocol.Tcp); - await ValidateCosistencyLevel(client); + await ValidateConsistencyLevel(client); } - private async Task ValidateCosistencyLevel(DocumentClient client) + private async Task ValidateConsistencyLevel(DocumentClient client) { DocumentCollection collection = TestCommon.CreateOrGetDocumentCollection(client); @@ -203,17 +204,16 @@ private async Task ValidateCosistencyLevel(DocumentClient client) } [TestMethod] - [Owner("brchon")] public void ValidateJsonSerializationFormatGateway() { - var client = TestCommon.CreateClient(true); + using var client = TestCommon.CreateClient(true); ValidateJsonSerializationFormat(client); } [TestMethod] public void ValidateJsonSerializationFormatRntbd() { - var client = TestCommon.CreateClient(false, Protocol.Tcp); + using var client = TestCommon.CreateClient(false, Protocol.Tcp); ValidateJsonSerializationFormat(client); } @@ -306,6 +306,184 @@ private void ValidateJsonSerializationFormatQuery(DocumentClient client, Documen Assert.IsTrue(response.ResponseBody.ReadByte() == HeadersValidationTests.BinarySerializationByteMarkValue); } + [TestMethod] + public void ValidateSupportedSerializationFormatsGateway() + { + using var client = TestCommon.CreateClient(true); + this.ValidateSupportedSerializationFormats(client, true); + } + + [TestMethod] + public void ValidateSupportedSerializationFormatsRntbd() + { + using var client = TestCommon.CreateClient(false, Protocol.Tcp); + this.ValidateSupportedSerializationFormats(client, false); + } + + private void ValidateSupportedSerializationFormats(DocumentClient client, bool isHttps) + { + DocumentCollection collection = TestCommon.CreateOrGetDocumentCollection(client); + this.ValidateSupportedSerializationFormatsReadFeed(client, collection, isHttps); + + List sqlQueryList = new List() + { + new SqlQuerySpec("SELECT * FROM c"), + new SqlQuerySpec("SELECT c.id FROM c ORDER BY c.partitionKey"), + new SqlQuerySpec("SELECT c.name FROM c GROUP BY c.name") + }; + + foreach(SqlQuerySpec sqlQuery in sqlQueryList) + { + this.ValidateSupportedSerializationFormatsQuery(client, collection, sqlQuery, isHttps); + } + } + + private void SupportedSerializationFormatsNegativeCases( + DocumentClient client, + DocumentCollection collection, + string invalidValue, + bool isHttps, + SqlQuerySpec sqlQuerySpec = null) + { + INameValueCollection headers = new RequestNameValueCollection(); + headers.Add(HttpConstants.HttpHeaders.SupportedSerializationFormats, invalidValue); + + try + { + DocumentServiceResponse response; + if (sqlQuerySpec != null) + { + response = this.QueryRequest(client, collection.ResourceId, sqlQuerySpec, headers); + } + else + { + headers.Set(HttpConstants.HttpHeaders.PartitionKey, "[\"test\"]"); + response = this.ReadDocumentFeedRequestSinglePartition(client, collection.ResourceId, headers); + } + + if (isHttps) + { + // Invalid value is treated as default JsonText if HTTPS + Assert.IsTrue(response.StatusCode == HttpStatusCode.OK, "Invalid status code"); + Assert.IsTrue(this.CheckSerializationFormat(response) == JsonSerializationFormat.Text); + } + else + { + Assert.Fail("Should throw an exception"); + } + } + catch (Exception ex) + { + DocumentClientException innerException = ex.InnerException as DocumentClientException; + Assert.IsTrue(innerException.StatusCode == HttpStatusCode.BadRequest, "invalid status code"); + } + } + + private void SupportedSerializationFormatsPositiveCases( + DocumentClient client, + DocumentCollection collection, + SupportedSerializationFormats expectedFormat, + string supportedSerializationFormats, + SqlQuerySpec sqlQuerySpec = null) + { + INameValueCollection headers = new RequestNameValueCollection(); + + headers.Add(HttpConstants.HttpHeaders.SupportedSerializationFormats, supportedSerializationFormats); + DocumentServiceResponse response; + if(sqlQuerySpec!=null) + { + response = this.QueryRequest(client, collection.ResourceId, sqlQuerySpec, headers); + } + else + { + Assert.IsTrue(expectedFormat == SupportedSerializationFormats.JsonText, "ReadFeed response should be in Text"); + response = this.ReadDocumentFeedRequestAsync(client, collection.ResourceId, headers).Result; + } + + Assert.IsTrue(response.StatusCode == HttpStatusCode.OK, "Invalid status code"); + + if(expectedFormat == SupportedSerializationFormats.JsonText) + { + Assert.IsTrue(this.CheckSerializationFormat(response) == JsonSerializationFormat.Text); + } + else + { + Assert.IsTrue(this.CheckSerializationFormat(response) == JsonSerializationFormat.Binary); + } + } + + private void ValidateSupportedSerializationFormatsReadFeed(DocumentClient client, DocumentCollection collection, bool isHttps) + { + // Value not supported + this.SupportedSerializationFormatsNegativeCases(client, collection, "Invalid value", isHttps); + + // Supported values + this.SupportedSerializationFormatsPositiveCases(client, collection, expectedFormat: SupportedSerializationFormats.JsonText, supportedSerializationFormats: "JSONText"); + this.SupportedSerializationFormatsPositiveCases(client, collection, expectedFormat: SupportedSerializationFormats.JsonText, supportedSerializationFormats: "COSMOSbinary"); + this.SupportedSerializationFormatsPositiveCases(client, collection, expectedFormat: SupportedSerializationFormats.JsonText, supportedSerializationFormats: "JsonText, CosmosBinary"); + } + + private void ValidateSupportedSerializationFormatsQuery(DocumentClient client, DocumentCollection collection, SqlQuerySpec sqlQuerySpec, bool isHttps) + { + // Values not supported + this.SupportedSerializationFormatsNegativeCases(client, collection, "Invalid value", isHttps, sqlQuerySpec: sqlQuerySpec); + this.SupportedSerializationFormatsNegativeCases(client, collection, ", ,", isHttps, sqlQuerySpec: sqlQuerySpec); + this.SupportedSerializationFormatsNegativeCases(client, collection, ",,", isHttps, sqlQuerySpec: sqlQuerySpec); + this.SupportedSerializationFormatsNegativeCases(client, collection, "JsonText CosmosBinary", isHttps, sqlQuerySpec: sqlQuerySpec); + this.SupportedSerializationFormatsNegativeCases(client, collection, ",JsonText|CosmosBinary", isHttps, sqlQuerySpec: sqlQuerySpec); + this.SupportedSerializationFormatsNegativeCases(client, collection, "Json Text", isHttps, sqlQuerySpec: sqlQuerySpec); + this.SupportedSerializationFormatsNegativeCases(client, collection, "Json,Text", isHttps, sqlQuerySpec: sqlQuerySpec); + this.SupportedSerializationFormatsNegativeCases(client, collection, "JsonText, ", isHttps, sqlQuerySpec: sqlQuerySpec); + + // Supported values + this.SupportedSerializationFormatsPositiveCases(client, collection, + expectedFormat: SupportedSerializationFormats.JsonText, + supportedSerializationFormats: "jsontext", + sqlQuerySpec: sqlQuerySpec); + /* + this.SupportedSerializationFormatsPositiveCases(client, collection, + expectedFormat: SupportedSerializationFormats.CosmosBinary, + supportedSerializationFormats: "COSMOSBINARY", + sqlQuerySpec: sqlQuerySpec); + */ + this.SupportedSerializationFormatsPositiveCases(client, collection, + expectedFormat: SupportedSerializationFormats.JsonText, + supportedSerializationFormats: "JsonText, CosmosBinary", + sqlQuerySpec: sqlQuerySpec); + /* + this.SupportedSerializationFormatsPositiveCases(client, collection, + expectedFormat: SupportedSerializationFormats.CosmosBinary, + supportedSerializationFormats: "CosmosBinary, HybridRow", + sqlQuerySpec: sqlQuerySpec); + */ + this.SupportedSerializationFormatsPositiveCases(client, collection, + expectedFormat: SupportedSerializationFormats.JsonText, + supportedSerializationFormats: "JsonText, CosmosBinary, HybridRow", + sqlQuerySpec: sqlQuerySpec); + /* + this.SupportedSerializationFormatsPositiveCases(client, collection, + expectedFormat: SupportedSerializationFormats.CosmosBinary, + supportedSerializationFormats: "JsonText, CosmosBinary, HybridRow", + sqlQuerySpec: sqlQuerySpec); + */ + this.SupportedSerializationFormatsPositiveCases(client, collection, + expectedFormat: SupportedSerializationFormats.JsonText, + supportedSerializationFormats: "JsonText, CosmosBinary, HybridRow", + sqlQuerySpec: sqlQuerySpec); + } + + private JsonSerializationFormat CheckSerializationFormat(DocumentServiceResponse response) + { + if(response.ResponseBody.ReadByte() < BinarySerializationByteMarkValue) + { + return JsonSerializationFormat.Text; + } + else + { + return JsonSerializationFormat.Binary; + } + } + [TestMethod] public void ValidateIndexingDirectiveGateway() { @@ -1105,4 +1283,4 @@ internal override string BaseUserAgent } } } -} \ No newline at end of file +} diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqSQLTranslationBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqSQLTranslationBaselineTests.cs index f3c27a2230..230e2599a3 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqSQLTranslationBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqSQLTranslationBaselineTests.cs @@ -103,6 +103,12 @@ struct complex public string id; public string pk; + [Newtonsoft.Json.JsonExtensionData(ReadData = true, WriteData = true)] + public Dictionary NewtonsoftExtensionData { get; set; } + + [System.Text.Json.Serialization.JsonExtensionData()] + public Dictionary NetExtensionData { get; set; } + public complex(double d, string str, bool b, double[] da, simple s) { this.dbl = d; @@ -113,6 +119,8 @@ public complex(double d, string str, bool b, double[] da, simple s) this.json = null; this.id = Guid.NewGuid().ToString(); this.pk = "Test"; + this.NetExtensionData = new Dictionary(); + this.NewtonsoftExtensionData = new Dictionary(); } public override string ToString() @@ -236,7 +244,15 @@ public void ValidateSQLTranslation() inputs.Add(new LinqTestInput("Select new constructor", b => dataQuery(b).Select(x => new TimeSpan(x.x)))); inputs.Add(new LinqTestInput("Select method id", b => dataQuery(b).Select(x => id(x)))); inputs.Add(new LinqTestInput("Select identity", b => dataQuery(b).Select(x => x))); - inputs.Add(new LinqTestInput("Select simple property", b => dataQuery(b).Select(x => x.x))); + inputs.Add(new LinqTestInput("Select simple property", b => dataQuery(b).Select(x => x.x))); + inputs.Add(new LinqTestInput("Select extension data", b => dataQuery(b).Select(x => new complex() { + NewtonsoftExtensionData = new() { + { "test", 1.5 } + }, + NetExtensionData = new() { + { "OtherTest", 1.5 } + } + } ))); this.ExecuteTestSuite(inputs); } @@ -264,6 +280,10 @@ public void ValidateSQLTranslationComplexData() obj.str = random.NextDouble() < 0.1 ? "5" : LinqTestsCommon.RandomString(random, random.Next(MaxStringLength)); obj.id = Guid.NewGuid().ToString(); obj.pk = "Test"; + obj.NewtonsoftExtensionData = new Dictionary() { + ["age"] = 32, + ["tags"] = new [] { "item-1", "item-2" } + }; return obj; }; Func> getQuery = LinqTestsCommon.GenerateTestCosmosData(createDataObj, Records, testContainer); @@ -285,6 +305,14 @@ public void ValidateSQLTranslationComplexData() inputs.Add(new LinqTestInput("SelectMany x -> Select y", b => getQuery(b).SelectMany(x => x.dblArray.Select(y => y)))); inputs.Add(new LinqTestInput("SelectMany x -> Select x.y", b => getQuery(b).SelectMany(x => x.dblArray.Select(y => y)))); inputs.Add(new LinqTestInput("SelectMany array", b => getQuery(b).SelectMany(x => x.dblArray))); + + inputs.Add(new LinqTestInput("Select where extensiondata", b => getQuery(b).Where(p => (int)p.NewtonsoftExtensionData["age"] > 18).Select(x => new { Age = (int)x.NewtonsoftExtensionData["age"] }))); + inputs.Add(new LinqTestInput("Select where extensiondata contains", b => getQuery(b).Where(p => ((string[])p.NewtonsoftExtensionData["tags"]).Contains("item-1")).Select(x => (string[])x.NewtonsoftExtensionData["tags"] ))); + + // TODO: SelectMany does not currently work with Dictionary objects, the snapshot represents + // the current (broken) behavior + inputs.Add(new LinqTestInput("SelectMany where extensiondata contains", b => getQuery(b).Where(p => ((string[])p.NewtonsoftExtensionData["tags"]).Contains("item-1")).SelectMany(x => (object[])x.NewtonsoftExtensionData["tags"] ))); + this.ExecuteTestSuite(inputs); } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTestsCommon.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTestsCommon.cs index 5907d861fc..87b33110e2 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTestsCommon.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTestsCommon.cs @@ -296,7 +296,14 @@ public static Func> GenerateTestCosmosData(Func query = container.GetItemLinqQueryable(allowSynchronousQueryExecution: true); + QueryRequestOptions requestOptions = new QueryRequestOptions() + { +#if PREVIEW + EnableOptimisticDirectExecution = false +#endif + }; + + IOrderedQueryable query = container.GetItemLinqQueryable(allowSynchronousQueryExecution: true, requestOptions: requestOptions); // To cover both query against backend and queries on the original data using LINQ nicely, // the LINQ expression should be written once and they should be compiled and executed against the two sources. @@ -483,7 +490,14 @@ Cosmos.Database cosmosDatabase } FeedOptions feedOptions = new FeedOptions() { EnableScanInQuery = true, EnableCrossPartitionQuery = true }; - IOrderedQueryable query = container.GetItemLinqQueryable(allowSynchronousQueryExecution: true); + QueryRequestOptions requestOptions = new QueryRequestOptions() + { +#if PREVIEW + EnableOptimisticDirectExecution = false +#endif + }; + + IOrderedQueryable query = container.GetItemLinqQueryable(allowSynchronousQueryExecution: true, requestOptions: requestOptions); // To cover both query against backend and queries on the original data using LINQ nicely, // the LINQ expression should be written once and they should be compiled and executed against the two sources. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTranslationBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTranslationBaselineTests.cs index 5a46a2d118..4c8d6c423f 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTranslationBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTranslationBaselineTests.cs @@ -1044,6 +1044,58 @@ public void TestStringCompareTo() this.ExecuteTestSuite(inputs); } + [TestMethod] + public void TestStringCompare() + { + IOrderedQueryable testQuery = testContainer.GetItemLinqQueryable(allowSynchronousQueryExecution: true); + + const int Records = 100; + const int MaxStringLength = 20; + Func createDataObj = (random) => + { + DataObject obj = new DataObject(); + obj.StringField = LinqTestsCommon.RandomString(random, random.Next(MaxStringLength)); + obj.StringField2 = random.NextDouble() < 0.5 ? obj.StringField : LinqTestsCommon.RandomString(random, random.Next(MaxStringLength)); + obj.Id = Guid.NewGuid().ToString(); + obj.Pk = "Test"; + return obj; + }; + Func> getQuery = LinqTestsCommon.GenerateTestCosmosData(createDataObj, Records, testContainer); + + List inputs = new List + { + // projected compare + new LinqTestInput("Projected Compare ==", b => getQuery(b).Select(doc => String.Compare(doc.StringField, doc.StringField2) == 0)), + new LinqTestInput("Projected Compare >", b => getQuery(b).Select(doc => String.Compare(doc.StringField, doc.StringField2) > 0)), + new LinqTestInput("Projected Compare >=", b => getQuery(b).Select(doc => String.Compare(doc.StringField, doc.StringField2) >= 0)), + new LinqTestInput("Projected Compare <", b => getQuery(b).Select(doc => String.Compare(doc.StringField, doc.StringField2) < 0)), + new LinqTestInput("Projected Compare <=", b => getQuery(b).Select(doc => String.Compare(doc.StringField, doc.StringField2) <= 0)), + // static strings + new LinqTestInput("String.Compare static string ==", b => getQuery(b).Select(doc => String.Compare(doc.StringField, "str") == 0)), + new LinqTestInput("String.Compare static string >", b => getQuery(b).Select(doc => String.Compare(doc.StringField, "str") > 0)), + new LinqTestInput("String.Compare static string >=", b => getQuery(b).Select(doc => String.Compare(doc.StringField, "str") >= 0)), + new LinqTestInput("String.Compare static string <", b => getQuery(b).Select(doc => String.Compare(doc.StringField, "str") < 0)), + new LinqTestInput("String.Compare static string <=", b => getQuery(b).Select(doc => String.Compare(doc.StringField, "str") <= 0)), + // reverse operands + new LinqTestInput("Projected Compare == reverse operands", b => getQuery(b).Select(doc => 0 == String.Compare(doc.StringField, doc.StringField2))), + new LinqTestInput("Projected Compare < reverse operands", b => getQuery(b).Select(doc => 0 < String.Compare(doc.StringField, doc.StringField2))), + new LinqTestInput("Projected Compare <= reverse operands", b => getQuery(b).Select(doc => 0 <= String.Compare(doc.StringField, doc.StringField2))), + new LinqTestInput("Projected Compare > reverse operands", b => getQuery(b).Select(doc => 0 > String.Compare(doc.StringField, doc.StringField2))), + new LinqTestInput("Projected Compare >= reverse operands", b => getQuery(b).Select(doc => 0 >= String.Compare(doc.StringField, doc.StringField2))), + // errors Invalid compare value + new LinqTestInput("String.Compare > 1", b => getQuery(b).Select(doc => String.Compare(doc.StringField, "str") > 1)), + new LinqTestInput("String.Compare == 1", b => getQuery(b).Select(doc => String.Compare(doc.StringField, "str") == 1)), + new LinqTestInput("String.Compare == -1", b => getQuery(b).Select(doc => String.Compare(doc.StringField, "str") == -1)), + // errors Invalid operator + new LinqTestInput("String.Compare | 0", b => getQuery(b).Select(doc => String.Compare(doc.StringField, "str") | 0)), + new LinqTestInput("String.Compare & 0", b => getQuery(b).Select(doc => String.Compare(doc.StringField, "str") & 0)), + new LinqTestInput("String.Compare ^ 0", b => getQuery(b).Select(doc => String.Compare(doc.StringField, "str") ^ 0)), + // errors Unexpected number of arguments to string.Compare + new LinqTestInput("Unexpected number of arguments to string.Compare", b => getQuery(b).Select(doc => String.Compare(doc.StringField, 0, "str", 0, 3) == 0)) + }; + this.ExecuteTestSuite(inputs); + } + [TestMethod] public void TestUDFs() { @@ -1136,8 +1188,14 @@ public void TestSelectTop() Tuple> generatedData = this.CreateDataTestSelectTop(); int seed = generatedData.Item1; List data = generatedData.Item2; + QueryRequestOptions requestOptions = new QueryRequestOptions() + { +#if PREVIEW + EnableOptimisticDirectExecution = false +#endif + }; - IOrderedQueryable query = testContainer.GetItemLinqQueryable(allowSynchronousQueryExecution: true); + IOrderedQueryable query = testContainer.GetItemLinqQueryable(allowSynchronousQueryExecution: true, requestOptions: requestOptions); Func> getQuery = useQuery => useQuery ? query : data.AsQueryable(); List inputs = new List diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Microsoft.Azure.Cosmos.EmulatorTests.csproj b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Microsoft.Azure.Cosmos.EmulatorTests.csproj index eb0e07c4d3..cb59dfb820 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Microsoft.Azure.Cosmos.EmulatorTests.csproj +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Microsoft.Azure.Cosmos.EmulatorTests.csproj @@ -53,7 +53,6 @@ - @@ -214,6 +213,9 @@ PreserveNewest + + PreserveNewest + PreserveNewest @@ -300,6 +302,9 @@ PreserveNewest + + PreserveNewest + PreserveNewest diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/AggregateQueryTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/AggregateQueryTests.cs index 0bcfcea030..d60f76f92c 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/AggregateQueryTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/AggregateQueryTests.cs @@ -152,6 +152,9 @@ async Task ImplementationAsync( new QueryRequestOptions() { MaxConcurrency = maxDoP, +#if PREVIEW + EnableOptimisticDirectExecution = false +#endif }); if (argument.ExpectedValue == null) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/SanityQueryTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/SanityQueryTests.cs index 60ab6f9fe4..9eecd81e30 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/SanityQueryTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/SanityQueryTests.cs @@ -538,6 +538,9 @@ static async Task ImplementationAsync(Container container, IReadOnlyList MaxBufferedItemCount = 7000, MaxConcurrency = maxDegreeOfParallelism, MaxItemCount = maxItemCount, +#if PREVIEW + EnableOptimisticDirectExecution = false +#endif }; async Task> AssertPassthroughAsync(string query, Cosmos.PartitionKey? pk = default) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/SupportedSerializationFormatsTest.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/SupportedSerializationFormatsTest.cs new file mode 100644 index 0000000000..f4cdab6e51 --- /dev/null +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/SupportedSerializationFormatsTest.cs @@ -0,0 +1,102 @@ +namespace Microsoft.Azure.Cosmos.Query +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Threading.Tasks; + using Microsoft.Azure.Cosmos.CosmosElements; + using Microsoft.Azure.Cosmos.EmulatorTests.Query; + using Microsoft.Azure.Cosmos.SDK.EmulatorTests.QueryOracle; + using Microsoft.Azure.Documents; + using Microsoft.VisualStudio.TestTools.UnitTesting; + + [TestClass] + [TestCategory("Query")] + public sealed class SupportedSerializationFormatsTest : QueryTestsBase + { + [TestMethod] + public async Task TestSupportedSerializationFormats() + { + string[] inputDocuments = new[] + { + @"{""id"":""0"",""name"":""document_0""}", + @"{""id"":""1"",""name"":""document_1""}", + @"{""id"":""2"",""name"":""document_2""}", + @"{""id"":""3"",""name"":""document_3""}", + @"{""id"":""4"",""name"":""document_4""}", + @"{""id"":""5"",""name"":""document_5""}", + @"{""id"":""6"",""name"":""document_6""}", + @"{""id"":""7"",""name"":""document_7""}", + @"{""id"":""8"",""name"":""document_8""}", + @"{""id"":""9"",""name"":""document_9""}", + }; + + await this.CreateIngestQueryDeleteAsync( + ConnectionModes.Direct, + CollectionTypes.SinglePartition | CollectionTypes.MultiPartition, + inputDocuments, + this.TestSupportedSerializationFormatsHelper, + "/id"); + } + + private async Task TestSupportedSerializationFormatsHelper(Container container, IReadOnlyList documents) + { + string[] expectedResults = new[] { "document_0", "document_1", "document_2", "document_3", "document_4", "document_5", "document_6", "document_7", "document_8", "document_9" }; + string query = string.Format("SELECT c.name FROM c"); + List queryRequestOptionsList = new List() + { + new QueryRequestOptions() + { + SupportedSerializationFormats = SupportedSerializationFormats.CosmosBinary | SupportedSerializationFormats.HybridRow + }, + new QueryRequestOptions() + { + SupportedSerializationFormats = SupportedSerializationFormats.JsonText | SupportedSerializationFormats.CosmosBinary + }, + new QueryRequestOptions() + { + SupportedSerializationFormats = SupportedSerializationFormats.JsonText | SupportedSerializationFormats.HybridRow + }, + new QueryRequestOptions() + { + SupportedSerializationFormats = SupportedSerializationFormats.JsonText | SupportedSerializationFormats.CosmosBinary | SupportedSerializationFormats.HybridRow + }, + new QueryRequestOptions() + { + SupportedSerializationFormats = SupportedSerializationFormats.JsonText + }, + new QueryRequestOptions() + { + SupportedSerializationFormats = SupportedSerializationFormats.CosmosBinary + }, + new QueryRequestOptions() + { + SupportedSerializationFormats = SupportedSerializationFormats.CosmosBinary + }, + new QueryRequestOptions() + { + SupportedSerializationFormats = SupportedSerializationFormats.JsonText + } + }; + + foreach (QueryRequestOptions requestOptions in queryRequestOptionsList) + { + List results = new List(); + using (FeedIterator feedIterator = container.GetItemQueryIterator(new QueryDefinition(query), requestOptions: requestOptions)) + { + while (feedIterator.HasMoreResults) + { + FeedResponse response = await feedIterator.ReadNextAsync(); + results.AddRange(response.ToList()); + } + } + + string[] actualResults = results + .Select(doc => ((CosmosString)(doc as CosmosObject)["name"]).Value.ToString()) + .ToArray(); + + CollectionAssert.AreEquivalent(expectedResults, actualResults); + } + } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/QueryPerfTest/ContentSerializationPerformanceTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/QueryPerfTest/ContentSerializationPerformanceTests.cs index c18ac5e420..759e63b345 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/QueryPerfTest/ContentSerializationPerformanceTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/QueryPerfTest/ContentSerializationPerformanceTests.cs @@ -83,10 +83,6 @@ private async Task RunQueryAsync(Container container) { MaxConcurrency = this.MaxConcurrency, MaxItemCount = this.MaxItemCount, - CosmosSerializationFormatOptions = new CosmosSerializationFormatOptions( - contentSerializationFormat: this.contentSerialization, - createCustomNavigator: (content) => JsonNavigator.Create(content), - createCustomWriter: () => JsonWriter.Create(this.contentSerialization == "JsonText" ? JsonSerializationFormat.Text : JsonSerializationFormat.Binary)) }; if (this.useStronglyTypedIterator) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/EndToEndTraceWriterBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/EndToEndTraceWriterBaselineTests.cs index 64bc7c015a..6abd4f8ad9 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/EndToEndTraceWriterBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/EndToEndTraceWriterBaselineTests.cs @@ -464,6 +464,12 @@ public async Task ChangeFeedAsync() public async Task QueryAsync() { List inputs = new List(); + QueryRequestOptions requestOptions = new QueryRequestOptions() + { +#if PREVIEW + EnableOptimisticDirectExecution = false +#endif + }; int startLineNumber; int endLineNumber; @@ -474,7 +480,8 @@ public async Task QueryAsync() { startLineNumber = GetLineNumber(); FeedIteratorInternal feedIterator = (FeedIteratorInternal)container.GetItemQueryStreamIterator( - queryText: "SELECT * FROM c"); + queryText: "SELECT * FROM c", + requestOptions: requestOptions); List traces = new List(); while (feedIterator.HasMoreResults) @@ -499,7 +506,8 @@ public async Task QueryAsync() { startLineNumber = GetLineNumber(); FeedIteratorInternal feedIterator = (FeedIteratorInternal)container.GetItemQueryIterator( - queryText: "SELECT * FROM c"); + queryText: "SELECT * FROM c", + requestOptions: requestOptions); List traces = new List(); while (feedIterator.HasMoreResults) @@ -524,7 +532,8 @@ public async Task QueryAsync() { startLineNumber = GetLineNumber(); FeedIterator feedIterator = container.GetItemQueryStreamIterator( - queryText: "SELECT * FROM c"); + queryText: "SELECT * FROM c", + requestOptions: requestOptions); List traces = new List(); @@ -550,7 +559,8 @@ public async Task QueryAsync() { startLineNumber = GetLineNumber(); FeedIterator feedIterator = container.GetItemQueryIterator( - queryText: "SELECT * FROM c"); + queryText: "SELECT * FROM c", + requestOptions: requestOptions); List traces = new List(); @@ -578,7 +588,8 @@ public async Task QueryAsync() Lazy currentLazy = Documents.ServiceInteropWrapper.AssembliesExist; Documents.ServiceInteropWrapper.AssembliesExist = new Lazy(() => false); FeedIterator feedIterator = container.GetItemQueryIterator( - queryText: "SELECT * FROM c"); + queryText: "SELECT * FROM c", + requestOptions: requestOptions); List traces = new List(); @@ -607,7 +618,8 @@ public async Task QueryAsync() FeedIterator feedIterator = container.GetItemQueryStreamIterator( feedRange: FeedRangeEpk.FullRange, queryDefinition: new QueryDefinition("SELECT * FROM c"), - continuationToken: null); + continuationToken: null, + requestOptions: requestOptions); List traces = new List(); @@ -635,7 +647,8 @@ public async Task QueryAsync() FeedIterator feedIterator = container.GetItemQueryIterator( feedRange: FeedRangeEpk.FullRange, queryDefinition: new QueryDefinition("SELECT * FROM c"), - continuationToken: null); + continuationToken: null, + requestOptions: requestOptions); List traces = new List(); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BinaryEncodingOverTheWireTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BinaryEncodingOverTheWireTests.cs index b55e837844..7d570d65d0 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BinaryEncodingOverTheWireTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BinaryEncodingOverTheWireTests.cs @@ -28,15 +28,11 @@ public class BinaryEncodingOverTheWireTests ConfigurationManager.AppSettings["GatewayEndpoint"], ConfigurationManager.AppSettings["MasterKey"], new CosmosClientOptions() { ConnectionMode = ConnectionMode.Gateway }); - private static readonly CosmosClient DirectHttpsClient = new CosmosClient( - ConfigurationManager.AppSettings["GatewayEndpoint"], - ConfigurationManager.AppSettings["MasterKey"], - new CosmosClientOptions() { ConnectionMode = ConnectionMode.Direct, ConnectionProtocol = Documents.Client.Protocol.Https }); private static readonly CosmosClient RntbdClient = new CosmosClient( ConfigurationManager.AppSettings["GatewayEndpoint"], ConfigurationManager.AppSettings["MasterKey"], new CosmosClientOptions() { ConnectionMode = ConnectionMode.Direct, ConnectionProtocol = Documents.Client.Protocol.Tcp }); - private static readonly CosmosClient[] Clients = new CosmosClient[] { GatewayClient, DirectHttpsClient, RntbdClient }; + private static readonly CosmosClient[] Clients = new CosmosClient[] { GatewayClient, RntbdClient }; private static readonly CosmosClient Client = RntbdClient; private static readonly AsyncLazy Database = new AsyncLazy(async () => { @@ -124,7 +120,7 @@ public void CheckThatAllTestsAreRunning() [TestMethod] public async Task CombinedScriptsDataTest() { - await this.TestCurratedDocs("CombinedScriptsData.json"); + await this.TestCuratedDocs("CombinedScriptsData.json"); } // For now we are skipping this test since the documents are too large to ingest and we get a rate size too large (HTTP 413). @@ -139,96 +135,96 @@ public async Task CountriesTest() [TestMethod] public async Task DevTestCollTest() { - await this.TestCurratedDocs("devtestcoll.json"); + await this.TestCuratedDocs("devtestcoll.json"); } [TestMethod] public async Task LastFMTest() { - await this.TestCurratedDocs("lastfm"); + await this.TestCuratedDocs("lastfm"); } [TestMethod] public async Task LogDataTest() { - await this.TestCurratedDocs("LogData.json"); + await this.TestCuratedDocs("LogData.json"); } [TestMethod] public async Task MillionSong1KDocumentsTest() { - await this.TestCurratedDocs("MillionSong1KDocuments.json"); + await this.TestCuratedDocs("MillionSong1KDocuments.json"); } [TestMethod] public async Task MsnCollectionTest() { - await this.TestCurratedDocs("MsnCollection.json"); + await this.TestCuratedDocs("MsnCollection.json"); } [TestMethod] public async Task NutritionDataTest() { - await this.TestCurratedDocs("NutritionData"); + await this.TestCuratedDocs("NutritionData"); } [TestMethod] public async Task RunsCollectionTest() { - await this.TestCurratedDocs("runsCollection"); + await this.TestCuratedDocs("runsCollection"); } [TestMethod] public async Task StatesCommitteesTest() { - await this.TestCurratedDocs("states_committees.json"); + await this.TestCuratedDocs("states_committees.json"); } [TestMethod] public async Task StatesLegislatorsTest() { - await this.TestCurratedDocs("states_legislators"); + await this.TestCuratedDocs("states_legislators"); } [TestMethod] public async Task Store01Test() { - await this.TestCurratedDocs("store01C.json"); + await this.TestCuratedDocs("store01C.json"); } [TestMethod] public async Task TicinoErrorBucketsTest() { - await this.TestCurratedDocs("TicinoErrorBuckets"); + await this.TestCuratedDocs("TicinoErrorBuckets"); } [TestMethod] public async Task TwitterDataTest() { - await this.TestCurratedDocs("twitter_data"); + await this.TestCuratedDocs("twitter_data"); } [TestMethod] public async Task Ups1Test() { - await this.TestCurratedDocs("ups1"); + await this.TestCuratedDocs("ups1"); } [TestMethod] public async Task XpertEventsTest() { - await this.TestCurratedDocs("XpertEvents"); + await this.TestCuratedDocs("XpertEvents"); } - private async Task TestCurratedDocs(string path) + private async Task TestCuratedDocs(string path) { IEnumerable documents = BinaryEncodingOverTheWireTests.GetDocumentsFromCurratedDoc(path); await BinaryEncodingOverTheWireTests.CreateIngestQueryDelete( documents.Select(x => x.ToString()), - this.TestCurratedDocs); + this.TestCuratedDocs); } - private async Task TestCurratedDocs(CosmosClient cosmosClient, Container container, List items) + private async Task TestCuratedDocs(CosmosClient cosmosClient, Container container, List items) { HashSet inputItems = new HashSet(items, JsonTokenEqualityComparer.Value); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ClientRetryPolicyTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ClientRetryPolicyTests.cs index a41f08afa1..0851952f40 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ClientRetryPolicyTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ClientRetryPolicyTests.cs @@ -209,7 +209,8 @@ private async Task ValidateConnectTimeoutTriggersClientRetryPolicy( enableReadRequestsFallback: false, useMultipleWriteLocations: useMultipleWriteLocations, detectClientConnectivityIssues: true, - disableRetryWithRetryPolicy: false); + disableRetryWithRetryPolicy: false, + enableReplicaValidation: false); // Reducing retry timeout to avoid long-running tests replicatedResourceClient.GoneAndRetryWithRetryTimeoutInSecondsOverride = 1; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosBadReplicaTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosBadReplicaTests.cs index 3ef86568b8..151e0690a8 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosBadReplicaTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosBadReplicaTests.cs @@ -6,7 +6,6 @@ namespace Microsoft.Azure.Cosmos.Tests { using System; using System.Collections.Generic; - using System.Globalization; using System.IO; using System.Linq; using System.Net; @@ -14,176 +13,213 @@ namespace Microsoft.Azure.Cosmos.Tests using System.Text; using System.Threading; using System.Threading.Tasks; - using global::Azure.Core; - using Microsoft.Azure.Cosmos.Fluent; using Microsoft.VisualStudio.TestTools.UnitTesting; using Moq; - using Newtonsoft.Json.Linq; [TestClass] public class CosmosBadReplicaTests { [TestMethod] [Timeout(30000)] - public async Task TestGoneFromServiceScenarioAsync() + [DataRow(true, true, false, DisplayName = "Validate when replica validation is enabled using environment variable.")] + [DataRow(false, true, false, DisplayName = "Validate when replica validation is disabled using environment variable.")] + [DataRow(true, false, true, DisplayName = "Validate when replica validation is enabled using cosmos client options.")] + [DataRow(false, false, true, DisplayName = "Validate when replica validation is disabled using cosmos client options.")] + public async Task TestGoneFromServiceScenarioAsync( + bool enableReplicaValidation, + bool useEnvironmentVariable, + bool useCosmosClientOptions) { - Mock mockHttpHandler = new Mock(MockBehavior.Strict); - Uri endpoint = MockSetupsHelper.SetupSingleRegionAccount( - "mockAccountInfo", - consistencyLevel: ConsistencyLevel.Session, - mockHttpHandler, - out string primaryRegionEndpoint); - - string databaseName = "mockDbName"; - string containerName = "mockContainerName"; - string containerRid = "ccZ1ANCszwk="; - Documents.ResourceId cRid = Documents.ResourceId.Parse(containerRid); - MockSetupsHelper.SetupContainerProperties( - mockHttpHandler: mockHttpHandler, - regionEndpoint: primaryRegionEndpoint, - databaseName: databaseName, - containerName: containerName, - containerRid: containerRid); - - MockSetupsHelper.SetupSinglePartitionKeyRange( - mockHttpHandler, - primaryRegionEndpoint, - cRid, - out IReadOnlyList partitionKeyRanges); - - List replicaIds1 = new List() + try { - "11111111111111111", - "22222222222222222", - "33333333333333333", - "44444444444444444", - }; - - HttpResponseMessage replicaSet1 = MockSetupsHelper.CreateAddresses( - replicaIds1, - partitionKeyRanges.First(), - "eastus", - cRid); - - // One replica changed on the refresh - List replicaIds2 = new List() - { - "11111111111111111", - "22222222222222222", - "33333333333333333", - "55555555555555555", - }; - - HttpResponseMessage replicaSet2 = MockSetupsHelper.CreateAddresses( - replicaIds2, - partitionKeyRanges.First(), - "eastus", - cRid); - - bool delayCacheRefresh = true; - bool delayRefreshUnblocked = false; - mockHttpHandler.SetupSequence(x => x.SendAsync( - It.Is(r => r.RequestUri.ToString().Contains("addresses")), It.IsAny())) - .Returns(Task.FromResult(replicaSet1)) - .Returns(async ()=> + if (useEnvironmentVariable) + { + Environment.SetEnvironmentVariable( + variable: ConfigurationManager.ReplicaConnectivityValidationEnabled, + value: enableReplicaValidation.ToString()); + } + + Mock mockHttpHandler = new Mock(MockBehavior.Strict); + Uri endpoint = MockSetupsHelper.SetupSingleRegionAccount( + "mockAccountInfo", + consistencyLevel: ConsistencyLevel.Session, + mockHttpHandler, + out string primaryRegionEndpoint); + + string databaseName = "mockDbName"; + string containerName = "mockContainerName"; + string containerRid = "ccZ1ANCszwk="; + Documents.ResourceId cRid = Documents.ResourceId.Parse(containerRid); + MockSetupsHelper.SetupContainerProperties( + mockHttpHandler: mockHttpHandler, + regionEndpoint: primaryRegionEndpoint, + databaseName: databaseName, + containerName: containerName, + containerRid: containerRid); + + MockSetupsHelper.SetupSinglePartitionKeyRange( + mockHttpHandler, + primaryRegionEndpoint, + cRid, + out IReadOnlyList partitionKeyRanges); + + List replicaIds1 = new List() + { + "11111111111111111", + "22222222222222222", + "33333333333333333", + "44444444444444444", + }; + + HttpResponseMessage replicaSet1 = MockSetupsHelper.CreateAddresses( + replicaIds1, + partitionKeyRanges.First(), + "eastus", + cRid); + + // One replica changed on the refresh + List replicaIds2 = new List() + { + "11111111111111111", + "22222222222222222", + "33333333333333333", + "55555555555555555", + }; + + HttpResponseMessage replicaSet2 = MockSetupsHelper.CreateAddresses( + replicaIds2, + partitionKeyRanges.First(), + "eastus", + cRid); + + bool delayCacheRefresh = true; + bool delayRefreshUnblocked = false; + mockHttpHandler.SetupSequence(x => x.SendAsync( + It.Is(r => r.RequestUri.ToString().Contains("addresses")), It.IsAny())) + .Returns(Task.FromResult(replicaSet1)) + .Returns(async ()=> + { + //block cache refresh to verify bad replica is not visited during refresh + while (delayCacheRefresh) + { + await Task.Delay(TimeSpan.FromMilliseconds(20)); + } + + delayRefreshUnblocked = true; + return replicaSet2; + }); + + int callBack = 0; + List urisVisited = new List(); + Mock mockTransportClient = new Mock(MockBehavior.Strict); + mockTransportClient.Setup(x => x.InvokeResourceOperationAsync(It.IsAny(), It.IsAny())) + .Callback((t, _) => urisVisited.Add(t)) + .Returns(() => { - //block cache refresh to verify bad replica is not visited during refresh - while (delayCacheRefresh) + callBack++; + if (callBack == 1) { - await Task.Delay(TimeSpan.FromMilliseconds(20)); + throw Documents.Rntbd.TransportExceptions.GetGoneException( + new Uri("https://localhost:8081"), + Guid.NewGuid(), + new Documents.TransportException(Documents.TransportErrorCode.ConnectionBroken, + null, + Guid.NewGuid(), + new Uri("https://localhost:8081"), + "Mock", + userPayload: true, + payloadSent: false)); } - delayRefreshUnblocked = true; - return replicaSet2; + return Task.FromResult(new Documents.StoreResponse() + { + Status = 200, + Headers = new Documents.Collections.StoreResponseNameValueCollection() + { + ActivityId = Guid.NewGuid().ToString(), + LSN = "12345", + PartitionKeyRangeId = "0", + GlobalCommittedLSN = "12345", + SessionToken = "1#12345#1=12345" + }, + ResponseBody = new MemoryStream() + }); }); - int callBack = 0; - List urisVisited = new List(); - Mock mockTransportClient = new Mock(MockBehavior.Strict); - mockTransportClient.Setup(x => x.InvokeResourceOperationAsync(It.IsAny(), It.IsAny())) - .Callback((t, _) => urisVisited.Add(t)) - .Returns(() => - { - callBack++; - if (callBack == 1) + CosmosClientOptions cosmosClientOptions = new CosmosClientOptions() { - throw Documents.Rntbd.TransportExceptions.GetGoneException( - new Uri("https://localhost:8081"), - Guid.NewGuid(), - new Documents.TransportException(Documents.TransportErrorCode.ConnectionBroken, - null, - Guid.NewGuid(), - new Uri("https://localhost:8081"), - "Mock", - userPayload: true, - payloadSent: false)); - } + ConsistencyLevel = Cosmos.ConsistencyLevel.Session, + HttpClientFactory = () => new HttpClient(new HttpHandlerHelper(mockHttpHandler.Object)), + TransportClientHandlerFactory = (original) => mockTransportClient.Object, + }; - return Task.FromResult(new Documents.StoreResponse() + if (useCosmosClientOptions) { - Status = 200, - Headers = new Documents.Collections.StoreResponseNameValueCollection() - { - ActivityId = Guid.NewGuid().ToString(), - LSN = "12345", - PartitionKeyRangeId = "0", - GlobalCommittedLSN = "12345", - SessionToken = "1#12345#1=12345" - }, - ResponseBody = new MemoryStream() - }); - }); + cosmosClientOptions.EnableAdvancedReplicaSelectionForTcp = enableReplicaValidation; + } - CosmosClientOptions cosmosClientOptions = new CosmosClientOptions() - { - ConsistencyLevel = Cosmos.ConsistencyLevel.Session, - HttpClientFactory = () => new HttpClient(new HttpHandlerHelper(mockHttpHandler.Object)), - TransportClientHandlerFactory = (original) => mockTransportClient.Object, - }; - - using (CosmosClient customClient = new CosmosClient( - endpoint.ToString(), - Convert.ToBase64String(Encoding.UTF8.GetBytes(Guid.NewGuid().ToString())), - cosmosClientOptions)) - { - try + using (CosmosClient customClient = new CosmosClient( + endpoint.ToString(), + Convert.ToBase64String(Encoding.UTF8.GetBytes(Guid.NewGuid().ToString())), + cosmosClientOptions)) { - Container container = customClient.GetContainer(databaseName, containerName); - - for (int i = 0; i < 20; i++) + try { - ResponseMessage response = await container.ReadItemStreamAsync(Guid.NewGuid().ToString(), new Cosmos.PartitionKey(Guid.NewGuid().ToString())); - Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Container container = customClient.GetContainer(databaseName, containerName); + + for (int i = 0; i < 20; i++) + { + ResponseMessage response = await container.ReadItemStreamAsync(Guid.NewGuid().ToString(), new Cosmos.PartitionKey(Guid.NewGuid().ToString())); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + } + + mockTransportClient.VerifyAll(); + mockHttpHandler.VerifyAll(); + + Documents.TransportAddressUri failedReplica = urisVisited.First(); + + // With replica validation enabled in preview mode, the failed replica will be validated as a part of the flow, + // and because any subsequent validation/ connection will be successful, the failed replica will now be marked + // as connected, thus it will be visited more than once. However, note that when replice validation is disabled, + // no validation is done thus the URI will be marked as unhealthy as expected. Therefore the uri will be visited + // just once. + Assert.IsTrue( + enableReplicaValidation + ? urisVisited.Any(x => x.Equals(failedReplica)) + : urisVisited.Count(x => x.Equals(failedReplica)) == 1); + + urisVisited.Clear(); + delayCacheRefresh = false; + do + { + await Task.Delay(TimeSpan.FromMilliseconds(100)); + }while (!delayRefreshUnblocked); + + for (int i = 0; i < 20; i++) + { + ResponseMessage response = await container.ReadItemStreamAsync(Guid.NewGuid().ToString(), new Cosmos.PartitionKey(Guid.NewGuid().ToString())); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + } + + Assert.AreEqual(4, urisVisited.ToHashSet().Count()); + + // Clears all the setups. No network calls should be done on the next operation. + mockHttpHandler.Reset(); + mockTransportClient.Reset(); } - - mockTransportClient.VerifyAll(); - mockHttpHandler.VerifyAll(); - - Documents.TransportAddressUri failedReplica = urisVisited.First(); - Assert.AreEqual(1, urisVisited.Count(x => x.Equals(failedReplica))); - - urisVisited.Clear(); - delayCacheRefresh = false; - do + finally { - await Task.Delay(TimeSpan.FromMilliseconds(100)); - }while (!delayRefreshUnblocked); - - for (int i = 0; i < 20; i++) - { - ResponseMessage response = await container.ReadItemStreamAsync(Guid.NewGuid().ToString(), new Cosmos.PartitionKey(Guid.NewGuid().ToString())); - Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + mockTransportClient.Setup(x => x.Dispose()); } - - Assert.AreEqual(4, urisVisited.ToHashSet().Count()); - - // Clears all the setups. No network calls should be done on the next operation. - mockHttpHandler.Reset(); - mockTransportClient.Reset(); } - finally + } + finally + { + if (useEnvironmentVariable) { - mockTransportClient.Setup(x => x.Dispose()); + Environment.SetEnvironmentVariable( + variable: ConfigurationManager.ReplicaConnectivityValidationEnabled, + value: null); } } } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosClientOptionsUnitTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosClientOptionsUnitTests.cs index efb06d7cc5..37d89c389a 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosClientOptionsUnitTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosClientOptionsUnitTests.cs @@ -81,6 +81,7 @@ public void VerifyCosmosConfigurationPropertiesGetUpdated() Assert.IsNull(clientOptions.HttpClientFactory); Assert.AreNotEqual(consistencyLevel, clientOptions.ConsistencyLevel); Assert.IsFalse(clientOptions.EnablePartitionLevelFailover); + Assert.IsFalse(clientOptions.EnableAdvancedReplicaSelectionForTcp.HasValue); //Verify GetConnectionPolicy returns the correct values for default ConnectionPolicy policy = clientOptions.GetConnectionPolicy(clientId: 0); @@ -97,6 +98,7 @@ public void VerifyCosmosConfigurationPropertiesGetUpdated() Assert.IsNull(policy.HttpClientFactory); Assert.AreNotEqual(Cosmos.ConsistencyLevel.Session, clientOptions.ConsistencyLevel); Assert.IsFalse(policy.EnablePartitionLevelFailover); + Assert.IsFalse(clientOptions.EnableAdvancedReplicaSelectionForTcp.HasValue); cosmosClientBuilder.WithApplicationRegion(region) .WithConnectionModeGateway(maxConnections, webProxy) @@ -112,6 +114,7 @@ public void VerifyCosmosConfigurationPropertiesGetUpdated() cosmosClient = cosmosClientBuilder.Build(new MockDocumentClient()); clientOptions = cosmosClient.ClientOptions; + clientOptions.EnableAdvancedReplicaSelectionForTcp = true; //Verify all the values are updated Assert.AreEqual(region, clientOptions.ApplicationRegion); @@ -131,6 +134,7 @@ public void VerifyCosmosConfigurationPropertiesGetUpdated() Assert.IsTrue(clientOptions.AllowBulkExecution); Assert.AreEqual(consistencyLevel, clientOptions.ConsistencyLevel); Assert.IsTrue(clientOptions.EnablePartitionLevelFailover); + Assert.IsTrue(clientOptions.EnableAdvancedReplicaSelectionForTcp.HasValue && clientOptions.EnableAdvancedReplicaSelectionForTcp.Value); //Verify GetConnectionPolicy returns the correct values policy = clientOptions.GetConnectionPolicy(clientId: 0); @@ -145,7 +149,8 @@ public void VerifyCosmosConfigurationPropertiesGetUpdated() Assert.AreEqual((int)maxRetryWaitTime.TotalSeconds, policy.RetryOptions.MaxRetryWaitTimeInSeconds); Assert.AreEqual((Documents.ConsistencyLevel)consistencyLevel, clientOptions.GetDocumentsConsistencyLevel()); Assert.IsTrue(policy.EnablePartitionLevelFailover); - + Assert.IsTrue(clientOptions.EnableAdvancedReplicaSelectionForTcp.Value); + IReadOnlyList preferredLocations = new List() { Regions.AustraliaCentral, Regions.AustraliaCentral2 }; //Verify Direct Mode settings cosmosClientBuilder = new CosmosClientBuilder( diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayAddressCacheTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayAddressCacheTests.cs index 5116eb22de..c855599465 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayAddressCacheTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayAddressCacheTests.cs @@ -480,6 +480,75 @@ await cache.OpenConnectionsAsync( expectedTotalSuccessAddressesToOpenCount: 0); } + /// + /// Test to validate that when is called with a valid open connection handler + /// and a cancellation token that will expire with a pre-configured time, the handler method is indeed invoked and the open connection + /// operation gets cancelled successfully, if the cancellation token expires. The open connection operation succeeds if the operation + /// is finished before the cancellation token expiry time. + /// + [TestMethod] + [Owner("dkunda")] + [DataRow(1, 2, 1, 0, 3, 0, true, DisplayName = "Validate that when the cancellation token expiry time (i.e. 1 sec) is smaller than the open connection opperation duration (i.e. 2 sec)," + + "the open connection operation gets cancelled and the cancellation token is indeed respected and eventually cancelled.")] + [DataRow(3, 1, 1, 0, 3, 3, false, DisplayName = "Validate that when the cancellation token expiry time (i.e. 3 sec) is larger than the open connection opperation duration (i.e. 1 sec)," + + "the open connection operation completes successfully and the cancellation token is not cancelled.")] + public async Task OpenConnectionsAsync_WithValidOpenConnectionHandlerAndCancellationTokenExpires_ShouldInvokeHandlerMethodAndCancelToken( + int cancellationTokenTimeoutInSeconds, + int openConnectionDelayInSeconds, + int expectedTotalHandlerInvocationCount, + int expectedTotalFailedAddressesToOpenCount, + int expectedTotalReceivedAddressesCount, + int expectedTotalSuccessAddressesToOpenCount, + bool shouldCancelToken) + { + // Arrange. + FakeMessageHandler messageHandler = new (); + FakeOpenConnectionHandler fakeOpenConnectionHandler = new ( + failingIndexes: new HashSet(), + openConnectionDelayInSeconds: openConnectionDelayInSeconds); + + ContainerProperties containerProperties = ContainerProperties.CreateWithResourceId("ccZ1ANCszwk="); + containerProperties.Id = "TestId"; + containerProperties.PartitionKeyPath = "/pk"; + HttpClient httpClient = new(messageHandler) + { + Timeout = TimeSpan.FromSeconds(120) + }; + + CancellationTokenSource cts = new (TimeSpan.FromSeconds(cancellationTokenTimeoutInSeconds)); + CancellationToken token = cts.Token; + + GatewayAddressCache cache = new ( + new Uri(GatewayAddressCacheTests.DatabaseAccountApiEndpoint), + Protocol.Tcp, + this.mockTokenProvider.Object, + this.mockServiceConfigReader.Object, + MockCosmosUtil.CreateCosmosHttpClient(() => httpClient), + openConnectionsHandler: fakeOpenConnectionHandler, + suboptimalPartitionForceRefreshIntervalInSeconds: 2); + + // Act. + await cache.OpenConnectionsAsync( + databaseName: "test-database", + collection: containerProperties, + partitionKeyRangeIdentities: new List() + { + this.testPartitionKeyRangeIdentity + }, + shouldOpenRntbdChannels: true, + cancellationToken: token); + + // Assert. + GatewayAddressCacheTests.AssertOpenConnectionHandlerAttributes( + fakeOpenConnectionHandler: fakeOpenConnectionHandler, + expectedTotalFailedAddressesToOpenCount: expectedTotalFailedAddressesToOpenCount, + expectedTotalHandlerInvocationCount: expectedTotalHandlerInvocationCount, + expectedTotalReceivedAddressesCount: expectedTotalReceivedAddressesCount, + expectedTotalSuccessAddressesToOpenCount: expectedTotalSuccessAddressesToOpenCount); + + Assert.AreEqual(shouldCancelToken, token.IsCancellationRequested); + } + /// /// Test to validate that when is called with a /// valid open connection handler, the handler method is indeed invoked and an attempt is made to open @@ -931,19 +1000,8 @@ public async Task TryGetAddressesAsync_WhenReplicaVlidationEnabled_ShouldValidat MockCosmosUtil.CreateCosmosHttpClient(() => httpClient), openConnectionsHandler: fakeOpenConnectionHandler, suboptimalPartitionForceRefreshIntervalInSeconds: 2, - enableTcpConnectionEndpointRediscovery: true); - - // By default, the replica validation feature is disabled in GatewayAddressCache. Reflection is used to enable the feature - // for the purpose of this test. - FieldInfo fieldInfo = cache - .GetType() - .GetField( - name: "isReplicaAddressValidationEnabled", - bindingAttr: BindingFlags.Instance | BindingFlags.NonPublic); - - fieldInfo.SetValue( - obj: cache, - value: true); + enableTcpConnectionEndpointRediscovery: true, + replicaAddressValidationEnabled: true); DocumentServiceRequest request = DocumentServiceRequest.Create(OperationType.Invalid, ResourceType.Address, AuthorizationTokenType.Invalid); @@ -1074,7 +1132,7 @@ public async Task TryGetAddressesAsync_WhenReplicaVlidationEnabledAndUnhealthyUr FakeOpenConnectionHandler fakeOpenConnectionHandler = new ( failIndexesByAttempts: new Dictionary>() { - { 0, new HashSet() { 1 } } + { 0, new HashSet() { 2 } } }, manualResetEvent: manualResetEvent); @@ -1087,19 +1145,8 @@ public async Task TryGetAddressesAsync_WhenReplicaVlidationEnabledAndUnhealthyUr MockCosmosUtil.CreateCosmosHttpClient(() => httpClient), openConnectionsHandler: fakeOpenConnectionHandler, suboptimalPartitionForceRefreshIntervalInSeconds: 2, - enableTcpConnectionEndpointRediscovery: true); - - // By default, the replica validation feature is disabled in GatewayAddressCache. Reflection is used to enable the feature - // for the purpose of this test. - FieldInfo fieldInfo = cache - .GetType() - .GetField( - name: "isReplicaAddressValidationEnabled", - bindingAttr: BindingFlags.Instance | BindingFlags.NonPublic); - - fieldInfo.SetValue( - obj: cache, - value: true); + enableTcpConnectionEndpointRediscovery: true, + replicaAddressValidationEnabled: true); DocumentServiceRequest request = DocumentServiceRequest.Create(OperationType.Invalid, ResourceType.Address, AuthorizationTokenType.Invalid); @@ -1513,16 +1560,19 @@ public class FakeOpenConnectionHandler : IOpenConnectionsHandler private int successInvocationCounter = 0; private int totalReceivedAddressesCounter = 0; private readonly HashSet failingIndexes; + private readonly int openConnectionDelayInSeconds; private readonly bool useAttemptBasedFailingIndexs; private readonly ManualResetEvent manualResetEvent; private readonly Dictionary> failIndexesByAttempts; public FakeOpenConnectionHandler( HashSet failingIndexes, - ManualResetEvent manualResetEvent = null) + ManualResetEvent manualResetEvent = null, + int openConnectionDelayInSeconds = 0) { this.failingIndexes = failingIndexes; this.manualResetEvent = manualResetEvent; + this.openConnectionDelayInSeconds = openConnectionDelayInSeconds; } public FakeOpenConnectionHandler( @@ -1554,11 +1604,18 @@ public int GetTotalMethodInvocationCount() return this.methodInvocationCounter; } - Task IOpenConnectionsHandler.TryOpenRntbdChannelsAsync( + async Task IOpenConnectionsHandler.TryOpenRntbdChannelsAsync( IEnumerable addresses) { int idx = 0; + this.methodInvocationCounter++; this.totalReceivedAddressesCounter += addresses.Count(); + + if (this.openConnectionDelayInSeconds > 0) + { + await Task.Delay(TimeSpan.FromSeconds(this.openConnectionDelayInSeconds)); + } + foreach (TransportAddressUri transportAddress in addresses) { if (this.useAttemptBasedFailingIndexs) @@ -1587,9 +1644,7 @@ Task IOpenConnectionsHandler.TryOpenRntbdChannelsAsync( idx++; } - this.methodInvocationCounter++; this.manualResetEvent?.Set(); - return Task.CompletedTask; } private void ExecuteSuccessCondition( diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Linq/CosmosLinqJsonConverterTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Linq/CosmosLinqJsonConverterTests.cs index ca2e12c8da..8e50a21dd0 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Linq/CosmosLinqJsonConverterTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Linq/CosmosLinqJsonConverterTests.cs @@ -5,6 +5,7 @@ namespace Microsoft.Azure.Cosmos.Linq { using System; + using System.Collections.Generic; using System.Globalization; using System.IO; using System.Linq; @@ -152,6 +153,35 @@ public override void WriteJson(JsonWriter writer, object value, JsonSerializer s } } + [TestMethod] + public void TestNewtonsoftExtensionDataQuery() + { + Expression> expr = a => (string)a.NewtonsoftExtensionData["foo"] == "bar"; + string sql = SqlTranslator.TranslateExpression(expr.Body); + + Assert.AreEqual("(a[\"foo\"] = \"bar\")", sql); + } + + [TestMethod] + public void TestSystemTextJsonExtensionDataQuery() + { + Expression> expr = a => ((object)a.NetExtensionData["foo"]) == "bar"; + string sql = SqlTranslator.TranslateExpression(expr.Body); + + // TODO: This is a limitation in the translator. It should be able to handle STJ extension data, if a custom + // JSON serializer is specified. + Assert.AreEqual("(a[\"NetExtensionData\"][\"foo\"] = \"bar\")", sql); + } + + class DocumentWithExtensionData + { + [Newtonsoft.Json.JsonExtensionData(ReadData = true, WriteData = true)] + public Dictionary NewtonsoftExtensionData { get; set; } + + [System.Text.Json.Serialization.JsonExtensionData()] + public Dictionary NetExtensionData { get; set; } + } + /// // See: https://github.com/Azure/azure-cosmos-dotnet-v3/blob/master/Microsoft.Azure.Cosmos.Samples/Usage/SystemTextJson/CosmosSystemTextJsonSerializer.cs /// diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/ContinuationTokens/OrderByQueryResultTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/ContinuationTokens/OrderByQueryResultTests.cs index 86093aa296..7207f897be 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/ContinuationTokens/OrderByQueryResultTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/ContinuationTokens/OrderByQueryResultTests.cs @@ -31,11 +31,7 @@ public void TestOrderByUndefined() CosmosArray documents = CosmosQueryClientCore.ParseElementsFromRestStream( memoryStream, - Documents.ResourceType.Document, - new CosmosSerializationFormatOptions( - "JsonText", - (content) => JsonNavigator.Create(content), - () => JsonWriter.Create(JsonSerializationFormat.Text))); + Documents.ResourceType.Document); List orderByQueryResults = documents.Select(x => new OrderByQueryResult(x)).ToList(); Assert.AreEqual(14, orderByQueryResults.Count); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/FeedOptionTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/FeedOptionTests.cs index 54c965cce8..703636ca81 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/FeedOptionTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/FeedOptionTests.cs @@ -50,6 +50,31 @@ public void TestCopyConstructor() _ = new FeedOptions(fo); } + [TestMethod] + public async Task TestSupportedSerializationFormats() + { + FeedOptions feedOptions = new FeedOptions(); + Mock client = new Mock(MockBehavior.Strict); + client.Setup(x => x.GetDefaultConsistencyLevelAsync()).Returns(Task.FromResult(ConsistencyLevel.BoundedStaleness)); + client.Setup(x => x.GetDesiredConsistencyLevelAsync()).Returns(Task.FromResult(ConsistencyLevel.BoundedStaleness)); + Expression> randomFunc = x => x * 2; + + TestQueryExecutionContext testQueryExecutionContext = new TestQueryExecutionContext( + client.Object, + ResourceType.Document, + typeof(TestQueryExecutionContext), + randomFunc, + feedOptions, + string.Empty, + true, Guid.NewGuid()); + INameValueCollection headers = await testQueryExecutionContext.CreateCommonHeadersAsync(feedOptions); + Assert.AreEqual("JsonText,CosmosBinary", headers[HttpConstants.HttpHeaders.SupportedSerializationFormats]); + + feedOptions.SupportedSerializationFormats = SupportedSerializationFormats.CosmosBinary | SupportedSerializationFormats.HybridRow; + headers = await testQueryExecutionContext.CreateCommonHeadersAsync(feedOptions); + Assert.AreEqual("CosmosBinary, HybridRow", headers[HttpConstants.HttpHeaders.SupportedSerializationFormats]); + } + internal class TestQueryExecutionContext : DocumentQueryExecutionContextBase { public TestQueryExecutionContext( diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/RequestEventHandlerTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/RequestEventHandlerTests.cs index f5602a1f29..9a19fb4a90 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/RequestEventHandlerTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/RequestEventHandlerTests.cs @@ -82,7 +82,7 @@ private StoreClient GetMockStoreClient() TransportClient mockTransportClient = this.GetMockTransportClient(); ISessionContainer sessionContainer = new SessionContainer(string.Empty); - StoreReader storeReader = new StoreReader(mockTransportClient, addressSelector, new AddressEnumerator(), sessionContainer); + StoreReader storeReader = new StoreReader(mockTransportClient, addressSelector, new AddressEnumerator(), sessionContainer, false); Mock mockAuthorizationTokenProvider = new Mock(); mockAuthorizationTokenProvider.Setup(provider => provider.AddSystemAuthorizationHeaderAsync( diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/StoreReaderTest.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/StoreReaderTest.cs index 609817f3de..ac9d3f95f2 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/StoreReaderTest.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/StoreReaderTest.cs @@ -536,7 +536,8 @@ public void StoreReaderBarrierTest() new StoreReader(mockTransportClient, addressSelector, new AddressEnumerator(), - sessionContainer); + sessionContainer, + enableReplicaValidation: false); // reads always go to read quorum (2) replicas int replicaCountToRead = 2; @@ -611,14 +612,14 @@ public void GlobalStrongConsistentWriteMockTest() for (int i = 0; i < addressInformation.Length; i++) { TransportClient mockTransportClient = this.GetMockTransportClientForGlobalStrongWrites(addressInformation, i, false, false, false); - StoreReader storeReader = new StoreReader(mockTransportClient, addressSelector, new AddressEnumerator(), sessionContainer); - ConsistencyWriter consistencyWriter = new ConsistencyWriter(addressSelector, sessionContainer, mockTransportClient, mockServiceConfigReader.Object, mockAuthorizationTokenProvider.Object, false); + StoreReader storeReader = new StoreReader(mockTransportClient, addressSelector, new AddressEnumerator(), sessionContainer, false); + ConsistencyWriter consistencyWriter = new ConsistencyWriter(addressSelector, sessionContainer, mockTransportClient, mockServiceConfigReader.Object, mockAuthorizationTokenProvider.Object, false, false); StoreResponse response = consistencyWriter.WriteAsync(entity, new TimeoutHelper(TimeSpan.FromSeconds(30)), false).Result; Assert.AreEqual(100, response.LSN); //globalCommittedLsn never catches up in this case mockTransportClient = this.GetMockTransportClientForGlobalStrongWrites(addressInformation, i, true, false, false); - consistencyWriter = new ConsistencyWriter(addressSelector, sessionContainer, mockTransportClient, mockServiceConfigReader.Object, mockAuthorizationTokenProvider.Object, false); + consistencyWriter = new ConsistencyWriter(addressSelector, sessionContainer, mockTransportClient, mockServiceConfigReader.Object, mockAuthorizationTokenProvider.Object, false, false); try { response = consistencyWriter.WriteAsync(entity, new TimeoutHelper(TimeSpan.FromSeconds(30)), false).Result; @@ -629,17 +630,17 @@ public void GlobalStrongConsistentWriteMockTest() } mockTransportClient = this.GetMockTransportClientForGlobalStrongWrites(addressInformation, i, false, true, false); - consistencyWriter = new ConsistencyWriter(addressSelector, sessionContainer, mockTransportClient, mockServiceConfigReader.Object, mockAuthorizationTokenProvider.Object, false); + consistencyWriter = new ConsistencyWriter(addressSelector, sessionContainer, mockTransportClient, mockServiceConfigReader.Object, mockAuthorizationTokenProvider.Object, false, false); response = consistencyWriter.WriteAsync(entity, new TimeoutHelper(TimeSpan.FromSeconds(30)), false).Result; Assert.AreEqual(100, response.LSN); mockTransportClient = this.GetMockTransportClientForGlobalStrongWrites(addressInformation, i, false, true, true); - consistencyWriter = new ConsistencyWriter(addressSelector, sessionContainer, mockTransportClient, mockServiceConfigReader.Object, mockAuthorizationTokenProvider.Object, false); + consistencyWriter = new ConsistencyWriter(addressSelector, sessionContainer, mockTransportClient, mockServiceConfigReader.Object, mockAuthorizationTokenProvider.Object, false, false); response = consistencyWriter.WriteAsync(entity, new TimeoutHelper(TimeSpan.FromSeconds(30)), false).Result; Assert.AreEqual(100, response.LSN); mockTransportClient = this.GetMockTransportClientForGlobalStrongWrites(addressInformation, i, false, false, true); - consistencyWriter = new ConsistencyWriter(addressSelector, sessionContainer, mockTransportClient, mockServiceConfigReader.Object, mockAuthorizationTokenProvider.Object, false); + consistencyWriter = new ConsistencyWriter(addressSelector, sessionContainer, mockTransportClient, mockServiceConfigReader.Object, mockAuthorizationTokenProvider.Object, false, false); response = consistencyWriter.WriteAsync(entity, new TimeoutHelper(TimeSpan.FromSeconds(30)), false).Result; Assert.AreEqual(100, response.LSN); } @@ -703,7 +704,8 @@ public void GlobalStrongConsistencyMockTest() new StoreReader(mockTransportClient, addressSelector, new AddressEnumerator(), - sessionContainer); + sessionContainer, + false); Mock mockAuthorizationTokenProvider = new Mock(); mockAuthorizationTokenProvider.Setup(provider => provider.AddSystemAuthorizationHeaderAsync( @@ -746,7 +748,8 @@ public void GlobalStrongConsistencyMockTest() new StoreReader(mockTransportClient, addressSelector, new AddressEnumerator(), - sessionContainer); + sessionContainer, + false); Mock mockAuthorizationTokenProvider = new Mock(); mockAuthorizationTokenProvider.Setup(provider => provider.AddSystemAuthorizationHeaderAsync( @@ -798,7 +801,8 @@ public void GlobalStrongConsistencyMockTest() new StoreReader(mockTransportClient, addressSelector, new AddressEnumerator(), - sessionContainer); + sessionContainer, + false); Mock mockAuthorizationTokenProvider = new Mock(); mockAuthorizationTokenProvider.Setup(provider => provider.AddSystemAuthorizationHeaderAsync( diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/DiagnosticsFilterHelperTest.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/DiagnosticsFilterHelperTest.cs index c04c0d6faf..e345394265 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/DiagnosticsFilterHelperTest.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/DiagnosticsFilterHelperTest.cs @@ -46,7 +46,7 @@ public void CheckReturnFalseOnSuccessAndLowerLatencyThanConfiguredConfig() Assert.IsFalse( DiagnosticsFilterHelper - .IsTracingNeeded(distributedTracingOptions, OperationType.Read, response), + .IsLatencyThresholdCrossed(distributedTracingOptions, OperationType.Read, response), $" Response time is {response.Diagnostics.GetClientElapsedTime().Milliseconds}ms " + $"and Configured threshold value is {distributedTracingOptions.LatencyThresholdForDiagnosticEvent.Value.Milliseconds}ms " + $"and Is response Success : {response.StatusCode.IsSuccess()}" ); @@ -70,8 +70,8 @@ public void CheckReturnTrueOnFailedStatusCode() }; Assert.IsTrue( - DiagnosticsFilterHelper - .IsTracingNeeded(distributedTracingOptions, OperationType.Read, response), + !DiagnosticsFilterHelper + .IsSuccessfulResponse(response), $" Response time is {response.Diagnostics.GetClientElapsedTime().Milliseconds}ms " + $"and Configured threshold value is {distributedTracingOptions.LatencyThresholdForDiagnosticEvent.Value.Milliseconds}ms " + $"and Is response Success : {response.StatusCode.IsSuccess()}"); diff --git a/changelog.md b/changelog.md index bd5c29c32c..ab733a4137 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,6 @@ ## Recommended version -The **minimum recommended version is [3.33.0](#3.33.0)**. +The **minimum recommended version is [3.33.0](#3.33.0) when using Direct mode and [3.35.1](#3.35.1) for Gateway mode**. Make sure that your applications, when using the .NET V3 SDK, are using at least the version described here to have all the critical fixes. @@ -12,9 +12,35 @@ Preview features are treated as a separate branch and will not be included in th The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -### [3.35.0-preview](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.35.0-preview) - 2023-06-19 -### Added +### [3.35.2-preview](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.35.2-preview) - 2023-07-17 + +#### Fixed +- [3973](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3973) Application Insights Integration: Fixes event generation for failed requests + +#### Added +- [3951](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3951) Upgrade Resiliency: Adds Code to Enable Replica Validation Feature By Default for Preview + +### [3.35.2](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.35.2) - 2023-07-17 + +#### Fixed +- [3917](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3917) Query: Fixes malformed continuation token exception type and message +- [3969](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3969) Diagnostics: Fixes verbose levels for "Operation will NOT be retried" + +#### Added +- [3668](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3668) Query : Adds string comparison alternative when converting LINQ to SQL (Thanks [@ernesto1596](https://github.com/ernesto1596)) +- [3834](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3834) Query : Adds support for newtonsoft member access via ExtensionData (Thanks [@onionhammer](https://github.com/onionhammer)) +- [3939](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3939) CreateAndInitializeAsync: Adds Code to Optimize Rntbd Open Connection Logic to Open Connections in Parallel + +### [3.35.1-preview](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.35.1-preview) - 2023-06-27 +### [3.35.1](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.35.1) - 2023-06-27 + +#### Fixed +- [3944](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3944) Availability: Fixes HttpTimeoutPolicies to not accidentally suppress retries + +### [3.35.0-preview](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.35.0-preview) - 2023-06-19 + +#### Added - [3836](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3836) Integrated cache: Adds BypassIntegratedCache to DedicatedGatewayRequestOptions - [3909](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3909) Query: Adds EnableOptimisticDirectExecution in QueryRequestOptions enabled by default diff --git a/docs/LocalQuorum.md b/docs/LocalQuorum.md new file mode 100644 index 0000000000..5ca45e9055 --- /dev/null +++ b/docs/LocalQuorum.md @@ -0,0 +1,59 @@ +> # NOT SUPPORTED FOR PRODUCTION USAGE +> # ONLY INTERNAL, DEVELOPMENT OR EXPERIMENTAL USAGE ONLY + + +## Context +Distributed databases that rely on replication for high availability, low latency, or both, must make a fundamental tradeoff between the read consistency, availability, latency, and throughput. + +The linearizability of the strong consistency model is the gold standard of data programmability. But it adds a steep price from higher write latencies due to data having to replicate and commit across large distances. Strong consistency may also suffer from reduced availability (during failures) because data can't replicate and commit in every region. Eventual consistency offers higher availability and better performance, but it's more difficult to program applications because data may not be consistent across all regions (eventual reads are not guaranteed to be monotonic). + + +Please refer to [public documentation](https://learn.microsoft.com/en-us/azure/cosmos-db/consistency-levels) for more details. + + +Many applications can benefit from having a read-write model like below + +| Operation | Write-Region | Replicated-Regions | +|---|---|---| +|Write | Write high availabillity in write region
vs BoundedStaleness: write un-availability when bounds are violated | Eventual replication: Asynchronous non-blocking, possibly unbounded staleness
vs BoundedStaleness: staleness limited by bounds | +|Read |**Single write region**: Read my writes
**Multiple write regions**: read-my-writes from the region of writes, otherwise eventual
Monotonic reads
No sessionToken management| **Single write region**: Eventual read
**Multiple write regions**: read-my-writes from the region of writes, otherwise eventual
Monotonic reads
No sessionToken management | + +> ### NOTE: cross-region reads will violate the monotonic reads guarantee + + +## How-TO +It involves three stages + +#### Create CosmosDB account with Eventual/ConsistentPrefix/Session consistency + +#### Enabling/opt-in ability to upgrade consistency level +SDK version: MA [3.35.1](https://github.com/Azure/azure-cosmos-dotnet-v3/blob/master/changelog.md#-3351---2023-06-27) or [minimum recommended version](https://github.com/Azure/azure-cosmos-dotnet-v3/blob/master/changelog.md#-recommended-version) + +```C# +CosmosClientOptions clientOptions = new CosmosClientOptions(); +var upgradeConsistencyProperty = clientOptions.GetType().GetProperty("EnableUpgradeConsistencyToLocalQuorum", BindingFlags.NonPublic | BindingFlags.Instance); +upgradeConsistencyProperty.SetValue(clientOptions, true); + +CosmosClient cosmosClient = new CosmosClient(..., clientOptions); +``` + +#### Per request upgrade consistency to Bounded +> ###### Please note that Bounded here is only used as HINT for SDK to do quorum reads +> ###### It will not impact CosmosDB account or write consistency levels + +```C# +ItemRequestOptions requestOption = new ItemRequestOptions(); +requestOption.ConsistencyLevel = ConsistencyLevel.Bounded; + +T item = await container.ReadItemAsync(docId, new PartitionKey(docPartitionKey), requestOption); +``` + +```C# +QueryRequestOptions requestOption = new QueryRequestOptions(); +requestOption.ConsistencyLevel = ConsistencyLevel.Bounded; + +await container.GetItemQueryIterator(queryText, continuationToken, requestOption); +``` + +> #### Please use Bounded only for per request options as pattern +> #### Single master account possibly Strong == Bounded (**TBD**) \ No newline at end of file diff --git a/docs/observability.md b/docs/observability.md index 50ce14d33c..1da6f02e44 100644 --- a/docs/observability.md +++ b/docs/observability.md @@ -5,6 +5,11 @@ **Source to capture operation level activities**: _Azure.Cosmos.Operation_\ **Source to capture event with request diagnostics** : _Azure-Cosmos-Operation-Request-Diagnostics_ +There are 3 kind of events generated: +1. LatencyOverThrehold: If particular operation latency is more than threshold. +2. FailedRequest: If particular reequest failed. Status codes not considered as failed, are anything below 300, 404/0, 304/0, 409/0, and 412/0 +3. Exception: If any exception occured. + For detail about usage of this feature, please see the [Azure Cosmos DB SDK observability](https://learn.microsoft.com/azure/cosmos-db/nosql/sdk-observability?tabs=dotnet) ```mermaid @@ -104,4 +109,4 @@ flowchart TD ``` ### Limitations -1. AAD Support is not available. \ No newline at end of file +1. AAD Support is not available.