diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CassandraResourcesOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CassandraResourcesOperations.cs index a51b36dcfc43..ee0dc9198a7f 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CassandraResourcesOperations.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CassandraResourcesOperations.cs @@ -1812,7 +1812,6 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -1821,10 +1820,6 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 200 && (int)_statusCode != 202)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); @@ -2047,7 +2042,6 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -2056,10 +2050,6 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 200) && !((int)_statusCode != 204)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); @@ -2286,7 +2276,6 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -2295,10 +2284,6 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 200 && (int)_statusCode != 202)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); @@ -2551,7 +2536,6 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -2560,10 +2544,6 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 200 && (int)_statusCode != 202)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); @@ -2795,7 +2775,6 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -2804,10 +2783,6 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 202 && (int)_statusCode != 204)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); @@ -3043,7 +3018,6 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -3052,10 +3026,6 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 200 && (int)_statusCode != 202)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CosmosDBManagementClient.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CosmosDBManagementClient.cs index 3c0fc422cbad..fb66aaca48aa 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CosmosDBManagementClient.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CosmosDBManagementClient.cs @@ -164,6 +164,11 @@ public partial class CosmosDBManagementClient : ServiceClient public virtual IGremlinResourcesOperations GremlinResources { get; private set; } + /// + /// Gets the INotebookWorkspacesOperations. + /// + public virtual INotebookWorkspacesOperations NotebookWorkspaces { get; private set; } + /// /// Gets the IPrivateLinkResourcesOperations. /// @@ -433,6 +438,7 @@ private void Initialize() TableResources = new TableResourcesOperations(this); CassandraResources = new CassandraResourcesOperations(this); GremlinResources = new GremlinResourcesOperations(this); + NotebookWorkspaces = new NotebookWorkspacesOperations(this); PrivateLinkResources = new PrivateLinkResourcesOperations(this); PrivateEndpointConnections = new PrivateEndpointConnectionsOperations(this); BaseUri = new System.Uri("https://management.azure.com"); diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/DatabaseAccountsOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/DatabaseAccountsOperations.cs index 9c04c2e5ac24..be434e75f2cc 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/DatabaseAccountsOperations.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/DatabaseAccountsOperations.cs @@ -2769,7 +2769,6 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -2778,10 +2777,6 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 200)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); @@ -3017,7 +3012,6 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -3026,10 +3020,6 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 200)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); @@ -3243,7 +3233,6 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -3252,10 +3241,6 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 202 && (int)_statusCode != 204)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/GremlinResourcesOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/GremlinResourcesOperations.cs index 1620990f0694..0b8b1c78d94c 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/GremlinResourcesOperations.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/GremlinResourcesOperations.cs @@ -1810,7 +1810,6 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -1819,10 +1818,6 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 200 && (int)_statusCode != 202)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); @@ -2045,7 +2040,6 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -2054,10 +2048,6 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 202 && (int)_statusCode != 204)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); @@ -2284,7 +2274,6 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -2293,10 +2282,6 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 200 && (int)_statusCode != 202)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); @@ -2549,7 +2534,6 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -2558,10 +2542,6 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 200 && (int)_statusCode != 202)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); @@ -2793,7 +2773,6 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -2802,10 +2781,6 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 202 && (int)_statusCode != 204)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); @@ -3041,7 +3016,6 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -3050,10 +3024,6 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 200 && (int)_statusCode != 202)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/ICosmosDBManagementClient.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/ICosmosDBManagementClient.cs index e1cbd9db1c2e..b79506cbc401 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/ICosmosDBManagementClient.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/ICosmosDBManagementClient.cs @@ -159,6 +159,11 @@ public partial interface ICosmosDBManagementClient : System.IDisposable /// IGremlinResourcesOperations GremlinResources { get; } + /// + /// Gets the INotebookWorkspacesOperations. + /// + INotebookWorkspacesOperations NotebookWorkspaces { get; } + /// /// Gets the IPrivateLinkResourcesOperations. /// diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/INotebookWorkspacesOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/INotebookWorkspacesOperations.cs new file mode 100644 index 000000000000..9f9d6d4dfeb7 --- /dev/null +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/INotebookWorkspacesOperations.cs @@ -0,0 +1,285 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.CosmosDB +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// NotebookWorkspacesOperations operations. + /// + public partial interface INotebookWorkspacesOperations + { + /// + /// Gets the notebook workspace resources of an existing Cosmos DB + /// account. + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByDatabaseAccountWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the notebook workspace for a Cosmos DB account. + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates the notebook workspace for a Cosmos DB account. + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes the notebook workspace for a Cosmos DB account. + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Retrieves the connection info for the notebook workspace + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> ListConnectionInfoWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Regenerates the auth token for the notebook workspace + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task RegenerateAuthTokenWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Starts the notebook workspace + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task StartWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates the notebook workspace for a Cosmos DB account. + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes the notebook workspace for a Cosmos DB account. + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Regenerates the auth token for the notebook workspace + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginRegenerateAuthTokenWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Starts the notebook workspace + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginStartWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/CassandraKeyspaceGetPropertiesOptions.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/CassandraKeyspaceGetPropertiesOptions.cs new file mode 100644 index 000000000000..cb24390abb9c --- /dev/null +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/CassandraKeyspaceGetPropertiesOptions.cs @@ -0,0 +1,45 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.CosmosDB.Models +{ + using System.Linq; + + public partial class CassandraKeyspaceGetPropertiesOptions : OptionsResource + { + /// + /// Initializes a new instance of the + /// CassandraKeyspaceGetPropertiesOptions class. + /// + public CassandraKeyspaceGetPropertiesOptions() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// CassandraKeyspaceGetPropertiesOptions class. + /// + /// Value of the Cosmos DB resource + /// throughput. Use the ThroughputSetting resource when retrieving + /// offer details. + public CassandraKeyspaceGetPropertiesOptions(int? throughput = default(int?)) + : base(throughput) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/CassandraKeyspaceGetResults.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/CassandraKeyspaceGetResults.cs index 4cf74824ad86..34d756d6cd7d 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/CassandraKeyspaceGetResults.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/CassandraKeyspaceGetResults.cs @@ -42,10 +42,11 @@ public CassandraKeyspaceGetResults() /// The type of Azure resource. /// The location of the resource group to which /// the resource belongs. - public CassandraKeyspaceGetResults(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), CassandraKeyspaceGetPropertiesResource resource = default(CassandraKeyspaceGetPropertiesResource)) + public CassandraKeyspaceGetResults(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), CassandraKeyspaceGetPropertiesResource resource = default(CassandraKeyspaceGetPropertiesResource), CassandraKeyspaceGetPropertiesOptions options = default(CassandraKeyspaceGetPropertiesOptions)) : base(id, name, type, location, tags) { Resource = resource; + Options = options; CustomInit(); } @@ -59,6 +60,11 @@ public CassandraKeyspaceGetResults() [JsonProperty(PropertyName = "properties.resource")] public CassandraKeyspaceGetPropertiesResource Resource { get; set; } + /// + /// + [JsonProperty(PropertyName = "properties.options")] + public CassandraKeyspaceGetPropertiesOptions Options { get; set; } + /// /// Validate the object. /// diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/CassandraTableGetPropertiesOptions.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/CassandraTableGetPropertiesOptions.cs new file mode 100644 index 000000000000..e881fa2d015d --- /dev/null +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/CassandraTableGetPropertiesOptions.cs @@ -0,0 +1,45 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.CosmosDB.Models +{ + using System.Linq; + + public partial class CassandraTableGetPropertiesOptions : OptionsResource + { + /// + /// Initializes a new instance of the + /// CassandraTableGetPropertiesOptions class. + /// + public CassandraTableGetPropertiesOptions() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// CassandraTableGetPropertiesOptions class. + /// + /// Value of the Cosmos DB resource + /// throughput. Use the ThroughputSetting resource when retrieving + /// offer details. + public CassandraTableGetPropertiesOptions(int? throughput = default(int?)) + : base(throughput) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/CassandraTableGetResults.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/CassandraTableGetResults.cs index 4b5478d478c4..bbe765553a15 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/CassandraTableGetResults.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/CassandraTableGetResults.cs @@ -40,10 +40,11 @@ public CassandraTableGetResults() /// The type of Azure resource. /// The location of the resource group to which /// the resource belongs. - public CassandraTableGetResults(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), CassandraTableGetPropertiesResource resource = default(CassandraTableGetPropertiesResource)) + public CassandraTableGetResults(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), CassandraTableGetPropertiesResource resource = default(CassandraTableGetPropertiesResource), CassandraTableGetPropertiesOptions options = default(CassandraTableGetPropertiesOptions)) : base(id, name, type, location, tags) { Resource = resource; + Options = options; CustomInit(); } @@ -57,6 +58,11 @@ public CassandraTableGetResults() [JsonProperty(PropertyName = "properties.resource")] public CassandraTableGetPropertiesResource Resource { get; set; } + /// + /// + [JsonProperty(PropertyName = "properties.options")] + public CassandraTableGetPropertiesOptions Options { get; set; } + /// /// Validate the object. /// diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/CreateUpdateOptions.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/CreateUpdateOptions.cs index d5fc7205aa3f..7ccd52085168 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/CreateUpdateOptions.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/CreateUpdateOptions.cs @@ -53,6 +53,7 @@ public CreateUpdateOptions() /// Gets or sets unmatched properties from the message are deserialized /// this collection /// + [JsonExtensionData] public IDictionary AdditionalProperties { get; set; } /// diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/GremlinDatabaseGetPropertiesOptions.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/GremlinDatabaseGetPropertiesOptions.cs new file mode 100644 index 000000000000..b966aff4f441 --- /dev/null +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/GremlinDatabaseGetPropertiesOptions.cs @@ -0,0 +1,45 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.CosmosDB.Models +{ + using System.Linq; + + public partial class GremlinDatabaseGetPropertiesOptions : OptionsResource + { + /// + /// Initializes a new instance of the + /// GremlinDatabaseGetPropertiesOptions class. + /// + public GremlinDatabaseGetPropertiesOptions() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// GremlinDatabaseGetPropertiesOptions class. + /// + /// Value of the Cosmos DB resource + /// throughput. Use the ThroughputSetting resource when retrieving + /// offer details. + public GremlinDatabaseGetPropertiesOptions(int? throughput = default(int?)) + : base(throughput) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/GremlinDatabaseGetResults.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/GremlinDatabaseGetResults.cs index 313c16cf09d6..9a89af0bd5ea 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/GremlinDatabaseGetResults.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/GremlinDatabaseGetResults.cs @@ -40,10 +40,11 @@ public GremlinDatabaseGetResults() /// The type of Azure resource. /// The location of the resource group to which /// the resource belongs. - public GremlinDatabaseGetResults(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), GremlinDatabaseGetPropertiesResource resource = default(GremlinDatabaseGetPropertiesResource)) + public GremlinDatabaseGetResults(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), GremlinDatabaseGetPropertiesResource resource = default(GremlinDatabaseGetPropertiesResource), GremlinDatabaseGetPropertiesOptions options = default(GremlinDatabaseGetPropertiesOptions)) : base(id, name, type, location, tags) { Resource = resource; + Options = options; CustomInit(); } @@ -57,6 +58,11 @@ public GremlinDatabaseGetResults() [JsonProperty(PropertyName = "properties.resource")] public GremlinDatabaseGetPropertiesResource Resource { get; set; } + /// + /// + [JsonProperty(PropertyName = "properties.options")] + public GremlinDatabaseGetPropertiesOptions Options { get; set; } + /// /// Validate the object. /// diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/GremlinGraphGetPropertiesOptions.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/GremlinGraphGetPropertiesOptions.cs new file mode 100644 index 000000000000..f0e65250da0c --- /dev/null +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/GremlinGraphGetPropertiesOptions.cs @@ -0,0 +1,45 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.CosmosDB.Models +{ + using System.Linq; + + public partial class GremlinGraphGetPropertiesOptions : OptionsResource + { + /// + /// Initializes a new instance of the GremlinGraphGetPropertiesOptions + /// class. + /// + public GremlinGraphGetPropertiesOptions() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the GremlinGraphGetPropertiesOptions + /// class. + /// + /// Value of the Cosmos DB resource + /// throughput. Use the ThroughputSetting resource when retrieving + /// offer details. + public GremlinGraphGetPropertiesOptions(int? throughput = default(int?)) + : base(throughput) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/GremlinGraphGetResults.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/GremlinGraphGetResults.cs index 9989bf70f8b1..a0736cbceec3 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/GremlinGraphGetResults.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/GremlinGraphGetResults.cs @@ -40,10 +40,11 @@ public GremlinGraphGetResults() /// The type of Azure resource. /// The location of the resource group to which /// the resource belongs. - public GremlinGraphGetResults(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), GremlinGraphGetPropertiesResource resource = default(GremlinGraphGetPropertiesResource)) + public GremlinGraphGetResults(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), GremlinGraphGetPropertiesResource resource = default(GremlinGraphGetPropertiesResource), GremlinGraphGetPropertiesOptions options = default(GremlinGraphGetPropertiesOptions)) : base(id, name, type, location, tags) { Resource = resource; + Options = options; CustomInit(); } @@ -57,6 +58,11 @@ public GremlinGraphGetResults() [JsonProperty(PropertyName = "properties.resource")] public GremlinGraphGetPropertiesResource Resource { get; set; } + /// + /// + [JsonProperty(PropertyName = "properties.options")] + public GremlinGraphGetPropertiesOptions Options { get; set; } + /// /// Validate the object. /// diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/MongoDBCollectionGetPropertiesOptions.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/MongoDBCollectionGetPropertiesOptions.cs new file mode 100644 index 000000000000..67aad07ad142 --- /dev/null +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/MongoDBCollectionGetPropertiesOptions.cs @@ -0,0 +1,45 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.CosmosDB.Models +{ + using System.Linq; + + public partial class MongoDBCollectionGetPropertiesOptions : OptionsResource + { + /// + /// Initializes a new instance of the + /// MongoDBCollectionGetPropertiesOptions class. + /// + public MongoDBCollectionGetPropertiesOptions() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// MongoDBCollectionGetPropertiesOptions class. + /// + /// Value of the Cosmos DB resource + /// throughput. Use the ThroughputSetting resource when retrieving + /// offer details. + public MongoDBCollectionGetPropertiesOptions(int? throughput = default(int?)) + : base(throughput) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/MongoDBCollectionGetResults.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/MongoDBCollectionGetResults.cs index e1718b52cf27..175756c84be5 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/MongoDBCollectionGetResults.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/MongoDBCollectionGetResults.cs @@ -42,10 +42,11 @@ public MongoDBCollectionGetResults() /// The type of Azure resource. /// The location of the resource group to which /// the resource belongs. - public MongoDBCollectionGetResults(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), MongoDBCollectionGetPropertiesResource resource = default(MongoDBCollectionGetPropertiesResource)) + public MongoDBCollectionGetResults(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), MongoDBCollectionGetPropertiesResource resource = default(MongoDBCollectionGetPropertiesResource), MongoDBCollectionGetPropertiesOptions options = default(MongoDBCollectionGetPropertiesOptions)) : base(id, name, type, location, tags) { Resource = resource; + Options = options; CustomInit(); } @@ -59,6 +60,11 @@ public MongoDBCollectionGetResults() [JsonProperty(PropertyName = "properties.resource")] public MongoDBCollectionGetPropertiesResource Resource { get; set; } + /// + /// + [JsonProperty(PropertyName = "properties.options")] + public MongoDBCollectionGetPropertiesOptions Options { get; set; } + /// /// Validate the object. /// diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/MongoDBDatabaseGetPropertiesOptions.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/MongoDBDatabaseGetPropertiesOptions.cs new file mode 100644 index 000000000000..438d8c76fc47 --- /dev/null +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/MongoDBDatabaseGetPropertiesOptions.cs @@ -0,0 +1,45 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.CosmosDB.Models +{ + using System.Linq; + + public partial class MongoDBDatabaseGetPropertiesOptions : OptionsResource + { + /// + /// Initializes a new instance of the + /// MongoDBDatabaseGetPropertiesOptions class. + /// + public MongoDBDatabaseGetPropertiesOptions() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// MongoDBDatabaseGetPropertiesOptions class. + /// + /// Value of the Cosmos DB resource + /// throughput. Use the ThroughputSetting resource when retrieving + /// offer details. + public MongoDBDatabaseGetPropertiesOptions(int? throughput = default(int?)) + : base(throughput) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/MongoDBDatabaseGetResults.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/MongoDBDatabaseGetResults.cs index 74e34cd999ed..1221e26766ac 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/MongoDBDatabaseGetResults.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/MongoDBDatabaseGetResults.cs @@ -40,10 +40,11 @@ public MongoDBDatabaseGetResults() /// The type of Azure resource. /// The location of the resource group to which /// the resource belongs. - public MongoDBDatabaseGetResults(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), MongoDBDatabaseGetPropertiesResource resource = default(MongoDBDatabaseGetPropertiesResource)) + public MongoDBDatabaseGetResults(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), MongoDBDatabaseGetPropertiesResource resource = default(MongoDBDatabaseGetPropertiesResource), MongoDBDatabaseGetPropertiesOptions options = default(MongoDBDatabaseGetPropertiesOptions)) : base(id, name, type, location, tags) { Resource = resource; + Options = options; CustomInit(); } @@ -57,6 +58,11 @@ public MongoDBDatabaseGetResults() [JsonProperty(PropertyName = "properties.resource")] public MongoDBDatabaseGetPropertiesResource Resource { get; set; } + /// + /// + [JsonProperty(PropertyName = "properties.options")] + public MongoDBDatabaseGetPropertiesOptions Options { get; set; } + /// /// Validate the object. /// diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/NotebookWorkspace.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/NotebookWorkspace.cs new file mode 100644 index 000000000000..5df0b25fbfb5 --- /dev/null +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/NotebookWorkspace.cs @@ -0,0 +1,70 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.CosmosDB.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// A notebook workspace resource + /// + [Rest.Serialization.JsonTransformation] + public partial class NotebookWorkspace : ARMProxyResource + { + /// + /// Initializes a new instance of the NotebookWorkspace class. + /// + public NotebookWorkspace() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NotebookWorkspace class. + /// + /// The unique resource identifier of the database + /// account. + /// The name of the database account. + /// The type of Azure resource. + /// Specifies the endpoint of + /// Notebook server. + /// Status of the notebook workspace. Possible + /// values are: Creating, Online, Deleting, Failed, Updating. + public NotebookWorkspace(string id = default(string), string name = default(string), string type = default(string), string notebookServerEndpoint = default(string), string status = default(string)) + : base(id, name, type) + { + NotebookServerEndpoint = notebookServerEndpoint; + Status = status; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets specifies the endpoint of Notebook server. + /// + [JsonProperty(PropertyName = "properties.notebookServerEndpoint")] + public string NotebookServerEndpoint { get; private set; } + + /// + /// Gets status of the notebook workspace. Possible values are: + /// Creating, Online, Deleting, Failed, Updating. + /// + [JsonProperty(PropertyName = "properties.status")] + public string Status { get; private set; } + + } +} diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/NotebookWorkspaceConnectionInfoResult.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/NotebookWorkspaceConnectionInfoResult.cs new file mode 100644 index 000000000000..cb4393139255 --- /dev/null +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/NotebookWorkspaceConnectionInfoResult.cs @@ -0,0 +1,64 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.CosmosDB.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The connection info for the given notebook workspace + /// + public partial class NotebookWorkspaceConnectionInfoResult + { + /// + /// Initializes a new instance of the + /// NotebookWorkspaceConnectionInfoResult class. + /// + public NotebookWorkspaceConnectionInfoResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// NotebookWorkspaceConnectionInfoResult class. + /// + /// Specifies auth token used for connecting to + /// Notebook server (uses token-based auth). + /// Specifies the endpoint of + /// Notebook server. + public NotebookWorkspaceConnectionInfoResult(string authToken = default(string), string notebookServerEndpoint = default(string)) + { + AuthToken = authToken; + NotebookServerEndpoint = notebookServerEndpoint; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets specifies auth token used for connecting to Notebook server + /// (uses token-based auth). + /// + [JsonProperty(PropertyName = "authToken")] + public string AuthToken { get; private set; } + + /// + /// Gets specifies the endpoint of Notebook server. + /// + [JsonProperty(PropertyName = "notebookServerEndpoint")] + public string NotebookServerEndpoint { get; private set; } + + } +} diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/NotebookWorkspaceCreateUpdateParameters.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/NotebookWorkspaceCreateUpdateParameters.cs new file mode 100644 index 000000000000..415b2604e14b --- /dev/null +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/NotebookWorkspaceCreateUpdateParameters.cs @@ -0,0 +1,49 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.CosmosDB.Models +{ + using System.Linq; + + /// + /// Parameters to create a notebook workspace resource + /// + public partial class NotebookWorkspaceCreateUpdateParameters : ARMProxyResource + { + /// + /// Initializes a new instance of the + /// NotebookWorkspaceCreateUpdateParameters class. + /// + public NotebookWorkspaceCreateUpdateParameters() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// NotebookWorkspaceCreateUpdateParameters class. + /// + /// The unique resource identifier of the database + /// account. + /// The name of the database account. + /// The type of Azure resource. + public NotebookWorkspaceCreateUpdateParameters(string id = default(string), string name = default(string), string type = default(string)) + : base(id, name, type) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/OptionsResource.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/OptionsResource.cs new file mode 100644 index 000000000000..cbeec5b5998f --- /dev/null +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/OptionsResource.cs @@ -0,0 +1,54 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.CosmosDB.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Cosmos DB options resource object + /// + public partial class OptionsResource + { + /// + /// Initializes a new instance of the OptionsResource class. + /// + public OptionsResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OptionsResource class. + /// + /// Value of the Cosmos DB resource + /// throughput. Use the ThroughputSetting resource when retrieving + /// offer details. + public OptionsResource(int? throughput = default(int?)) + { + Throughput = throughput; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets value of the Cosmos DB resource throughput. Use the + /// ThroughputSetting resource when retrieving offer details. + /// + [JsonProperty(PropertyName = "throughput")] + public int? Throughput { get; set; } + + } +} diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/SqlContainerGetPropertiesOptions.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/SqlContainerGetPropertiesOptions.cs new file mode 100644 index 000000000000..040709e8ff24 --- /dev/null +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/SqlContainerGetPropertiesOptions.cs @@ -0,0 +1,45 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.CosmosDB.Models +{ + using System.Linq; + + public partial class SqlContainerGetPropertiesOptions : OptionsResource + { + /// + /// Initializes a new instance of the SqlContainerGetPropertiesOptions + /// class. + /// + public SqlContainerGetPropertiesOptions() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SqlContainerGetPropertiesOptions + /// class. + /// + /// Value of the Cosmos DB resource + /// throughput. Use the ThroughputSetting resource when retrieving + /// offer details. + public SqlContainerGetPropertiesOptions(int? throughput = default(int?)) + : base(throughput) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/SqlContainerGetResults.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/SqlContainerGetResults.cs index 4ed50b3c17f1..241a58696957 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/SqlContainerGetResults.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/SqlContainerGetResults.cs @@ -40,10 +40,11 @@ public SqlContainerGetResults() /// The type of Azure resource. /// The location of the resource group to which /// the resource belongs. - public SqlContainerGetResults(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), SqlContainerGetPropertiesResource resource = default(SqlContainerGetPropertiesResource)) + public SqlContainerGetResults(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), SqlContainerGetPropertiesResource resource = default(SqlContainerGetPropertiesResource), SqlContainerGetPropertiesOptions options = default(SqlContainerGetPropertiesOptions)) : base(id, name, type, location, tags) { Resource = resource; + Options = options; CustomInit(); } @@ -57,6 +58,11 @@ public SqlContainerGetResults() [JsonProperty(PropertyName = "properties.resource")] public SqlContainerGetPropertiesResource Resource { get; set; } + /// + /// + [JsonProperty(PropertyName = "properties.options")] + public SqlContainerGetPropertiesOptions Options { get; set; } + /// /// Validate the object. /// diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/SqlDatabaseGetPropertiesOptions.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/SqlDatabaseGetPropertiesOptions.cs new file mode 100644 index 000000000000..95bf28400e59 --- /dev/null +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/SqlDatabaseGetPropertiesOptions.cs @@ -0,0 +1,45 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.CosmosDB.Models +{ + using System.Linq; + + public partial class SqlDatabaseGetPropertiesOptions : OptionsResource + { + /// + /// Initializes a new instance of the SqlDatabaseGetPropertiesOptions + /// class. + /// + public SqlDatabaseGetPropertiesOptions() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SqlDatabaseGetPropertiesOptions + /// class. + /// + /// Value of the Cosmos DB resource + /// throughput. Use the ThroughputSetting resource when retrieving + /// offer details. + public SqlDatabaseGetPropertiesOptions(int? throughput = default(int?)) + : base(throughput) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/SqlDatabaseGetResults.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/SqlDatabaseGetResults.cs index 177bf31ead0b..1a16ae9b45b2 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/SqlDatabaseGetResults.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/SqlDatabaseGetResults.cs @@ -40,10 +40,11 @@ public SqlDatabaseGetResults() /// The type of Azure resource. /// The location of the resource group to which /// the resource belongs. - public SqlDatabaseGetResults(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), SqlDatabaseGetPropertiesResource resource = default(SqlDatabaseGetPropertiesResource)) + public SqlDatabaseGetResults(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), SqlDatabaseGetPropertiesResource resource = default(SqlDatabaseGetPropertiesResource), SqlDatabaseGetPropertiesOptions options = default(SqlDatabaseGetPropertiesOptions)) : base(id, name, type, location, tags) { Resource = resource; + Options = options; CustomInit(); } @@ -57,6 +58,11 @@ public SqlDatabaseGetResults() [JsonProperty(PropertyName = "properties.resource")] public SqlDatabaseGetPropertiesResource Resource { get; set; } + /// + /// + [JsonProperty(PropertyName = "properties.options")] + public SqlDatabaseGetPropertiesOptions Options { get; set; } + /// /// Validate the object. /// diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/TableGetPropertiesOptions.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/TableGetPropertiesOptions.cs new file mode 100644 index 000000000000..c314559f5d77 --- /dev/null +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/TableGetPropertiesOptions.cs @@ -0,0 +1,43 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.CosmosDB.Models +{ + using System.Linq; + + public partial class TableGetPropertiesOptions : OptionsResource + { + /// + /// Initializes a new instance of the TableGetPropertiesOptions class. + /// + public TableGetPropertiesOptions() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the TableGetPropertiesOptions class. + /// + /// Value of the Cosmos DB resource + /// throughput. Use the ThroughputSetting resource when retrieving + /// offer details. + public TableGetPropertiesOptions(int? throughput = default(int?)) + : base(throughput) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/TableGetResults.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/TableGetResults.cs index 305a165e4c37..71b768ca4f6d 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/TableGetResults.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/TableGetResults.cs @@ -40,10 +40,11 @@ public TableGetResults() /// The type of Azure resource. /// The location of the resource group to which /// the resource belongs. - public TableGetResults(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), TableGetPropertiesResource resource = default(TableGetPropertiesResource)) + public TableGetResults(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), TableGetPropertiesResource resource = default(TableGetPropertiesResource), TableGetPropertiesOptions options = default(TableGetPropertiesOptions)) : base(id, name, type, location, tags) { Resource = resource; + Options = options; CustomInit(); } @@ -57,6 +58,11 @@ public TableGetResults() [JsonProperty(PropertyName = "properties.resource")] public TableGetPropertiesResource Resource { get; set; } + /// + /// + [JsonProperty(PropertyName = "properties.options")] + public TableGetPropertiesOptions Options { get; set; } + /// /// Validate the object. /// diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/MongoDBResourcesOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/MongoDBResourcesOperations.cs index 18e4060dc723..8e7bc3e2a360 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/MongoDBResourcesOperations.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/MongoDBResourcesOperations.cs @@ -1812,7 +1812,6 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -1821,10 +1820,6 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 200 && (int)_statusCode != 202)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); @@ -2047,7 +2042,6 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -2056,10 +2050,6 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 202 && (int)_statusCode != 204)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); @@ -2286,7 +2276,6 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -2295,10 +2284,6 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 200 && (int)_statusCode != 202)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); @@ -2551,7 +2536,6 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -2560,10 +2544,6 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 200 && (int)_statusCode != 202)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); @@ -2795,7 +2775,6 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -2804,10 +2783,6 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 202 && (int)_statusCode != 204)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); @@ -3050,12 +3025,7 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client) } HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; string _responseContent = null; - if (!((int)_statusCode != 200 && (int)_statusCode != 202)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/NotebookWorkspacesOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/NotebookWorkspacesOperations.cs new file mode 100644 index 000000000000..77e2a737944e --- /dev/null +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/NotebookWorkspacesOperations.cs @@ -0,0 +1,1638 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.CosmosDB +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// NotebookWorkspacesOperations operations. + /// + internal partial class NotebookWorkspacesOperations : IServiceOperations, INotebookWorkspacesOperations + { + /// + /// Initializes a new instance of the NotebookWorkspacesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal NotebookWorkspacesOperations(CosmosDBManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the CosmosDBManagementClient + /// + public CosmosDBManagementClient Client { get; private set; } + + /// + /// Gets the notebook workspace resources of an existing Cosmos DB account. + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByDatabaseAccountWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (accountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + } + if (accountName != null) + { + if (accountName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "accountName", 50); + } + if (accountName.Length < 3) + { + throw new ValidationException(ValidationRules.MinLength, "accountName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-z0-9]+(-[a-z0-9]+)*")) + { + throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); + } + } + string apiVersion = "2019-08-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByDatabaseAccount", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets the notebook workspace for a Cosmos DB account. + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (accountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + } + if (accountName != null) + { + if (accountName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "accountName", 50); + } + if (accountName.Length < 3) + { + throw new ValidationException(ValidationRules.MinLength, "accountName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-z0-9]+(-[a-z0-9]+)*")) + { + throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); + } + } + string apiVersion = "2019-08-01"; + string notebookWorkspaceName = "default"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("notebookWorkspaceName", notebookWorkspaceName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{notebookWorkspaceName}", System.Uri.EscapeDataString(notebookWorkspaceName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates the notebook workspace for a Cosmos DB account. + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, accountName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes the notebook workspace for a Cosmos DB account. + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Retrieves the connection info for the notebook workspace + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> ListConnectionInfoWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (accountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + } + if (accountName != null) + { + if (accountName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "accountName", 50); + } + if (accountName.Length < 3) + { + throw new ValidationException(ValidationRules.MinLength, "accountName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-z0-9]+(-[a-z0-9]+)*")) + { + throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); + } + } + string apiVersion = "2019-08-01"; + string notebookWorkspaceName = "default"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("notebookWorkspaceName", notebookWorkspaceName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListConnectionInfo", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/listConnectionInfo").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{notebookWorkspaceName}", System.Uri.EscapeDataString(notebookWorkspaceName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Regenerates the auth token for the notebook workspace + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task RegenerateAuthTokenWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginRegenerateAuthTokenWithHttpMessagesAsync(resourceGroupName, accountName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Starts the notebook workspace + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task StartWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginStartWithHttpMessagesAsync(resourceGroupName, accountName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Creates the notebook workspace for a Cosmos DB account. + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (accountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + } + if (accountName != null) + { + if (accountName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "accountName", 50); + } + if (accountName.Length < 3) + { + throw new ValidationException(ValidationRules.MinLength, "accountName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-z0-9]+(-[a-z0-9]+)*")) + { + throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); + } + } + string apiVersion = "2019-08-01"; + string notebookWorkspaceName = "default"; + NotebookWorkspaceCreateUpdateParameters notebookCreateUpdateParameters = new NotebookWorkspaceCreateUpdateParameters(); + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("notebookWorkspaceName", notebookWorkspaceName); + tracingParameters.Add("notebookCreateUpdateParameters", notebookCreateUpdateParameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{notebookWorkspaceName}", System.Uri.EscapeDataString(notebookWorkspaceName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(notebookCreateUpdateParameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(notebookCreateUpdateParameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes the notebook workspace for a Cosmos DB account. + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (accountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + } + if (accountName != null) + { + if (accountName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "accountName", 50); + } + if (accountName.Length < 3) + { + throw new ValidationException(ValidationRules.MinLength, "accountName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-z0-9]+(-[a-z0-9]+)*")) + { + throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); + } + } + string apiVersion = "2019-08-01"; + string notebookWorkspaceName = "default"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("notebookWorkspaceName", notebookWorkspaceName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{notebookWorkspaceName}", System.Uri.EscapeDataString(notebookWorkspaceName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Regenerates the auth token for the notebook workspace + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginRegenerateAuthTokenWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (accountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + } + if (accountName != null) + { + if (accountName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "accountName", 50); + } + if (accountName.Length < 3) + { + throw new ValidationException(ValidationRules.MinLength, "accountName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-z0-9]+(-[a-z0-9]+)*")) + { + throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); + } + } + string apiVersion = "2019-08-01"; + string notebookWorkspaceName = "default"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("notebookWorkspaceName", notebookWorkspaceName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginRegenerateAuthToken", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/regenerateAuthToken").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{notebookWorkspaceName}", System.Uri.EscapeDataString(notebookWorkspaceName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Starts the notebook workspace + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginStartWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (accountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + } + if (accountName != null) + { + if (accountName.Length > 50) + { + throw new ValidationException(ValidationRules.MaxLength, "accountName", 50); + } + if (accountName.Length < 3) + { + throw new ValidationException(ValidationRules.MinLength, "accountName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[a-z0-9]+(-[a-z0-9]+)*")) + { + throw new ValidationException(ValidationRules.Pattern, "accountName", "^[a-z0-9]+(-[a-z0-9]+)*"); + } + } + string apiVersion = "2019-08-01"; + string notebookWorkspaceName = "default"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("notebookWorkspaceName", notebookWorkspaceName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginStart", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/start").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{notebookWorkspaceName}", System.Uri.EscapeDataString(notebookWorkspaceName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/NotebookWorkspacesOperationsExtensions.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/NotebookWorkspacesOperationsExtensions.cs new file mode 100644 index 000000000000..e09db97d37c2 --- /dev/null +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/NotebookWorkspacesOperationsExtensions.cs @@ -0,0 +1,449 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.CosmosDB +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for NotebookWorkspacesOperations. + /// + public static partial class NotebookWorkspacesOperationsExtensions + { + /// + /// Gets the notebook workspace resources of an existing Cosmos DB account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Cosmos DB database account name. + /// + public static IEnumerable ListByDatabaseAccount(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName) + { + return operations.ListByDatabaseAccountAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + } + + /// + /// Gets the notebook workspace resources of an existing Cosmos DB account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByDatabaseAccountAsync(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByDatabaseAccountWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the notebook workspace for a Cosmos DB account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Cosmos DB database account name. + /// + public static NotebookWorkspace Get(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName) + { + return operations.GetAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + } + + /// + /// Gets the notebook workspace for a Cosmos DB account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates the notebook workspace for a Cosmos DB account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Cosmos DB database account name. + /// + public static NotebookWorkspace CreateOrUpdate(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName) + { + return operations.CreateOrUpdateAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + } + + /// + /// Creates the notebook workspace for a Cosmos DB account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the notebook workspace for a Cosmos DB account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Cosmos DB database account name. + /// + public static void Delete(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName) + { + operations.DeleteAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the notebook workspace for a Cosmos DB account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Retrieves the connection info for the notebook workspace + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Cosmos DB database account name. + /// + public static NotebookWorkspaceConnectionInfoResult ListConnectionInfo(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName) + { + return operations.ListConnectionInfoAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + } + + /// + /// Retrieves the connection info for the notebook workspace + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The cancellation token. + /// + public static async Task ListConnectionInfoAsync(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListConnectionInfoWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Regenerates the auth token for the notebook workspace + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Cosmos DB database account name. + /// + public static void RegenerateAuthToken(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName) + { + operations.RegenerateAuthTokenAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + } + + /// + /// Regenerates the auth token for the notebook workspace + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The cancellation token. + /// + public static async Task RegenerateAuthTokenAsync(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.RegenerateAuthTokenWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Starts the notebook workspace + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Cosmos DB database account name. + /// + public static void Start(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName) + { + operations.StartAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + } + + /// + /// Starts the notebook workspace + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The cancellation token. + /// + public static async Task StartAsync(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.StartWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Creates the notebook workspace for a Cosmos DB account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Cosmos DB database account name. + /// + public static NotebookWorkspace BeginCreateOrUpdate(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName) + { + return operations.BeginCreateOrUpdateAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + } + + /// + /// Creates the notebook workspace for a Cosmos DB account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the notebook workspace for a Cosmos DB account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Cosmos DB database account name. + /// + public static void BeginDelete(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName) + { + operations.BeginDeleteAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the notebook workspace for a Cosmos DB account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Regenerates the auth token for the notebook workspace + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Cosmos DB database account name. + /// + public static void BeginRegenerateAuthToken(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName) + { + operations.BeginRegenerateAuthTokenAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + } + + /// + /// Regenerates the auth token for the notebook workspace + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The cancellation token. + /// + public static async Task BeginRegenerateAuthTokenAsync(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginRegenerateAuthTokenWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Starts the notebook workspace + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Cosmos DB database account name. + /// + public static void BeginStart(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName) + { + operations.BeginStartAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + } + + /// + /// Starts the notebook workspace + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an Azure resource group. + /// + /// + /// Cosmos DB database account name. + /// + /// + /// The cancellation token. + /// + public static async Task BeginStartAsync(this INotebookWorkspacesOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginStartWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + } +} diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/SdkInfo_CosmosDBManagementClient.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/SdkInfo_CosmosDBManagementClient.cs index c1fe9313fd27..fe248a222c28 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/SdkInfo_CosmosDBManagementClient.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/SdkInfo_CosmosDBManagementClient.cs @@ -29,6 +29,7 @@ public static IEnumerable> ApiInfo_CosmosDBManagem new Tuple("DocumentDB", "DatabaseAccounts", "2020-03-01"), new Tuple("DocumentDB", "GremlinResources", "2020-03-01"), new Tuple("DocumentDB", "MongoDBResources", "2020-03-01"), + new Tuple("DocumentDB", "NotebookWorkspaces", "2019-08-01"), new Tuple("DocumentDB", "Operations", "2020-03-01"), new Tuple("DocumentDB", "PartitionKeyRangeId", "2020-03-01"), new Tuple("DocumentDB", "PartitionKeyRangeIdRegion", "2020-03-01"), @@ -42,16 +43,5 @@ public static IEnumerable> ApiInfo_CosmosDBManagem }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "v2"; - public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4413"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/cosmos-db/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=D:\\azure-sdk-for-net2\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "ef3a1ab6db775897bfc13f921e0e489ca4d58be5"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } - diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/SqlResourcesOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/SqlResourcesOperations.cs index bd4abc1f4076..42454c034fb9 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/SqlResourcesOperations.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/SqlResourcesOperations.cs @@ -3487,7 +3487,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -3496,10 +3495,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 200 && (int)_statusCode != 202)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); @@ -3722,7 +3717,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -3731,10 +3725,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 202 && (int)_statusCode != 204)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); @@ -3961,7 +3951,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -3970,10 +3959,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 200 && (int)_statusCode != 202)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); @@ -4226,7 +4211,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -4235,10 +4219,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 200 && (int)_statusCode != 202)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); @@ -4470,7 +4450,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -4479,10 +4458,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 202 && (int)_statusCode != 204)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); @@ -4718,7 +4693,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -4727,10 +4701,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 200 && (int)_statusCode != 202)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); @@ -4992,7 +4962,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -5001,10 +4970,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 200 && (int)_statusCode != 202)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); @@ -5245,7 +5210,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -5254,10 +5218,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 202 && (int)_statusCode != 204)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); @@ -5501,7 +5461,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -5510,10 +5469,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 200 && (int)_statusCode != 202)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); @@ -5754,7 +5709,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -5763,10 +5717,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 202 && (int)_statusCode != 204)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); @@ -6010,7 +5960,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -6019,10 +5968,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 200 && (int)_statusCode != 202)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); @@ -6263,7 +6208,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -6272,10 +6216,6 @@ internal SqlResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 202 && (int)_statusCode != 204)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/TableResourcesOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/TableResourcesOperations.cs index b9b765091db5..3237547f343a 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/TableResourcesOperations.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/TableResourcesOperations.cs @@ -999,7 +999,6 @@ internal TableResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -1008,10 +1007,6 @@ internal TableResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 200 && (int)_statusCode != 202)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); @@ -1234,7 +1229,6 @@ internal TableResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -1243,10 +1237,6 @@ internal TableResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 202 && (int)_statusCode != 204)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); @@ -1472,7 +1462,6 @@ internal TableResourcesOperations(CosmosDBManagementClient client) ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - System.Uri _originRequestUri = _httpRequest.RequestUri; _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { @@ -1481,10 +1470,6 @@ internal TableResourcesOperations(CosmosDBManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if (!((int)_statusCode != 200 && (int)_statusCode != 202)) - { - _httpRequest.RequestUri = _originRequestUri; - } if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));