From de4d1fd322568caae06040649fc330299a32799b Mon Sep 17 00:00:00 2001 From: Wenming Liu Date: Sat, 11 May 2024 15:38:52 +0800 Subject: [PATCH 1/8] 1st commit --- ...sourceManager.AppService.netstandard2.0.cs | 12 ++ .../RestOperations/WebAppsRestOperations.cs | 160 ++++++++++++++++++ .../src/Customization/WebSiteResource.cs | 6 +- .../src/Customization/WebSiteSlotResource.cs | 5 + .../Models/HybridConnectionListResult.cs | 2 + .../RestOperations/WebAppsRestOperations.cs | 38 ++--- .../src/Generated/WebSiteResource.cs | 58 +++++++ .../src/Generated/WebSiteSlotResource.cs | 58 +++++++ .../src/autorest.md | 60 +++++++ .../tests/TestsCase/SiteOperationsTests.cs | 36 ++++ 10 files changed, 414 insertions(+), 21 deletions(-) diff --git a/sdk/websites/Azure.ResourceManager.AppService/api/Azure.ResourceManager.AppService.netstandard2.0.cs b/sdk/websites/Azure.ResourceManager.AppService/api/Azure.ResourceManager.AppService.netstandard2.0.cs index 7712dfafee999..7daded8af2e97 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/api/Azure.ResourceManager.AppService.netstandard2.0.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/api/Azure.ResourceManager.AppService.netstandard2.0.cs @@ -4354,7 +4354,11 @@ protected WebSiteResource() { } public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetAllConfigurationData(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetAllConfigurationDataAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.ObsoleteAttribute("This method is obsolete and will be removed in a future release, please use `GetAllTheHybridConnectionData` instead", false)] public virtual Azure.Response GetAllHybridConnectionData(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.ObsoleteAttribute("This method is obsolete and will be removed in a future release, please use `GetAllTheHybridConnectionDataAsync` instead", false)] public virtual System.Threading.Tasks.Task> GetAllHybridConnectionDataAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetAllPremierAddOnData(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAllPremierAddOnDataAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -4362,6 +4366,8 @@ protected WebSiteResource() { } public virtual System.Threading.Tasks.Task> GetAllRelayServiceConnectionDataAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetAllSiteBackupData(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetAllSiteBackupDataAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAllTheHybridConnectionData(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllTheHybridConnectionDataAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetApplicationSettings(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetApplicationSettingsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -4919,7 +4925,11 @@ protected WebSiteSlotResource() { } public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetAllConfigurationSlotData(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetAllConfigurationSlotDataAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.ObsoleteAttribute("This method is obsolete and will be removed in a future release, please use `GetAllTheHybridConnectionSlotData` instead", false)] public virtual Azure.Response GetAllHybridConnectionSlotData(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.ObsoleteAttribute("This method is obsolete and will be removed in a future release, please use `GetAllTheHybridConnectionSlotDataAsync` instead", false)] public virtual System.Threading.Tasks.Task> GetAllHybridConnectionSlotDataAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetAllPremierAddOnSlotData(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAllPremierAddOnSlotDataAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -4927,6 +4937,8 @@ protected WebSiteSlotResource() { } public virtual System.Threading.Tasks.Task> GetAllRelayServiceConnectionSlotDataAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetAllSiteBackupSlotData(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetAllSiteBackupSlotDataAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAllTheHybridConnectionSlotData(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllTheHybridConnectionSlotDataAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetApplicationSettingsSlot(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetApplicationSettingsSlotAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Customization/RestOperations/WebAppsRestOperations.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Customization/RestOperations/WebAppsRestOperations.cs index 921888ce59ae4..537261a78361b 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Customization/RestOperations/WebAppsRestOperations.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Customization/RestOperations/WebAppsRestOperations.cs @@ -156,5 +156,165 @@ public Response ListFunctionKeys(string subsc throw new RequestFailedException(message.Response); } } + /// Description for Retrieves all Service Bus Hybrid Connections used by this Web App. + /// Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). + /// Name of the resource group to which the resource belongs. + /// The name of the web app. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListHybridConnectionsAsync(string subscriptionId, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var message = CreateListHybridConnectionsRequest(subscriptionId, resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + HybridConnectionData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = HybridConnectionData.DeserializeHybridConnectionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Description for Retrieves all Service Bus Hybrid Connections used by this Web App. + /// Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). + /// Name of the resource group to which the resource belongs. + /// The name of the web app. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListHybridConnections(string subscriptionId, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var message = CreateListHybridConnectionsRequest(subscriptionId, resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + HybridConnectionData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = HybridConnectionData.DeserializeHybridConnectionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + /// Description for Retrieves all Service Bus Hybrid Connections used by this Web App. + /// Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). + /// Name of the resource group to which the resource belongs. + /// The name of the web app. + /// The name of the slot for the web app. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListHybridConnectionsSlotAsync(string subscriptionId, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNullOrEmpty(slot, nameof(slot)); + + using var message = CreateListHybridConnectionsSlotRequest(subscriptionId, resourceGroupName, name, slot); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + HybridConnectionData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = HybridConnectionData.DeserializeHybridConnectionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Description for Retrieves all Service Bus Hybrid Connections used by this Web App. + /// Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). + /// Name of the resource group to which the resource belongs. + /// The name of the web app. + /// The name of the slot for the web app. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListHybridConnectionsSlot(string subscriptionId, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNullOrEmpty(slot, nameof(slot)); + + using var message = CreateListHybridConnectionsSlotRequest(subscriptionId, resourceGroupName, name, slot); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + HybridConnectionData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = HybridConnectionData.DeserializeHybridConnectionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + internal HttpMessage CreateListHybridConnectionsSlotRequest(string subscriptionId, string resourceGroupName, string name, string slot) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/slots/", false); + uri.AppendPath(slot, true); + uri.AppendPath("/hybridConnectionRelays", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + internal HttpMessage CreateListHybridConnectionsRequest(string subscriptionId, string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Web/sites/", false); + uri.AppendPath(name, true); + uri.AppendPath("/hybridConnectionRelays", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } } } diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Customization/WebSiteResource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Customization/WebSiteResource.cs index 7f0bc0f8f8e03..a75f6101479ca 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Customization/WebSiteResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Customization/WebSiteResource.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Globalization; using System.IO; using System.Threading; @@ -140,6 +141,8 @@ Page NextPageFunc(string nextLink, int? pageSizeHint) /// /// /// The cancellation token to use. + [Obsolete("This method is obsolete and will be removed in a future release, please use `GetAllTheHybridConnectionDataAsync` instead", false)] + [EditorBrowsable(EditorBrowsableState.Never)] public virtual async Task> GetAllHybridConnectionDataAsync(CancellationToken cancellationToken = default) { using var scope = _webSiteWebAppsClientDiagnostics.CreateScope("WebSiteResource.GetAllHybridConnectionData"); @@ -170,6 +173,8 @@ public virtual async Task> GetAllHybridConnection /// /// /// The cancellation token to use. + [Obsolete("This method is obsolete and will be removed in a future release, please use `GetAllTheHybridConnectionData` instead", false)] + [EditorBrowsable(EditorBrowsableState.Never)] public virtual Response GetAllHybridConnectionData(CancellationToken cancellationToken = default) { using var scope = _webSiteWebAppsClientDiagnostics.CreateScope("WebSiteResource.GetAllHybridConnectionData"); @@ -185,7 +190,6 @@ public virtual Response GetAllHybridConnectionData(Cancell throw; } } - /// /// Description for Gets hybrid connections configured for an app (or deployment slot, if specified). /// diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Customization/WebSiteSlotResource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Customization/WebSiteSlotResource.cs index 3e32c59f01c54..5e3a521a135fd 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Customization/WebSiteSlotResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Customization/WebSiteSlotResource.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Globalization; using System.IO; using System.Threading; @@ -139,6 +140,8 @@ Page NextPageFunc(string nextLink, int? pageSizeHint) /// /// /// The cancellation token to use. + [Obsolete("This method is obsolete and will be removed in a future release, please use `GetAllTheHybridConnectionSlotDataAsync` instead", false)] + [EditorBrowsable(EditorBrowsableState.Never)] public virtual async Task> GetAllHybridConnectionSlotDataAsync(CancellationToken cancellationToken = default) { using var scope = _webSiteSlotWebAppsClientDiagnostics.CreateScope("WebSiteSlotResource.GetAllHybridConnectionSlotData"); @@ -169,6 +172,8 @@ public virtual async Task> GetAllHybridConnection /// /// /// The cancellation token to use. + [Obsolete("This method is obsolete and will be removed in a future release, please use `GetAllTheHybridConnectionSlotData` instead", false)] + [EditorBrowsable(EditorBrowsableState.Never)] public virtual Response GetAllHybridConnectionSlotData(CancellationToken cancellationToken = default) { using var scope = _webSiteSlotWebAppsClientDiagnostics.CreateScope("WebSiteSlotResource.GetAllHybridConnectionSlotData"); diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/HybridConnectionListResult.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/HybridConnectionListResult.cs index 57fb405758989..166cf09ecb965 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/HybridConnectionListResult.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/Models/HybridConnectionListResult.cs @@ -73,8 +73,10 @@ internal HybridConnectionListResult() } /// Collection of resources. + [WirePath("value")] public IReadOnlyList Value { get; } /// Link to next page of resources. + [WirePath("nextLink")] public string NextLink { get; } } } diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/RestOperations/WebAppsRestOperations.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/RestOperations/WebAppsRestOperations.cs index 1678e84299a7b..6054f5eeb0f90 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/RestOperations/WebAppsRestOperations.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/RestOperations/WebAppsRestOperations.cs @@ -9326,7 +9326,7 @@ public Response UpdateHybridConnection(string subscription } } - internal RequestUriBuilder CreateListHybridConnectionsRequestUri(string subscriptionId, string resourceGroupName, string name) + internal RequestUriBuilder CreateGetAllTheHybridConnectionDataRequestUri(string subscriptionId, string resourceGroupName, string name) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -9341,7 +9341,6 @@ internal RequestUriBuilder CreateListHybridConnectionsRequestUri(string subscrip return uri; } - internal HttpMessage CreateListHybridConnectionsRequest(string subscriptionId, string resourceGroupName, string name) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -9369,21 +9368,21 @@ internal HttpMessage CreateListHybridConnectionsRequest(string subscriptionId, s /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task> ListHybridConnectionsAsync(string subscriptionId, string resourceGroupName, string name, CancellationToken cancellationToken = default) + public async Task> GetAllTheHybridConnectionDataAsync(string subscriptionId, string resourceGroupName, string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var message = CreateListHybridConnectionsRequest(subscriptionId, resourceGroupName, name); + using var message = CreateGetAllTheHybridConnectionDataRequest(subscriptionId, resourceGroupName, name); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - HybridConnectionData value = default; + HybridConnectionListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = HybridConnectionData.DeserializeHybridConnectionData(document.RootElement); + value = HybridConnectionListResult.DeserializeHybridConnectionListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -9398,21 +9397,21 @@ public async Task> ListHybridConnectionsAsync(str /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response ListHybridConnections(string subscriptionId, string resourceGroupName, string name, CancellationToken cancellationToken = default) + public Response GetAllTheHybridConnectionData(string subscriptionId, string resourceGroupName, string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var message = CreateListHybridConnectionsRequest(subscriptionId, resourceGroupName, name); + using var message = CreateGetAllTheHybridConnectionDataRequest(subscriptionId, resourceGroupName, name); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - HybridConnectionData value = default; + HybridConnectionListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = HybridConnectionData.DeserializeHybridConnectionData(document.RootElement); + value = HybridConnectionListResult.DeserializeHybridConnectionListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -26276,7 +26275,6 @@ public Response UpdateHybridConnectionSlot(string subscrip } } - internal RequestUriBuilder CreateListHybridConnectionsSlotRequestUri(string subscriptionId, string resourceGroupName, string name, string slot) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -26293,7 +26291,7 @@ internal RequestUriBuilder CreateListHybridConnectionsSlotRequestUri(string subs return uri; } - internal HttpMessage CreateListHybridConnectionsSlotRequest(string subscriptionId, string resourceGroupName, string name, string slot) + internal HttpMessage CreateGetAllTheHybridConnectionSlotDataRequest(string subscriptionId, string resourceGroupName, string name, string slot) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -26324,22 +26322,22 @@ internal HttpMessage CreateListHybridConnectionsSlotRequest(string subscriptionI /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> ListHybridConnectionsSlotAsync(string subscriptionId, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + public async Task> GetAllTheHybridConnectionSlotDataAsync(string subscriptionId, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); Argument.AssertNotNullOrEmpty(slot, nameof(slot)); - using var message = CreateListHybridConnectionsSlotRequest(subscriptionId, resourceGroupName, name, slot); + using var message = CreateGetAllTheHybridConnectionSlotDataRequest(subscriptionId, resourceGroupName, name, slot); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - HybridConnectionData value = default; + HybridConnectionListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = HybridConnectionData.DeserializeHybridConnectionData(document.RootElement); + value = HybridConnectionListResult.DeserializeHybridConnectionListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -26355,22 +26353,22 @@ public async Task> ListHybridConnectionsSlotAsync /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response ListHybridConnectionsSlot(string subscriptionId, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + public Response GetAllTheHybridConnectionSlotData(string subscriptionId, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); Argument.AssertNotNullOrEmpty(slot, nameof(slot)); - using var message = CreateListHybridConnectionsSlotRequest(subscriptionId, resourceGroupName, name, slot); + using var message = CreateGetAllTheHybridConnectionSlotDataRequest(subscriptionId, resourceGroupName, name, slot); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - HybridConnectionData value = default; + HybridConnectionListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = HybridConnectionData.DeserializeHybridConnectionData(document.RootElement); + value = HybridConnectionListResult.DeserializeHybridConnectionListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/WebSiteResource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/WebSiteResource.cs index 549fff15c2735..f9f5deefce857 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/WebSiteResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/WebSiteResource.cs @@ -4564,6 +4564,64 @@ public virtual Response DeleteHostSecret(string keyType, string keyName, Cancell } } + /// + /// Description for Retrieves all Service Bus Hybrid Connections used by this Web App. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionRelays + /// + /// + /// Operation Id + /// WebApps_GetAllTheHybridConnectionData + /// + /// + /// Default Api Version + /// 2021-02-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllTheHybridConnectionDataAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _webSiteWebAppsRestClient.CreateGetAllTheHybridConnectionDataRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => HybridConnectionData.DeserializeHybridConnectionData(e), _webSiteWebAppsClientDiagnostics, Pipeline, "WebSiteResource.GetAllTheHybridConnectionData", "value", null, cancellationToken); + } + + /// + /// Description for Retrieves all Service Bus Hybrid Connections used by this Web App. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionRelays + /// + /// + /// Operation Id + /// WebApps_GetAllTheHybridConnectionData + /// + /// + /// Default Api Version + /// 2021-02-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAllTheHybridConnectionData(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _webSiteWebAppsRestClient.CreateGetAllTheHybridConnectionDataRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => HybridConnectionData.DeserializeHybridConnectionData(e), _webSiteWebAppsClientDiagnostics, Pipeline, "WebSiteResource.GetAllTheHybridConnectionData", "value", null, cancellationToken); + } + /// /// Description for Shows whether an app can be cloned to another resource group or subscription. /// diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/WebSiteSlotResource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/WebSiteSlotResource.cs index 46bc822c36fa6..94c5dfcaaa236 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/WebSiteSlotResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/WebSiteSlotResource.cs @@ -4226,6 +4226,64 @@ public virtual Response DeleteHostSecretSlot(string keyType, string keyName, Can } } + /// + /// Description for Retrieves all Service Bus Hybrid Connections used by this Web App. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionRelays + /// + /// + /// Operation Id + /// WebApps_GetAllTheHybridConnectionSlotData + /// + /// + /// Default Api Version + /// 2021-02-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllTheHybridConnectionSlotDataAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _webSiteSlotWebAppsRestClient.CreateGetAllTheHybridConnectionSlotDataRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => HybridConnectionData.DeserializeHybridConnectionData(e), _webSiteSlotWebAppsClientDiagnostics, Pipeline, "WebSiteSlotResource.GetAllTheHybridConnectionSlotData", "value", null, cancellationToken); + } + + /// + /// Description for Retrieves all Service Bus Hybrid Connections used by this Web App. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionRelays + /// + /// + /// Operation Id + /// WebApps_GetAllTheHybridConnectionSlotData + /// + /// + /// Default Api Version + /// 2021-02-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAllTheHybridConnectionSlotData(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _webSiteSlotWebAppsRestClient.CreateGetAllTheHybridConnectionSlotDataRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => HybridConnectionData.DeserializeHybridConnectionData(e), _webSiteSlotWebAppsClientDiagnostics, Pipeline, "WebSiteSlotResource.GetAllTheHybridConnectionSlotData", "value", null, cancellationToken); + } + /// /// Description for Shows whether an app can be cloned to another resource group or subscription. /// diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/autorest.md b/sdk/websites/Azure.ResourceManager.AppService/src/autorest.md index bbb6b83ae95f4..f0f6303572205 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/autorest.md +++ b/sdk/websites/Azure.ResourceManager.AppService/src/autorest.md @@ -849,4 +849,64 @@ directive: "Aborted", "Running" ] + - from: CommonDefinitions.json + where: $.definitions + transform: > + $["HybridConnectionCollection"] = { + "description": "Collection of hostname bindings.", + "required": [ + "value" + ], + "type": "object", + "properties": { + "value": { + "description": "Collection of resources.", + "type": "array", + "items": { + "$ref": "./CommonDefinitions.json#/definitions/HybridConnection" + } + }, + "nextLink": { + "description": "Link to next page of resources.", + "type": "string", + "readOnly": true + } + } + }; + - from: WebApps.json + where: $.paths['/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionRelays'].get + transform: > + $['operationId'] = "WebApps_GetAllTheHybridConnectionData"; + $['responses'] = { + "200": { + "description": "Description for Retrieves all Service Bus Hybrid Connections used by this Web App.", + "schema": { + "$ref": "./CommonDefinitions.json#/definitions/HybridConnectionCollection" + } + }, + "default": { + "description": "App Service error response.", + "schema": { + "$ref": "./CommonDefinitions.json#/definitions/DefaultErrorResponse" + } + } + }; + - from: WebApps.json + where: $.paths['/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionRelays'].get + transform: > + $['operationId'] = "WebApps_GetAllTheHybridConnectionSlotData"; + $['responses'] = { + "200": { + "description": "Description for Retrieves all Service Bus Hybrid Connections used by this Web App.", + "schema": { + "$ref": "./CommonDefinitions.json#/definitions/HybridConnectionCollection" + } + }, + "default": { + "description": "App Service error response.", + "schema": { + "$ref": "./CommonDefinitions.json#/definitions/DefaultErrorResponse" + } + } + }; ``` diff --git a/sdk/websites/Azure.ResourceManager.AppService/tests/TestsCase/SiteOperationsTests.cs b/sdk/websites/Azure.ResourceManager.AppService/tests/TestsCase/SiteOperationsTests.cs index ffc8e1d44ad8d..3015cfe6f4f0f 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/tests/TestsCase/SiteOperationsTests.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/tests/TestsCase/SiteOperationsTests.cs @@ -3,7 +3,10 @@ using System.Threading.Tasks; using Azure.Core.TestFramework; +using Azure.Identity; +using Azure.ResourceManager.AppService.Models; using Azure.ResourceManager.AppService.Tests.Helpers; +using Azure.ResourceManager.Resources; using NUnit.Framework; namespace Azure.ResourceManager.AppService.Tests.TestsCase @@ -42,5 +45,38 @@ public async Task Get() ResourceDataHelper.AssertSite(site1.Data, site2.Data); } + + //Manual operation needed to create website/hybridconnection resource, get it from existing one. + [TestCase] + [RecordedTest] + public async Task GetAllTheHybridConnectionData() + { + ResourceGroupCollection rgCollection = DefaultSubscription.GetResourceGroups(); + ResourceGroupResource rg = await rgCollection.GetAsync("Rg_Lwm"); + WebSiteCollection webSiteCollection = rg.GetWebSites(); + WebSiteResource webSiteResource = await webSiteCollection.GetAsync("sitelwm01"); + var hybridConnectionDataCollection = webSiteResource.GetAllTheHybridConnectionDataAsync(); + int count = 0; + await foreach (HybridConnectionData item in hybridConnectionDataCollection) + { + count++; + } + Assert.AreEqual(2, count); + } + //Manual operation needed to create website/hybridconnection resource, get it from existing one. + [TestCase] + [RecordedTest] + public async Task GetAllTheHybridConnectionSlotData() + { + var wbSiteSlotID = WebSiteSlotResource.CreateResourceIdentifier(DefaultSubscription.Data.SubscriptionId, "Rg_Lwm", "sitelwm01", "slotsitelwm01"); + WebSiteSlotResource wsSlotResource = Client.GetWebSiteSlotResource(wbSiteSlotID); + var hybridConnectionDataCollection = wsSlotResource.GetAllTheHybridConnectionSlotDataAsync(); + int count = 0; + await foreach (HybridConnectionData item in hybridConnectionDataCollection) + { + count++; + } + Assert.AreEqual(2, count); + } } } From 22f3a4b45186a023858d4473cf3079f076cce3e7 Mon Sep 17 00:00:00 2001 From: Wenming Liu Date: Sat, 11 May 2024 15:39:26 +0800 Subject: [PATCH 2/8] update --- .../src/Generated/RestOperations/WebAppsRestOperations.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/RestOperations/WebAppsRestOperations.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/RestOperations/WebAppsRestOperations.cs index 6054f5eeb0f90..3857103caabf1 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/RestOperations/WebAppsRestOperations.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/RestOperations/WebAppsRestOperations.cs @@ -9341,6 +9341,7 @@ internal RequestUriBuilder CreateGetAllTheHybridConnectionDataRequestUri(string return uri; } + internal HttpMessage CreateGetAllTheHybridConnectionDataRequest(string subscriptionId, string resourceGroupName, string name) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -26275,6 +26276,7 @@ public Response UpdateHybridConnectionSlot(string subscrip } } + internal RequestUriBuilder CreateGetAllTheHybridConnectionSlotDataRequestUri(string subscriptionId, string resourceGroupName, string name, string slot) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); From 3fa7b92207d8bd1b8ad524736809e5f6cfa18b8d Mon Sep 17 00:00:00 2001 From: Wenming Liu Date: Sat, 11 May 2024 15:41:05 +0800 Subject: [PATCH 3/8] Update assets.json --- sdk/websites/Azure.ResourceManager.AppService/assets.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/websites/Azure.ResourceManager.AppService/assets.json b/sdk/websites/Azure.ResourceManager.AppService/assets.json index 436139cad36a7..f2b734705cbb5 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/assets.json +++ b/sdk/websites/Azure.ResourceManager.AppService/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/websites/Azure.ResourceManager.AppService", - "Tag": "net/websites/Azure.ResourceManager.AppService_438b9596a0" + "Tag": "net/websites/Azure.ResourceManager.AppService_ac1a4edd2d" } From b0c5cf2199ca57fdfff95ecc5ef081553e1ec36a Mon Sep 17 00:00:00 2001 From: Wenming Liu Date: Mon, 13 May 2024 10:20:32 +0800 Subject: [PATCH 4/8] upate changelog.md --- sdk/websites/Azure.ResourceManager.AppService/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/websites/Azure.ResourceManager.AppService/CHANGELOG.md b/sdk/websites/Azure.ResourceManager.AppService/CHANGELOG.md index 5ea2616cb109a..78a4225d5450f 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/CHANGELOG.md +++ b/sdk/websites/Azure.ResourceManager.AppService/CHANGELOG.md @@ -7,6 +7,7 @@ ### Breaking Changes ### Bugs Fixed +- Fix null Id deserialization problem for 'WebSiteResource.GetAllHybridConnectionDataAsync()' and 'WebSiteSlotResource.GetAllHybridConnectionSlotDataAsync()', to use 'WebSiteResource.GetAllTheHybridConnectionDataAsync()' and 'WebSiteSlotResource.GetAllTheHybridConnectionSlotDataAsync()' instead. ### Other Changes @@ -27,7 +28,6 @@ ### Features Added - Enable mocking for extension methods, refer this [document](https://aka.ms/azsdk/net/mocking) for more details. - ### Other Changes - Upgraded dependent `Azure.ResourceManager` to 1.9.0. From b67764ef3741d8de575f17e98afb93e50ca23abc Mon Sep 17 00:00:00 2001 From: Wenming Liu Date: Mon, 13 May 2024 10:51:38 +0800 Subject: [PATCH 5/8] fix for audit commnet. --- .../src/Customization/WebSiteResource.cs | 1 + .../src/autorest.md | 28 ++----------------- 2 files changed, 3 insertions(+), 26 deletions(-) diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Customization/WebSiteResource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Customization/WebSiteResource.cs index a75f6101479ca..efad1e6da543a 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Customization/WebSiteResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Customization/WebSiteResource.cs @@ -190,6 +190,7 @@ public virtual Response GetAllHybridConnectionData(Cancell throw; } } + /// /// Description for Gets hybrid connections configured for an app (or deployment slot, if specified). /// diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/autorest.md b/sdk/websites/Azure.ResourceManager.AppService/src/autorest.md index f0f6303572205..da9b7fe34beba 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/autorest.md +++ b/sdk/websites/Azure.ResourceManager.AppService/src/autorest.md @@ -849,30 +849,6 @@ directive: "Aborted", "Running" ] - - from: CommonDefinitions.json - where: $.definitions - transform: > - $["HybridConnectionCollection"] = { - "description": "Collection of hostname bindings.", - "required": [ - "value" - ], - "type": "object", - "properties": { - "value": { - "description": "Collection of resources.", - "type": "array", - "items": { - "$ref": "./CommonDefinitions.json#/definitions/HybridConnection" - } - }, - "nextLink": { - "description": "Link to next page of resources.", - "type": "string", - "readOnly": true - } - } - }; - from: WebApps.json where: $.paths['/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionRelays'].get transform: > @@ -881,7 +857,7 @@ directive: "200": { "description": "Description for Retrieves all Service Bus Hybrid Connections used by this Web App.", "schema": { - "$ref": "./CommonDefinitions.json#/definitions/HybridConnectionCollection" + "$ref": "./AppServicePlans.json#/definitions/HybridConnectionCollection" } }, "default": { @@ -899,7 +875,7 @@ directive: "200": { "description": "Description for Retrieves all Service Bus Hybrid Connections used by this Web App.", "schema": { - "$ref": "./CommonDefinitions.json#/definitions/HybridConnectionCollection" + "$ref": "./AppServicePlans.json#/definitions/HybridConnectionCollection" } }, "default": { From 1a3a79af53b90ef7e99397e6a09bc05751912fca Mon Sep 17 00:00:00 2001 From: Wenming Liu Date: Mon, 13 May 2024 14:45:41 +0800 Subject: [PATCH 6/8] revised according to the review commnets --- .../CHANGELOG.md | 4 +- ...sourceManager.AppService.netstandard2.0.cs | 16 +- .../assets.json | 2 +- .../RestOperations/WebAppsRestOperations.cs | 160 ------------------ .../src/Customization/WebSiteResource.cs | 33 +--- .../src/Customization/WebSiteSlotResource.cs | 32 +--- .../RestOperations/WebAppsRestOperations.cs | 24 +-- .../src/Generated/WebSiteResource.cs | 16 +- .../src/Generated/WebSiteSlotResource.cs | 16 +- .../src/autorest.md | 36 +--- .../tests/TestsCase/SiteOperationsTests.cs | 8 +- 11 files changed, 58 insertions(+), 289 deletions(-) diff --git a/sdk/websites/Azure.ResourceManager.AppService/CHANGELOG.md b/sdk/websites/Azure.ResourceManager.AppService/CHANGELOG.md index 78a4225d5450f..e952468949010 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/CHANGELOG.md +++ b/sdk/websites/Azure.ResourceManager.AppService/CHANGELOG.md @@ -5,9 +5,9 @@ ### Features Added ### Breaking Changes +- Fix null Id deserialization problem for 'WebSiteResource.GetAllHybridConnectionDataAsync()' and 'WebSiteSlotResource.GetAllHybridConnectionSlotDataAsync()', to use 'WebSiteResource.GetHybridConnectionsAsync()' and 'WebSiteSlotResource.GetHybridConnectionsSlotAsync()' instead. ### Bugs Fixed -- Fix null Id deserialization problem for 'WebSiteResource.GetAllHybridConnectionDataAsync()' and 'WebSiteSlotResource.GetAllHybridConnectionSlotDataAsync()', to use 'WebSiteResource.GetAllTheHybridConnectionDataAsync()' and 'WebSiteSlotResource.GetAllTheHybridConnectionSlotDataAsync()' instead. ### Other Changes @@ -28,7 +28,7 @@ ### Features Added - Enable mocking for extension methods, refer this [document](https://aka.ms/azsdk/net/mocking) for more details. -### Other Changes +### Other ChangesGetHybridConnectionsAsync - Upgraded dependent `Azure.ResourceManager` to 1.9.0. diff --git a/sdk/websites/Azure.ResourceManager.AppService/api/Azure.ResourceManager.AppService.netstandard2.0.cs b/sdk/websites/Azure.ResourceManager.AppService/api/Azure.ResourceManager.AppService.netstandard2.0.cs index 7daded8af2e97..bc0d5f96607ba 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/api/Azure.ResourceManager.AppService.netstandard2.0.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/api/Azure.ResourceManager.AppService.netstandard2.0.cs @@ -4355,10 +4355,10 @@ protected WebSiteResource() { } public virtual Azure.Pageable GetAllConfigurationData(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetAllConfigurationDataAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - [System.ObsoleteAttribute("This method is obsolete and will be removed in a future release, please use `GetAllTheHybridConnectionData` instead", false)] + [System.ObsoleteAttribute("This method is obsolete and will be removed in a future release, please use `GetHybridConnectionsAsync` instead", false)] public virtual Azure.Response GetAllHybridConnectionData(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - [System.ObsoleteAttribute("This method is obsolete and will be removed in a future release, please use `GetAllTheHybridConnectionDataAsync` instead", false)] + [System.ObsoleteAttribute("This method is obsolete and will be removed in a future release, please use `GetHybridConnectionsAsync` instead", false)] public virtual System.Threading.Tasks.Task> GetAllHybridConnectionDataAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetAllPremierAddOnData(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAllPremierAddOnDataAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -4366,8 +4366,6 @@ protected WebSiteResource() { } public virtual System.Threading.Tasks.Task> GetAllRelayServiceConnectionDataAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetAllSiteBackupData(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetAllSiteBackupDataAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetAllTheHybridConnectionData(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetAllTheHybridConnectionDataAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetApplicationSettings(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetApplicationSettingsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -4389,6 +4387,8 @@ protected WebSiteResource() { } public virtual Azure.AsyncPageable GetHistoryForWebAppRecommendationsAsync(bool? expiredOnly = default(bool?), string filter = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetHostKeys(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetHostKeysAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetHybridConnections(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetHybridConnectionsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.AppService.LogsSiteConfigResource GetLogsSiteConfig() { throw null; } public virtual Azure.Response GetMetadata(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetMetadataAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -4926,10 +4926,10 @@ protected WebSiteSlotResource() { } public virtual Azure.Pageable GetAllConfigurationSlotData(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetAllConfigurationSlotDataAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - [System.ObsoleteAttribute("This method is obsolete and will be removed in a future release, please use `GetAllTheHybridConnectionSlotData` instead", false)] + [System.ObsoleteAttribute("This method is obsolete and will be removed in a future release, please use `GetHybridConnectionsSlot` instead", false)] public virtual Azure.Response GetAllHybridConnectionSlotData(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - [System.ObsoleteAttribute("This method is obsolete and will be removed in a future release, please use `GetAllTheHybridConnectionSlotDataAsync` instead", false)] + [System.ObsoleteAttribute("This method is obsolete and will be removed in a future release, please use `GetHybridConnectionsSlotAsync` instead", false)] public virtual System.Threading.Tasks.Task> GetAllHybridConnectionSlotDataAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetAllPremierAddOnSlotData(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAllPremierAddOnSlotDataAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -4937,8 +4937,6 @@ protected WebSiteSlotResource() { } public virtual System.Threading.Tasks.Task> GetAllRelayServiceConnectionSlotDataAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetAllSiteBackupSlotData(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetAllSiteBackupSlotDataAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetAllTheHybridConnectionSlotData(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetAllTheHybridConnectionSlotDataAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetApplicationSettingsSlot(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetApplicationSettingsSlotAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -4958,6 +4956,8 @@ protected WebSiteSlotResource() { } public virtual System.Threading.Tasks.Task> GetFunctionsAdminTokenSlotAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetHostKeysSlot(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetHostKeysSlotAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetHybridConnectionsSlot(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetHybridConnectionsSlotAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.AppService.LogsSiteSlotConfigResource GetLogsSiteSlotConfig() { throw null; } public virtual Azure.Response GetMetadataSlot(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetMetadataSlotAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } diff --git a/sdk/websites/Azure.ResourceManager.AppService/assets.json b/sdk/websites/Azure.ResourceManager.AppService/assets.json index f2b734705cbb5..b55f1fb87f68a 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/assets.json +++ b/sdk/websites/Azure.ResourceManager.AppService/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/websites/Azure.ResourceManager.AppService", - "Tag": "net/websites/Azure.ResourceManager.AppService_ac1a4edd2d" + "Tag": "net/websites/Azure.ResourceManager.AppService_e88897654e" } diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Customization/RestOperations/WebAppsRestOperations.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Customization/RestOperations/WebAppsRestOperations.cs index 537261a78361b..921888ce59ae4 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Customization/RestOperations/WebAppsRestOperations.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Customization/RestOperations/WebAppsRestOperations.cs @@ -156,165 +156,5 @@ public Response ListFunctionKeys(string subsc throw new RequestFailedException(message.Response); } } - /// Description for Retrieves all Service Bus Hybrid Connections used by this Web App. - /// Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). - /// Name of the resource group to which the resource belongs. - /// The name of the web app. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListHybridConnectionsAsync(string subscriptionId, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(name, nameof(name)); - - using var message = CreateListHybridConnectionsRequest(subscriptionId, resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - HybridConnectionData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = HybridConnectionData.DeserializeHybridConnectionData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Description for Retrieves all Service Bus Hybrid Connections used by this Web App. - /// Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). - /// Name of the resource group to which the resource belongs. - /// The name of the web app. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListHybridConnections(string subscriptionId, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(name, nameof(name)); - - using var message = CreateListHybridConnectionsRequest(subscriptionId, resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - HybridConnectionData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = HybridConnectionData.DeserializeHybridConnectionData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - /// Description for Retrieves all Service Bus Hybrid Connections used by this Web App. - /// Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). - /// Name of the resource group to which the resource belongs. - /// The name of the web app. - /// The name of the slot for the web app. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> ListHybridConnectionsSlotAsync(string subscriptionId, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(name, nameof(name)); - Argument.AssertNotNullOrEmpty(slot, nameof(slot)); - - using var message = CreateListHybridConnectionsSlotRequest(subscriptionId, resourceGroupName, name, slot); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - HybridConnectionData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = HybridConnectionData.DeserializeHybridConnectionData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Description for Retrieves all Service Bus Hybrid Connections used by this Web App. - /// Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). - /// Name of the resource group to which the resource belongs. - /// The name of the web app. - /// The name of the slot for the web app. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response ListHybridConnectionsSlot(string subscriptionId, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(name, nameof(name)); - Argument.AssertNotNullOrEmpty(slot, nameof(slot)); - - using var message = CreateListHybridConnectionsSlotRequest(subscriptionId, resourceGroupName, name, slot); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - HybridConnectionData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = HybridConnectionData.DeserializeHybridConnectionData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - internal HttpMessage CreateListHybridConnectionsSlotRequest(string subscriptionId, string resourceGroupName, string name, string slot) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/slots/", false); - uri.AppendPath(slot, true); - uri.AppendPath("/hybridConnectionRelays", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - internal HttpMessage CreateListHybridConnectionsRequest(string subscriptionId, string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Web/sites/", false); - uri.AppendPath(name, true); - uri.AppendPath("/hybridConnectionRelays", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } } } diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Customization/WebSiteResource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Customization/WebSiteResource.cs index efad1e6da543a..afe606bd70c87 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Customization/WebSiteResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Customization/WebSiteResource.cs @@ -141,22 +141,11 @@ Page NextPageFunc(string nextLink, int? pageSizeHint) /// /// /// The cancellation token to use. - [Obsolete("This method is obsolete and will be removed in a future release, please use `GetAllTheHybridConnectionDataAsync` instead", false)] + [Obsolete("This method is obsolete and will be removed in a future release, please use `GetHybridConnectionsAsync` instead", false)] [EditorBrowsable(EditorBrowsableState.Never)] - public virtual async Task> GetAllHybridConnectionDataAsync(CancellationToken cancellationToken = default) + public virtual Task> GetAllHybridConnectionDataAsync(CancellationToken cancellationToken = default) { - using var scope = _webSiteWebAppsClientDiagnostics.CreateScope("WebSiteResource.GetAllHybridConnectionData"); - scope.Start(); - try - { - var response = await _webSiteWebAppsRestClient.ListHybridConnectionsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } + throw new Exception("Obsolete method, Use GetHybridConnectionsAsync instead."); } /// @@ -169,26 +158,16 @@ public virtual async Task> GetAllHybridConnection /// /// Operation Id /// WebApps_ListHybridConnections + /// WebApps_ListHybridConnections /// /// /// /// The cancellation token to use. - [Obsolete("This method is obsolete and will be removed in a future release, please use `GetAllTheHybridConnectionData` instead", false)] + [Obsolete("This method is obsolete and will be removed in a future release, please use `GetHybridConnectionsAsync` instead", false)] [EditorBrowsable(EditorBrowsableState.Never)] public virtual Response GetAllHybridConnectionData(CancellationToken cancellationToken = default) { - using var scope = _webSiteWebAppsClientDiagnostics.CreateScope("WebSiteResource.GetAllHybridConnectionData"); - scope.Start(); - try - { - var response = _webSiteWebAppsRestClient.ListHybridConnections(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } + throw new Exception("Obsolete method, Use GetHybridConnectionsAsync instead."); } /// diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Customization/WebSiteSlotResource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Customization/WebSiteSlotResource.cs index 5e3a521a135fd..e7eacfe22c91d 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Customization/WebSiteSlotResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Customization/WebSiteSlotResource.cs @@ -140,22 +140,11 @@ Page NextPageFunc(string nextLink, int? pageSizeHint) /// /// /// The cancellation token to use. - [Obsolete("This method is obsolete and will be removed in a future release, please use `GetAllTheHybridConnectionSlotDataAsync` instead", false)] + [Obsolete("This method is obsolete and will be removed in a future release, please use `GetHybridConnectionsSlotAsync` instead", false)] [EditorBrowsable(EditorBrowsableState.Never)] - public virtual async Task> GetAllHybridConnectionSlotDataAsync(CancellationToken cancellationToken = default) + public virtual Task> GetAllHybridConnectionSlotDataAsync(CancellationToken cancellationToken = default) { - using var scope = _webSiteSlotWebAppsClientDiagnostics.CreateScope("WebSiteSlotResource.GetAllHybridConnectionSlotData"); - scope.Start(); - try - { - var response = await _webSiteSlotWebAppsRestClient.ListHybridConnectionsSlotAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } + throw new Exception("Obsolete method, Use GetHybridConnectionsSlotAsync instead."); } /// @@ -172,22 +161,11 @@ public virtual async Task> GetAllHybridConnection /// /// /// The cancellation token to use. - [Obsolete("This method is obsolete and will be removed in a future release, please use `GetAllTheHybridConnectionSlotData` instead", false)] + [Obsolete("This method is obsolete and will be removed in a future release, please use `GetHybridConnectionsSlot` instead", false)] [EditorBrowsable(EditorBrowsableState.Never)] public virtual Response GetAllHybridConnectionSlotData(CancellationToken cancellationToken = default) { - using var scope = _webSiteSlotWebAppsClientDiagnostics.CreateScope("WebSiteSlotResource.GetAllHybridConnectionSlotData"); - scope.Start(); - try - { - var response = _webSiteSlotWebAppsRestClient.ListHybridConnectionsSlot(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } + throw new Exception("Obsolete method, Use GetHybridConnectionsSlot instead."); } /// diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/RestOperations/WebAppsRestOperations.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/RestOperations/WebAppsRestOperations.cs index 3857103caabf1..ab4f5df2008c8 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/RestOperations/WebAppsRestOperations.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/RestOperations/WebAppsRestOperations.cs @@ -9326,7 +9326,7 @@ public Response UpdateHybridConnection(string subscription } } - internal RequestUriBuilder CreateGetAllTheHybridConnectionDataRequestUri(string subscriptionId, string resourceGroupName, string name) + internal RequestUriBuilder CreateListHybridConnectionsRequestUri(string subscriptionId, string resourceGroupName, string name) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -9341,7 +9341,7 @@ internal RequestUriBuilder CreateGetAllTheHybridConnectionDataRequestUri(string return uri; } - internal HttpMessage CreateGetAllTheHybridConnectionDataRequest(string subscriptionId, string resourceGroupName, string name) + internal HttpMessage CreateListHybridConnectionsRequest(string subscriptionId, string resourceGroupName, string name) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -9369,13 +9369,13 @@ internal HttpMessage CreateGetAllTheHybridConnectionDataRequest(string subscript /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task> GetAllTheHybridConnectionDataAsync(string subscriptionId, string resourceGroupName, string name, CancellationToken cancellationToken = default) + public async Task> ListHybridConnectionsAsync(string subscriptionId, string resourceGroupName, string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var message = CreateGetAllTheHybridConnectionDataRequest(subscriptionId, resourceGroupName, name); + using var message = CreateListHybridConnectionsRequest(subscriptionId, resourceGroupName, name); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -9398,13 +9398,13 @@ public async Task> GetAllTheHybridConnectio /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response GetAllTheHybridConnectionData(string subscriptionId, string resourceGroupName, string name, CancellationToken cancellationToken = default) + public Response ListHybridConnections(string subscriptionId, string resourceGroupName, string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var message = CreateGetAllTheHybridConnectionDataRequest(subscriptionId, resourceGroupName, name); + using var message = CreateListHybridConnectionsRequest(subscriptionId, resourceGroupName, name); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -26276,7 +26276,7 @@ public Response UpdateHybridConnectionSlot(string subscrip } } - internal RequestUriBuilder CreateGetAllTheHybridConnectionSlotDataRequestUri(string subscriptionId, string resourceGroupName, string name, string slot) + internal RequestUriBuilder CreateListHybridConnectionsSlotRequestUri(string subscriptionId, string resourceGroupName, string name, string slot) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -26293,7 +26293,7 @@ internal RequestUriBuilder CreateGetAllTheHybridConnectionSlotDataRequestUri(str return uri; } - internal HttpMessage CreateGetAllTheHybridConnectionSlotDataRequest(string subscriptionId, string resourceGroupName, string name, string slot) + internal HttpMessage CreateListHybridConnectionsSlotRequest(string subscriptionId, string resourceGroupName, string name, string slot) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -26324,14 +26324,14 @@ internal HttpMessage CreateGetAllTheHybridConnectionSlotDataRequest(string subsc /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetAllTheHybridConnectionSlotDataAsync(string subscriptionId, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + public async Task> ListHybridConnectionsSlotAsync(string subscriptionId, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); Argument.AssertNotNullOrEmpty(slot, nameof(slot)); - using var message = CreateGetAllTheHybridConnectionSlotDataRequest(subscriptionId, resourceGroupName, name, slot); + using var message = CreateListHybridConnectionsSlotRequest(subscriptionId, resourceGroupName, name, slot); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -26355,14 +26355,14 @@ public async Task> GetAllTheHybridConnectio /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response GetAllTheHybridConnectionSlotData(string subscriptionId, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) + public Response ListHybridConnectionsSlot(string subscriptionId, string resourceGroupName, string name, string slot, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); Argument.AssertNotNullOrEmpty(slot, nameof(slot)); - using var message = CreateGetAllTheHybridConnectionSlotDataRequest(subscriptionId, resourceGroupName, name, slot); + using var message = CreateListHybridConnectionsSlotRequest(subscriptionId, resourceGroupName, name, slot); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/WebSiteResource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/WebSiteResource.cs index f9f5deefce857..9deca7c3d854d 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/WebSiteResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/WebSiteResource.cs @@ -4573,7 +4573,7 @@ public virtual Response DeleteHostSecret(string keyType, string keyName, Cancell /// /// /// Operation Id - /// WebApps_GetAllTheHybridConnectionData + /// WebApps_ListHybridConnections /// /// /// Default Api Version @@ -4587,10 +4587,10 @@ public virtual Response DeleteHostSecret(string keyType, string keyName, Cancell /// /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllTheHybridConnectionDataAsync(CancellationToken cancellationToken = default) + public virtual AsyncPageable GetHybridConnectionsAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _webSiteWebAppsRestClient.CreateGetAllTheHybridConnectionDataRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => HybridConnectionData.DeserializeHybridConnectionData(e), _webSiteWebAppsClientDiagnostics, Pipeline, "WebSiteResource.GetAllTheHybridConnectionData", "value", null, cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _webSiteWebAppsRestClient.CreateListHybridConnectionsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => HybridConnectionData.DeserializeHybridConnectionData(e), _webSiteWebAppsClientDiagnostics, Pipeline, "WebSiteResource.GetHybridConnections", "value", null, cancellationToken); } /// @@ -4602,7 +4602,7 @@ public virtual AsyncPageable GetAllTheHybridConnectionData /// /// /// Operation Id - /// WebApps_GetAllTheHybridConnectionData + /// WebApps_ListHybridConnections /// /// /// Default Api Version @@ -4616,10 +4616,10 @@ public virtual AsyncPageable GetAllTheHybridConnectionData /// /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAllTheHybridConnectionData(CancellationToken cancellationToken = default) + public virtual Pageable GetHybridConnections(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _webSiteWebAppsRestClient.CreateGetAllTheHybridConnectionDataRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => HybridConnectionData.DeserializeHybridConnectionData(e), _webSiteWebAppsClientDiagnostics, Pipeline, "WebSiteResource.GetAllTheHybridConnectionData", "value", null, cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _webSiteWebAppsRestClient.CreateListHybridConnectionsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => HybridConnectionData.DeserializeHybridConnectionData(e), _webSiteWebAppsClientDiagnostics, Pipeline, "WebSiteResource.GetHybridConnections", "value", null, cancellationToken); } /// diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/WebSiteSlotResource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/WebSiteSlotResource.cs index 94c5dfcaaa236..e3da142f6e663 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Generated/WebSiteSlotResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Generated/WebSiteSlotResource.cs @@ -4235,7 +4235,7 @@ public virtual Response DeleteHostSecretSlot(string keyType, string keyName, Can /// /// /// Operation Id - /// WebApps_GetAllTheHybridConnectionSlotData + /// WebApps_ListHybridConnectionsSlot /// /// /// Default Api Version @@ -4249,10 +4249,10 @@ public virtual Response DeleteHostSecretSlot(string keyType, string keyName, Can /// /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllTheHybridConnectionSlotDataAsync(CancellationToken cancellationToken = default) + public virtual AsyncPageable GetHybridConnectionsSlotAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _webSiteSlotWebAppsRestClient.CreateGetAllTheHybridConnectionSlotDataRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => HybridConnectionData.DeserializeHybridConnectionData(e), _webSiteSlotWebAppsClientDiagnostics, Pipeline, "WebSiteSlotResource.GetAllTheHybridConnectionSlotData", "value", null, cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _webSiteSlotWebAppsRestClient.CreateListHybridConnectionsSlotRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => HybridConnectionData.DeserializeHybridConnectionData(e), _webSiteSlotWebAppsClientDiagnostics, Pipeline, "WebSiteSlotResource.GetHybridConnectionsSlot", "value", null, cancellationToken); } /// @@ -4264,7 +4264,7 @@ public virtual AsyncPageable GetAllTheHybridConnectionSlot /// /// /// Operation Id - /// WebApps_GetAllTheHybridConnectionSlotData + /// WebApps_ListHybridConnectionsSlot /// /// /// Default Api Version @@ -4278,10 +4278,10 @@ public virtual AsyncPageable GetAllTheHybridConnectionSlot /// /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAllTheHybridConnectionSlotData(CancellationToken cancellationToken = default) + public virtual Pageable GetHybridConnectionsSlot(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _webSiteSlotWebAppsRestClient.CreateGetAllTheHybridConnectionSlotDataRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => HybridConnectionData.DeserializeHybridConnectionData(e), _webSiteSlotWebAppsClientDiagnostics, Pipeline, "WebSiteSlotResource.GetAllTheHybridConnectionSlotData", "value", null, cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _webSiteSlotWebAppsRestClient.CreateListHybridConnectionsSlotRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => HybridConnectionData.DeserializeHybridConnectionData(e), _webSiteSlotWebAppsClientDiagnostics, Pipeline, "WebSiteSlotResource.GetHybridConnectionsSlot", "value", null, cancellationToken); } /// diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/autorest.md b/sdk/websites/Azure.ResourceManager.AppService/src/autorest.md index da9b7fe34beba..18fe5253d7f06 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/autorest.md +++ b/sdk/websites/Azure.ResourceManager.AppService/src/autorest.md @@ -119,12 +119,12 @@ override-operation-name: ResourceHealthMetadata_ListByResourceGroup: GetAllResourceHealthMetadataData ListSiteIdentifiersAssignedToHostName: GetAllSiteIdentifierData WebApps_ListConfigurations: GetAllConfigurationData - WebApps_ListHybridConnections: GetAllHybridConnectionData + WebApps_ListHybridConnections: GetHybridConnections WebApps_ListPremierAddOns: GetAllPremierAddOnData WebApps_ListRelayServiceConnections: GetAllRelayServiceConnectionData WebApps_ListSiteBackups: GetAllSiteBackupData WebApps_ListConfigurationsSlot: GetAllConfigurationSlotData - WebApps_ListHybridConnectionsSlot: GetAllHybridConnectionSlotData + WebApps_ListHybridConnectionsSlot: GetHybridConnectionsSlot WebApps_ListPremierAddOnsSlot: GetAllPremierAddOnSlotData WebApps_ListRelayServiceConnectionsSlot: GetAllRelayServiceConnectionSlotData WebApps_ListSiteBackupsSlot: GetAllSiteBackupSlotData @@ -852,37 +852,9 @@ directive: - from: WebApps.json where: $.paths['/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionRelays'].get transform: > - $['operationId'] = "WebApps_GetAllTheHybridConnectionData"; - $['responses'] = { - "200": { - "description": "Description for Retrieves all Service Bus Hybrid Connections used by this Web App.", - "schema": { - "$ref": "./AppServicePlans.json#/definitions/HybridConnectionCollection" - } - }, - "default": { - "description": "App Service error response.", - "schema": { - "$ref": "./CommonDefinitions.json#/definitions/DefaultErrorResponse" - } - } - }; + $['responses']['200']['schema']['$ref'] = "./AppServicePlans.json#/definitions/HybridConnectionCollection"; - from: WebApps.json where: $.paths['/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionRelays'].get transform: > - $['operationId'] = "WebApps_GetAllTheHybridConnectionSlotData"; - $['responses'] = { - "200": { - "description": "Description for Retrieves all Service Bus Hybrid Connections used by this Web App.", - "schema": { - "$ref": "./AppServicePlans.json#/definitions/HybridConnectionCollection" - } - }, - "default": { - "description": "App Service error response.", - "schema": { - "$ref": "./CommonDefinitions.json#/definitions/DefaultErrorResponse" - } - } - }; + $['responses']['200']['schema']['$ref'] = "./AppServicePlans.json#/definitions/HybridConnectionCollection"; ``` diff --git a/sdk/websites/Azure.ResourceManager.AppService/tests/TestsCase/SiteOperationsTests.cs b/sdk/websites/Azure.ResourceManager.AppService/tests/TestsCase/SiteOperationsTests.cs index 3015cfe6f4f0f..a8b82f1efe99c 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/tests/TestsCase/SiteOperationsTests.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/tests/TestsCase/SiteOperationsTests.cs @@ -49,13 +49,13 @@ public async Task Get() //Manual operation needed to create website/hybridconnection resource, get it from existing one. [TestCase] [RecordedTest] - public async Task GetAllTheHybridConnectionData() + public async Task GetHybridConnections() { ResourceGroupCollection rgCollection = DefaultSubscription.GetResourceGroups(); ResourceGroupResource rg = await rgCollection.GetAsync("Rg_Lwm"); WebSiteCollection webSiteCollection = rg.GetWebSites(); WebSiteResource webSiteResource = await webSiteCollection.GetAsync("sitelwm01"); - var hybridConnectionDataCollection = webSiteResource.GetAllTheHybridConnectionDataAsync(); + var hybridConnectionDataCollection = webSiteResource.GetHybridConnectionsAsync(); int count = 0; await foreach (HybridConnectionData item in hybridConnectionDataCollection) { @@ -66,11 +66,11 @@ public async Task GetAllTheHybridConnectionData() //Manual operation needed to create website/hybridconnection resource, get it from existing one. [TestCase] [RecordedTest] - public async Task GetAllTheHybridConnectionSlotData() + public async Task GetHybridConnectionsSlot() { var wbSiteSlotID = WebSiteSlotResource.CreateResourceIdentifier(DefaultSubscription.Data.SubscriptionId, "Rg_Lwm", "sitelwm01", "slotsitelwm01"); WebSiteSlotResource wsSlotResource = Client.GetWebSiteSlotResource(wbSiteSlotID); - var hybridConnectionDataCollection = wsSlotResource.GetAllTheHybridConnectionSlotDataAsync(); + var hybridConnectionDataCollection = wsSlotResource.GetHybridConnectionsSlotAsync(); int count = 0; await foreach (HybridConnectionData item in hybridConnectionDataCollection) { From abd4d66a3d7745be65bba6a781eba47dda4863ac Mon Sep 17 00:00:00 2001 From: Wenming Liu Date: Mon, 13 May 2024 14:52:20 +0800 Subject: [PATCH 7/8] add some commments --- .../src/Customization/WebSiteResource.cs | 2 ++ .../src/Customization/WebSiteSlotResource.cs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Customization/WebSiteResource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Customization/WebSiteResource.cs index afe606bd70c87..5780a9bae44df 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Customization/WebSiteResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Customization/WebSiteResource.cs @@ -141,6 +141,7 @@ Page NextPageFunc(string nextLink, int? pageSizeHint) /// /// /// The cancellation token to use. + /// due to this isssue https://github.com/Azure/azure-sdk-for-net/issues/43813, and this method doesn't work,so just throw Exception. [Obsolete("This method is obsolete and will be removed in a future release, please use `GetHybridConnectionsAsync` instead", false)] [EditorBrowsable(EditorBrowsableState.Never)] public virtual Task> GetAllHybridConnectionDataAsync(CancellationToken cancellationToken = default) @@ -163,6 +164,7 @@ public virtual Task> GetAllHybridConnectionDataAs /// /// /// The cancellation token to use. + ///due to this isssue https://github.com/Azure/azure-sdk-for-net/issues/43813, and this method doesn't work,so just throw Exception. [Obsolete("This method is obsolete and will be removed in a future release, please use `GetHybridConnectionsAsync` instead", false)] [EditorBrowsable(EditorBrowsableState.Never)] public virtual Response GetAllHybridConnectionData(CancellationToken cancellationToken = default) diff --git a/sdk/websites/Azure.ResourceManager.AppService/src/Customization/WebSiteSlotResource.cs b/sdk/websites/Azure.ResourceManager.AppService/src/Customization/WebSiteSlotResource.cs index e7eacfe22c91d..0da91a7f2cf46 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/src/Customization/WebSiteSlotResource.cs +++ b/sdk/websites/Azure.ResourceManager.AppService/src/Customization/WebSiteSlotResource.cs @@ -140,6 +140,7 @@ Page NextPageFunc(string nextLink, int? pageSizeHint) /// /// /// The cancellation token to use. + ///due to this isssue https://github.com/Azure/azure-sdk-for-net/issues/43813, and this method doesn't work,so just throw Exception. [Obsolete("This method is obsolete and will be removed in a future release, please use `GetHybridConnectionsSlotAsync` instead", false)] [EditorBrowsable(EditorBrowsableState.Never)] public virtual Task> GetAllHybridConnectionSlotDataAsync(CancellationToken cancellationToken = default) @@ -161,6 +162,7 @@ public virtual Task> GetAllHybridConnectionSlotDa /// /// /// The cancellation token to use. + /// due to this isssue https://github.com/Azure/azure-sdk-for-net/issues/43813, and this method doesn't work,so just throw Exception. [Obsolete("This method is obsolete and will be removed in a future release, please use `GetHybridConnectionsSlot` instead", false)] [EditorBrowsable(EditorBrowsableState.Never)] public virtual Response GetAllHybridConnectionSlotData(CancellationToken cancellationToken = default) From 1a956e11075bfe7882479fad2a0deecbe03423ba Mon Sep 17 00:00:00 2001 From: Wenming Liu Date: Mon, 13 May 2024 16:08:02 +0800 Subject: [PATCH 8/8] update asset.json --- sdk/websites/Azure.ResourceManager.AppService/assets.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/websites/Azure.ResourceManager.AppService/assets.json b/sdk/websites/Azure.ResourceManager.AppService/assets.json index b55f1fb87f68a..236be26a781b1 100644 --- a/sdk/websites/Azure.ResourceManager.AppService/assets.json +++ b/sdk/websites/Azure.ResourceManager.AppService/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/websites/Azure.ResourceManager.AppService", - "Tag": "net/websites/Azure.ResourceManager.AppService_e88897654e" + "Tag": "net/websites/Azure.ResourceManager.AppService_9137631a43" }