From f320f1c90b66e9f477018f8ed6795fdfc256dcce Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 25 Jul 2022 03:45:21 +0000 Subject: [PATCH] CodeGen from PR 19767 in Azure/azure-rest-api-specs [Hub Generated] Review request for Microsoft.KeyVault to add version preview/2021-06-01-preview (#19767) * Updated the managed hsm resource manager spec to include two additional properties for private endpoint connection item * Update managed hsm private endpoint connection item in mhsm spec for latest api version * Address LRO_RESPONSE_HEADER violation for managed hsm Long running operations that are annotated with x-ms-long-running-operation:true must return location header or azure-AsyncOperation in response. Added the missing location header for managed hsm update command as well as to the corresponding examples. --- ...ndpointConnectionItemData.Serialization.cs | 20 ++++++++++++++++++- ...gedHsmPrivateEndpointConnectionItemData.cs | 11 +++++++++- .../src/autorest.md | 8 ++++---- 3 files changed, 33 insertions(+), 6 deletions(-) diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmPrivateEndpointConnectionItemData.Serialization.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmPrivateEndpointConnectionItemData.Serialization.cs index 66ab7519ffbc..e4cf033aee76 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmPrivateEndpointConnectionItemData.Serialization.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmPrivateEndpointConnectionItemData.Serialization.cs @@ -6,6 +6,7 @@ #nullable disable using System.Text.Json; +using Azure; using Azure.Core; using Azure.ResourceManager.Resources.Models; @@ -15,11 +16,28 @@ public partial class ManagedHsmPrivateEndpointConnectionItemData { internal static ManagedHsmPrivateEndpointConnectionItemData DeserializeManagedHsmPrivateEndpointConnectionItemData(JsonElement element) { + Optional id = default; + Optional etag = default; Optional privateEndpoint = default; Optional privateLinkServiceConnectionState = default; Optional provisioningState = default; foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("id")) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("etag")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + etag = new ETag(property.Value.GetString()); + continue; + } if (property.NameEquals("properties")) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -63,7 +81,7 @@ internal static ManagedHsmPrivateEndpointConnectionItemData DeserializeManagedHs continue; } } - return new ManagedHsmPrivateEndpointConnectionItemData(privateEndpoint, privateLinkServiceConnectionState.Value, Optional.ToNullable(provisioningState)); + return new ManagedHsmPrivateEndpointConnectionItemData(id.Value, Optional.ToNullable(etag), privateEndpoint, privateLinkServiceConnectionState.Value, Optional.ToNullable(provisioningState)); } } } diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmPrivateEndpointConnectionItemData.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmPrivateEndpointConnectionItemData.cs index b6e043e10ddd..fa9d95a17dd6 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmPrivateEndpointConnectionItemData.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmPrivateEndpointConnectionItemData.cs @@ -5,6 +5,7 @@ #nullable disable +using Azure; using Azure.Core; using Azure.ResourceManager.Resources.Models; @@ -19,16 +20,24 @@ internal ManagedHsmPrivateEndpointConnectionItemData() } /// Initializes a new instance of ManagedHsmPrivateEndpointConnectionItemData. + /// Id of private endpoint connection. + /// Modified whenever there is a change in the state of private endpoint connection. /// Properties of the private endpoint object. /// Approval state of the private link connection. /// Provisioning state of the private endpoint connection. - internal ManagedHsmPrivateEndpointConnectionItemData(SubResource privateEndpoint, ManagedHsmPrivateLinkServiceConnectionState privateLinkServiceConnectionState, ManagedHsmPrivateEndpointConnectionProvisioningState? provisioningState) + internal ManagedHsmPrivateEndpointConnectionItemData(string id, ETag? etag, SubResource privateEndpoint, ManagedHsmPrivateLinkServiceConnectionState privateLinkServiceConnectionState, ManagedHsmPrivateEndpointConnectionProvisioningState? provisioningState) { + Id = id; + ETag = etag; PrivateEndpoint = privateEndpoint; PrivateLinkServiceConnectionState = privateLinkServiceConnectionState; ProvisioningState = provisioningState; } + /// Id of private endpoint connection. + public string Id { get; } + /// Modified whenever there is a change in the state of private endpoint connection. + public ETag? ETag { get; } /// Properties of the private endpoint object. internal SubResource PrivateEndpoint { get; } /// Gets Id. diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/autorest.md b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/autorest.md index 32802b079a22..a0fe1c1b4814 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/autorest.md +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/autorest.md @@ -152,8 +152,8 @@ These settings apply only when `--tag=package-2021-10` is specified on the comma ```yaml $(tag) == 'package-2021-10' input-file: - - https://github.com/Azure/azure-rest-api-specs/blob/8b871ca35a08c43293fcbb2926e6062db4f6d85c/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2021-10-01/common.json - - https://github.com/Azure/azure-rest-api-specs/blob/8b871ca35a08c43293fcbb2926e6062db4f6d85c/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2021-10-01/keyvault.json - - https://github.com/Azure/azure-rest-api-specs/blob/8b871ca35a08c43293fcbb2926e6062db4f6d85c/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2021-10-01/managedHsm.json - - https://github.com/Azure/azure-rest-api-specs/blob/8b871ca35a08c43293fcbb2926e6062db4f6d85c/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2021-10-01/providers.json + - https://github.com/Azure/azure-rest-api-specs/blob/5bca31022f138acfae10fa7e9d6042fbbc27ec12/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2021-10-01/common.json + - https://github.com/Azure/azure-rest-api-specs/blob/5bca31022f138acfae10fa7e9d6042fbbc27ec12/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2021-10-01/keyvault.json + - https://github.com/Azure/azure-rest-api-specs/blob/5bca31022f138acfae10fa7e9d6042fbbc27ec12/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2021-10-01/managedHsm.json + - https://github.com/Azure/azure-rest-api-specs/blob/5bca31022f138acfae10fa7e9d6042fbbc27ec12/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2021-10-01/providers.json ```