From 98a1020ec2a5c55b3540710387e2d1e15b4cbd10 Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Wed, 5 Aug 2020 12:15:25 +0000 Subject: [PATCH] Generated from 230e1797a6f1cc31dab6d4fa1eeb81bdc2ce80c2 run prettier --- .../src/Generated/AccountsOperations.cs | 222 +++---- .../Generated/AccountsOperationsExtensions.cs | 80 +-- .../ConsumerInvitationsOperations.cs | 98 +-- ...ConsumerInvitationsOperationsExtensions.cs | 60 +- .../Generated/DataSetMappingsOperations.cs | 18 +- .../DataSetMappingsOperationsExtensions.cs | 20 +- .../src/Generated/DataSetsOperations.cs | 18 +- .../Generated/DataSetsOperationsExtensions.cs | 20 +- .../src/Generated/IAccountsOperations.cs | 50 +- .../IConsumerInvitationsOperations.cs | 26 +- .../Generated/IDataSetMappingsOperations.cs | 8 +- .../src/Generated/IDataSetsOperations.cs | 8 +- .../src/Generated/IInvitationsOperations.cs | 8 +- .../IProviderShareSubscriptionsOperations.cs | 32 +- .../IShareSubscriptionsOperations.cs | 162 ++--- .../src/Generated/ISharesOperations.cs | 96 +-- .../src/Generated/InvitationsOperations.cs | 18 +- .../InvitationsOperationsExtensions.cs | 20 +- .../src/Generated/Models/DataSet.cs | 2 - .../src/Generated/Models/DataSetMapping.cs | 2 - .../SourceShareSynchronizationSetting.cs | 2 - .../Models/SynchronizationSetting.cs | 2 - .../src/Generated/Models/Trigger.cs | 2 - .../ProviderShareSubscriptionsOperations.cs | 134 ++-- ...rShareSubscriptionsOperationsExtensions.cs | 80 +-- .../SdkInfo_DataShareManagementClient.cs | 11 - .../Generated/ShareSubscriptionsOperations.cs | 604 ++++++++++-------- .../ShareSubscriptionsOperationsExtensions.cs | 372 ++++++----- .../src/Generated/SharesOperations.cs | 344 +++++----- .../Generated/SharesOperationsExtensions.cs | 224 ++++--- 30 files changed, 1514 insertions(+), 1229 deletions(-) diff --git a/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/AccountsOperations.cs b/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/AccountsOperations.cs index 7044ddaea35cb..fb8cbfa847f2b 100644 --- a/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/AccountsOperations.cs +++ b/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/AccountsOperations.cs @@ -51,16 +51,13 @@ internal AccountsOperations(DataShareManagementClient client) public DataShareManagementClient Client { get; private set; } /// - /// Get an account under a resource group + /// List Accounts in a subscription /// /// - /// Get an account + /// List Accounts in Subscription /// - /// - /// The resource group name. - /// - /// - /// The name of the share account. + /// + /// Continuation token /// /// /// Headers that will be added to request. @@ -83,20 +80,12 @@ internal AccountsOperations(DataShareManagementClient client) /// /// 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)) + public async Task>> ListBySubscriptionWithHttpMessagesAsync(string skipToken = default(string), 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 (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -108,22 +97,23 @@ internal AccountsOperations(DataShareManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("accountName", accountName); + tracingParameters.Add("skipToken", skipToken); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", 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.DataShare/accounts/{accountName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.DataShare/accounts").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 (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } + if (skipToken != null) + { + _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -212,7 +202,7 @@ internal AccountsOperations(DataShareManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -225,7 +215,7 @@ internal AccountsOperations(DataShareManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -245,63 +235,10 @@ internal AccountsOperations(DataShareManagementClient client) } /// - /// Create an account in the given resource group - /// - /// - /// Create an account - /// - /// - /// The resource group name. - /// - /// - /// The name of the share account. - /// - /// - /// The account payload. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CreateWithHttpMessagesAsync(string resourceGroupName, string accountName, Account account, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(resourceGroupName, accountName, account, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Delete an account - /// - /// - /// DeleteAccount - /// - /// - /// The resource group name. - /// - /// - /// The name of the share account. - /// - /// - /// 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); - } - - /// - /// Patch a given account + /// Get an account under a resource group /// /// - /// Patch an account + /// Get an account /// /// /// The resource group name. @@ -309,9 +246,6 @@ internal AccountsOperations(DataShareManagementClient client) /// /// The name of the share account. /// - /// - /// The account update parameters. - /// /// /// Headers that will be added to request. /// @@ -333,7 +267,7 @@ internal AccountsOperations(DataShareManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, AccountUpdateParameters accountUpdateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -347,10 +281,6 @@ internal AccountsOperations(DataShareManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); } - if (accountUpdateParameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountUpdateParameters"); - } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -364,9 +294,8 @@ internal AccountsOperations(DataShareManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("accountUpdateParameters", accountUpdateParameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -386,7 +315,7 @@ internal AccountsOperations(DataShareManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -417,12 +346,6 @@ internal AccountsOperations(DataShareManagementClient client) // Serialize Request string _requestContent = null; - if(accountUpdateParameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(accountUpdateParameters, 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) { @@ -506,13 +429,72 @@ internal AccountsOperations(DataShareManagementClient client) } /// - /// List Accounts in a subscription + /// Create an account in the given resource group /// /// - /// List Accounts in Subscription + /// Create an account /// - /// - /// Continuation token + /// + /// The resource group name. + /// + /// + /// The name of the share account. + /// + /// + /// The account payload. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateWithHttpMessagesAsync(string resourceGroupName, string accountName, Account account, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(resourceGroupName, accountName, account, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Delete an account + /// + /// + /// DeleteAccount + /// + /// + /// The resource group name. + /// + /// + /// The name of the share account. + /// + /// + /// 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); + } + + /// + /// Patch a given account + /// + /// + /// Patch an account + /// + /// + /// The resource group name. + /// + /// + /// The name of the share account. + /// + /// + /// The account update parameters. /// /// /// Headers that will be added to request. @@ -535,12 +517,24 @@ internal AccountsOperations(DataShareManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListBySubscriptionWithHttpMessagesAsync(string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, AccountUpdateParameters accountUpdateParameters, 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 (accountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + } + if (accountUpdateParameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "accountUpdateParameters"); + } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -552,23 +546,23 @@ internal AccountsOperations(DataShareManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("skipToken", skipToken); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("accountUpdateParameters", accountUpdateParameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.DataShare/accounts").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}").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 (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } - if (skipToken != null) - { - _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); - } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -576,7 +570,7 @@ internal AccountsOperations(DataShareManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -607,6 +601,12 @@ internal AccountsOperations(DataShareManagementClient client) // Serialize Request string _requestContent = null; + if(accountUpdateParameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(accountUpdateParameters, 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) { @@ -657,7 +657,7 @@ internal AccountsOperations(DataShareManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -670,7 +670,7 @@ internal AccountsOperations(DataShareManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { diff --git a/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/AccountsOperationsExtensions.cs b/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/AccountsOperationsExtensions.cs index 7971abde20e3f..4701f9430738c 100644 --- a/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/AccountsOperationsExtensions.cs +++ b/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/AccountsOperationsExtensions.cs @@ -21,6 +21,46 @@ namespace Microsoft.Azure.Management.DataShare /// public static partial class AccountsOperationsExtensions { + /// + /// List Accounts in a subscription + /// + /// + /// List Accounts in Subscription + /// + /// + /// The operations group for this extension method. + /// + /// + /// Continuation token + /// + public static IPage ListBySubscription(this IAccountsOperations operations, string skipToken = default(string)) + { + return operations.ListBySubscriptionAsync(skipToken).GetAwaiter().GetResult(); + } + + /// + /// List Accounts in a subscription + /// + /// + /// List Accounts in Subscription + /// + /// + /// The operations group for this extension method. + /// + /// + /// Continuation token + /// + /// + /// The cancellation token. + /// + public static async Task> ListBySubscriptionAsync(this IAccountsOperations operations, string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(skipToken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Get an account under a resource group /// @@ -217,46 +257,6 @@ public static Account Update(this IAccountsOperations operations, string resourc } } - /// - /// List Accounts in a subscription - /// - /// - /// List Accounts in Subscription - /// - /// - /// The operations group for this extension method. - /// - /// - /// Continuation token - /// - public static IPage ListBySubscription(this IAccountsOperations operations, string skipToken = default(string)) - { - return operations.ListBySubscriptionAsync(skipToken).GetAwaiter().GetResult(); - } - - /// - /// List Accounts in a subscription - /// - /// - /// List Accounts in Subscription - /// - /// - /// The operations group for this extension method. - /// - /// - /// Continuation token - /// - /// - /// The cancellation token. - /// - public static async Task> ListBySubscriptionAsync(this IAccountsOperations operations, string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(skipToken, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// List Accounts in a resource group /// diff --git a/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/ConsumerInvitationsOperations.cs b/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/ConsumerInvitationsOperations.cs index b8fcc63a5fd74..e89a807a7bdc5 100644 --- a/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/ConsumerInvitationsOperations.cs +++ b/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/ConsumerInvitationsOperations.cs @@ -51,16 +51,13 @@ internal ConsumerInvitationsOperations(DataShareManagementClient client) public DataShareManagementClient Client { get; private set; } /// - /// Rejects the invitation identified by invitationId + /// List the invitations /// /// - /// Reject an invitation + /// Lists invitations /// - /// - /// Location of the invitation - /// - /// - /// An invitation payload + /// + /// The continuation token /// /// /// Headers that will be added to request. @@ -83,20 +80,8 @@ internal ConsumerInvitationsOperations(DataShareManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> RejectInvitationWithHttpMessagesAsync(string location, ConsumerInvitation invitation, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListInvitationsWithHttpMessagesAsync(string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (location == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); - } - if (invitation == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "invitation"); - } - if (invitation != null) - { - invitation.Validate(); - } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -108,20 +93,22 @@ internal ConsumerInvitationsOperations(DataShareManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("location", location); - tracingParameters.Add("invitation", invitation); + tracingParameters.Add("skipToken", skipToken); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "RejectInvitation", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListInvitations", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.DataShare/locations/{location}/RejectInvitation").ToString(); - _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.DataShare/ListInvitations").ToString(); List _queryParameters = new List(); if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } + if (skipToken != null) + { + _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -129,7 +116,7 @@ internal ConsumerInvitationsOperations(DataShareManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -160,12 +147,6 @@ internal ConsumerInvitationsOperations(DataShareManagementClient client) // Serialize Request string _requestContent = null; - if(invitation != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(invitation, 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) { @@ -216,7 +197,7 @@ internal ConsumerInvitationsOperations(DataShareManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -229,7 +210,7 @@ internal ConsumerInvitationsOperations(DataShareManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -438,13 +419,16 @@ internal ConsumerInvitationsOperations(DataShareManagementClient client) } /// - /// List the invitations + /// Rejects the invitation identified by invitationId /// /// - /// Lists invitations + /// Reject an invitation /// - /// - /// The continuation token + /// + /// Location of the invitation + /// + /// + /// An invitation payload /// /// /// Headers that will be added to request. @@ -467,8 +451,20 @@ internal ConsumerInvitationsOperations(DataShareManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListInvitationsWithHttpMessagesAsync(string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> RejectInvitationWithHttpMessagesAsync(string location, ConsumerInvitation invitation, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "location"); + } + if (invitation == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "invitation"); + } + if (invitation != null) + { + invitation.Validate(); + } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -480,22 +476,20 @@ internal ConsumerInvitationsOperations(DataShareManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("skipToken", skipToken); + tracingParameters.Add("location", location); + tracingParameters.Add("invitation", invitation); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListInvitations", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "RejectInvitation", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.DataShare/ListInvitations").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.DataShare/locations/{location}/RejectInvitation").ToString(); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); List _queryParameters = new List(); if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } - if (skipToken != null) - { - _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); - } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -503,7 +497,7 @@ internal ConsumerInvitationsOperations(DataShareManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -534,6 +528,12 @@ internal ConsumerInvitationsOperations(DataShareManagementClient client) // Serialize Request string _requestContent = null; + if(invitation != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(invitation, 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) { @@ -584,7 +584,7 @@ internal ConsumerInvitationsOperations(DataShareManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -597,7 +597,7 @@ internal ConsumerInvitationsOperations(DataShareManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { diff --git a/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/ConsumerInvitationsOperationsExtensions.cs b/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/ConsumerInvitationsOperationsExtensions.cs index 55efdc3c31071..fcb7b3d99d409 100644 --- a/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/ConsumerInvitationsOperationsExtensions.cs +++ b/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/ConsumerInvitationsOperationsExtensions.cs @@ -22,46 +22,40 @@ namespace Microsoft.Azure.Management.DataShare public static partial class ConsumerInvitationsOperationsExtensions { /// - /// Rejects the invitation identified by invitationId + /// List the invitations /// /// - /// Reject an invitation + /// Lists invitations /// /// /// The operations group for this extension method. /// - /// - /// Location of the invitation - /// - /// - /// An invitation payload + /// + /// The continuation token /// - public static ConsumerInvitation RejectInvitation(this IConsumerInvitationsOperations operations, string location, ConsumerInvitation invitation) + public static IPage ListInvitations(this IConsumerInvitationsOperations operations, string skipToken = default(string)) { - return operations.RejectInvitationAsync(location, invitation).GetAwaiter().GetResult(); + return operations.ListInvitationsAsync(skipToken).GetAwaiter().GetResult(); } /// - /// Rejects the invitation identified by invitationId + /// List the invitations /// /// - /// Reject an invitation + /// Lists invitations /// /// /// The operations group for this extension method. /// - /// - /// Location of the invitation - /// - /// - /// An invitation payload + /// + /// The continuation token /// /// /// The cancellation token. /// - public static async Task RejectInvitationAsync(this IConsumerInvitationsOperations operations, string location, ConsumerInvitation invitation, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListInvitationsAsync(this IConsumerInvitationsOperations operations, string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.RejectInvitationWithHttpMessagesAsync(location, invitation, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListInvitationsWithHttpMessagesAsync(skipToken, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -114,40 +108,46 @@ public static ConsumerInvitation Get(this IConsumerInvitationsOperations operati } /// - /// List the invitations + /// Rejects the invitation identified by invitationId /// /// - /// Lists invitations + /// Reject an invitation /// /// /// The operations group for this extension method. /// - /// - /// The continuation token + /// + /// Location of the invitation /// - public static IPage ListInvitations(this IConsumerInvitationsOperations operations, string skipToken = default(string)) + /// + /// An invitation payload + /// + public static ConsumerInvitation RejectInvitation(this IConsumerInvitationsOperations operations, string location, ConsumerInvitation invitation) { - return operations.ListInvitationsAsync(skipToken).GetAwaiter().GetResult(); + return operations.RejectInvitationAsync(location, invitation).GetAwaiter().GetResult(); } /// - /// List the invitations + /// Rejects the invitation identified by invitationId /// /// - /// Lists invitations + /// Reject an invitation /// /// /// The operations group for this extension method. /// - /// - /// The continuation token + /// + /// Location of the invitation + /// + /// + /// An invitation payload /// /// /// The cancellation token. /// - public static async Task> ListInvitationsAsync(this IConsumerInvitationsOperations operations, string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task RejectInvitationAsync(this IConsumerInvitationsOperations operations, string location, ConsumerInvitation invitation, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListInvitationsWithHttpMessagesAsync(skipToken, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.RejectInvitationWithHttpMessagesAsync(location, invitation, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/DataSetMappingsOperations.cs b/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/DataSetMappingsOperations.cs index 497326a964ec5..f33f699777e77 100644 --- a/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/DataSetMappingsOperations.cs +++ b/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/DataSetMappingsOperations.cs @@ -717,6 +717,12 @@ internal DataSetMappingsOperations(DataShareManagementClient client) /// /// Continuation token /// + /// + /// Filters the results using OData syntax. + /// + /// + /// Sorts the results using OData syntax. + /// /// /// Headers that will be added to request. /// @@ -738,7 +744,7 @@ internal DataSetMappingsOperations(DataShareManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByShareSubscriptionWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareSubscriptionName, string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByShareSubscriptionWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareSubscriptionName, string skipToken = default(string), string filter = default(string), string orderby = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -771,6 +777,8 @@ internal DataSetMappingsOperations(DataShareManagementClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("shareSubscriptionName", shareSubscriptionName); tracingParameters.Add("skipToken", skipToken); + tracingParameters.Add("filter", filter); + tracingParameters.Add("orderby", orderby); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListByShareSubscription", tracingParameters); } @@ -790,6 +798,14 @@ internal DataSetMappingsOperations(DataShareManagementClient client) { _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } + if (orderby != null) + { + _queryParameters.Add(string.Format("$orderby={0}", System.Uri.EscapeDataString(orderby))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); diff --git a/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/DataSetMappingsOperationsExtensions.cs b/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/DataSetMappingsOperationsExtensions.cs index 536a42bddc6c5..168c682af07a9 100644 --- a/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/DataSetMappingsOperationsExtensions.cs +++ b/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/DataSetMappingsOperationsExtensions.cs @@ -223,9 +223,15 @@ public static void Delete(this IDataSetMappingsOperations operations, string res /// /// Continuation token /// - public static IPage ListByShareSubscription(this IDataSetMappingsOperations operations, string resourceGroupName, string accountName, string shareSubscriptionName, string skipToken = default(string)) + /// + /// Filters the results using OData syntax. + /// + /// + /// Sorts the results using OData syntax. + /// + public static IPage ListByShareSubscription(this IDataSetMappingsOperations operations, string resourceGroupName, string accountName, string shareSubscriptionName, string skipToken = default(string), string filter = default(string), string orderby = default(string)) { - return operations.ListByShareSubscriptionAsync(resourceGroupName, accountName, shareSubscriptionName, skipToken).GetAwaiter().GetResult(); + return operations.ListByShareSubscriptionAsync(resourceGroupName, accountName, shareSubscriptionName, skipToken, filter, orderby).GetAwaiter().GetResult(); } /// @@ -249,12 +255,18 @@ public static void Delete(this IDataSetMappingsOperations operations, string res /// /// Continuation token /// + /// + /// Filters the results using OData syntax. + /// + /// + /// Sorts the results using OData syntax. + /// /// /// The cancellation token. /// - public static async Task> ListByShareSubscriptionAsync(this IDataSetMappingsOperations operations, string resourceGroupName, string accountName, string shareSubscriptionName, string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByShareSubscriptionAsync(this IDataSetMappingsOperations operations, string resourceGroupName, string accountName, string shareSubscriptionName, string skipToken = default(string), string filter = default(string), string orderby = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByShareSubscriptionWithHttpMessagesAsync(resourceGroupName, accountName, shareSubscriptionName, skipToken, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByShareSubscriptionWithHttpMessagesAsync(resourceGroupName, accountName, shareSubscriptionName, skipToken, filter, orderby, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/DataSetsOperations.cs b/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/DataSetsOperations.cs index 9f89024743dbd..5c3c2c9f09580 100644 --- a/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/DataSetsOperations.cs +++ b/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/DataSetsOperations.cs @@ -555,6 +555,12 @@ internal DataSetsOperations(DataShareManagementClient client) /// /// continuation token /// + /// + /// Filters the results using OData syntax. + /// + /// + /// Sorts the results using OData syntax. + /// /// /// Headers that will be added to request. /// @@ -576,7 +582,7 @@ internal DataSetsOperations(DataShareManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByShareWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareName, string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByShareWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareName, string skipToken = default(string), string filter = default(string), string orderby = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -609,6 +615,8 @@ internal DataSetsOperations(DataShareManagementClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("shareName", shareName); tracingParameters.Add("skipToken", skipToken); + tracingParameters.Add("filter", filter); + tracingParameters.Add("orderby", orderby); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListByShare", tracingParameters); } @@ -628,6 +636,14 @@ internal DataSetsOperations(DataShareManagementClient client) { _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } + if (orderby != null) + { + _queryParameters.Add(string.Format("$orderby={0}", System.Uri.EscapeDataString(orderby))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); diff --git a/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/DataSetsOperationsExtensions.cs b/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/DataSetsOperationsExtensions.cs index f9fb1d1090ea7..8d7abcf02507b 100644 --- a/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/DataSetsOperationsExtensions.cs +++ b/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/DataSetsOperationsExtensions.cs @@ -219,9 +219,15 @@ public static void Delete(this IDataSetsOperations operations, string resourceGr /// /// continuation token /// - public static IPage ListByShare(this IDataSetsOperations operations, string resourceGroupName, string accountName, string shareName, string skipToken = default(string)) + /// + /// Filters the results using OData syntax. + /// + /// + /// Sorts the results using OData syntax. + /// + public static IPage ListByShare(this IDataSetsOperations operations, string resourceGroupName, string accountName, string shareName, string skipToken = default(string), string filter = default(string), string orderby = default(string)) { - return operations.ListByShareAsync(resourceGroupName, accountName, shareName, skipToken).GetAwaiter().GetResult(); + return operations.ListByShareAsync(resourceGroupName, accountName, shareName, skipToken, filter, orderby).GetAwaiter().GetResult(); } /// @@ -245,12 +251,18 @@ public static void Delete(this IDataSetsOperations operations, string resourceGr /// /// continuation token /// + /// + /// Filters the results using OData syntax. + /// + /// + /// Sorts the results using OData syntax. + /// /// /// The cancellation token. /// - public static async Task> ListByShareAsync(this IDataSetsOperations operations, string resourceGroupName, string accountName, string shareName, string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByShareAsync(this IDataSetsOperations operations, string resourceGroupName, string accountName, string shareName, string skipToken = default(string), string filter = default(string), string orderby = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByShareWithHttpMessagesAsync(resourceGroupName, accountName, shareName, skipToken, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByShareWithHttpMessagesAsync(resourceGroupName, accountName, shareName, skipToken, filter, orderby, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/IAccountsOperations.cs b/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/IAccountsOperations.cs index 93e63ba01ac9f..d6dd20a2025ce 100644 --- a/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/IAccountsOperations.cs +++ b/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/IAccountsOperations.cs @@ -23,6 +23,31 @@ namespace Microsoft.Azure.Management.DataShare /// public partial interface IAccountsOperations { + /// + /// List Accounts in a subscription + /// + /// + /// List Accounts in Subscription + /// + /// + /// Continuation token + /// + /// + /// 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>> ListBySubscriptionWithHttpMessagesAsync(string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Get an account under a resource group /// @@ -142,31 +167,6 @@ public partial interface IAccountsOperations /// Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, AccountUpdateParameters accountUpdateParameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// List Accounts in a subscription - /// - /// - /// List Accounts in Subscription - /// - /// - /// Continuation token - /// - /// - /// 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>> ListBySubscriptionWithHttpMessagesAsync(string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// List Accounts in a resource group /// /// diff --git a/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/IConsumerInvitationsOperations.cs b/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/IConsumerInvitationsOperations.cs index 7f1ca3ed424d0..6325b92f815e1 100644 --- a/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/IConsumerInvitationsOperations.cs +++ b/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/IConsumerInvitationsOperations.cs @@ -24,16 +24,13 @@ namespace Microsoft.Azure.Management.DataShare public partial interface IConsumerInvitationsOperations { /// - /// Rejects the invitation identified by invitationId + /// List the invitations /// /// - /// Reject an invitation + /// Lists invitations /// - /// - /// Location of the invitation - /// - /// - /// An invitation payload + /// + /// The continuation token /// /// /// The headers that will be added to request. @@ -50,7 +47,7 @@ public partial interface IConsumerInvitationsOperations /// /// Thrown when a required parameter is null /// - Task> RejectInvitationWithHttpMessagesAsync(string location, ConsumerInvitation invitation, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListInvitationsWithHttpMessagesAsync(string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets the invitation identified by invitationId /// @@ -80,13 +77,16 @@ public partial interface IConsumerInvitationsOperations /// Task> GetWithHttpMessagesAsync(string location, string invitationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// List the invitations + /// Rejects the invitation identified by invitationId /// /// - /// Lists invitations + /// Reject an invitation /// - /// - /// The continuation token + /// + /// Location of the invitation + /// + /// + /// An invitation payload /// /// /// The headers that will be added to request. @@ -103,7 +103,7 @@ public partial interface IConsumerInvitationsOperations /// /// Thrown when a required parameter is null /// - Task>> ListInvitationsWithHttpMessagesAsync(string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> RejectInvitationWithHttpMessagesAsync(string location, ConsumerInvitation invitation, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// List the invitations /// diff --git a/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/IDataSetMappingsOperations.cs b/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/IDataSetMappingsOperations.cs index ef1bfed000fb2..9c35900c030e2 100644 --- a/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/IDataSetMappingsOperations.cs +++ b/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/IDataSetMappingsOperations.cs @@ -146,6 +146,12 @@ public partial interface IDataSetMappingsOperations /// /// Continuation token /// + /// + /// Filters the results using OData syntax. + /// + /// + /// Sorts the results using OData syntax. + /// /// /// The headers that will be added to request. /// @@ -161,7 +167,7 @@ public partial interface IDataSetMappingsOperations /// /// Thrown when a required parameter is null /// - Task>> ListByShareSubscriptionWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareSubscriptionName, string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByShareSubscriptionWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareSubscriptionName, string skipToken = default(string), string filter = default(string), string orderby = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// List DataSetMappings in a share subscription. /// diff --git a/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/IDataSetsOperations.cs b/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/IDataSetsOperations.cs index d3b86037087a9..91890aaaeaf19 100644 --- a/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/IDataSetsOperations.cs +++ b/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/IDataSetsOperations.cs @@ -143,6 +143,12 @@ public partial interface IDataSetsOperations /// /// continuation token /// + /// + /// Filters the results using OData syntax. + /// + /// + /// Sorts the results using OData syntax. + /// /// /// The headers that will be added to request. /// @@ -158,7 +164,7 @@ public partial interface IDataSetsOperations /// /// Thrown when a required parameter is null /// - Task>> ListByShareWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareName, string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByShareWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareName, string skipToken = default(string), string filter = default(string), string orderby = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Delete DataSet in a share. /// diff --git a/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/IInvitationsOperations.cs b/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/IInvitationsOperations.cs index 03d7eed02517e..c3e74ed03c194 100644 --- a/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/IInvitationsOperations.cs +++ b/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/IInvitationsOperations.cs @@ -143,6 +143,12 @@ public partial interface IInvitationsOperations /// /// The continuation token /// + /// + /// Filters the results using OData syntax. + /// + /// + /// Sorts the results using OData syntax. + /// /// /// The headers that will be added to request. /// @@ -158,7 +164,7 @@ public partial interface IInvitationsOperations /// /// Thrown when a required parameter is null /// - Task>> ListByShareWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareName, string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByShareWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareName, string skipToken = default(string), string filter = default(string), string orderby = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// List all Invitations in a share. /// diff --git a/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/IProviderShareSubscriptionsOperations.cs b/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/IProviderShareSubscriptionsOperations.cs index eb453727e565a..9d646a07e525a 100644 --- a/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/IProviderShareSubscriptionsOperations.cs +++ b/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/IProviderShareSubscriptionsOperations.cs @@ -24,10 +24,10 @@ namespace Microsoft.Azure.Management.DataShare public partial interface IProviderShareSubscriptionsOperations { /// - /// Get share subscription in a provider share. + /// Reinstate share subscription in a provider share. /// /// - /// Get share subscription in a provider share + /// Reinstate share subscription in a provider share /// /// /// The resource group name. @@ -56,12 +56,12 @@ public partial interface IProviderShareSubscriptionsOperations /// /// Thrown when a required parameter is null /// - Task> GetByShareWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareName, string providerShareSubscriptionId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ReinstateWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareName, string providerShareSubscriptionId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// List of available share subscriptions to a provider share. + /// Revoke share subscription in a provider share. /// /// - /// List share subscriptions in a provider share + /// Revoke share subscription in a provider share /// /// /// The resource group name. @@ -72,8 +72,8 @@ public partial interface IProviderShareSubscriptionsOperations /// /// The name of the share. /// - /// - /// Continuation Token + /// + /// To locate shareSubscription /// /// /// The headers that will be added to request. @@ -90,12 +90,12 @@ public partial interface IProviderShareSubscriptionsOperations /// /// Thrown when a required parameter is null /// - Task>> ListByShareWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareName, string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> RevokeWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareName, string providerShareSubscriptionId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Revoke share subscription in a provider share. + /// Get share subscription in a provider share. /// /// - /// Revoke share subscription in a provider share + /// Get share subscription in a provider share /// /// /// The resource group name. @@ -124,12 +124,12 @@ public partial interface IProviderShareSubscriptionsOperations /// /// Thrown when a required parameter is null /// - Task> RevokeWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareName, string providerShareSubscriptionId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetByShareWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareName, string providerShareSubscriptionId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Reinstate share subscription in a provider share. + /// List of available share subscriptions to a provider share. /// /// - /// Reinstate share subscription in a provider share + /// List share subscriptions in a provider share /// /// /// The resource group name. @@ -140,8 +140,8 @@ public partial interface IProviderShareSubscriptionsOperations /// /// The name of the share. /// - /// - /// To locate shareSubscription + /// + /// Continuation Token /// /// /// The headers that will be added to request. @@ -158,7 +158,7 @@ public partial interface IProviderShareSubscriptionsOperations /// /// Thrown when a required parameter is null /// - Task> ReinstateWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareName, string providerShareSubscriptionId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByShareWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareName, string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Revoke share subscription in a provider share. /// diff --git a/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/IShareSubscriptionsOperations.cs b/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/IShareSubscriptionsOperations.cs index ec220422b1bb5..0786309f949fa 100644 --- a/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/IShareSubscriptionsOperations.cs +++ b/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/IShareSubscriptionsOperations.cs @@ -24,10 +24,10 @@ namespace Microsoft.Azure.Management.DataShare public partial interface IShareSubscriptionsOperations { /// - /// Get shareSubscription in an account. + /// Request cancellation of a data share snapshot /// /// - /// Get a shareSubscription in an account + /// Request to cancel a synchronization. /// /// /// The resource group name. @@ -38,6 +38,9 @@ public partial interface IShareSubscriptionsOperations /// /// The name of the shareSubscription. /// + /// + /// Share Subscription Synchronization payload. + /// /// /// The headers that will be added to request. /// @@ -53,12 +56,12 @@ public partial interface IShareSubscriptionsOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareSubscriptionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CancelSynchronizationWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareSubscriptionName, ShareSubscriptionSynchronization shareSubscriptionSynchronization, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Create shareSubscription in an account. + /// Get source share synchronization settings for a shareSubscription. /// /// - /// Create a shareSubscription in an account + /// Get synchronization settings set on a share /// /// /// The resource group name. @@ -69,8 +72,8 @@ public partial interface IShareSubscriptionsOperations /// /// The name of the shareSubscription. /// - /// - /// create parameters for shareSubscription + /// + /// Continuation token /// /// /// The headers that will be added to request. @@ -87,12 +90,13 @@ public partial interface IShareSubscriptionsOperations /// /// Thrown when a required parameter is null /// - Task> CreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareSubscriptionName, ShareSubscription shareSubscription, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListSourceShareSynchronizationSettingsWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareSubscriptionName, string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Delete shareSubscription in an account. + /// List data set level details for a share subscription + /// synchronization /// /// - /// Delete a shareSubscription in an account + /// List synchronization details /// /// /// The resource group name. @@ -101,7 +105,19 @@ public partial interface IShareSubscriptionsOperations /// The name of the share account. /// /// - /// The name of the shareSubscription. + /// The name of the share subscription. + /// + /// + /// Share Subscription Synchronization payload. + /// + /// + /// Continuation token + /// + /// + /// Filters the results using OData syntax. + /// + /// + /// Sorts the results using OData syntax. /// /// /// The headers that will be added to request. @@ -118,12 +134,12 @@ public partial interface IShareSubscriptionsOperations /// /// Thrown when a required parameter is null /// - Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareSubscriptionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListSynchronizationDetailsWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareSubscriptionName, ShareSubscriptionSynchronization shareSubscriptionSynchronization, string skipToken = default(string), string filter = default(string), string orderby = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// List of available share subscriptions under an account. + /// List Synchronizations in a share subscription. /// /// - /// List share subscriptions in an account + /// List synchronizations of a share subscription /// /// /// The resource group name. @@ -131,8 +147,17 @@ public partial interface IShareSubscriptionsOperations /// /// The name of the share account. /// + /// + /// The name of the share subscription. + /// /// - /// Continuation Token + /// Continuation token + /// + /// + /// Filters the results using OData syntax. + /// + /// + /// Sorts the results using OData syntax. /// /// /// The headers that will be added to request. @@ -149,12 +174,12 @@ public partial interface IShareSubscriptionsOperations /// /// Thrown when a required parameter is null /// - Task>> ListByAccountWithHttpMessagesAsync(string resourceGroupName, string accountName, string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListSynchronizationsWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareSubscriptionName, string skipToken = default(string), string filter = default(string), string orderby = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Get source share synchronization settings for a shareSubscription. + /// Initiate an asynchronous data share job /// /// - /// Get synchronization settings set on a share + /// Initiate a copy /// /// /// The resource group name. @@ -163,10 +188,10 @@ public partial interface IShareSubscriptionsOperations /// The name of the share account. /// /// - /// The name of the shareSubscription. + /// The name of share subscription /// - /// - /// Continuation token + /// + /// Synchronize payload /// /// /// The headers that will be added to request. @@ -183,12 +208,12 @@ public partial interface IShareSubscriptionsOperations /// /// Thrown when a required parameter is null /// - Task>> ListSourceShareSynchronizationSettingsWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareSubscriptionName, string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> SynchronizeMethodWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareSubscriptionName, Synchronize synchronize, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// List Synchronizations in a share subscription. + /// Get shareSubscription in an account. /// /// - /// List synchronizations of a share subscription + /// Get a shareSubscription in an account /// /// /// The resource group name. @@ -197,10 +222,7 @@ public partial interface IShareSubscriptionsOperations /// The name of the share account. /// /// - /// The name of the share subscription. - /// - /// - /// Continuation token + /// The name of the shareSubscription. /// /// /// The headers that will be added to request. @@ -217,13 +239,12 @@ public partial interface IShareSubscriptionsOperations /// /// Thrown when a required parameter is null /// - Task>> ListSynchronizationsWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareSubscriptionName, string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareSubscriptionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// List data set level details for a share subscription - /// synchronization + /// Create shareSubscription in an account. /// /// - /// List synchronization details + /// Create a shareSubscription in an account /// /// /// The resource group name. @@ -232,13 +253,10 @@ public partial interface IShareSubscriptionsOperations /// The name of the share account. /// /// - /// The name of the share subscription. - /// - /// - /// Share Subscription Synchronization payload. + /// The name of the shareSubscription. /// - /// - /// Continuation token + /// + /// create parameters for shareSubscription /// /// /// The headers that will be added to request. @@ -255,12 +273,12 @@ public partial interface IShareSubscriptionsOperations /// /// Thrown when a required parameter is null /// - Task>> ListSynchronizationDetailsWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareSubscriptionName, ShareSubscriptionSynchronization shareSubscriptionSynchronization, string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareSubscriptionName, ShareSubscription shareSubscription, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Initiate an asynchronous data share job + /// Delete shareSubscription in an account. /// /// - /// Initiate a copy + /// Delete a shareSubscription in an account /// /// /// The resource group name. @@ -269,10 +287,7 @@ public partial interface IShareSubscriptionsOperations /// The name of the share account. /// /// - /// The name of share subscription - /// - /// - /// Synchronize payload + /// The name of the shareSubscription. /// /// /// The headers that will be added to request. @@ -289,12 +304,12 @@ public partial interface IShareSubscriptionsOperations /// /// Thrown when a required parameter is null /// - Task> SynchronizeMethodWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareSubscriptionName, Synchronize synchronize, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareSubscriptionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Request cancellation of a data share snapshot + /// List of available share subscriptions under an account. /// /// - /// Request to cancel a synchronization. + /// List share subscriptions in an account /// /// /// The resource group name. @@ -302,11 +317,14 @@ public partial interface IShareSubscriptionsOperations /// /// The name of the share account. /// - /// - /// The name of the shareSubscription. + /// + /// Continuation Token /// - /// - /// Share Subscription Synchronization payload. + /// + /// Filters the results using OData syntax. + /// + /// + /// Sorts the results using OData syntax. /// /// /// The headers that will be added to request. @@ -323,12 +341,12 @@ public partial interface IShareSubscriptionsOperations /// /// Thrown when a required parameter is null /// - Task> CancelSynchronizationWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareSubscriptionName, ShareSubscriptionSynchronization shareSubscriptionSynchronization, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByAccountWithHttpMessagesAsync(string resourceGroupName, string accountName, string skipToken = default(string), string filter = default(string), string orderby = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Delete shareSubscription in an account. + /// Request cancellation of a data share snapshot /// /// - /// Delete a shareSubscription in an account + /// Request to cancel a synchronization. /// /// /// The resource group name. @@ -339,6 +357,9 @@ public partial interface IShareSubscriptionsOperations /// /// The name of the shareSubscription. /// + /// + /// Share Subscription Synchronization payload. + /// /// /// The headers that will be added to request. /// @@ -354,7 +375,7 @@ public partial interface IShareSubscriptionsOperations /// /// Thrown when a required parameter is null /// - Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareSubscriptionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginCancelSynchronizationWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareSubscriptionName, ShareSubscriptionSynchronization shareSubscriptionSynchronization, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Initiate an asynchronous data share job /// @@ -390,10 +411,10 @@ public partial interface IShareSubscriptionsOperations /// Task> BeginSynchronizeMethodWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareSubscriptionName, Synchronize synchronize, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Request cancellation of a data share snapshot + /// Delete shareSubscription in an account. /// /// - /// Request to cancel a synchronization. + /// Delete a shareSubscription in an account /// /// /// The resource group name. @@ -404,9 +425,6 @@ public partial interface IShareSubscriptionsOperations /// /// The name of the shareSubscription. /// - /// - /// Share Subscription Synchronization payload. - /// /// /// The headers that will be added to request. /// @@ -422,12 +440,12 @@ public partial interface IShareSubscriptionsOperations /// /// Thrown when a required parameter is null /// - Task> BeginCancelSynchronizationWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareSubscriptionName, ShareSubscriptionSynchronization shareSubscriptionSynchronization, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareSubscriptionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// List of available share subscriptions under an account. + /// Get source share synchronization settings for a shareSubscription. /// /// - /// List share subscriptions in an account + /// Get synchronization settings set on a share /// /// /// The NextLink from the previous successful call to List operation. @@ -447,12 +465,13 @@ public partial interface IShareSubscriptionsOperations /// /// Thrown when a required parameter is null /// - Task>> ListByAccountNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListSourceShareSynchronizationSettingsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Get source share synchronization settings for a shareSubscription. + /// List data set level details for a share subscription + /// synchronization /// /// - /// Get synchronization settings set on a share + /// List synchronization details /// /// /// The NextLink from the previous successful call to List operation. @@ -472,7 +491,7 @@ public partial interface IShareSubscriptionsOperations /// /// Thrown when a required parameter is null /// - Task>> ListSourceShareSynchronizationSettingsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListSynchronizationDetailsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// List Synchronizations in a share subscription. /// @@ -499,11 +518,10 @@ public partial interface IShareSubscriptionsOperations /// Task>> ListSynchronizationsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// List data set level details for a share subscription - /// synchronization + /// List of available share subscriptions under an account. /// /// - /// List synchronization details + /// List share subscriptions in an account /// /// /// The NextLink from the previous successful call to List operation. @@ -523,6 +541,6 @@ public partial interface IShareSubscriptionsOperations /// /// Thrown when a required parameter is null /// - Task>> ListSynchronizationDetailsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByAccountNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/ISharesOperations.cs b/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/ISharesOperations.cs index cf0eb4d8ee74b..fdc763400f508 100644 --- a/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/ISharesOperations.cs +++ b/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/ISharesOperations.cs @@ -24,10 +24,10 @@ namespace Microsoft.Azure.Management.DataShare public partial interface ISharesOperations { /// - /// Get a specified share + /// List data set level details for a share synchronization /// /// - /// Get a share + /// List synchronization details /// /// /// The resource group name. @@ -36,7 +36,19 @@ public partial interface ISharesOperations /// The name of the share account. /// /// - /// The name of the share to retrieve. + /// The name of the share. + /// + /// + /// Share Synchronization payload. + /// + /// + /// Continuation token + /// + /// + /// Filters the results using OData syntax. + /// + /// + /// Sorts the results using OData syntax. /// /// /// The headers that will be added to request. @@ -53,12 +65,12 @@ public partial interface ISharesOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListSynchronizationDetailsWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareName, ShareSynchronization shareSynchronization, string skipToken = default(string), string filter = default(string), string orderby = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Create a share in the given account. + /// List Synchronizations in a share /// /// - /// Create a share + /// List synchronizations of a share /// /// /// The resource group name. @@ -69,8 +81,14 @@ public partial interface ISharesOperations /// /// The name of the share. /// - /// - /// The share payload + /// + /// Continuation token + /// + /// + /// Filters the results using OData syntax. + /// + /// + /// Sorts the results using OData syntax. /// /// /// The headers that will be added to request. @@ -87,12 +105,12 @@ public partial interface ISharesOperations /// /// Thrown when a required parameter is null /// - Task> CreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareName, Share share, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListSynchronizationsWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareName, string skipToken = default(string), string filter = default(string), string orderby = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Deletes a share + /// Get a specified share /// /// - /// Delete a share + /// Get a share /// /// /// The resource group name. @@ -101,7 +119,7 @@ public partial interface ISharesOperations /// The name of the share account. /// /// - /// The name of the share. + /// The name of the share to retrieve. /// /// /// The headers that will be added to request. @@ -118,12 +136,12 @@ public partial interface ISharesOperations /// /// Thrown when a required parameter is null /// - Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// List of available shares under an account. + /// Create a share in the given account. /// /// - /// List shares in an account + /// Create a share /// /// /// The resource group name. @@ -131,8 +149,11 @@ public partial interface ISharesOperations /// /// The name of the share account. /// - /// - /// Continuation Token + /// + /// The name of the share. + /// + /// + /// The share payload /// /// /// The headers that will be added to request. @@ -149,12 +170,12 @@ public partial interface ISharesOperations /// /// Thrown when a required parameter is null /// - Task>> ListByAccountWithHttpMessagesAsync(string resourceGroupName, string accountName, string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareName, Share share, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// List Synchronizations in a share + /// Deletes a share /// /// - /// List synchronizations of a share + /// Delete a share /// /// /// The resource group name. @@ -165,9 +186,6 @@ public partial interface ISharesOperations /// /// The name of the share. /// - /// - /// Continuation token - /// /// /// The headers that will be added to request. /// @@ -183,12 +201,12 @@ public partial interface ISharesOperations /// /// Thrown when a required parameter is null /// - Task>> ListSynchronizationsWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareName, string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// List data set level details for a share synchronization + /// List of available shares under an account. /// /// - /// List synchronization details + /// List shares in an account /// /// /// The resource group name. @@ -196,14 +214,14 @@ public partial interface ISharesOperations /// /// The name of the share account. /// - /// - /// The name of the share. + /// + /// Continuation Token /// - /// - /// Share Synchronization payload. + /// + /// Filters the results using OData syntax. /// - /// - /// Continuation token + /// + /// Sorts the results using OData syntax. /// /// /// The headers that will be added to request. @@ -220,7 +238,7 @@ public partial interface ISharesOperations /// /// Thrown when a required parameter is null /// - Task>> ListSynchronizationDetailsWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareName, ShareSynchronization shareSynchronization, string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByAccountWithHttpMessagesAsync(string resourceGroupName, string accountName, string skipToken = default(string), string filter = default(string), string orderby = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Deletes a share /// @@ -253,10 +271,10 @@ public partial interface ISharesOperations /// Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// List of available shares under an account. + /// List data set level details for a share synchronization /// /// - /// List shares in an account + /// List synchronization details /// /// /// The NextLink from the previous successful call to List operation. @@ -276,7 +294,7 @@ public partial interface ISharesOperations /// /// Thrown when a required parameter is null /// - Task>> ListByAccountNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListSynchronizationDetailsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// List Synchronizations in a share /// @@ -303,10 +321,10 @@ public partial interface ISharesOperations /// Task>> ListSynchronizationsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// List data set level details for a share synchronization + /// List of available shares under an account. /// /// - /// List synchronization details + /// List shares in an account /// /// /// The NextLink from the previous successful call to List operation. @@ -326,6 +344,6 @@ public partial interface ISharesOperations /// /// Thrown when a required parameter is null /// - Task>> ListSynchronizationDetailsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByAccountNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/InvitationsOperations.cs b/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/InvitationsOperations.cs index 4abaebeddebd4..a08f51aff6c8c 100644 --- a/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/InvitationsOperations.cs +++ b/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/InvitationsOperations.cs @@ -715,6 +715,12 @@ internal InvitationsOperations(DataShareManagementClient client) /// /// The continuation token /// + /// + /// Filters the results using OData syntax. + /// + /// + /// Sorts the results using OData syntax. + /// /// /// Headers that will be added to request. /// @@ -736,7 +742,7 @@ internal InvitationsOperations(DataShareManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByShareWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareName, string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByShareWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareName, string skipToken = default(string), string filter = default(string), string orderby = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -769,6 +775,8 @@ internal InvitationsOperations(DataShareManagementClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("shareName", shareName); tracingParameters.Add("skipToken", skipToken); + tracingParameters.Add("filter", filter); + tracingParameters.Add("orderby", orderby); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListByShare", tracingParameters); } @@ -788,6 +796,14 @@ internal InvitationsOperations(DataShareManagementClient client) { _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } + if (orderby != null) + { + _queryParameters.Add(string.Format("$orderby={0}", System.Uri.EscapeDataString(orderby))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); diff --git a/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/InvitationsOperationsExtensions.cs b/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/InvitationsOperationsExtensions.cs index c8670b28a37fb..59bfe6e308472 100644 --- a/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/InvitationsOperationsExtensions.cs +++ b/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/InvitationsOperationsExtensions.cs @@ -219,9 +219,15 @@ public static void Delete(this IInvitationsOperations operations, string resourc /// /// The continuation token /// - public static IPage ListByShare(this IInvitationsOperations operations, string resourceGroupName, string accountName, string shareName, string skipToken = default(string)) + /// + /// Filters the results using OData syntax. + /// + /// + /// Sorts the results using OData syntax. + /// + public static IPage ListByShare(this IInvitationsOperations operations, string resourceGroupName, string accountName, string shareName, string skipToken = default(string), string filter = default(string), string orderby = default(string)) { - return operations.ListByShareAsync(resourceGroupName, accountName, shareName, skipToken).GetAwaiter().GetResult(); + return operations.ListByShareAsync(resourceGroupName, accountName, shareName, skipToken, filter, orderby).GetAwaiter().GetResult(); } /// @@ -245,12 +251,18 @@ public static void Delete(this IInvitationsOperations operations, string resourc /// /// The continuation token /// + /// + /// Filters the results using OData syntax. + /// + /// + /// Sorts the results using OData syntax. + /// /// /// The cancellation token. /// - public static async Task> ListByShareAsync(this IInvitationsOperations operations, string resourceGroupName, string accountName, string shareName, string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByShareAsync(this IInvitationsOperations operations, string resourceGroupName, string accountName, string shareName, string skipToken = default(string), string filter = default(string), string orderby = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByShareWithHttpMessagesAsync(resourceGroupName, accountName, shareName, skipToken, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByShareWithHttpMessagesAsync(resourceGroupName, accountName, shareName, skipToken, filter, orderby, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/Models/DataSet.cs b/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/Models/DataSet.cs index f453cb9d4d1f4..43d00ef299d5f 100644 --- a/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/Models/DataSet.cs +++ b/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/Models/DataSet.cs @@ -10,13 +10,11 @@ namespace Microsoft.Azure.Management.DataShare.Models { - using Newtonsoft.Json; using System.Linq; /// /// A DataSet data transfer object. /// - [Newtonsoft.Json.JsonObject("DataSet")] public partial class DataSet : ProxyDto { /// diff --git a/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/Models/DataSetMapping.cs b/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/Models/DataSetMapping.cs index ee11f00c0e10f..99a33c2f8c57c 100644 --- a/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/Models/DataSetMapping.cs +++ b/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/Models/DataSetMapping.cs @@ -10,13 +10,11 @@ namespace Microsoft.Azure.Management.DataShare.Models { - using Newtonsoft.Json; using System.Linq; /// /// A data set mapping data transfer object. /// - [Newtonsoft.Json.JsonObject("DataSetMapping")] public partial class DataSetMapping : ProxyDto { /// diff --git a/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/Models/SourceShareSynchronizationSetting.cs b/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/Models/SourceShareSynchronizationSetting.cs index c34d9f9393f74..f15fbd2b7318a 100644 --- a/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/Models/SourceShareSynchronizationSetting.cs +++ b/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/Models/SourceShareSynchronizationSetting.cs @@ -10,13 +10,11 @@ namespace Microsoft.Azure.Management.DataShare.Models { - using Newtonsoft.Json; using System.Linq; /// /// A view of synchronization setting added by the provider /// - [Newtonsoft.Json.JsonObject("SourceShareSynchronizationSetting")] public partial class SourceShareSynchronizationSetting { /// diff --git a/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/Models/SynchronizationSetting.cs b/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/Models/SynchronizationSetting.cs index 559f90889fc75..38cc15b4a9438 100644 --- a/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/Models/SynchronizationSetting.cs +++ b/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/Models/SynchronizationSetting.cs @@ -10,13 +10,11 @@ namespace Microsoft.Azure.Management.DataShare.Models { - using Newtonsoft.Json; using System.Linq; /// /// A Synchronization Setting data transfer object. /// - [Newtonsoft.Json.JsonObject("SynchronizationSetting")] public partial class SynchronizationSetting : ProxyDto { /// diff --git a/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/Models/Trigger.cs b/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/Models/Trigger.cs index 6ef6d0f0d61d6..d9cc431a6d371 100644 --- a/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/Models/Trigger.cs +++ b/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/Models/Trigger.cs @@ -10,13 +10,11 @@ namespace Microsoft.Azure.Management.DataShare.Models { - using Newtonsoft.Json; using System.Linq; /// /// A Trigger data transfer object. /// - [Newtonsoft.Json.JsonObject("Trigger")] public partial class Trigger : ProxyDto { /// diff --git a/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/ProviderShareSubscriptionsOperations.cs b/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/ProviderShareSubscriptionsOperations.cs index a1884a6b8708c..2323341235d4b 100644 --- a/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/ProviderShareSubscriptionsOperations.cs +++ b/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/ProviderShareSubscriptionsOperations.cs @@ -51,10 +51,10 @@ internal ProviderShareSubscriptionsOperations(DataShareManagementClient client) public DataShareManagementClient Client { get; private set; } /// - /// Get share subscription in a provider share. + /// Reinstate share subscription in a provider share. /// /// - /// Get share subscription in a provider share + /// Reinstate share subscription in a provider share /// /// /// The resource group name. @@ -89,7 +89,7 @@ internal ProviderShareSubscriptionsOperations(DataShareManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetByShareWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareName, string providerShareSubscriptionId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ReinstateWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareName, string providerShareSubscriptionId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -127,11 +127,11 @@ internal ProviderShareSubscriptionsOperations(DataShareManagementClient client) tracingParameters.Add("shareName", shareName); tracingParameters.Add("providerShareSubscriptionId", providerShareSubscriptionId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetByShare", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Reinstate", 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.DataShare/accounts/{accountName}/shares/{shareName}/providerShareSubscriptions/{providerShareSubscriptionId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/providerShareSubscriptions/{providerShareSubscriptionId}/reinstate").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)); @@ -149,7 +149,7 @@ internal ProviderShareSubscriptionsOperations(DataShareManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -263,10 +263,10 @@ internal ProviderShareSubscriptionsOperations(DataShareManagementClient client) } /// - /// List of available share subscriptions to a provider share. + /// Revoke share subscription in a provider share. /// /// - /// List share subscriptions in a provider share + /// Revoke share subscription in a provider share /// /// /// The resource group name. @@ -277,8 +277,39 @@ internal ProviderShareSubscriptionsOperations(DataShareManagementClient client) /// /// The name of the share. /// - /// - /// Continuation Token + /// + /// To locate shareSubscription + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> RevokeWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareName, string providerShareSubscriptionId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginRevokeWithHttpMessagesAsync(resourceGroupName, accountName, shareName, providerShareSubscriptionId, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get share subscription in a provider share. + /// + /// + /// Get share subscription in a provider share + /// + /// + /// The resource group name. + /// + /// + /// The name of the share account. + /// + /// + /// The name of the share. + /// + /// + /// To locate shareSubscription /// /// /// Headers that will be added to request. @@ -301,7 +332,7 @@ internal ProviderShareSubscriptionsOperations(DataShareManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByShareWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareName, string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetByShareWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareName, string providerShareSubscriptionId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -319,6 +350,10 @@ internal ProviderShareSubscriptionsOperations(DataShareManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "shareName"); } + if (providerShareSubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "providerShareSubscriptionId"); + } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -333,26 +368,23 @@ internal ProviderShareSubscriptionsOperations(DataShareManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("shareName", shareName); - tracingParameters.Add("skipToken", skipToken); + tracingParameters.Add("providerShareSubscriptionId", providerShareSubscriptionId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByShare", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetByShare", 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.DataShare/accounts/{accountName}/shares/{shareName}/providerShareSubscriptions").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/providerShareSubscriptions/{providerShareSubscriptionId}").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("{shareName}", System.Uri.EscapeDataString(shareName)); + _url = _url.Replace("{providerShareSubscriptionId}", System.Uri.EscapeDataString(providerShareSubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } - if (skipToken != null) - { - _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); - } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -441,7 +473,7 @@ internal ProviderShareSubscriptionsOperations(DataShareManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -454,7 +486,7 @@ internal ProviderShareSubscriptionsOperations(DataShareManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -474,41 +506,10 @@ internal ProviderShareSubscriptionsOperations(DataShareManagementClient client) } /// - /// Revoke share subscription in a provider share. - /// - /// - /// Revoke share subscription in a provider share - /// - /// - /// The resource group name. - /// - /// - /// The name of the share account. - /// - /// - /// The name of the share. - /// - /// - /// To locate shareSubscription - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> RevokeWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareName, string providerShareSubscriptionId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginRevokeWithHttpMessagesAsync(resourceGroupName, accountName, shareName, providerShareSubscriptionId, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Reinstate share subscription in a provider share. + /// List of available share subscriptions to a provider share. /// /// - /// Reinstate share subscription in a provider share + /// List share subscriptions in a provider share /// /// /// The resource group name. @@ -519,8 +520,8 @@ internal ProviderShareSubscriptionsOperations(DataShareManagementClient client) /// /// The name of the share. /// - /// - /// To locate shareSubscription + /// + /// Continuation Token /// /// /// Headers that will be added to request. @@ -543,7 +544,7 @@ internal ProviderShareSubscriptionsOperations(DataShareManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ReinstateWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareName, string providerShareSubscriptionId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByShareWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareName, string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -561,10 +562,6 @@ internal ProviderShareSubscriptionsOperations(DataShareManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "shareName"); } - if (providerShareSubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "providerShareSubscriptionId"); - } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -579,23 +576,26 @@ internal ProviderShareSubscriptionsOperations(DataShareManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("shareName", shareName); - tracingParameters.Add("providerShareSubscriptionId", providerShareSubscriptionId); + tracingParameters.Add("skipToken", skipToken); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Reinstate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByShare", 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.DataShare/accounts/{accountName}/shares/{shareName}/providerShareSubscriptions/{providerShareSubscriptionId}/reinstate").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/providerShareSubscriptions").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("{shareName}", System.Uri.EscapeDataString(shareName)); - _url = _url.Replace("{providerShareSubscriptionId}", System.Uri.EscapeDataString(providerShareSubscriptionId)); List _queryParameters = new List(); if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } + if (skipToken != null) + { + _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -603,7 +603,7 @@ internal ProviderShareSubscriptionsOperations(DataShareManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -684,7 +684,7 @@ internal ProviderShareSubscriptionsOperations(DataShareManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -697,7 +697,7 @@ internal ProviderShareSubscriptionsOperations(DataShareManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { diff --git a/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/ProviderShareSubscriptionsOperationsExtensions.cs b/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/ProviderShareSubscriptionsOperationsExtensions.cs index ddf703350b119..be5dfb5201fcb 100644 --- a/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/ProviderShareSubscriptionsOperationsExtensions.cs +++ b/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/ProviderShareSubscriptionsOperationsExtensions.cs @@ -22,10 +22,10 @@ namespace Microsoft.Azure.Management.DataShare public static partial class ProviderShareSubscriptionsOperationsExtensions { /// - /// Get share subscription in a provider share. + /// Reinstate share subscription in a provider share. /// /// - /// Get share subscription in a provider share + /// Reinstate share subscription in a provider share /// /// /// The operations group for this extension method. @@ -42,16 +42,16 @@ public static partial class ProviderShareSubscriptionsOperationsExtensions /// /// To locate shareSubscription /// - public static ProviderShareSubscription GetByShare(this IProviderShareSubscriptionsOperations operations, string resourceGroupName, string accountName, string shareName, string providerShareSubscriptionId) + public static ProviderShareSubscription Reinstate(this IProviderShareSubscriptionsOperations operations, string resourceGroupName, string accountName, string shareName, string providerShareSubscriptionId) { - return operations.GetByShareAsync(resourceGroupName, accountName, shareName, providerShareSubscriptionId).GetAwaiter().GetResult(); + return operations.ReinstateAsync(resourceGroupName, accountName, shareName, providerShareSubscriptionId).GetAwaiter().GetResult(); } /// - /// Get share subscription in a provider share. + /// Reinstate share subscription in a provider share. /// /// - /// Get share subscription in a provider share + /// Reinstate share subscription in a provider share /// /// /// The operations group for this extension method. @@ -71,19 +71,19 @@ public static ProviderShareSubscription GetByShare(this IProviderShareSubscripti /// /// The cancellation token. /// - public static async Task GetByShareAsync(this IProviderShareSubscriptionsOperations operations, string resourceGroupName, string accountName, string shareName, string providerShareSubscriptionId, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ReinstateAsync(this IProviderShareSubscriptionsOperations operations, string resourceGroupName, string accountName, string shareName, string providerShareSubscriptionId, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetByShareWithHttpMessagesAsync(resourceGroupName, accountName, shareName, providerShareSubscriptionId, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ReinstateWithHttpMessagesAsync(resourceGroupName, accountName, shareName, providerShareSubscriptionId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// List of available share subscriptions to a provider share. + /// Revoke share subscription in a provider share. /// /// - /// List share subscriptions in a provider share + /// Revoke share subscription in a provider share /// /// /// The operations group for this extension method. @@ -97,19 +97,19 @@ public static ProviderShareSubscription GetByShare(this IProviderShareSubscripti /// /// The name of the share. /// - /// - /// Continuation Token + /// + /// To locate shareSubscription /// - public static IPage ListByShare(this IProviderShareSubscriptionsOperations operations, string resourceGroupName, string accountName, string shareName, string skipToken = default(string)) + public static ProviderShareSubscription Revoke(this IProviderShareSubscriptionsOperations operations, string resourceGroupName, string accountName, string shareName, string providerShareSubscriptionId) { - return operations.ListByShareAsync(resourceGroupName, accountName, shareName, skipToken).GetAwaiter().GetResult(); + return operations.RevokeAsync(resourceGroupName, accountName, shareName, providerShareSubscriptionId).GetAwaiter().GetResult(); } /// - /// List of available share subscriptions to a provider share. + /// Revoke share subscription in a provider share. /// /// - /// List share subscriptions in a provider share + /// Revoke share subscription in a provider share /// /// /// The operations group for this extension method. @@ -123,25 +123,25 @@ public static ProviderShareSubscription GetByShare(this IProviderShareSubscripti /// /// The name of the share. /// - /// - /// Continuation Token + /// + /// To locate shareSubscription /// /// /// The cancellation token. /// - public static async Task> ListByShareAsync(this IProviderShareSubscriptionsOperations operations, string resourceGroupName, string accountName, string shareName, string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task RevokeAsync(this IProviderShareSubscriptionsOperations operations, string resourceGroupName, string accountName, string shareName, string providerShareSubscriptionId, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByShareWithHttpMessagesAsync(resourceGroupName, accountName, shareName, skipToken, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.RevokeWithHttpMessagesAsync(resourceGroupName, accountName, shareName, providerShareSubscriptionId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Revoke share subscription in a provider share. + /// Get share subscription in a provider share. /// /// - /// Revoke share subscription in a provider share + /// Get share subscription in a provider share /// /// /// The operations group for this extension method. @@ -158,16 +158,16 @@ public static ProviderShareSubscription GetByShare(this IProviderShareSubscripti /// /// To locate shareSubscription /// - public static ProviderShareSubscription Revoke(this IProviderShareSubscriptionsOperations operations, string resourceGroupName, string accountName, string shareName, string providerShareSubscriptionId) + public static ProviderShareSubscription GetByShare(this IProviderShareSubscriptionsOperations operations, string resourceGroupName, string accountName, string shareName, string providerShareSubscriptionId) { - return operations.RevokeAsync(resourceGroupName, accountName, shareName, providerShareSubscriptionId).GetAwaiter().GetResult(); + return operations.GetByShareAsync(resourceGroupName, accountName, shareName, providerShareSubscriptionId).GetAwaiter().GetResult(); } /// - /// Revoke share subscription in a provider share. + /// Get share subscription in a provider share. /// /// - /// Revoke share subscription in a provider share + /// Get share subscription in a provider share /// /// /// The operations group for this extension method. @@ -187,19 +187,19 @@ public static ProviderShareSubscription Revoke(this IProviderShareSubscriptionsO /// /// The cancellation token. /// - public static async Task RevokeAsync(this IProviderShareSubscriptionsOperations operations, string resourceGroupName, string accountName, string shareName, string providerShareSubscriptionId, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetByShareAsync(this IProviderShareSubscriptionsOperations operations, string resourceGroupName, string accountName, string shareName, string providerShareSubscriptionId, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.RevokeWithHttpMessagesAsync(resourceGroupName, accountName, shareName, providerShareSubscriptionId, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetByShareWithHttpMessagesAsync(resourceGroupName, accountName, shareName, providerShareSubscriptionId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Reinstate share subscription in a provider share. + /// List of available share subscriptions to a provider share. /// /// - /// Reinstate share subscription in a provider share + /// List share subscriptions in a provider share /// /// /// The operations group for this extension method. @@ -213,19 +213,19 @@ public static ProviderShareSubscription Revoke(this IProviderShareSubscriptionsO /// /// The name of the share. /// - /// - /// To locate shareSubscription + /// + /// Continuation Token /// - public static ProviderShareSubscription Reinstate(this IProviderShareSubscriptionsOperations operations, string resourceGroupName, string accountName, string shareName, string providerShareSubscriptionId) + public static IPage ListByShare(this IProviderShareSubscriptionsOperations operations, string resourceGroupName, string accountName, string shareName, string skipToken = default(string)) { - return operations.ReinstateAsync(resourceGroupName, accountName, shareName, providerShareSubscriptionId).GetAwaiter().GetResult(); + return operations.ListByShareAsync(resourceGroupName, accountName, shareName, skipToken).GetAwaiter().GetResult(); } /// - /// Reinstate share subscription in a provider share. + /// List of available share subscriptions to a provider share. /// /// - /// Reinstate share subscription in a provider share + /// List share subscriptions in a provider share /// /// /// The operations group for this extension method. @@ -239,15 +239,15 @@ public static ProviderShareSubscription Reinstate(this IProviderShareSubscriptio /// /// The name of the share. /// - /// - /// To locate shareSubscription + /// + /// Continuation Token /// /// /// The cancellation token. /// - public static async Task ReinstateAsync(this IProviderShareSubscriptionsOperations operations, string resourceGroupName, string accountName, string shareName, string providerShareSubscriptionId, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByShareAsync(this IProviderShareSubscriptionsOperations operations, string resourceGroupName, string accountName, string shareName, string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ReinstateWithHttpMessagesAsync(resourceGroupName, accountName, shareName, providerShareSubscriptionId, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByShareWithHttpMessagesAsync(resourceGroupName, accountName, shareName, skipToken, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/SdkInfo_DataShareManagementClient.cs b/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/SdkInfo_DataShareManagementClient.cs index f7fd47faf8d09..61a0b92feb557 100644 --- a/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/SdkInfo_DataShareManagementClient.cs +++ b/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/SdkInfo_DataShareManagementClient.cs @@ -34,16 +34,5 @@ public static IEnumerable> ApiInfo_DataShareManage }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "2.0.4413"; - 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/datashare/resource-manager/readme.md --csharp --version=2.0.4413 --reflect-api-versions --tag=package-2019-11-01 --csharp-sdks-folder=F:\\azure-sdk-for-net\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "9505236faa86b99b6dc58b5655d8e1c4a758d89c"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } - diff --git a/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/ShareSubscriptionsOperations.cs b/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/ShareSubscriptionsOperations.cs index 9123fff700992..b8b8aae99a514 100644 --- a/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/ShareSubscriptionsOperations.cs +++ b/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/ShareSubscriptionsOperations.cs @@ -51,10 +51,10 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) public DataShareManagementClient Client { get; private set; } /// - /// Get shareSubscription in an account. + /// Request cancellation of a data share snapshot /// /// - /// Get a shareSubscription in an account + /// Request to cancel a synchronization. /// /// /// The resource group name. @@ -65,6 +65,40 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) /// /// The name of the shareSubscription. /// + /// + /// Share Subscription Synchronization payload. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CancelSynchronizationWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareSubscriptionName, ShareSubscriptionSynchronization shareSubscriptionSynchronization, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginCancelSynchronizationWithHttpMessagesAsync(resourceGroupName, accountName, shareSubscriptionName, shareSubscriptionSynchronization, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get source share synchronization settings for a shareSubscription. + /// + /// + /// Get synchronization settings set on a share + /// + /// + /// The resource group name. + /// + /// + /// The name of the share account. + /// + /// + /// The name of the shareSubscription. + /// + /// + /// Continuation token + /// /// /// Headers that will be added to request. /// @@ -86,7 +120,7 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareSubscriptionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListSourceShareSynchronizationSettingsWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareSubscriptionName, string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -118,12 +152,13 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("shareSubscriptionName", shareSubscriptionName); + tracingParameters.Add("skipToken", skipToken); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSourceShareSynchronizationSettings", 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.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/listSourceShareSynchronizationSettings").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)); @@ -133,6 +168,10 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } + if (skipToken != null) + { + _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -140,7 +179,7 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -221,7 +260,7 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -234,7 +273,7 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -254,10 +293,10 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) } /// - /// Create shareSubscription in an account. + /// List data set level details for a share subscription synchronization /// /// - /// Create a shareSubscription in an account + /// List synchronization details /// /// /// The resource group name. @@ -266,10 +305,19 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) /// The name of the share account. /// /// - /// The name of the shareSubscription. + /// The name of the share subscription. /// - /// - /// create parameters for shareSubscription + /// + /// Share Subscription Synchronization payload. + /// + /// + /// Continuation token + /// + /// + /// Filters the results using OData syntax. + /// + /// + /// Sorts the results using OData syntax. /// /// /// Headers that will be added to request. @@ -292,7 +340,7 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareSubscriptionName, ShareSubscription shareSubscription, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListSynchronizationDetailsWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareSubscriptionName, ShareSubscriptionSynchronization shareSubscriptionSynchronization, string skipToken = default(string), string filter = default(string), string orderby = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -310,13 +358,13 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "shareSubscriptionName"); } - if (shareSubscription == null) + if (shareSubscriptionSynchronization == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "shareSubscription"); + throw new ValidationException(ValidationRules.CannotBeNull, "shareSubscriptionSynchronization"); } - if (shareSubscription != null) + if (shareSubscriptionSynchronization != null) { - shareSubscription.Validate(); + shareSubscriptionSynchronization.Validate(); } if (Client.ApiVersion == null) { @@ -332,13 +380,16 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("shareSubscriptionName", shareSubscriptionName); - tracingParameters.Add("shareSubscription", shareSubscription); + tracingParameters.Add("shareSubscriptionSynchronization", shareSubscriptionSynchronization); + tracingParameters.Add("skipToken", skipToken); + tracingParameters.Add("filter", filter); + tracingParameters.Add("orderby", orderby); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Create", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSynchronizationDetails", 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.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/listSynchronizationDetails").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)); @@ -348,6 +399,18 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } + if (skipToken != null) + { + _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } + if (orderby != null) + { + _queryParameters.Add(string.Format("$orderby={0}", System.Uri.EscapeDataString(orderby))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -355,7 +418,7 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -386,9 +449,9 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) // Serialize Request string _requestContent = null; - if(shareSubscription != null) + if(shareSubscriptionSynchronization != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(shareSubscription, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(shareSubscriptionSynchronization, 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"); } @@ -412,7 +475,7 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200) { var ex = new DataShareErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -442,7 +505,7 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -455,25 +518,7 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) _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); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -493,10 +538,10 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) } /// - /// Delete shareSubscription in an account. + /// List Synchronizations in a share subscription. /// /// - /// Delete a shareSubscription in an account + /// List synchronizations of a share subscription /// /// /// The resource group name. @@ -505,35 +550,16 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) /// The name of the share account. /// /// - /// The name of the shareSubscription. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. + /// The name of the share subscription. /// - public async Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareSubscriptionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, shareSubscriptionName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// List of available share subscriptions under an account. - /// - /// - /// List share subscriptions in an account - /// - /// - /// The resource group name. + /// + /// Continuation token /// - /// - /// The name of the share account. + /// + /// Filters the results using OData syntax. /// - /// - /// Continuation Token + /// + /// Sorts the results using OData syntax. /// /// /// Headers that will be added to request. @@ -556,7 +582,7 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByAccountWithHttpMessagesAsync(string resourceGroupName, string accountName, string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListSynchronizationsWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareSubscriptionName, string skipToken = default(string), string filter = default(string), string orderby = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -570,6 +596,10 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); } + if (shareSubscriptionName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "shareSubscriptionName"); + } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -583,16 +613,20 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); + tracingParameters.Add("shareSubscriptionName", shareSubscriptionName); tracingParameters.Add("skipToken", skipToken); + tracingParameters.Add("filter", filter); + tracingParameters.Add("orderby", orderby); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByAccount", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSynchronizations", 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.DataShare/accounts/{accountName}/shareSubscriptions").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/listSynchronizations").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("{shareSubscriptionName}", System.Uri.EscapeDataString(shareSubscriptionName)); List _queryParameters = new List(); if (Client.ApiVersion != null) { @@ -602,6 +636,14 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) { _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } + if (orderby != null) + { + _queryParameters.Add(string.Format("$orderby={0}", System.Uri.EscapeDataString(orderby))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -609,7 +651,7 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -690,7 +732,7 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -703,7 +745,7 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -723,10 +765,10 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) } /// - /// Get source share synchronization settings for a shareSubscription. + /// Initiate an asynchronous data share job /// /// - /// Get synchronization settings set on a share + /// Initiate a copy /// /// /// The resource group name. @@ -735,10 +777,38 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) /// The name of the share account. /// /// - /// The name of the shareSubscription. + /// The name of share subscription /// - /// - /// Continuation token + /// + /// Synchronize payload + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> SynchronizeMethodWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareSubscriptionName, Synchronize synchronize, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginSynchronizeMethodWithHttpMessagesAsync(resourceGroupName, accountName, shareSubscriptionName, synchronize, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get shareSubscription in an account. + /// + /// + /// Get a shareSubscription in an account + /// + /// + /// The resource group name. + /// + /// + /// The name of the share account. + /// + /// + /// The name of the shareSubscription. /// /// /// Headers that will be added to request. @@ -761,7 +831,7 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListSourceShareSynchronizationSettingsWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareSubscriptionName, string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareSubscriptionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -793,13 +863,12 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("shareSubscriptionName", shareSubscriptionName); - tracingParameters.Add("skipToken", skipToken); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSourceShareSynchronizationSettings", tracingParameters); + 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.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/listSourceShareSynchronizationSettings").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}").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)); @@ -809,10 +878,6 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } - if (skipToken != null) - { - _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); - } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -820,7 +885,7 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -901,7 +966,7 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -914,7 +979,7 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -934,10 +999,10 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) } /// - /// List Synchronizations in a share subscription. + /// Create shareSubscription in an account. /// /// - /// List synchronizations of a share subscription + /// Create a shareSubscription in an account /// /// /// The resource group name. @@ -946,10 +1011,10 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) /// The name of the share account. /// /// - /// The name of the share subscription. + /// The name of the shareSubscription. /// - /// - /// Continuation token + /// + /// create parameters for shareSubscription /// /// /// Headers that will be added to request. @@ -972,7 +1037,7 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListSynchronizationsWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareSubscriptionName, string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareSubscriptionName, ShareSubscription shareSubscription, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -990,6 +1055,14 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "shareSubscriptionName"); } + if (shareSubscription == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "shareSubscription"); + } + if (shareSubscription != null) + { + shareSubscription.Validate(); + } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -1004,13 +1077,13 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("shareSubscriptionName", shareSubscriptionName); - tracingParameters.Add("skipToken", skipToken); + tracingParameters.Add("shareSubscription", shareSubscription); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSynchronizations", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Create", 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.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/listSynchronizations").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}").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)); @@ -1020,10 +1093,6 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } - if (skipToken != null) - { - _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); - } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -1031,7 +1100,7 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1062,6 +1131,12 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) // Serialize Request string _requestContent = null; + if(shareSubscription != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(shareSubscription, 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) { @@ -1082,7 +1157,7 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new DataShareErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1112,7 +1187,7 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1125,7 +1200,25 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _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); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -1145,10 +1238,38 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) } /// - /// List data set level details for a share subscription synchronization + /// Delete shareSubscription in an account. + /// + /// + /// Delete a shareSubscription in an account + /// + /// + /// The resource group name. + /// + /// + /// The name of the share account. + /// + /// + /// The name of the shareSubscription. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareSubscriptionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, shareSubscriptionName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// List of available share subscriptions under an account. /// /// - /// List synchronization details + /// List share subscriptions in an account /// /// /// The resource group name. @@ -1156,14 +1277,14 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) /// /// The name of the share account. /// - /// - /// The name of the share subscription. + /// + /// Continuation Token /// - /// - /// Share Subscription Synchronization payload. + /// + /// Filters the results using OData syntax. /// - /// - /// Continuation token + /// + /// Sorts the results using OData syntax. /// /// /// Headers that will be added to request. @@ -1186,7 +1307,7 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListSynchronizationDetailsWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareSubscriptionName, ShareSubscriptionSynchronization shareSubscriptionSynchronization, string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByAccountWithHttpMessagesAsync(string resourceGroupName, string accountName, string skipToken = default(string), string filter = default(string), string orderby = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -1200,18 +1321,6 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); } - if (shareSubscriptionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "shareSubscriptionName"); - } - if (shareSubscriptionSynchronization == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "shareSubscriptionSynchronization"); - } - if (shareSubscriptionSynchronization != null) - { - shareSubscriptionSynchronization.Validate(); - } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -1225,19 +1334,18 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("shareSubscriptionName", shareSubscriptionName); - tracingParameters.Add("shareSubscriptionSynchronization", shareSubscriptionSynchronization); tracingParameters.Add("skipToken", skipToken); + tracingParameters.Add("filter", filter); + tracingParameters.Add("orderby", orderby); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSynchronizationDetails", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByAccount", 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.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/listSynchronizationDetails").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions").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("{shareSubscriptionName}", System.Uri.EscapeDataString(shareSubscriptionName)); List _queryParameters = new List(); if (Client.ApiVersion != null) { @@ -1247,6 +1355,14 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) { _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } + if (orderby != null) + { + _queryParameters.Add(string.Format("$orderby={0}", System.Uri.EscapeDataString(orderby))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -1254,7 +1370,7 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1285,12 +1401,6 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) // Serialize Request string _requestContent = null; - if(shareSubscriptionSynchronization != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(shareSubscriptionSynchronization, 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) { @@ -1341,7 +1451,7 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1354,7 +1464,7 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -1373,37 +1483,6 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) return _result; } - /// - /// Initiate an asynchronous data share job - /// - /// - /// Initiate a copy - /// - /// - /// The resource group name. - /// - /// - /// The name of the share account. - /// - /// - /// The name of share subscription - /// - /// - /// Synchronize payload - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> SynchronizeMethodWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareSubscriptionName, Synchronize synchronize, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginSynchronizeMethodWithHttpMessagesAsync(resourceGroupName, accountName, shareSubscriptionName, synchronize, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - /// /// Request cancellation of a data share snapshot /// @@ -1423,34 +1502,6 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) /// Share Subscription Synchronization payload. /// /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> CancelSynchronizationWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareSubscriptionName, ShareSubscriptionSynchronization shareSubscriptionSynchronization, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginCancelSynchronizationWithHttpMessagesAsync(resourceGroupName, accountName, shareSubscriptionName, shareSubscriptionSynchronization, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Delete shareSubscription in an account. - /// - /// - /// Delete a shareSubscription in an account - /// - /// - /// The resource group name. - /// - /// - /// The name of the share account. - /// - /// - /// The name of the shareSubscription. - /// - /// /// Headers that will be added to request. /// /// @@ -1471,7 +1522,7 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareSubscriptionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCancelSynchronizationWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareSubscriptionName, ShareSubscriptionSynchronization shareSubscriptionSynchronization, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -1489,6 +1540,14 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "shareSubscriptionName"); } + if (shareSubscriptionSynchronization == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "shareSubscriptionSynchronization"); + } + if (shareSubscriptionSynchronization != null) + { + shareSubscriptionSynchronization.Validate(); + } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -1503,12 +1562,13 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("shareSubscriptionName", shareSubscriptionName); + tracingParameters.Add("shareSubscriptionSynchronization", shareSubscriptionSynchronization); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCancelSynchronization", 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.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/cancelSynchronization").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)); @@ -1525,7 +1585,7 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1556,6 +1616,12 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) // Serialize Request string _requestContent = null; + if(shareSubscriptionSynchronization != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(shareSubscriptionSynchronization, 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) { @@ -1576,7 +1642,7 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new DataShareErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1606,7 +1672,7 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1619,7 +1685,25 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _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); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -1874,10 +1958,10 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) } /// - /// Request cancellation of a data share snapshot + /// Delete shareSubscription in an account. /// /// - /// Request to cancel a synchronization. + /// Delete a shareSubscription in an account /// /// /// The resource group name. @@ -1888,9 +1972,6 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) /// /// The name of the shareSubscription. /// - /// - /// Share Subscription Synchronization payload. - /// /// /// Headers that will be added to request. /// @@ -1912,7 +1993,7 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCancelSynchronizationWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareSubscriptionName, ShareSubscriptionSynchronization shareSubscriptionSynchronization, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareSubscriptionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -1930,14 +2011,6 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "shareSubscriptionName"); } - if (shareSubscriptionSynchronization == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "shareSubscriptionSynchronization"); - } - if (shareSubscriptionSynchronization != null) - { - shareSubscriptionSynchronization.Validate(); - } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -1952,13 +2025,12 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("shareSubscriptionName", shareSubscriptionName); - tracingParameters.Add("shareSubscriptionSynchronization", shareSubscriptionSynchronization); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCancelSynchronization", tracingParameters); + 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.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/cancelSynchronization").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}").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)); @@ -1975,7 +2047,7 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -2006,12 +2078,6 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) // Serialize Request string _requestContent = null; - if(shareSubscriptionSynchronization != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(shareSubscriptionSynchronization, 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) { @@ -2032,7 +2098,7 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new DataShareErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -2062,7 +2128,7 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -2075,25 +2141,7 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) _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); - } - } - // Deserialize Response - if ((int)_statusCode == 202) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -2113,10 +2161,10 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) } /// - /// List of available share subscriptions under an account. + /// Get source share synchronization settings for a shareSubscription. /// /// - /// List share subscriptions in an account + /// Get synchronization settings set on a share /// /// /// The NextLink from the previous successful call to List operation. @@ -2142,7 +2190,7 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByAccountNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListSourceShareSynchronizationSettingsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -2157,7 +2205,7 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByAccountNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSourceShareSynchronizationSettingsNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -2170,7 +2218,7 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -2251,7 +2299,7 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -2264,7 +2312,7 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -2284,10 +2332,10 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) } /// - /// Get source share synchronization settings for a shareSubscription. + /// List data set level details for a share subscription synchronization /// /// - /// Get synchronization settings set on a share + /// List synchronization details /// /// /// The NextLink from the previous successful call to List operation. @@ -2313,7 +2361,7 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListSourceShareSynchronizationSettingsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListSynchronizationDetailsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -2328,7 +2376,7 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSourceShareSynchronizationSettingsNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSynchronizationDetailsNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -2422,7 +2470,7 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -2435,7 +2483,7 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -2626,10 +2674,10 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) } /// - /// List data set level details for a share subscription synchronization + /// List of available share subscriptions under an account. /// /// - /// List synchronization details + /// List share subscriptions in an account /// /// /// The NextLink from the previous successful call to List operation. @@ -2655,7 +2703,7 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListSynchronizationDetailsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByAccountNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -2670,7 +2718,7 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSynchronizationDetailsNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByAccountNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -2683,7 +2731,7 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -2764,7 +2812,7 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -2777,7 +2825,7 @@ internal ShareSubscriptionsOperations(DataShareManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { diff --git a/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/ShareSubscriptionsOperationsExtensions.cs b/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/ShareSubscriptionsOperationsExtensions.cs index d8a710c32e3e2..946c94ef1f643 100644 --- a/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/ShareSubscriptionsOperationsExtensions.cs +++ b/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/ShareSubscriptionsOperationsExtensions.cs @@ -22,10 +22,10 @@ namespace Microsoft.Azure.Management.DataShare public static partial class ShareSubscriptionsOperationsExtensions { /// - /// Get shareSubscription in an account. + /// Request cancellation of a data share snapshot /// /// - /// Get a shareSubscription in an account + /// Request to cancel a synchronization. /// /// /// The operations group for this extension method. @@ -39,16 +39,19 @@ public static partial class ShareSubscriptionsOperationsExtensions /// /// The name of the shareSubscription. /// - public static ShareSubscription Get(this IShareSubscriptionsOperations operations, string resourceGroupName, string accountName, string shareSubscriptionName) + /// + /// Share Subscription Synchronization payload. + /// + public static ShareSubscriptionSynchronization CancelSynchronization(this IShareSubscriptionsOperations operations, string resourceGroupName, string accountName, string shareSubscriptionName, ShareSubscriptionSynchronization shareSubscriptionSynchronization) { - return operations.GetAsync(resourceGroupName, accountName, shareSubscriptionName).GetAwaiter().GetResult(); + return operations.CancelSynchronizationAsync(resourceGroupName, accountName, shareSubscriptionName, shareSubscriptionSynchronization).GetAwaiter().GetResult(); } /// - /// Get shareSubscription in an account. + /// Request cancellation of a data share snapshot /// /// - /// Get a shareSubscription in an account + /// Request to cancel a synchronization. /// /// /// The operations group for this extension method. @@ -62,22 +65,25 @@ public static ShareSubscription Get(this IShareSubscriptionsOperations operation /// /// The name of the shareSubscription. /// + /// + /// Share Subscription Synchronization payload. + /// /// /// The cancellation token. /// - public static async Task GetAsync(this IShareSubscriptionsOperations operations, string resourceGroupName, string accountName, string shareSubscriptionName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CancelSynchronizationAsync(this IShareSubscriptionsOperations operations, string resourceGroupName, string accountName, string shareSubscriptionName, ShareSubscriptionSynchronization shareSubscriptionSynchronization, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, accountName, shareSubscriptionName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CancelSynchronizationWithHttpMessagesAsync(resourceGroupName, accountName, shareSubscriptionName, shareSubscriptionSynchronization, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Create shareSubscription in an account. + /// Get source share synchronization settings for a shareSubscription. /// /// - /// Create a shareSubscription in an account + /// Get synchronization settings set on a share /// /// /// The operations group for this extension method. @@ -91,19 +97,19 @@ public static ShareSubscription Get(this IShareSubscriptionsOperations operation /// /// The name of the shareSubscription. /// - /// - /// create parameters for shareSubscription + /// + /// Continuation token /// - public static ShareSubscription Create(this IShareSubscriptionsOperations operations, string resourceGroupName, string accountName, string shareSubscriptionName, ShareSubscription shareSubscription) + public static IPage ListSourceShareSynchronizationSettings(this IShareSubscriptionsOperations operations, string resourceGroupName, string accountName, string shareSubscriptionName, string skipToken = default(string)) { - return operations.CreateAsync(resourceGroupName, accountName, shareSubscriptionName, shareSubscription).GetAwaiter().GetResult(); + return operations.ListSourceShareSynchronizationSettingsAsync(resourceGroupName, accountName, shareSubscriptionName, skipToken).GetAwaiter().GetResult(); } /// - /// Create shareSubscription in an account. + /// Get source share synchronization settings for a shareSubscription. /// /// - /// Create a shareSubscription in an account + /// Get synchronization settings set on a share /// /// /// The operations group for this extension method. @@ -117,25 +123,25 @@ public static ShareSubscription Create(this IShareSubscriptionsOperations operat /// /// The name of the shareSubscription. /// - /// - /// create parameters for shareSubscription + /// + /// Continuation token /// /// /// The cancellation token. /// - public static async Task CreateAsync(this IShareSubscriptionsOperations operations, string resourceGroupName, string accountName, string shareSubscriptionName, ShareSubscription shareSubscription, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListSourceShareSynchronizationSettingsAsync(this IShareSubscriptionsOperations operations, string resourceGroupName, string accountName, string shareSubscriptionName, string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, accountName, shareSubscriptionName, shareSubscription, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListSourceShareSynchronizationSettingsWithHttpMessagesAsync(resourceGroupName, accountName, shareSubscriptionName, skipToken, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Delete shareSubscription in an account. + /// List data set level details for a share subscription synchronization /// /// - /// Delete a shareSubscription in an account + /// List synchronization details /// /// /// The operations group for this extension method. @@ -147,18 +153,30 @@ public static ShareSubscription Create(this IShareSubscriptionsOperations operat /// The name of the share account. /// /// - /// The name of the shareSubscription. + /// The name of the share subscription. /// - public static OperationResponse Delete(this IShareSubscriptionsOperations operations, string resourceGroupName, string accountName, string shareSubscriptionName) + /// + /// Share Subscription Synchronization payload. + /// + /// + /// Continuation token + /// + /// + /// Filters the results using OData syntax. + /// + /// + /// Sorts the results using OData syntax. + /// + public static IPage ListSynchronizationDetails(this IShareSubscriptionsOperations operations, string resourceGroupName, string accountName, string shareSubscriptionName, ShareSubscriptionSynchronization shareSubscriptionSynchronization, string skipToken = default(string), string filter = default(string), string orderby = default(string)) { - return operations.DeleteAsync(resourceGroupName, accountName, shareSubscriptionName).GetAwaiter().GetResult(); + return operations.ListSynchronizationDetailsAsync(resourceGroupName, accountName, shareSubscriptionName, shareSubscriptionSynchronization, skipToken, filter, orderby).GetAwaiter().GetResult(); } /// - /// Delete shareSubscription in an account. + /// List data set level details for a share subscription synchronization /// /// - /// Delete a shareSubscription in an account + /// List synchronization details /// /// /// The operations group for this extension method. @@ -170,24 +188,36 @@ public static OperationResponse Delete(this IShareSubscriptionsOperations operat /// The name of the share account. /// /// - /// The name of the shareSubscription. + /// The name of the share subscription. + /// + /// + /// Share Subscription Synchronization payload. + /// + /// + /// Continuation token + /// + /// + /// Filters the results using OData syntax. + /// + /// + /// Sorts the results using OData syntax. /// /// /// The cancellation token. /// - public static async Task DeleteAsync(this IShareSubscriptionsOperations operations, string resourceGroupName, string accountName, string shareSubscriptionName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListSynchronizationDetailsAsync(this IShareSubscriptionsOperations operations, string resourceGroupName, string accountName, string shareSubscriptionName, ShareSubscriptionSynchronization shareSubscriptionSynchronization, string skipToken = default(string), string filter = default(string), string orderby = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, accountName, shareSubscriptionName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListSynchronizationDetailsWithHttpMessagesAsync(resourceGroupName, accountName, shareSubscriptionName, shareSubscriptionSynchronization, skipToken, filter, orderby, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// List of available share subscriptions under an account. + /// List Synchronizations in a share subscription. /// /// - /// List share subscriptions in an account + /// List synchronizations of a share subscription /// /// /// The operations group for this extension method. @@ -198,19 +228,28 @@ public static OperationResponse Delete(this IShareSubscriptionsOperations operat /// /// The name of the share account. /// + /// + /// The name of the share subscription. + /// /// - /// Continuation Token + /// Continuation token /// - public static IPage ListByAccount(this IShareSubscriptionsOperations operations, string resourceGroupName, string accountName, string skipToken = default(string)) + /// + /// Filters the results using OData syntax. + /// + /// + /// Sorts the results using OData syntax. + /// + public static IPage ListSynchronizations(this IShareSubscriptionsOperations operations, string resourceGroupName, string accountName, string shareSubscriptionName, string skipToken = default(string), string filter = default(string), string orderby = default(string)) { - return operations.ListByAccountAsync(resourceGroupName, accountName, skipToken).GetAwaiter().GetResult(); + return operations.ListSynchronizationsAsync(resourceGroupName, accountName, shareSubscriptionName, skipToken, filter, orderby).GetAwaiter().GetResult(); } /// - /// List of available share subscriptions under an account. + /// List Synchronizations in a share subscription. /// /// - /// List share subscriptions in an account + /// List synchronizations of a share subscription /// /// /// The operations group for this extension method. @@ -221,25 +260,34 @@ public static OperationResponse Delete(this IShareSubscriptionsOperations operat /// /// The name of the share account. /// + /// + /// The name of the share subscription. + /// /// - /// Continuation Token + /// Continuation token + /// + /// + /// Filters the results using OData syntax. + /// + /// + /// Sorts the results using OData syntax. /// /// /// The cancellation token. /// - public static async Task> ListByAccountAsync(this IShareSubscriptionsOperations operations, string resourceGroupName, string accountName, string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListSynchronizationsAsync(this IShareSubscriptionsOperations operations, string resourceGroupName, string accountName, string shareSubscriptionName, string skipToken = default(string), string filter = default(string), string orderby = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByAccountWithHttpMessagesAsync(resourceGroupName, accountName, skipToken, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListSynchronizationsWithHttpMessagesAsync(resourceGroupName, accountName, shareSubscriptionName, skipToken, filter, orderby, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Get source share synchronization settings for a shareSubscription. + /// Initiate an asynchronous data share job /// /// - /// Get synchronization settings set on a share + /// Initiate a copy /// /// /// The operations group for this extension method. @@ -251,21 +299,21 @@ public static OperationResponse Delete(this IShareSubscriptionsOperations operat /// The name of the share account. /// /// - /// The name of the shareSubscription. + /// The name of share subscription /// - /// - /// Continuation token + /// + /// Synchronize payload /// - public static IPage ListSourceShareSynchronizationSettings(this IShareSubscriptionsOperations operations, string resourceGroupName, string accountName, string shareSubscriptionName, string skipToken = default(string)) + public static ShareSubscriptionSynchronization SynchronizeMethod(this IShareSubscriptionsOperations operations, string resourceGroupName, string accountName, string shareSubscriptionName, Synchronize synchronize) { - return operations.ListSourceShareSynchronizationSettingsAsync(resourceGroupName, accountName, shareSubscriptionName, skipToken).GetAwaiter().GetResult(); + return operations.SynchronizeMethodAsync(resourceGroupName, accountName, shareSubscriptionName, synchronize).GetAwaiter().GetResult(); } /// - /// Get source share synchronization settings for a shareSubscription. + /// Initiate an asynchronous data share job /// /// - /// Get synchronization settings set on a share + /// Initiate a copy /// /// /// The operations group for this extension method. @@ -277,27 +325,27 @@ public static OperationResponse Delete(this IShareSubscriptionsOperations operat /// The name of the share account. /// /// - /// The name of the shareSubscription. + /// The name of share subscription /// - /// - /// Continuation token + /// + /// Synchronize payload /// /// /// The cancellation token. /// - public static async Task> ListSourceShareSynchronizationSettingsAsync(this IShareSubscriptionsOperations operations, string resourceGroupName, string accountName, string shareSubscriptionName, string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task SynchronizeMethodAsync(this IShareSubscriptionsOperations operations, string resourceGroupName, string accountName, string shareSubscriptionName, Synchronize synchronize, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListSourceShareSynchronizationSettingsWithHttpMessagesAsync(resourceGroupName, accountName, shareSubscriptionName, skipToken, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.SynchronizeMethodWithHttpMessagesAsync(resourceGroupName, accountName, shareSubscriptionName, synchronize, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// List Synchronizations in a share subscription. + /// Get shareSubscription in an account. /// /// - /// List synchronizations of a share subscription + /// Get a shareSubscription in an account /// /// /// The operations group for this extension method. @@ -309,21 +357,18 @@ public static OperationResponse Delete(this IShareSubscriptionsOperations operat /// The name of the share account. /// /// - /// The name of the share subscription. - /// - /// - /// Continuation token + /// The name of the shareSubscription. /// - public static IPage ListSynchronizations(this IShareSubscriptionsOperations operations, string resourceGroupName, string accountName, string shareSubscriptionName, string skipToken = default(string)) + public static ShareSubscription Get(this IShareSubscriptionsOperations operations, string resourceGroupName, string accountName, string shareSubscriptionName) { - return operations.ListSynchronizationsAsync(resourceGroupName, accountName, shareSubscriptionName, skipToken).GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, accountName, shareSubscriptionName).GetAwaiter().GetResult(); } /// - /// List Synchronizations in a share subscription. + /// Get shareSubscription in an account. /// /// - /// List synchronizations of a share subscription + /// Get a shareSubscription in an account /// /// /// The operations group for this extension method. @@ -335,27 +380,24 @@ public static OperationResponse Delete(this IShareSubscriptionsOperations operat /// The name of the share account. /// /// - /// The name of the share subscription. - /// - /// - /// Continuation token + /// The name of the shareSubscription. /// /// /// The cancellation token. /// - public static async Task> ListSynchronizationsAsync(this IShareSubscriptionsOperations operations, string resourceGroupName, string accountName, string shareSubscriptionName, string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IShareSubscriptionsOperations operations, string resourceGroupName, string accountName, string shareSubscriptionName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListSynchronizationsWithHttpMessagesAsync(resourceGroupName, accountName, shareSubscriptionName, skipToken, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, accountName, shareSubscriptionName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// List data set level details for a share subscription synchronization + /// Create shareSubscription in an account. /// /// - /// List synchronization details + /// Create a shareSubscription in an account /// /// /// The operations group for this extension method. @@ -367,24 +409,21 @@ public static OperationResponse Delete(this IShareSubscriptionsOperations operat /// The name of the share account. /// /// - /// The name of the share subscription. - /// - /// - /// Share Subscription Synchronization payload. + /// The name of the shareSubscription. /// - /// - /// Continuation token + /// + /// create parameters for shareSubscription /// - public static IPage ListSynchronizationDetails(this IShareSubscriptionsOperations operations, string resourceGroupName, string accountName, string shareSubscriptionName, ShareSubscriptionSynchronization shareSubscriptionSynchronization, string skipToken = default(string)) + public static ShareSubscription Create(this IShareSubscriptionsOperations operations, string resourceGroupName, string accountName, string shareSubscriptionName, ShareSubscription shareSubscription) { - return operations.ListSynchronizationDetailsAsync(resourceGroupName, accountName, shareSubscriptionName, shareSubscriptionSynchronization, skipToken).GetAwaiter().GetResult(); + return operations.CreateAsync(resourceGroupName, accountName, shareSubscriptionName, shareSubscription).GetAwaiter().GetResult(); } /// - /// List data set level details for a share subscription synchronization + /// Create shareSubscription in an account. /// /// - /// List synchronization details + /// Create a shareSubscription in an account /// /// /// The operations group for this extension method. @@ -396,30 +435,27 @@ public static OperationResponse Delete(this IShareSubscriptionsOperations operat /// The name of the share account. /// /// - /// The name of the share subscription. - /// - /// - /// Share Subscription Synchronization payload. + /// The name of the shareSubscription. /// - /// - /// Continuation token + /// + /// create parameters for shareSubscription /// /// /// The cancellation token. /// - public static async Task> ListSynchronizationDetailsAsync(this IShareSubscriptionsOperations operations, string resourceGroupName, string accountName, string shareSubscriptionName, ShareSubscriptionSynchronization shareSubscriptionSynchronization, string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateAsync(this IShareSubscriptionsOperations operations, string resourceGroupName, string accountName, string shareSubscriptionName, ShareSubscription shareSubscription, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListSynchronizationDetailsWithHttpMessagesAsync(resourceGroupName, accountName, shareSubscriptionName, shareSubscriptionSynchronization, skipToken, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, accountName, shareSubscriptionName, shareSubscription, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Initiate an asynchronous data share job + /// Delete shareSubscription in an account. /// /// - /// Initiate a copy + /// Delete a shareSubscription in an account /// /// /// The operations group for this extension method. @@ -431,21 +467,18 @@ public static OperationResponse Delete(this IShareSubscriptionsOperations operat /// The name of the share account. /// /// - /// The name of share subscription - /// - /// - /// Synchronize payload + /// The name of the shareSubscription. /// - public static ShareSubscriptionSynchronization SynchronizeMethod(this IShareSubscriptionsOperations operations, string resourceGroupName, string accountName, string shareSubscriptionName, Synchronize synchronize) + public static OperationResponse Delete(this IShareSubscriptionsOperations operations, string resourceGroupName, string accountName, string shareSubscriptionName) { - return operations.SynchronizeMethodAsync(resourceGroupName, accountName, shareSubscriptionName, synchronize).GetAwaiter().GetResult(); + return operations.DeleteAsync(resourceGroupName, accountName, shareSubscriptionName).GetAwaiter().GetResult(); } /// - /// Initiate an asynchronous data share job + /// Delete shareSubscription in an account. /// /// - /// Initiate a copy + /// Delete a shareSubscription in an account /// /// /// The operations group for this extension method. @@ -457,27 +490,24 @@ public static ShareSubscriptionSynchronization SynchronizeMethod(this IShareSubs /// The name of the share account. /// /// - /// The name of share subscription - /// - /// - /// Synchronize payload + /// The name of the shareSubscription. /// /// /// The cancellation token. /// - public static async Task SynchronizeMethodAsync(this IShareSubscriptionsOperations operations, string resourceGroupName, string accountName, string shareSubscriptionName, Synchronize synchronize, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteAsync(this IShareSubscriptionsOperations operations, string resourceGroupName, string accountName, string shareSubscriptionName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.SynchronizeMethodWithHttpMessagesAsync(resourceGroupName, accountName, shareSubscriptionName, synchronize, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, accountName, shareSubscriptionName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Request cancellation of a data share snapshot + /// List of available share subscriptions under an account. /// /// - /// Request to cancel a synchronization. + /// List share subscriptions in an account /// /// /// The operations group for this extension method. @@ -488,22 +518,25 @@ public static ShareSubscriptionSynchronization SynchronizeMethod(this IShareSubs /// /// The name of the share account. /// - /// - /// The name of the shareSubscription. + /// + /// Continuation Token /// - /// - /// Share Subscription Synchronization payload. + /// + /// Filters the results using OData syntax. /// - public static ShareSubscriptionSynchronization CancelSynchronization(this IShareSubscriptionsOperations operations, string resourceGroupName, string accountName, string shareSubscriptionName, ShareSubscriptionSynchronization shareSubscriptionSynchronization) + /// + /// Sorts the results using OData syntax. + /// + public static IPage ListByAccount(this IShareSubscriptionsOperations operations, string resourceGroupName, string accountName, string skipToken = default(string), string filter = default(string), string orderby = default(string)) { - return operations.CancelSynchronizationAsync(resourceGroupName, accountName, shareSubscriptionName, shareSubscriptionSynchronization).GetAwaiter().GetResult(); + return operations.ListByAccountAsync(resourceGroupName, accountName, skipToken, filter, orderby).GetAwaiter().GetResult(); } /// - /// Request cancellation of a data share snapshot + /// List of available share subscriptions under an account. /// /// - /// Request to cancel a synchronization. + /// List share subscriptions in an account /// /// /// The operations group for this extension method. @@ -514,28 +547,31 @@ public static ShareSubscriptionSynchronization CancelSynchronization(this IShare /// /// The name of the share account. /// - /// - /// The name of the shareSubscription. + /// + /// Continuation Token /// - /// - /// Share Subscription Synchronization payload. + /// + /// Filters the results using OData syntax. + /// + /// + /// Sorts the results using OData syntax. /// /// /// The cancellation token. /// - public static async Task CancelSynchronizationAsync(this IShareSubscriptionsOperations operations, string resourceGroupName, string accountName, string shareSubscriptionName, ShareSubscriptionSynchronization shareSubscriptionSynchronization, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByAccountAsync(this IShareSubscriptionsOperations operations, string resourceGroupName, string accountName, string skipToken = default(string), string filter = default(string), string orderby = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CancelSynchronizationWithHttpMessagesAsync(resourceGroupName, accountName, shareSubscriptionName, shareSubscriptionSynchronization, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByAccountWithHttpMessagesAsync(resourceGroupName, accountName, skipToken, filter, orderby, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Delete shareSubscription in an account. + /// Request cancellation of a data share snapshot /// /// - /// Delete a shareSubscription in an account + /// Request to cancel a synchronization. /// /// /// The operations group for this extension method. @@ -549,16 +585,19 @@ public static ShareSubscriptionSynchronization CancelSynchronization(this IShare /// /// The name of the shareSubscription. /// - public static OperationResponse BeginDelete(this IShareSubscriptionsOperations operations, string resourceGroupName, string accountName, string shareSubscriptionName) + /// + /// Share Subscription Synchronization payload. + /// + public static ShareSubscriptionSynchronization BeginCancelSynchronization(this IShareSubscriptionsOperations operations, string resourceGroupName, string accountName, string shareSubscriptionName, ShareSubscriptionSynchronization shareSubscriptionSynchronization) { - return operations.BeginDeleteAsync(resourceGroupName, accountName, shareSubscriptionName).GetAwaiter().GetResult(); + return operations.BeginCancelSynchronizationAsync(resourceGroupName, accountName, shareSubscriptionName, shareSubscriptionSynchronization).GetAwaiter().GetResult(); } /// - /// Delete shareSubscription in an account. + /// Request cancellation of a data share snapshot /// /// - /// Delete a shareSubscription in an account + /// Request to cancel a synchronization. /// /// /// The operations group for this extension method. @@ -572,12 +611,15 @@ public static OperationResponse BeginDelete(this IShareSubscriptionsOperations o /// /// The name of the shareSubscription. /// + /// + /// Share Subscription Synchronization payload. + /// /// /// The cancellation token. /// - public static async Task BeginDeleteAsync(this IShareSubscriptionsOperations operations, string resourceGroupName, string accountName, string shareSubscriptionName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginCancelSynchronizationAsync(this IShareSubscriptionsOperations operations, string resourceGroupName, string accountName, string shareSubscriptionName, ShareSubscriptionSynchronization shareSubscriptionSynchronization, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, shareSubscriptionName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginCancelSynchronizationWithHttpMessagesAsync(resourceGroupName, accountName, shareSubscriptionName, shareSubscriptionSynchronization, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -642,10 +684,10 @@ public static ShareSubscriptionSynchronization BeginSynchronizeMethod(this IShar } /// - /// Request cancellation of a data share snapshot + /// Delete shareSubscription in an account. /// /// - /// Request to cancel a synchronization. + /// Delete a shareSubscription in an account /// /// /// The operations group for this extension method. @@ -659,19 +701,16 @@ public static ShareSubscriptionSynchronization BeginSynchronizeMethod(this IShar /// /// The name of the shareSubscription. /// - /// - /// Share Subscription Synchronization payload. - /// - public static ShareSubscriptionSynchronization BeginCancelSynchronization(this IShareSubscriptionsOperations operations, string resourceGroupName, string accountName, string shareSubscriptionName, ShareSubscriptionSynchronization shareSubscriptionSynchronization) + public static OperationResponse BeginDelete(this IShareSubscriptionsOperations operations, string resourceGroupName, string accountName, string shareSubscriptionName) { - return operations.BeginCancelSynchronizationAsync(resourceGroupName, accountName, shareSubscriptionName, shareSubscriptionSynchronization).GetAwaiter().GetResult(); + return operations.BeginDeleteAsync(resourceGroupName, accountName, shareSubscriptionName).GetAwaiter().GetResult(); } /// - /// Request cancellation of a data share snapshot + /// Delete shareSubscription in an account. /// /// - /// Request to cancel a synchronization. + /// Delete a shareSubscription in an account /// /// /// The operations group for this extension method. @@ -685,25 +724,22 @@ public static ShareSubscriptionSynchronization BeginCancelSynchronization(this I /// /// The name of the shareSubscription. /// - /// - /// Share Subscription Synchronization payload. - /// /// /// The cancellation token. /// - public static async Task BeginCancelSynchronizationAsync(this IShareSubscriptionsOperations operations, string resourceGroupName, string accountName, string shareSubscriptionName, ShareSubscriptionSynchronization shareSubscriptionSynchronization, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginDeleteAsync(this IShareSubscriptionsOperations operations, string resourceGroupName, string accountName, string shareSubscriptionName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginCancelSynchronizationWithHttpMessagesAsync(resourceGroupName, accountName, shareSubscriptionName, shareSubscriptionSynchronization, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, shareSubscriptionName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// List of available share subscriptions under an account. + /// Get source share synchronization settings for a shareSubscription. /// /// - /// List share subscriptions in an account + /// Get synchronization settings set on a share /// /// /// The operations group for this extension method. @@ -711,16 +747,16 @@ public static ShareSubscriptionSynchronization BeginCancelSynchronization(this I /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListByAccountNext(this IShareSubscriptionsOperations operations, string nextPageLink) + public static IPage ListSourceShareSynchronizationSettingsNext(this IShareSubscriptionsOperations operations, string nextPageLink) { - return operations.ListByAccountNextAsync(nextPageLink).GetAwaiter().GetResult(); + return operations.ListSourceShareSynchronizationSettingsNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// - /// List of available share subscriptions under an account. + /// Get source share synchronization settings for a shareSubscription. /// /// - /// List share subscriptions in an account + /// Get synchronization settings set on a share /// /// /// The operations group for this extension method. @@ -731,19 +767,19 @@ public static IPage ListByAccountNext(this IShareSubscription /// /// The cancellation token. /// - public static async Task> ListByAccountNextAsync(this IShareSubscriptionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListSourceShareSynchronizationSettingsNextAsync(this IShareSubscriptionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByAccountNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListSourceShareSynchronizationSettingsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Get source share synchronization settings for a shareSubscription. + /// List data set level details for a share subscription synchronization /// /// - /// Get synchronization settings set on a share + /// List synchronization details /// /// /// The operations group for this extension method. @@ -751,16 +787,16 @@ public static IPage ListByAccountNext(this IShareSubscription /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListSourceShareSynchronizationSettingsNext(this IShareSubscriptionsOperations operations, string nextPageLink) + public static IPage ListSynchronizationDetailsNext(this IShareSubscriptionsOperations operations, string nextPageLink) { - return operations.ListSourceShareSynchronizationSettingsNextAsync(nextPageLink).GetAwaiter().GetResult(); + return operations.ListSynchronizationDetailsNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// - /// Get source share synchronization settings for a shareSubscription. + /// List data set level details for a share subscription synchronization /// /// - /// Get synchronization settings set on a share + /// List synchronization details /// /// /// The operations group for this extension method. @@ -771,9 +807,9 @@ public static IPage ListSourceShareSynchroniz /// /// The cancellation token. /// - public static async Task> ListSourceShareSynchronizationSettingsNextAsync(this IShareSubscriptionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListSynchronizationDetailsNextAsync(this IShareSubscriptionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListSourceShareSynchronizationSettingsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListSynchronizationDetailsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -820,10 +856,10 @@ public static IPage ListSynchronizationsNext(t } /// - /// List data set level details for a share subscription synchronization + /// List of available share subscriptions under an account. /// /// - /// List synchronization details + /// List share subscriptions in an account /// /// /// The operations group for this extension method. @@ -831,16 +867,16 @@ public static IPage ListSynchronizationsNext(t /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListSynchronizationDetailsNext(this IShareSubscriptionsOperations operations, string nextPageLink) + public static IPage ListByAccountNext(this IShareSubscriptionsOperations operations, string nextPageLink) { - return operations.ListSynchronizationDetailsNextAsync(nextPageLink).GetAwaiter().GetResult(); + return operations.ListByAccountNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// - /// List data set level details for a share subscription synchronization + /// List of available share subscriptions under an account. /// /// - /// List synchronization details + /// List share subscriptions in an account /// /// /// The operations group for this extension method. @@ -851,9 +887,9 @@ public static IPage ListSynchronizationDetailsNext(this /// /// The cancellation token. /// - public static async Task> ListSynchronizationDetailsNextAsync(this IShareSubscriptionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByAccountNextAsync(this IShareSubscriptionsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListSynchronizationDetailsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByAccountNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/SharesOperations.cs b/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/SharesOperations.cs index 8253d02d53969..caf5cd91797ac 100644 --- a/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/SharesOperations.cs +++ b/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/SharesOperations.cs @@ -51,10 +51,10 @@ internal SharesOperations(DataShareManagementClient client) public DataShareManagementClient Client { get; private set; } /// - /// Get a specified share + /// List data set level details for a share synchronization /// /// - /// Get a share + /// List synchronization details /// /// /// The resource group name. @@ -63,7 +63,19 @@ internal SharesOperations(DataShareManagementClient client) /// The name of the share account. /// /// - /// The name of the share to retrieve. + /// The name of the share. + /// + /// + /// Share Synchronization payload. + /// + /// + /// Continuation token + /// + /// + /// Filters the results using OData syntax. + /// + /// + /// Sorts the results using OData syntax. /// /// /// Headers that will be added to request. @@ -86,7 +98,7 @@ internal SharesOperations(DataShareManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListSynchronizationDetailsWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareName, ShareSynchronization shareSynchronization, string skipToken = default(string), string filter = default(string), string orderby = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -104,6 +116,10 @@ internal SharesOperations(DataShareManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "shareName"); } + if (shareSynchronization == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "shareSynchronization"); + } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -118,12 +134,16 @@ internal SharesOperations(DataShareManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("shareName", shareName); + tracingParameters.Add("shareSynchronization", shareSynchronization); + tracingParameters.Add("skipToken", skipToken); + tracingParameters.Add("filter", filter); + tracingParameters.Add("orderby", orderby); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSynchronizationDetails", 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.DataShare/accounts/{accountName}/shares/{shareName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/listSynchronizationDetails").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)); @@ -133,6 +153,18 @@ internal SharesOperations(DataShareManagementClient client) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } + if (skipToken != null) + { + _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } + if (orderby != null) + { + _queryParameters.Add(string.Format("$orderby={0}", System.Uri.EscapeDataString(orderby))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -140,7 +172,7 @@ internal SharesOperations(DataShareManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -171,6 +203,12 @@ internal SharesOperations(DataShareManagementClient client) // Serialize Request string _requestContent = null; + if(shareSynchronization != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(shareSynchronization, 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) { @@ -221,7 +259,7 @@ internal SharesOperations(DataShareManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -234,7 +272,7 @@ internal SharesOperations(DataShareManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -254,10 +292,10 @@ internal SharesOperations(DataShareManagementClient client) } /// - /// Create a share in the given account. + /// List Synchronizations in a share /// /// - /// Create a share + /// List synchronizations of a share /// /// /// The resource group name. @@ -268,8 +306,14 @@ internal SharesOperations(DataShareManagementClient client) /// /// The name of the share. /// - /// - /// The share payload + /// + /// Continuation token + /// + /// + /// Filters the results using OData syntax. + /// + /// + /// Sorts the results using OData syntax. /// /// /// Headers that will be added to request. @@ -292,7 +336,7 @@ internal SharesOperations(DataShareManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareName, Share share, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListSynchronizationsWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareName, string skipToken = default(string), string filter = default(string), string orderby = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -310,10 +354,6 @@ internal SharesOperations(DataShareManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "shareName"); } - if (share == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "share"); - } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -328,13 +368,15 @@ internal SharesOperations(DataShareManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("shareName", shareName); - tracingParameters.Add("share", share); + tracingParameters.Add("skipToken", skipToken); + tracingParameters.Add("filter", filter); + tracingParameters.Add("orderby", orderby); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Create", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSynchronizations", 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.DataShare/accounts/{accountName}/shares/{shareName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/listSynchronizations").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)); @@ -344,6 +386,18 @@ internal SharesOperations(DataShareManagementClient client) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } + if (skipToken != null) + { + _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } + if (orderby != null) + { + _queryParameters.Add(string.Format("$orderby={0}", System.Uri.EscapeDataString(orderby))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -351,7 +405,7 @@ internal SharesOperations(DataShareManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -382,12 +436,6 @@ internal SharesOperations(DataShareManagementClient client) // Serialize Request string _requestContent = null; - if(share != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(share, 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) { @@ -408,7 +456,7 @@ internal SharesOperations(DataShareManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200) { var ex = new DataShareErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -438,7 +486,7 @@ internal SharesOperations(DataShareManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -451,25 +499,7 @@ internal SharesOperations(DataShareManagementClient client) _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); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -489,10 +519,10 @@ internal SharesOperations(DataShareManagementClient client) } /// - /// Deletes a share + /// Get a specified share /// /// - /// Delete a share + /// Get a share /// /// /// The resource group name. @@ -501,35 +531,7 @@ internal SharesOperations(DataShareManagementClient client) /// The name of the share account. /// /// - /// The name of the share. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, shareName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// List of available shares under an account. - /// - /// - /// List shares in an account - /// - /// - /// The resource group name. - /// - /// - /// The name of the share account. - /// - /// - /// Continuation Token + /// The name of the share to retrieve. /// /// /// Headers that will be added to request. @@ -552,7 +554,7 @@ internal SharesOperations(DataShareManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByAccountWithHttpMessagesAsync(string resourceGroupName, string accountName, string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -566,6 +568,10 @@ internal SharesOperations(DataShareManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); } + if (shareName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "shareName"); + } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -579,25 +585,22 @@ internal SharesOperations(DataShareManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("skipToken", skipToken); + tracingParameters.Add("shareName", shareName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByAccount", tracingParameters); + 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.DataShare/accounts/{accountName}/shares").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}").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("{shareName}", System.Uri.EscapeDataString(shareName)); List _queryParameters = new List(); if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } - if (skipToken != null) - { - _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); - } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -686,7 +689,7 @@ internal SharesOperations(DataShareManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -699,7 +702,7 @@ internal SharesOperations(DataShareManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -719,10 +722,10 @@ internal SharesOperations(DataShareManagementClient client) } /// - /// List Synchronizations in a share + /// Create a share in the given account. /// /// - /// List synchronizations of a share + /// Create a share /// /// /// The resource group name. @@ -733,8 +736,8 @@ internal SharesOperations(DataShareManagementClient client) /// /// The name of the share. /// - /// - /// Continuation token + /// + /// The share payload /// /// /// Headers that will be added to request. @@ -757,7 +760,7 @@ internal SharesOperations(DataShareManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListSynchronizationsWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareName, string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareName, Share share, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -775,6 +778,10 @@ internal SharesOperations(DataShareManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "shareName"); } + if (share == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "share"); + } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -789,13 +796,13 @@ internal SharesOperations(DataShareManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("shareName", shareName); - tracingParameters.Add("skipToken", skipToken); + tracingParameters.Add("share", share); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSynchronizations", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Create", 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.DataShare/accounts/{accountName}/shares/{shareName}/listSynchronizations").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}").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)); @@ -805,10 +812,6 @@ internal SharesOperations(DataShareManagementClient client) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } - if (skipToken != null) - { - _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); - } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -816,7 +819,7 @@ internal SharesOperations(DataShareManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -847,6 +850,12 @@ internal SharesOperations(DataShareManagementClient client) // Serialize Request string _requestContent = null; + if(share != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(share, 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) { @@ -867,7 +876,7 @@ internal SharesOperations(DataShareManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new DataShareErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -897,7 +906,7 @@ internal SharesOperations(DataShareManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -910,7 +919,25 @@ internal SharesOperations(DataShareManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _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); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -930,10 +957,10 @@ internal SharesOperations(DataShareManagementClient client) } /// - /// List data set level details for a share synchronization + /// Deletes a share /// /// - /// List synchronization details + /// Delete a share /// /// /// The resource group name. @@ -944,11 +971,39 @@ internal SharesOperations(DataShareManagementClient client) /// /// The name of the share. /// - /// - /// Share Synchronization payload. + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, shareName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// List of available shares under an account. + /// + /// + /// List shares in an account + /// + /// + /// The resource group name. + /// + /// + /// The name of the share account. /// /// - /// Continuation token + /// Continuation Token + /// + /// + /// Filters the results using OData syntax. + /// + /// + /// Sorts the results using OData syntax. /// /// /// Headers that will be added to request. @@ -971,7 +1026,7 @@ internal SharesOperations(DataShareManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListSynchronizationDetailsWithHttpMessagesAsync(string resourceGroupName, string accountName, string shareName, ShareSynchronization shareSynchronization, string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByAccountWithHttpMessagesAsync(string resourceGroupName, string accountName, string skipToken = default(string), string filter = default(string), string orderby = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -985,14 +1040,6 @@ internal SharesOperations(DataShareManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); } - if (shareName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "shareName"); - } - if (shareSynchronization == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "shareSynchronization"); - } if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -1006,19 +1053,18 @@ internal SharesOperations(DataShareManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("shareName", shareName); - tracingParameters.Add("shareSynchronization", shareSynchronization); tracingParameters.Add("skipToken", skipToken); + tracingParameters.Add("filter", filter); + tracingParameters.Add("orderby", orderby); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSynchronizationDetails", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByAccount", 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.DataShare/accounts/{accountName}/shares/{shareName}/listSynchronizationDetails").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares").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("{shareName}", System.Uri.EscapeDataString(shareName)); List _queryParameters = new List(); if (Client.ApiVersion != null) { @@ -1028,6 +1074,14 @@ internal SharesOperations(DataShareManagementClient client) { _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } + if (orderby != null) + { + _queryParameters.Add(string.Format("$orderby={0}", System.Uri.EscapeDataString(orderby))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -1035,7 +1089,7 @@ internal SharesOperations(DataShareManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1066,12 +1120,6 @@ internal SharesOperations(DataShareManagementClient client) // Serialize Request string _requestContent = null; - if(shareSynchronization != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(shareSynchronization, 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) { @@ -1122,7 +1170,7 @@ internal SharesOperations(DataShareManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1135,7 +1183,7 @@ internal SharesOperations(DataShareManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -1358,10 +1406,10 @@ internal SharesOperations(DataShareManagementClient client) } /// - /// List of available shares under an account. + /// List data set level details for a share synchronization /// /// - /// List shares in an account + /// List synchronization details /// /// /// The NextLink from the previous successful call to List operation. @@ -1387,7 +1435,7 @@ internal SharesOperations(DataShareManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListByAccountNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListSynchronizationDetailsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -1402,7 +1450,7 @@ internal SharesOperations(DataShareManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByAccountNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListSynchronizationDetailsNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -1415,7 +1463,7 @@ internal SharesOperations(DataShareManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1496,7 +1544,7 @@ internal SharesOperations(DataShareManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1509,7 +1557,7 @@ internal SharesOperations(DataShareManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -1700,10 +1748,10 @@ internal SharesOperations(DataShareManagementClient client) } /// - /// List data set level details for a share synchronization + /// List of available shares under an account. /// /// - /// List synchronization details + /// List shares in an account /// /// /// The NextLink from the previous successful call to List operation. @@ -1729,7 +1777,7 @@ internal SharesOperations(DataShareManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListSynchronizationDetailsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByAccountNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -1744,7 +1792,7 @@ internal SharesOperations(DataShareManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSynchronizationDetailsNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByAccountNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -1757,7 +1805,7 @@ internal SharesOperations(DataShareManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1838,7 +1886,7 @@ internal SharesOperations(DataShareManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1851,7 +1899,7 @@ internal SharesOperations(DataShareManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { diff --git a/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/SharesOperationsExtensions.cs b/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/SharesOperationsExtensions.cs index 190c573091d44..f82691ed68372 100644 --- a/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/SharesOperationsExtensions.cs +++ b/sdk/datashare/Microsoft.Azure.Management.DataShare/src/Generated/SharesOperationsExtensions.cs @@ -22,10 +22,10 @@ namespace Microsoft.Azure.Management.DataShare public static partial class SharesOperationsExtensions { /// - /// Get a specified share + /// List data set level details for a share synchronization /// /// - /// Get a share + /// List synchronization details /// /// /// The operations group for this extension method. @@ -37,18 +37,30 @@ public static partial class SharesOperationsExtensions /// The name of the share account. /// /// - /// The name of the share to retrieve. + /// The name of the share. /// - public static Share Get(this ISharesOperations operations, string resourceGroupName, string accountName, string shareName) + /// + /// Share Synchronization payload. + /// + /// + /// Continuation token + /// + /// + /// Filters the results using OData syntax. + /// + /// + /// Sorts the results using OData syntax. + /// + public static IPage ListSynchronizationDetails(this ISharesOperations operations, string resourceGroupName, string accountName, string shareName, ShareSynchronization shareSynchronization, string skipToken = default(string), string filter = default(string), string orderby = default(string)) { - return operations.GetAsync(resourceGroupName, accountName, shareName).GetAwaiter().GetResult(); + return operations.ListSynchronizationDetailsAsync(resourceGroupName, accountName, shareName, shareSynchronization, skipToken, filter, orderby).GetAwaiter().GetResult(); } /// - /// Get a specified share + /// List data set level details for a share synchronization /// /// - /// Get a share + /// List synchronization details /// /// /// The operations group for this extension method. @@ -60,24 +72,36 @@ public static Share Get(this ISharesOperations operations, string resourceGroupN /// The name of the share account. /// /// - /// The name of the share to retrieve. + /// The name of the share. + /// + /// + /// Share Synchronization payload. + /// + /// + /// Continuation token + /// + /// + /// Filters the results using OData syntax. + /// + /// + /// Sorts the results using OData syntax. /// /// /// The cancellation token. /// - public static async Task GetAsync(this ISharesOperations operations, string resourceGroupName, string accountName, string shareName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListSynchronizationDetailsAsync(this ISharesOperations operations, string resourceGroupName, string accountName, string shareName, ShareSynchronization shareSynchronization, string skipToken = default(string), string filter = default(string), string orderby = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, accountName, shareName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListSynchronizationDetailsWithHttpMessagesAsync(resourceGroupName, accountName, shareName, shareSynchronization, skipToken, filter, orderby, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Create a share in the given account. + /// List Synchronizations in a share /// /// - /// Create a share + /// List synchronizations of a share /// /// /// The operations group for this extension method. @@ -91,19 +115,25 @@ public static Share Get(this ISharesOperations operations, string resourceGroupN /// /// The name of the share. /// - /// - /// The share payload + /// + /// Continuation token /// - public static Share Create(this ISharesOperations operations, string resourceGroupName, string accountName, string shareName, Share share) + /// + /// Filters the results using OData syntax. + /// + /// + /// Sorts the results using OData syntax. + /// + public static IPage ListSynchronizations(this ISharesOperations operations, string resourceGroupName, string accountName, string shareName, string skipToken = default(string), string filter = default(string), string orderby = default(string)) { - return operations.CreateAsync(resourceGroupName, accountName, shareName, share).GetAwaiter().GetResult(); + return operations.ListSynchronizationsAsync(resourceGroupName, accountName, shareName, skipToken, filter, orderby).GetAwaiter().GetResult(); } /// - /// Create a share in the given account. + /// List Synchronizations in a share /// /// - /// Create a share + /// List synchronizations of a share /// /// /// The operations group for this extension method. @@ -117,25 +147,31 @@ public static Share Create(this ISharesOperations operations, string resourceGro /// /// The name of the share. /// - /// - /// The share payload + /// + /// Continuation token + /// + /// + /// Filters the results using OData syntax. + /// + /// + /// Sorts the results using OData syntax. /// /// /// The cancellation token. /// - public static async Task CreateAsync(this ISharesOperations operations, string resourceGroupName, string accountName, string shareName, Share share, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListSynchronizationsAsync(this ISharesOperations operations, string resourceGroupName, string accountName, string shareName, string skipToken = default(string), string filter = default(string), string orderby = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, accountName, shareName, share, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListSynchronizationsWithHttpMessagesAsync(resourceGroupName, accountName, shareName, skipToken, filter, orderby, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Deletes a share + /// Get a specified share /// /// - /// Delete a share + /// Get a share /// /// /// The operations group for this extension method. @@ -147,18 +183,18 @@ public static Share Create(this ISharesOperations operations, string resourceGro /// The name of the share account. /// /// - /// The name of the share. + /// The name of the share to retrieve. /// - public static OperationResponse Delete(this ISharesOperations operations, string resourceGroupName, string accountName, string shareName) + public static Share Get(this ISharesOperations operations, string resourceGroupName, string accountName, string shareName) { - return operations.DeleteAsync(resourceGroupName, accountName, shareName).GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, accountName, shareName).GetAwaiter().GetResult(); } /// - /// Deletes a share + /// Get a specified share /// /// - /// Delete a share + /// Get a share /// /// /// The operations group for this extension method. @@ -170,24 +206,24 @@ public static OperationResponse Delete(this ISharesOperations operations, string /// The name of the share account. /// /// - /// The name of the share. + /// The name of the share to retrieve. /// /// /// The cancellation token. /// - public static async Task DeleteAsync(this ISharesOperations operations, string resourceGroupName, string accountName, string shareName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this ISharesOperations operations, string resourceGroupName, string accountName, string shareName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, accountName, shareName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, accountName, shareName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// List of available shares under an account. + /// Create a share in the given account. /// /// - /// List shares in an account + /// Create a share /// /// /// The operations group for this extension method. @@ -198,19 +234,22 @@ public static OperationResponse Delete(this ISharesOperations operations, string /// /// The name of the share account. /// - /// - /// Continuation Token + /// + /// The name of the share. /// - public static IPage ListByAccount(this ISharesOperations operations, string resourceGroupName, string accountName, string skipToken = default(string)) + /// + /// The share payload + /// + public static Share Create(this ISharesOperations operations, string resourceGroupName, string accountName, string shareName, Share share) { - return operations.ListByAccountAsync(resourceGroupName, accountName, skipToken).GetAwaiter().GetResult(); + return operations.CreateAsync(resourceGroupName, accountName, shareName, share).GetAwaiter().GetResult(); } /// - /// List of available shares under an account. + /// Create a share in the given account. /// /// - /// List shares in an account + /// Create a share /// /// /// The operations group for this extension method. @@ -221,25 +260,28 @@ public static OperationResponse Delete(this ISharesOperations operations, string /// /// The name of the share account. /// - /// - /// Continuation Token + /// + /// The name of the share. + /// + /// + /// The share payload /// /// /// The cancellation token. /// - public static async Task> ListByAccountAsync(this ISharesOperations operations, string resourceGroupName, string accountName, string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateAsync(this ISharesOperations operations, string resourceGroupName, string accountName, string shareName, Share share, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByAccountWithHttpMessagesAsync(resourceGroupName, accountName, skipToken, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, accountName, shareName, share, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// List Synchronizations in a share + /// Deletes a share /// /// - /// List synchronizations of a share + /// Delete a share /// /// /// The operations group for this extension method. @@ -253,19 +295,16 @@ public static OperationResponse Delete(this ISharesOperations operations, string /// /// The name of the share. /// - /// - /// Continuation token - /// - public static IPage ListSynchronizations(this ISharesOperations operations, string resourceGroupName, string accountName, string shareName, string skipToken = default(string)) + public static OperationResponse Delete(this ISharesOperations operations, string resourceGroupName, string accountName, string shareName) { - return operations.ListSynchronizationsAsync(resourceGroupName, accountName, shareName, skipToken).GetAwaiter().GetResult(); + return operations.DeleteAsync(resourceGroupName, accountName, shareName).GetAwaiter().GetResult(); } /// - /// List Synchronizations in a share + /// Deletes a share /// /// - /// List synchronizations of a share + /// Delete a share /// /// /// The operations group for this extension method. @@ -279,25 +318,22 @@ public static OperationResponse Delete(this ISharesOperations operations, string /// /// The name of the share. /// - /// - /// Continuation token - /// /// /// The cancellation token. /// - public static async Task> ListSynchronizationsAsync(this ISharesOperations operations, string resourceGroupName, string accountName, string shareName, string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteAsync(this ISharesOperations operations, string resourceGroupName, string accountName, string shareName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListSynchronizationsWithHttpMessagesAsync(resourceGroupName, accountName, shareName, skipToken, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, accountName, shareName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// List data set level details for a share synchronization + /// List of available shares under an account. /// /// - /// List synchronization details + /// List shares in an account /// /// /// The operations group for this extension method. @@ -308,25 +344,25 @@ public static OperationResponse Delete(this ISharesOperations operations, string /// /// The name of the share account. /// - /// - /// The name of the share. + /// + /// Continuation Token /// - /// - /// Share Synchronization payload. + /// + /// Filters the results using OData syntax. /// - /// - /// Continuation token + /// + /// Sorts the results using OData syntax. /// - public static IPage ListSynchronizationDetails(this ISharesOperations operations, string resourceGroupName, string accountName, string shareName, ShareSynchronization shareSynchronization, string skipToken = default(string)) + public static IPage ListByAccount(this ISharesOperations operations, string resourceGroupName, string accountName, string skipToken = default(string), string filter = default(string), string orderby = default(string)) { - return operations.ListSynchronizationDetailsAsync(resourceGroupName, accountName, shareName, shareSynchronization, skipToken).GetAwaiter().GetResult(); + return operations.ListByAccountAsync(resourceGroupName, accountName, skipToken, filter, orderby).GetAwaiter().GetResult(); } /// - /// List data set level details for a share synchronization + /// List of available shares under an account. /// /// - /// List synchronization details + /// List shares in an account /// /// /// The operations group for this extension method. @@ -337,21 +373,21 @@ public static OperationResponse Delete(this ISharesOperations operations, string /// /// The name of the share account. /// - /// - /// The name of the share. + /// + /// Continuation Token /// - /// - /// Share Synchronization payload. + /// + /// Filters the results using OData syntax. /// - /// - /// Continuation token + /// + /// Sorts the results using OData syntax. /// /// /// The cancellation token. /// - public static async Task> ListSynchronizationDetailsAsync(this ISharesOperations operations, string resourceGroupName, string accountName, string shareName, ShareSynchronization shareSynchronization, string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByAccountAsync(this ISharesOperations operations, string resourceGroupName, string accountName, string skipToken = default(string), string filter = default(string), string orderby = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListSynchronizationDetailsWithHttpMessagesAsync(resourceGroupName, accountName, shareName, shareSynchronization, skipToken, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByAccountWithHttpMessagesAsync(resourceGroupName, accountName, skipToken, filter, orderby, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -410,10 +446,10 @@ public static OperationResponse BeginDelete(this ISharesOperations operations, s } /// - /// List of available shares under an account. + /// List data set level details for a share synchronization /// /// - /// List shares in an account + /// List synchronization details /// /// /// The operations group for this extension method. @@ -421,16 +457,16 @@ public static OperationResponse BeginDelete(this ISharesOperations operations, s /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListByAccountNext(this ISharesOperations operations, string nextPageLink) + public static IPage ListSynchronizationDetailsNext(this ISharesOperations operations, string nextPageLink) { - return operations.ListByAccountNextAsync(nextPageLink).GetAwaiter().GetResult(); + return operations.ListSynchronizationDetailsNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// - /// List of available shares under an account. + /// List data set level details for a share synchronization /// /// - /// List shares in an account + /// List synchronization details /// /// /// The operations group for this extension method. @@ -441,9 +477,9 @@ public static IPage ListByAccountNext(this ISharesOperations operations, /// /// The cancellation token. /// - public static async Task> ListByAccountNextAsync(this ISharesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListSynchronizationDetailsNextAsync(this ISharesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByAccountNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListSynchronizationDetailsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -490,10 +526,10 @@ public static IPage ListSynchronizationsNext(this ISharesO } /// - /// List data set level details for a share synchronization + /// List of available shares under an account. /// /// - /// List synchronization details + /// List shares in an account /// /// /// The operations group for this extension method. @@ -501,16 +537,16 @@ public static IPage ListSynchronizationsNext(this ISharesO /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListSynchronizationDetailsNext(this ISharesOperations operations, string nextPageLink) + public static IPage ListByAccountNext(this ISharesOperations operations, string nextPageLink) { - return operations.ListSynchronizationDetailsNextAsync(nextPageLink).GetAwaiter().GetResult(); + return operations.ListByAccountNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// - /// List data set level details for a share synchronization + /// List of available shares under an account. /// /// - /// List synchronization details + /// List shares in an account /// /// /// The operations group for this extension method. @@ -521,9 +557,9 @@ public static IPage ListSynchronizationDetailsNext(this /// /// The cancellation token. /// - public static async Task> ListSynchronizationDetailsNextAsync(this ISharesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListByAccountNextAsync(this ISharesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListSynchronizationDetailsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListByAccountNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; }