Skip to content

Commit d47a151

Browse files
authored
[KeyVault] Upgrade API to 2023-02-01 and Add region in PSManagedHsm (#22620)
* Upgrade API to 2023-02-01 * add region for psmanagedhsm * Update KeyVaultTestRunner.cs * Record test cases for new API version
1 parent 0b92e44 commit d47a151

39 files changed

+19426
-5386
lines changed

src/KeyVault/KeyVault.Sdk/Generated/IKeyVaultManagementClient.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,6 @@ public partial interface IKeyVaultManagementClient : System.IDisposable
3535
Microsoft.Rest.ServiceClientCredentials Credentials { get;}
3636

3737

38-
/// <summary>
39-
/// The API version to use for this operation.
40-
/// </summary>
41-
string ApiVersion { get;}
42-
43-
4438
/// <summary>
4539
/// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
4640
/// </summary>
@@ -98,5 +92,10 @@ public partial interface IKeyVaultManagementClient : System.IDisposable
9892
/// </summary>
9993
IMhsmPrivateLinkResourcesOperations MhsmPrivateLinkResources { get; }
10094

95+
/// <summary>
96+
/// Gets the IMhsmRegionsOperations
97+
/// </summary>
98+
IMhsmRegionsOperations MhsmRegions { get; }
99+
101100
}
102101
}
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License. See License.txt in the project root for license information.
3+
// Code generated by Microsoft (R) AutoRest Code Generator.
4+
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
5+
6+
namespace Microsoft.Azure.Management.KeyVault
7+
{
8+
using Microsoft.Rest.Azure;
9+
using Models;
10+
11+
/// <summary>
12+
/// MhsmRegionsOperations operations.
13+
/// </summary>
14+
public partial interface IMhsmRegionsOperations
15+
{
16+
/// <summary>
17+
/// The List operation gets information about the regions associated with the managed HSM Pool.
18+
/// </summary>
19+
/// <remarks>
20+
/// The List operation gets information about the regions associated with the managed HSM Pool.
21+
/// </remarks>
22+
/// <param name='resourceGroupName'>
23+
/// Name of the resource group that contains the managed HSM pool.
24+
/// </param>
25+
/// <param name='name'>
26+
/// Name of the managed HSM Pool
27+
/// </param>
28+
/// <param name='customHeaders'>
29+
/// The headers that will be added to request.
30+
/// </param>
31+
/// <param name='cancellationToken'>
32+
/// The cancellation token.
33+
/// </param>
34+
/// <exception cref="Microsoft.Rest.Azure.CloudException">
35+
/// Thrown when the operation returned an invalid status code
36+
/// </exception>
37+
/// <exception cref="Microsoft.Rest.SerializationException">
38+
/// Thrown when unable to deserialize the response
39+
/// </exception>
40+
System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse<Microsoft.Rest.Azure.IPage<MhsmGeoReplicatedRegion>>> ListByResourceWithHttpMessagesAsync(string resourceGroupName, string name, System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
41+
42+
/// <summary>
43+
/// The List operation gets information about the regions associated with the managed HSM Pool.
44+
/// </summary>
45+
/// <remarks>
46+
/// The List operation gets information about the regions associated with the managed HSM Pool.
47+
/// </remarks>
48+
/// <param name='nextPageLink'>
49+
/// The NextLink from the previous successful call to List operation.
50+
/// </param>
51+
/// <param name='customHeaders'>
52+
/// The headers that will be added to request.
53+
/// </param>
54+
/// <param name='cancellationToken'>
55+
/// The cancellation token.
56+
/// </param>
57+
/// <exception cref="Microsoft.Rest.Azure.CloudException">
58+
/// Thrown when the operation returned an invalid status code
59+
/// </exception>
60+
/// <exception cref="Microsoft.Rest.SerializationException">
61+
/// Thrown when unable to deserialize the response
62+
/// </exception>
63+
System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse<Microsoft.Rest.Azure.IPage<MhsmGeoReplicatedRegion>>> ListByResourceNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
64+
65+
}
66+
}

src/KeyVault/KeyVault.Sdk/Generated/KeyVaultManagementClient.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,6 @@ public partial class KeyVaultManagementClient : Microsoft.Rest.ServiceClient<Key
3232
/// </summary>
3333
public Microsoft.Rest.ServiceClientCredentials Credentials { get; private set; }
3434

35-
/// <summary>
36-
/// The API version to use for this operation.
37-
/// </summary>
38-
public string ApiVersion { get; private set; }
39-
4035
/// <summary>
4136
/// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
4237
/// </summary>
@@ -85,6 +80,10 @@ public partial class KeyVaultManagementClient : Microsoft.Rest.ServiceClient<Key
8580
/// </summary>
8681
public virtual IMhsmPrivateLinkResourcesOperations MhsmPrivateLinkResources { get; private set; }
8782
/// <summary>
83+
/// Gets the IMhsmRegionsOperations
84+
/// </summary>
85+
public virtual IMhsmRegionsOperations MhsmRegions { get; private set; }
86+
/// <summary>
8887
/// Initializes a new instance of the KeyVaultManagementClient class.
8988
/// </summary>
9089
/// <param name='httpClient'>
@@ -325,8 +324,8 @@ private void Initialize()
325324
this.ManagedHsms = new ManagedHsmsOperations(this);
326325
this.MhsmPrivateEndpointConnections = new MhsmPrivateEndpointConnectionsOperations(this);
327326
this.MhsmPrivateLinkResources = new MhsmPrivateLinkResourcesOperations(this);
327+
this.MhsmRegions = new MhsmRegionsOperations(this);
328328
this.BaseUri = new System.Uri("https://management.azure.com");
329-
this.ApiVersion = "2022-07-01";
330329
this.AcceptLanguage = "en-US";
331330
this.LongRunningOperationRetryTimeout = 30;
332331
this.GenerateClientRequestId = true;

src/KeyVault/KeyVault.Sdk/Generated/MHSMPrivateEndpointConnectionsOperations.cs

Lines changed: 16 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,6 @@ internal MhsmPrivateEndpointConnectionsOperations (KeyVaultManagementClient clie
7474

7575

7676

77-
if (this.Client.ApiVersion == null)
78-
{
79-
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion");
80-
}
81-
8277
if (this.Client.SubscriptionId == null)
8378
{
8479
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
@@ -94,13 +89,15 @@ internal MhsmPrivateEndpointConnectionsOperations (KeyVaultManagementClient clie
9489
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name");
9590
}
9691

92+
string apiVersion = "2023-02-01";
9793
// Tracing
9894
bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
9995
string _invocationId = null;
10096
if (_shouldTrace)
10197
{
10298
_invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString();
10399
System.Collections.Generic.Dictionary<string, object> tracingParameters = new System.Collections.Generic.Dictionary<string, object>();
100+
tracingParameters.Add("apiVersion", apiVersion);
104101
tracingParameters.Add("resourceGroupName", resourceGroupName);
105102
tracingParameters.Add("name", name);
106103

@@ -117,9 +114,9 @@ internal MhsmPrivateEndpointConnectionsOperations (KeyVaultManagementClient clie
117114
_url = _url.Replace("{name}", System.Uri.EscapeDataString(name));
118115

119116
System.Collections.Generic.List<string> _queryParameters = new System.Collections.Generic.List<string>();
120-
if (this.Client.ApiVersion != null)
117+
if (apiVersion != null)
121118
{
122-
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion)));
119+
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
123120
}
124121
if (_queryParameters.Count > 0)
125122
{
@@ -305,11 +302,7 @@ internal MhsmPrivateEndpointConnectionsOperations (KeyVaultManagementClient clie
305302
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "privateEndpointConnectionName");
306303
}
307304

308-
if (this.Client.ApiVersion == null)
309-
{
310-
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion");
311-
}
312-
305+
string apiVersion = "2023-02-01";
313306
// Tracing
314307
bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
315308
string _invocationId = null;
@@ -320,6 +313,7 @@ internal MhsmPrivateEndpointConnectionsOperations (KeyVaultManagementClient clie
320313
tracingParameters.Add("resourceGroupName", resourceGroupName);
321314
tracingParameters.Add("name", name);
322315
tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName);
316+
tracingParameters.Add("apiVersion", apiVersion);
323317

324318

325319
tracingParameters.Add("cancellationToken", cancellationToken);
@@ -335,9 +329,9 @@ internal MhsmPrivateEndpointConnectionsOperations (KeyVaultManagementClient clie
335329
_url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName));
336330

337331
System.Collections.Generic.List<string> _queryParameters = new System.Collections.Generic.List<string>();
338-
if (this.Client.ApiVersion != null)
332+
if (apiVersion != null)
339333
{
340-
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion)));
334+
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
341335
}
342336
if (_queryParameters.Count > 0)
343337
{
@@ -531,11 +525,7 @@ internal MhsmPrivateEndpointConnectionsOperations (KeyVaultManagementClient clie
531525
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "privateEndpointConnectionName");
532526
}
533527

534-
if (this.Client.ApiVersion == null)
535-
{
536-
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion");
537-
}
538-
528+
string apiVersion = "2023-02-01";
539529
// Tracing
540530
bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
541531
string _invocationId = null;
@@ -546,6 +536,7 @@ internal MhsmPrivateEndpointConnectionsOperations (KeyVaultManagementClient clie
546536
tracingParameters.Add("resourceGroupName", resourceGroupName);
547537
tracingParameters.Add("name", name);
548538
tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName);
539+
tracingParameters.Add("apiVersion", apiVersion);
549540

550541
tracingParameters.Add("properties", properties);
551542

@@ -562,9 +553,9 @@ internal MhsmPrivateEndpointConnectionsOperations (KeyVaultManagementClient clie
562553
_url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName));
563554

564555
System.Collections.Generic.List<string> _queryParameters = new System.Collections.Generic.List<string>();
565-
if (this.Client.ApiVersion != null)
556+
if (apiVersion != null)
566557
{
567-
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion)));
558+
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
568559
}
569560
if (_queryParameters.Count > 0)
570561
{
@@ -799,11 +790,7 @@ internal MhsmPrivateEndpointConnectionsOperations (KeyVaultManagementClient clie
799790
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "privateEndpointConnectionName");
800791
}
801792

802-
if (this.Client.ApiVersion == null)
803-
{
804-
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion");
805-
}
806-
793+
string apiVersion = "2023-02-01";
807794
// Tracing
808795
bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
809796
string _invocationId = null;
@@ -814,6 +801,7 @@ internal MhsmPrivateEndpointConnectionsOperations (KeyVaultManagementClient clie
814801
tracingParameters.Add("resourceGroupName", resourceGroupName);
815802
tracingParameters.Add("name", name);
816803
tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName);
804+
tracingParameters.Add("apiVersion", apiVersion);
817805

818806

819807
tracingParameters.Add("cancellationToken", cancellationToken);
@@ -829,9 +817,9 @@ internal MhsmPrivateEndpointConnectionsOperations (KeyVaultManagementClient clie
829817
_url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName));
830818

831819
System.Collections.Generic.List<string> _queryParameters = new System.Collections.Generic.List<string>();
832-
if (this.Client.ApiVersion != null)
820+
if (apiVersion != null)
833821
{
834-
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion)));
822+
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
835823
}
836824
if (_queryParameters.Count > 0)
837825
{

src/KeyVault/KeyVault.Sdk/Generated/MHSMPrivateLinkResourcesOperations.cs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,7 @@ internal MhsmPrivateLinkResourcesOperations (KeyVaultManagementClient client)
8989
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "name");
9090
}
9191

92-
if (this.Client.ApiVersion == null)
93-
{
94-
throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion");
95-
}
96-
92+
string apiVersion = "2023-02-01";
9793
// Tracing
9894
bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
9995
string _invocationId = null;
@@ -103,6 +99,7 @@ internal MhsmPrivateLinkResourcesOperations (KeyVaultManagementClient client)
10399
System.Collections.Generic.Dictionary<string, object> tracingParameters = new System.Collections.Generic.Dictionary<string, object>();
104100
tracingParameters.Add("resourceGroupName", resourceGroupName);
105101
tracingParameters.Add("name", name);
102+
tracingParameters.Add("apiVersion", apiVersion);
106103

107104

108105
tracingParameters.Add("cancellationToken", cancellationToken);
@@ -117,9 +114,9 @@ internal MhsmPrivateLinkResourcesOperations (KeyVaultManagementClient client)
117114
_url = _url.Replace("{name}", System.Uri.EscapeDataString(name));
118115

119116
System.Collections.Generic.List<string> _queryParameters = new System.Collections.Generic.List<string>();
120-
if (this.Client.ApiVersion != null)
117+
if (apiVersion != null)
121118
{
122-
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion)));
119+
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
123120
}
124121
if (_queryParameters.Count > 0)
125122
{

0 commit comments

Comments
 (0)