Skip to content

Commit 8eba242

Browse files
authored
Marking deprecating SQL classes and methods with obsolete (Azure#50966)
1 parent bd5b115 commit 8eba242

File tree

63 files changed

+868
-4024
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+868
-4024
lines changed

sdk/sqlmanagement/Azure.ResourceManager.Sql/Azure.ResourceManager.Sql.sln

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 17
44
VisualStudioVersion = 17.4.33403.182
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Core.TestFramework", "..\..\core\Azure.Core.TestFramework\src\Azure.Core.TestFramework.csproj", "{FDCB8782-8FDA-4DCB-A66D-24BD9E3F9F1A}"
7-
EndProject
86
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.ResourceManager.Sql", "src\Azure.ResourceManager.Sql.csproj", "{89796B68-A3DB-4298-B59B-17A8EF781021}"
97
EndProject
108
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.ResourceManager.Sql.Tests", "tests\Azure.ResourceManager.Sql.Tests.csproj", "{BE6FF05E-1E3C-4C35-B18A-89A029B79999}"
@@ -19,18 +17,6 @@ Global
1917
Release|x86 = Release|x86
2018
EndGlobalSection
2119
GlobalSection(ProjectConfigurationPlatforms) = postSolution
22-
{FDCB8782-8FDA-4DCB-A66D-24BD9E3F9F1A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
23-
{FDCB8782-8FDA-4DCB-A66D-24BD9E3F9F1A}.Debug|Any CPU.Build.0 = Debug|Any CPU
24-
{FDCB8782-8FDA-4DCB-A66D-24BD9E3F9F1A}.Debug|x64.ActiveCfg = Debug|Any CPU
25-
{FDCB8782-8FDA-4DCB-A66D-24BD9E3F9F1A}.Debug|x64.Build.0 = Debug|Any CPU
26-
{FDCB8782-8FDA-4DCB-A66D-24BD9E3F9F1A}.Debug|x86.ActiveCfg = Debug|Any CPU
27-
{FDCB8782-8FDA-4DCB-A66D-24BD9E3F9F1A}.Debug|x86.Build.0 = Debug|Any CPU
28-
{FDCB8782-8FDA-4DCB-A66D-24BD9E3F9F1A}.Release|Any CPU.ActiveCfg = Release|Any CPU
29-
{FDCB8782-8FDA-4DCB-A66D-24BD9E3F9F1A}.Release|Any CPU.Build.0 = Release|Any CPU
30-
{FDCB8782-8FDA-4DCB-A66D-24BD9E3F9F1A}.Release|x64.ActiveCfg = Release|Any CPU
31-
{FDCB8782-8FDA-4DCB-A66D-24BD9E3F9F1A}.Release|x64.Build.0 = Release|Any CPU
32-
{FDCB8782-8FDA-4DCB-A66D-24BD9E3F9F1A}.Release|x86.ActiveCfg = Release|Any CPU
33-
{FDCB8782-8FDA-4DCB-A66D-24BD9E3F9F1A}.Release|x86.Build.0 = Release|Any CPU
3420
{89796B68-A3DB-4298-B59B-17A8EF781021}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
3521
{89796B68-A3DB-4298-B59B-17A8EF781021}.Debug|Any CPU.Build.0 = Debug|Any CPU
3622
{89796B68-A3DB-4298-B59B-17A8EF781021}.Debug|x64.ActiveCfg = Debug|Any CPU

sdk/sqlmanagement/Azure.ResourceManager.Sql/api/Azure.ResourceManager.Sql.net8.0.cs

Lines changed: 132 additions & 15 deletions
Large diffs are not rendered by default.

sdk/sqlmanagement/Azure.ResourceManager.Sql/api/Azure.ResourceManager.Sql.netstandard2.0.cs

Lines changed: 132 additions & 15 deletions
Large diffs are not rendered by default.

sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Custom/ElasticPoolResource.cs renamed to sdk/sqlmanagement/Azure.ResourceManager.Sql/src/Custom/2014-04-01/ElasticPoolResource.cs

Lines changed: 25 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -4,54 +4,14 @@
44
#nullable disable
55

66
using System;
7-
using System.Collections.Generic;
8-
using System.Globalization;
7+
using System.ComponentModel;
98
using System.Threading;
10-
using System.Threading.Tasks;
11-
using Autorest.CSharp.Core;
12-
using Azure.Core;
13-
using Azure.Core.Pipeline;
149
using Azure.ResourceManager.Sql.Models;
1510

1611
namespace Azure.ResourceManager.Sql
1712
{
1813
public partial class ElasticPoolResource
1914
{
20-
private readonly ElasticPoolActivitiesRestOperations _elasticPoolActivitiesRestClient;
21-
private readonly ClientDiagnostics _elasticPoolActivitiesClientDiagnostics;
22-
private readonly ElasticPoolDatabaseActivitiesRestOperations _elasticPoolDatabaseActivitiesRestClient;
23-
private readonly ClientDiagnostics _elasticPoolDatabaseActivitiesClientDiagnostics;
24-
private readonly MetricDefinitionsRestOperations _metricDefinitionsRestClient;
25-
private readonly ClientDiagnostics _metricDefinitionsClientDiagnostics;
26-
private readonly MetricsRestOperations _metricsRestClient;
27-
private readonly ClientDiagnostics _metricsClientDiagnostics;
28-
29-
/// <summary> Initializes a new instance of the <see cref="ElasticPoolResource"/> class. </summary>
30-
/// <param name="client"> The client parameters to use in these operations. </param>
31-
/// <param name="id"> The identifier of the resource that is the target of operations. </param>
32-
internal ElasticPoolResource(ArmClient client, ResourceIdentifier id) : base(client, id)
33-
{
34-
_elasticPoolClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Sql", ResourceType.Namespace, Diagnostics);
35-
TryGetApiVersion(ResourceType, out string elasticPoolApiVersion);
36-
_elasticPoolRestClient = new ElasticPoolsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, elasticPoolApiVersion);
37-
_sqlDatabaseDatabasesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Sql", SqlDatabaseResource.ResourceType.Namespace, Diagnostics);
38-
TryGetApiVersion(SqlDatabaseResource.ResourceType, out string sqlDatabaseDatabasesApiVersion);
39-
_sqlDatabaseDatabasesRestClient = new DatabasesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, sqlDatabaseDatabasesApiVersion);
40-
_elasticPoolOperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Sql", ProviderConstants.DefaultProviderNamespace, Diagnostics);
41-
_elasticPoolOperationsRestClient = new ElasticPoolRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint);
42-
_elasticPoolActivitiesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Sql", ProviderConstants.DefaultProviderNamespace, Diagnostics);
43-
_elasticPoolActivitiesRestClient = new ElasticPoolActivitiesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint);
44-
_elasticPoolDatabaseActivitiesRestClient = new ElasticPoolDatabaseActivitiesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint);
45-
_elasticPoolDatabaseActivitiesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Sql", ProviderConstants.DefaultProviderNamespace, Diagnostics);
46-
_metricDefinitionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Sql", ProviderConstants.DefaultProviderNamespace, Diagnostics);
47-
_metricDefinitionsRestClient = new MetricDefinitionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint);
48-
_metricsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Sql", ProviderConstants.DefaultProviderNamespace, Diagnostics);
49-
_metricsRestClient = new MetricsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint);
50-
#if DEBUG
51-
ValidateResourceId(Id);
52-
#endif
53-
}
54-
5515
/// <summary>
5616
/// Returns elastic pool activities.
5717
/// <list type="bullet">
@@ -71,10 +31,11 @@ internal ElasticPoolResource(ArmClient client, ResourceIdentifier id) : base(cli
7131
/// </summary>
7232
/// <param name="cancellationToken"> The cancellation token to use. </param>
7333
/// <returns> An async collection of <see cref="ElasticPoolActivity"/> that may take multiple service requests to iterate over. </returns>
34+
[Obsolete("This method is deprecated and will be removed in a future release.")]
35+
[EditorBrowsable(EditorBrowsableState.Never)]
7436
public virtual AsyncPageable<ElasticPoolActivity> GetElasticPoolActivitiesAsync(CancellationToken cancellationToken = default)
7537
{
76-
HttpMessage FirstPageRequest(int? pageSizeHint) => _elasticPoolActivitiesRestClient.CreateListByElasticPoolRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name);
77-
return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => ElasticPoolActivity.DeserializeElasticPoolActivity(e), _elasticPoolActivitiesClientDiagnostics, Pipeline, "ElasticPoolResource.GetElasticPoolActivities", "value", null, cancellationToken);
38+
throw new NotSupportedException();
7839
}
7940

8041
/// <summary>
@@ -96,10 +57,11 @@ public virtual AsyncPageable<ElasticPoolActivity> GetElasticPoolActivitiesAsync(
9657
/// </summary>
9758
/// <param name="cancellationToken"> The cancellation token to use. </param>
9859
/// <returns> A collection of <see cref="ElasticPoolActivity"/> that may take multiple service requests to iterate over. </returns>
60+
[Obsolete("This method is deprecated and will be removed in a future release.")]
61+
[EditorBrowsable(EditorBrowsableState.Never)]
9962
public virtual Pageable<ElasticPoolActivity> GetElasticPoolActivities(CancellationToken cancellationToken = default)
10063
{
101-
HttpMessage FirstPageRequest(int? pageSizeHint) => _elasticPoolActivitiesRestClient.CreateListByElasticPoolRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name);
102-
return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => ElasticPoolActivity.DeserializeElasticPoolActivity(e), _elasticPoolActivitiesClientDiagnostics, Pipeline, "ElasticPoolResource.GetElasticPoolActivities", "value", null, cancellationToken);
64+
throw new NotSupportedException();
10365
}
10466

10567
/// <summary>
@@ -121,10 +83,11 @@ public virtual Pageable<ElasticPoolActivity> GetElasticPoolActivities(Cancellati
12183
/// </summary>
12284
/// <param name="cancellationToken"> The cancellation token to use. </param>
12385
/// <returns> An async collection of <see cref="ElasticPoolDatabaseActivity"/> that may take multiple service requests to iterate over. </returns>
86+
[Obsolete("This method is deprecated and will be removed in a future release.")]
87+
[EditorBrowsable(EditorBrowsableState.Never)]
12488
public virtual AsyncPageable<ElasticPoolDatabaseActivity> GetElasticPoolDatabaseActivitiesAsync(CancellationToken cancellationToken = default)
12589
{
126-
HttpMessage FirstPageRequest(int? pageSizeHint) => _elasticPoolDatabaseActivitiesRestClient.CreateListByElasticPoolRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name);
127-
return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => ElasticPoolDatabaseActivity.DeserializeElasticPoolDatabaseActivity(e), _elasticPoolDatabaseActivitiesClientDiagnostics, Pipeline, "ElasticPoolResource.GetElasticPoolDatabaseActivities", "value", null, cancellationToken);
90+
throw new NotSupportedException();
12891
}
12992

13093
/// <summary>
@@ -146,10 +109,11 @@ public virtual AsyncPageable<ElasticPoolDatabaseActivity> GetElasticPoolDatabase
146109
/// </summary>
147110
/// <param name="cancellationToken"> The cancellation token to use. </param>
148111
/// <returns> A collection of <see cref="ElasticPoolDatabaseActivity"/> that may take multiple service requests to iterate over. </returns>
112+
[Obsolete("This method is deprecated and will be removed in a future release.")]
113+
[EditorBrowsable(EditorBrowsableState.Never)]
149114
public virtual Pageable<ElasticPoolDatabaseActivity> GetElasticPoolDatabaseActivities(CancellationToken cancellationToken = default)
150115
{
151-
HttpMessage FirstPageRequest(int? pageSizeHint) => _elasticPoolDatabaseActivitiesRestClient.CreateListByElasticPoolRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name);
152-
return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => ElasticPoolDatabaseActivity.DeserializeElasticPoolDatabaseActivity(e), _elasticPoolDatabaseActivitiesClientDiagnostics, Pipeline, "ElasticPoolResource.GetElasticPoolDatabaseActivities", "value", null, cancellationToken);
116+
throw new NotSupportedException();
153117
}
154118

155119
/// <summary>
@@ -171,10 +135,11 @@ public virtual Pageable<ElasticPoolDatabaseActivity> GetElasticPoolDatabaseActiv
171135
/// </summary>
172136
/// <param name="cancellationToken"> The cancellation token to use. </param>
173137
/// <returns> An async collection of <see cref="SqlMetricDefinition"/> that may take multiple service requests to iterate over. </returns>
138+
[Obsolete("This method is deprecated and will be removed in a future release.")]
139+
[EditorBrowsable(EditorBrowsableState.Never)]
174140
public virtual AsyncPageable<SqlMetricDefinition> GetMetricDefinitionsAsync(CancellationToken cancellationToken = default)
175141
{
176-
HttpMessage FirstPageRequest(int? pageSizeHint) => _metricDefinitionsRestClient.CreateListElasticPoolRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name);
177-
return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => SqlMetricDefinition.DeserializeSqlMetricDefinition(e), _metricDefinitionsClientDiagnostics, Pipeline, "ElasticPoolResource.GetMetricDefinitions", "value", null, cancellationToken);
142+
throw new NotSupportedException();
178143
}
179144

180145
/// <summary>
@@ -196,10 +161,11 @@ public virtual AsyncPageable<SqlMetricDefinition> GetMetricDefinitionsAsync(Canc
196161
/// </summary>
197162
/// <param name="cancellationToken"> The cancellation token to use. </param>
198163
/// <returns> A collection of <see cref="SqlMetricDefinition"/> that may take multiple service requests to iterate over. </returns>
164+
[Obsolete("This method is deprecated and will be removed in a future release.")]
165+
[EditorBrowsable(EditorBrowsableState.Never)]
199166
public virtual Pageable<SqlMetricDefinition> GetMetricDefinitions(CancellationToken cancellationToken = default)
200167
{
201-
HttpMessage FirstPageRequest(int? pageSizeHint) => _metricDefinitionsRestClient.CreateListElasticPoolRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name);
202-
return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => SqlMetricDefinition.DeserializeSqlMetricDefinition(e), _metricDefinitionsClientDiagnostics, Pipeline, "ElasticPoolResource.GetMetricDefinitions", "value", null, cancellationToken);
168+
throw new NotSupportedException();
203169
}
204170

205171
/// <summary>
@@ -223,12 +189,11 @@ public virtual Pageable<SqlMetricDefinition> GetMetricDefinitions(CancellationTo
223189
/// <param name="cancellationToken"> The cancellation token to use. </param>
224190
/// <exception cref="ArgumentNullException"> <paramref name="filter"/> is null. </exception>
225191
/// <returns> An async collection of <see cref="SqlMetric"/> that may take multiple service requests to iterate over. </returns>
192+
[Obsolete("This method is deprecated and will be removed in a future release.")]
193+
[EditorBrowsable(EditorBrowsableState.Never)]
226194
public virtual AsyncPageable<SqlMetric> GetMetricsAsync(string filter, CancellationToken cancellationToken = default)
227195
{
228-
Argument.AssertNotNull(filter, nameof(filter));
229-
230-
HttpMessage FirstPageRequest(int? pageSizeHint) => _metricsRestClient.CreateListElasticPoolRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, filter);
231-
return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => SqlMetric.DeserializeSqlMetric(e), _metricsClientDiagnostics, Pipeline, "ElasticPoolResource.GetMetrics", "value", null, cancellationToken);
196+
throw new NotSupportedException();
232197
}
233198

234199
/// <summary>
@@ -252,12 +217,11 @@ public virtual AsyncPageable<SqlMetric> GetMetricsAsync(string filter, Cancellat
252217
/// <param name="cancellationToken"> The cancellation token to use. </param>
253218
/// <exception cref="ArgumentNullException"> <paramref name="filter"/> is null. </exception>
254219
/// <returns> A collection of <see cref="SqlMetric"/> that may take multiple service requests to iterate over. </returns>
220+
[Obsolete("This method is deprecated and will be removed in a future release.")]
221+
[EditorBrowsable(EditorBrowsableState.Never)]
255222
public virtual Pageable<SqlMetric> GetMetrics(string filter, CancellationToken cancellationToken = default)
256223
{
257-
Argument.AssertNotNull(filter, nameof(filter));
258-
259-
HttpMessage FirstPageRequest(int? pageSizeHint) => _metricsRestClient.CreateListElasticPoolRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, filter);
260-
return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => SqlMetric.DeserializeSqlMetric(e), _metricsClientDiagnostics, Pipeline, "ElasticPoolResource.GetMetrics", "value", null, cancellationToken);
224+
throw new NotSupportedException();
261225
}
262226
}
263227
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
4+
#nullable disable
5+
6+
using System;
7+
using System.ComponentModel;
8+
using Azure.Core;
9+
10+
namespace Azure.ResourceManager.Sql.Mocking
11+
{
12+
public partial class MockableSqlArmClient
13+
{
14+
/// <summary>
15+
/// Gets an object representing a <see cref="ServiceObjectiveResource"/> along with the instance operations that can be performed on it but with no data.
16+
/// You can use <see cref="ServiceObjectiveResource.CreateResourceIdentifier" /> to create a <see cref="ServiceObjectiveResource"/> <see cref="ResourceIdentifier"/> from its components.
17+
/// </summary>
18+
/// <param name="id"> The resource ID of the resource to get. </param>
19+
/// <returns> Returns a <see cref="ServiceObjectiveResource"/> object. </returns>
20+
[Obsolete("This method is deprecated and will be removed in a future release.")]
21+
[EditorBrowsable(EditorBrowsableState.Never)]
22+
public virtual ServiceObjectiveResource GetServiceObjectiveResource(ResourceIdentifier id)
23+
{
24+
throw new NotSupportedException();
25+
}
26+
27+
/// <summary>
28+
/// Gets an object representing a <see cref="SqlServerCommunicationLinkResource"/> along with the instance operations that can be performed on it but with no data.
29+
/// You can use <see cref="SqlServerCommunicationLinkResource.CreateResourceIdentifier" /> to create a <see cref="SqlServerCommunicationLinkResource"/> <see cref="ResourceIdentifier"/> from its components.
30+
/// </summary>
31+
/// <param name="id"> The resource ID of the resource to get. </param>
32+
/// <returns> Returns a <see cref="SqlServerCommunicationLinkResource"/> object. </returns>
33+
[Obsolete("This method is deprecated and will be removed in a future release.")]
34+
[EditorBrowsable(EditorBrowsableState.Never)]
35+
public virtual SqlServerCommunicationLinkResource GetSqlServerCommunicationLinkResource(ResourceIdentifier id)
36+
{
37+
throw new NotSupportedException();
38+
}
39+
}
40+
}

0 commit comments

Comments
 (0)