diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/api/Azure.ResourceManager.KeyVault.net8.0.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/api/Azure.ResourceManager.KeyVault.net8.0.cs index 2a000a33de75..a2a7c3e1fc18 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/api/Azure.ResourceManager.KeyVault.net8.0.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/api/Azure.ResourceManager.KeyVault.net8.0.cs @@ -99,10 +99,12 @@ protected KeyVaultCollection() { } System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } } - public partial class KeyVaultData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class KeyVaultData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public KeyVaultData(Azure.Core.AzureLocation location, Azure.ResourceManager.KeyVault.Models.KeyVaultProperties properties) { } - public Azure.ResourceManager.KeyVault.Models.KeyVaultProperties Properties { get { throw null; } set { } } + internal KeyVaultData() { } + public Azure.Core.AzureLocation? Location { get { throw null; } } + public Azure.ResourceManager.KeyVault.Models.KeyVaultProperties Properties { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary Tags { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.KeyVault.KeyVaultData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -268,9 +270,9 @@ protected KeyVaultSecretCollection() { } } public partial class KeyVaultSecretData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public KeyVaultSecretData(Azure.ResourceManager.KeyVault.Models.SecretProperties properties) { } + internal KeyVaultSecretData() { } public Azure.Core.AzureLocation? Location { get { throw null; } } - public Azure.ResourceManager.KeyVault.Models.SecretProperties Properties { get { throw null; } set { } } + public Azure.ResourceManager.KeyVault.Models.SecretProperties Properties { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Tags { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.KeyVault.KeyVaultSecretData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -400,10 +402,10 @@ protected ManagedHsmResource() { } public virtual Azure.Response GetManagedHsmPrivateEndpointConnection(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetManagedHsmPrivateEndpointConnectionAsync(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.KeyVault.ManagedHsmPrivateEndpointConnectionCollection GetManagedHsmPrivateEndpointConnections() { throw null; } - public virtual Azure.Pageable GetMHSMPrivateLinkResourcesByManagedHsmResource(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetMHSMPrivateLinkResourcesByManagedHsmResourceAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetMHSMRegionsByResource(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetMHSMRegionsByResourceAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetPrivateLinkResources(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetPrivateLinkResourcesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetRegions(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetRegionsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -479,10 +481,9 @@ public static partial class ArmKeyVaultModelFactory public static Azure.ResourceManager.KeyVault.Models.DeletedManagedHsmProperties DeletedManagedHsmProperties(Azure.Core.ResourceIdentifier managedHsmId = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), System.DateTimeOffset? deletedOn = default(System.DateTimeOffset?), System.DateTimeOffset? scheduledPurgeOn = default(System.DateTimeOffset?), bool? purgeProtectionEnabled = default(bool?), System.Collections.Generic.IReadOnlyDictionary tags = null) { throw null; } public static Azure.ResourceManager.KeyVault.Models.KeyVaultAccessPolicyParameters KeyVaultAccessPolicyParameters(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), System.Collections.Generic.IEnumerable accessPolicies = null) { throw null; } public static Azure.ResourceManager.KeyVault.Models.KeyVaultCreateOrUpdateContent KeyVaultCreateOrUpdateContent(Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.KeyVault.Models.KeyVaultProperties properties = null) { throw null; } - public static Azure.ResourceManager.KeyVault.KeyVaultData KeyVaultData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.KeyVault.Models.KeyVaultProperties properties = null) { throw null; } - public static Azure.ResourceManager.KeyVault.Models.KeyVaultNameAvailabilityContent KeyVaultNameAvailabilityContent(string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType)) { throw null; } + public static Azure.ResourceManager.KeyVault.KeyVaultData KeyVaultData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.KeyVault.Models.KeyVaultProperties properties = null, System.Collections.Generic.IReadOnlyDictionary tags = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?)) { throw null; } public static Azure.ResourceManager.KeyVault.Models.KeyVaultNameAvailabilityResult KeyVaultNameAvailabilityResult(bool? nameAvailable = default(bool?), Azure.ResourceManager.KeyVault.Models.KeyVaultNameUnavailableReason? reason = default(Azure.ResourceManager.KeyVault.Models.KeyVaultNameUnavailableReason?), string message = null) { throw null; } - public static Azure.ResourceManager.KeyVault.KeyVaultPrivateEndpointConnectionData KeyVaultPrivateEndpointConnectionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ETag? etag = default(Azure.ETag?), Azure.Core.ResourceIdentifier privateEndpointId = null, Azure.ResourceManager.KeyVault.Models.KeyVaultPrivateLinkServiceConnectionState connectionState = null, Azure.ResourceManager.KeyVault.Models.KeyVaultPrivateEndpointConnectionProvisioningState? provisioningState = default(Azure.ResourceManager.KeyVault.Models.KeyVaultPrivateEndpointConnectionProvisioningState?), Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), System.Collections.Generic.IReadOnlyDictionary tags = null) { throw null; } + public static Azure.ResourceManager.KeyVault.KeyVaultPrivateEndpointConnectionData KeyVaultPrivateEndpointConnectionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.ResourceIdentifier privateEndpointId = null, Azure.ResourceManager.KeyVault.Models.KeyVaultPrivateLinkServiceConnectionState connectionState = null, Azure.ResourceManager.KeyVault.Models.KeyVaultPrivateEndpointConnectionProvisioningState? provisioningState = default(Azure.ResourceManager.KeyVault.Models.KeyVaultPrivateEndpointConnectionProvisioningState?), Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), System.Collections.Generic.IReadOnlyDictionary tags = null, Azure.ETag? etag = default(Azure.ETag?)) { throw null; } public static Azure.ResourceManager.KeyVault.Models.KeyVaultPrivateEndpointConnectionItemData KeyVaultPrivateEndpointConnectionItemData(string id = null, Azure.ETag? etag = default(Azure.ETag?), Azure.Core.ResourceIdentifier privateEndpointId = null, Azure.ResourceManager.KeyVault.Models.KeyVaultPrivateLinkServiceConnectionState connectionState = null, Azure.ResourceManager.KeyVault.Models.KeyVaultPrivateEndpointConnectionProvisioningState? provisioningState = default(Azure.ResourceManager.KeyVault.Models.KeyVaultPrivateEndpointConnectionProvisioningState?)) { throw null; } public static Azure.ResourceManager.KeyVault.Models.KeyVaultPrivateLinkResourceData KeyVaultPrivateLinkResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string groupId = null, System.Collections.Generic.IEnumerable requiredMembers = null, System.Collections.Generic.IEnumerable requiredZoneNames = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), System.Collections.Generic.IReadOnlyDictionary tags = null) { throw null; } public static Azure.ResourceManager.KeyVault.Models.KeyVaultProperties KeyVaultProperties(System.Guid tenantId = default(System.Guid), Azure.ResourceManager.KeyVault.Models.KeyVaultSku sku = null, System.Collections.Generic.IEnumerable accessPolicies = null, System.Uri vaultUri = null, string hsmPoolResourceId = null, bool? enabledForDeployment = default(bool?), bool? enabledForDiskEncryption = default(bool?), bool? enabledForTemplateDeployment = default(bool?), bool? enableSoftDelete = default(bool?), int? softDeleteRetentionInDays = default(int?), bool? enableRbacAuthorization = default(bool?), Azure.ResourceManager.KeyVault.Models.KeyVaultCreateMode? createMode = default(Azure.ResourceManager.KeyVault.Models.KeyVaultCreateMode?), bool? enablePurgeProtection = default(bool?), Azure.ResourceManager.KeyVault.Models.KeyVaultNetworkRuleSet networkRuleSet = null, Azure.ResourceManager.KeyVault.Models.KeyVaultProvisioningState? provisioningState = default(Azure.ResourceManager.KeyVault.Models.KeyVaultProvisioningState?), System.Collections.Generic.IEnumerable privateEndpointConnections = null, string publicNetworkAccess = null) { throw null; } @@ -493,13 +494,11 @@ public static partial class ArmKeyVaultModelFactory public static Azure.ResourceManager.KeyVault.ManagedHsmData ManagedHsmData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.KeyVault.Models.ManagedHsmProperties properties = null, Azure.ResourceManager.KeyVault.Models.ManagedHsmSku sku = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } public static Azure.ResourceManager.KeyVault.Models.ManagedHsmGeoReplicatedRegion ManagedHsmGeoReplicatedRegion(string name = null, Azure.ResourceManager.KeyVault.Models.ManagedHsmGeoReplicatedRegionProvisioningState? provisioningState = default(Azure.ResourceManager.KeyVault.Models.ManagedHsmGeoReplicatedRegionProvisioningState?), bool? isPrimary = default(bool?)) { throw null; } public static Azure.ResourceManager.KeyVault.Models.ManagedHsmNameAvailabilityResult ManagedHsmNameAvailabilityResult(bool? isNameAvailable = default(bool?), Azure.ResourceManager.KeyVault.Models.ManagedHsmNameUnavailableReason? reason = default(Azure.ResourceManager.KeyVault.Models.ManagedHsmNameUnavailableReason?), string message = null) { throw null; } + public static Azure.ResourceManager.KeyVault.ManagedHsmPrivateEndpointConnectionData ManagedHsmPrivateEndpointConnectionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.Core.ResourceIdentifier privateEndpointId = null, Azure.ResourceManager.KeyVault.Models.ManagedHsmPrivateLinkServiceConnectionState privateLinkServiceConnectionState = null, Azure.ResourceManager.KeyVault.Models.ManagedHsmPrivateEndpointConnectionProvisioningState? provisioningState = default(Azure.ResourceManager.KeyVault.Models.ManagedHsmPrivateEndpointConnectionProvisioningState?), Azure.ResourceManager.KeyVault.Models.ManagedHsmSku sku = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ETag? etag = default(Azure.ETag?)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.ResourceManager.KeyVault.ManagedHsmPrivateEndpointConnectionData ManagedHsmPrivateEndpointConnectionData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, Azure.ETag? etag, Azure.Core.ResourceIdentifier privateEndpointId, Azure.ResourceManager.KeyVault.Models.ManagedHsmPrivateLinkServiceConnectionState privateLinkServiceConnectionState, Azure.ResourceManager.KeyVault.Models.ManagedHsmPrivateEndpointConnectionProvisioningState? provisioningState, Azure.ResourceManager.KeyVault.Models.ManagedHsmSku sku) { throw null; } - public static Azure.ResourceManager.KeyVault.ManagedHsmPrivateEndpointConnectionData ManagedHsmPrivateEndpointConnectionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ETag? etag = default(Azure.ETag?), Azure.Core.ResourceIdentifier privateEndpointId = null, Azure.ResourceManager.KeyVault.Models.ManagedHsmPrivateLinkServiceConnectionState privateLinkServiceConnectionState = null, Azure.ResourceManager.KeyVault.Models.ManagedHsmPrivateEndpointConnectionProvisioningState? provisioningState = default(Azure.ResourceManager.KeyVault.Models.ManagedHsmPrivateEndpointConnectionProvisioningState?), Azure.ResourceManager.KeyVault.Models.ManagedHsmSku sku = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } public static Azure.ResourceManager.KeyVault.Models.ManagedHsmPrivateEndpointConnectionItemData ManagedHsmPrivateEndpointConnectionItemData(Azure.Core.ResourceIdentifier id = null, Azure.ETag? etag = default(Azure.ETag?), Azure.Core.ResourceIdentifier privateEndpointId = null, Azure.ResourceManager.KeyVault.Models.ManagedHsmPrivateLinkServiceConnectionState privateLinkServiceConnectionState = null, Azure.ResourceManager.KeyVault.Models.ManagedHsmPrivateEndpointConnectionProvisioningState? provisioningState = default(Azure.ResourceManager.KeyVault.Models.ManagedHsmPrivateEndpointConnectionProvisioningState?)) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public static Azure.ResourceManager.KeyVault.Models.ManagedHsmPrivateLinkResourceData ManagedHsmPrivateLinkResourceData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, string groupId, System.Collections.Generic.IEnumerable requiredMembers, System.Collections.Generic.IEnumerable requiredZoneNames, Azure.ResourceManager.KeyVault.Models.ManagedHsmSku sku) { throw null; } - public static Azure.ResourceManager.KeyVault.Models.ManagedHsmPrivateLinkResourceData ManagedHsmPrivateLinkResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), string groupId = null, System.Collections.Generic.IEnumerable requiredMembers = null, System.Collections.Generic.IEnumerable requiredZoneNames = null, Azure.ResourceManager.KeyVault.Models.ManagedHsmSku sku = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } + public static Azure.ResourceManager.KeyVault.Models.ManagedHsmPrivateLinkResourceData ManagedHsmPrivateLinkResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string groupId = null, System.Collections.Generic.IEnumerable requiredMembers = null, System.Collections.Generic.IEnumerable requiredZoneNames = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), Azure.ResourceManager.KeyVault.Models.ManagedHsmSku sku = null, System.Collections.Generic.IReadOnlyDictionary tags = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } public static Azure.ResourceManager.KeyVault.Models.ManagedHsmProperties ManagedHsmProperties(System.Guid? tenantId = default(System.Guid?), System.Collections.Generic.IEnumerable initialAdminObjectIds = null, System.Uri hsmUri = null, bool? enableSoftDelete = default(bool?), int? softDeleteRetentionInDays = default(int?), bool? enablePurgeProtection = default(bool?), Azure.ResourceManager.KeyVault.Models.ManagedHsmCreateMode? createMode = default(Azure.ResourceManager.KeyVault.Models.ManagedHsmCreateMode?), string statusMessage = null, Azure.ResourceManager.KeyVault.Models.ManagedHsmProvisioningState? provisioningState = default(Azure.ResourceManager.KeyVault.Models.ManagedHsmProvisioningState?), Azure.ResourceManager.KeyVault.Models.ManagedHsmNetworkRuleSet networkRuleSet = null, System.Collections.Generic.IEnumerable regions = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null, Azure.ResourceManager.KeyVault.Models.ManagedHsmPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.KeyVault.Models.ManagedHsmPublicNetworkAccess?), System.DateTimeOffset? scheduledPurgeOn = default(System.DateTimeOffset?), Azure.ResourceManager.KeyVault.Models.ManagedHSMSecurityDomainProperties securityDomainProperties = null) { throw null; } public static Azure.ResourceManager.KeyVault.Models.ManagedHSMSecurityDomainProperties ManagedHSMSecurityDomainProperties(Azure.ResourceManager.KeyVault.Models.ManagedHSMSecurityDomainActivationStatus? activationStatus = default(Azure.ResourceManager.KeyVault.Models.ManagedHSMSecurityDomainActivationStatus?), string activationStatusMessage = null) { throw null; } public static Azure.ResourceManager.KeyVault.Models.SecretAttributes SecretAttributes(bool? enabled = default(bool?), System.DateTimeOffset? notBefore = default(System.DateTimeOffset?), System.DateTimeOffset? expires = default(System.DateTimeOffset?), System.DateTimeOffset? created = default(System.DateTimeOffset?), System.DateTimeOffset? updated = default(System.DateTimeOffset?)) { throw null; } @@ -769,7 +768,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer } public partial class KeyVaultNameAvailabilityContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public KeyVaultNameAvailabilityContent(string name) { } + public KeyVaultNameAvailabilityContent(string name, Azure.Core.ResourceType resourceType) { } public string Name { get { throw null; } } public Azure.Core.ResourceType ResourceType { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -946,11 +945,11 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer } public partial class KeyVaultPrivateLinkResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public KeyVaultPrivateLinkResourceData() { } + internal KeyVaultPrivateLinkResourceData() { } public string GroupId { get { throw null; } } public Azure.Core.AzureLocation? Location { get { throw null; } } public System.Collections.Generic.IReadOnlyList RequiredMembers { get { throw null; } } - public System.Collections.Generic.IList RequiredZoneNames { get { throw null; } } + public System.Collections.Generic.IReadOnlyList RequiredZoneNames { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Tags { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.KeyVault.Models.KeyVaultPrivateLinkResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1240,7 +1239,7 @@ public ManagedHsmNetworkRuleSet() { } public Azure.ResourceManager.KeyVault.Models.ManagedHsmNetworkRuleAction? DefaultAction { get { throw null; } set { } } public System.Collections.Generic.IList IPRules { get { throw null; } } public System.Collections.Generic.IList ServiceTags { get { throw null; } } - public System.Collections.Generic.IList VirtualNetworkRules { get { throw null; } } + public System.Collections.Generic.IList VirtualNetworkRules { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.KeyVault.Models.ManagedHsmNetworkRuleSet System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -1305,14 +1304,16 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.KeyVault.Models.ManagedHsmPrivateEndpointServiceConnectionStatus left, Azure.ResourceManager.KeyVault.Models.ManagedHsmPrivateEndpointServiceConnectionStatus right) { throw null; } public override string ToString() { throw null; } } - public partial class ManagedHsmPrivateLinkResourceData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class ManagedHsmPrivateLinkResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public ManagedHsmPrivateLinkResourceData(Azure.Core.AzureLocation location) { } + internal ManagedHsmPrivateLinkResourceData() { } public string GroupId { get { throw null; } } - public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } } + public Azure.Core.AzureLocation? Location { get { throw null; } } public System.Collections.Generic.IReadOnlyList RequiredMembers { get { throw null; } } - public System.Collections.Generic.IList RequiredZoneNames { get { throw null; } } - public Azure.ResourceManager.KeyVault.Models.ManagedHsmSku Sku { get { throw null; } set { } } + public System.Collections.Generic.IReadOnlyList RequiredZoneNames { get { throw null; } } + public Azure.ResourceManager.KeyVault.Models.ManagedHsmSku Sku { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary Tags { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.KeyVault.Models.ManagedHsmPrivateLinkResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -1481,17 +1482,6 @@ public enum ManagedHsmSkuName CustomC42 = 3, CustomC10 = 4, } - public partial class ManagedHsmVirtualNetworkRule : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public ManagedHsmVirtualNetworkRule(Azure.Core.ResourceIdentifier subnetId) { } - public Azure.Core.ResourceIdentifier SubnetId { get { throw null; } set { } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.KeyVault.Models.ManagedHsmVirtualNetworkRule System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.KeyVault.Models.ManagedHsmVirtualNetworkRule System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } public partial class SecretAttributes : Azure.ResourceManager.KeyVault.Models.SecretBaseAttributes, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public SecretAttributes() { } diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/api/Azure.ResourceManager.KeyVault.netstandard2.0.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/api/Azure.ResourceManager.KeyVault.netstandard2.0.cs index 2a000a33de75..a2a7c3e1fc18 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/api/Azure.ResourceManager.KeyVault.netstandard2.0.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/api/Azure.ResourceManager.KeyVault.netstandard2.0.cs @@ -99,10 +99,12 @@ protected KeyVaultCollection() { } System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } } - public partial class KeyVaultData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class KeyVaultData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public KeyVaultData(Azure.Core.AzureLocation location, Azure.ResourceManager.KeyVault.Models.KeyVaultProperties properties) { } - public Azure.ResourceManager.KeyVault.Models.KeyVaultProperties Properties { get { throw null; } set { } } + internal KeyVaultData() { } + public Azure.Core.AzureLocation? Location { get { throw null; } } + public Azure.ResourceManager.KeyVault.Models.KeyVaultProperties Properties { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary Tags { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.KeyVault.KeyVaultData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -268,9 +270,9 @@ protected KeyVaultSecretCollection() { } } public partial class KeyVaultSecretData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public KeyVaultSecretData(Azure.ResourceManager.KeyVault.Models.SecretProperties properties) { } + internal KeyVaultSecretData() { } public Azure.Core.AzureLocation? Location { get { throw null; } } - public Azure.ResourceManager.KeyVault.Models.SecretProperties Properties { get { throw null; } set { } } + public Azure.ResourceManager.KeyVault.Models.SecretProperties Properties { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Tags { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.KeyVault.KeyVaultSecretData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -400,10 +402,10 @@ protected ManagedHsmResource() { } public virtual Azure.Response GetManagedHsmPrivateEndpointConnection(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetManagedHsmPrivateEndpointConnectionAsync(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.KeyVault.ManagedHsmPrivateEndpointConnectionCollection GetManagedHsmPrivateEndpointConnections() { throw null; } - public virtual Azure.Pageable GetMHSMPrivateLinkResourcesByManagedHsmResource(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetMHSMPrivateLinkResourcesByManagedHsmResourceAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetMHSMRegionsByResource(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetMHSMRegionsByResourceAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetPrivateLinkResources(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetPrivateLinkResourcesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetRegions(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetRegionsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -479,10 +481,9 @@ public static partial class ArmKeyVaultModelFactory public static Azure.ResourceManager.KeyVault.Models.DeletedManagedHsmProperties DeletedManagedHsmProperties(Azure.Core.ResourceIdentifier managedHsmId = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), System.DateTimeOffset? deletedOn = default(System.DateTimeOffset?), System.DateTimeOffset? scheduledPurgeOn = default(System.DateTimeOffset?), bool? purgeProtectionEnabled = default(bool?), System.Collections.Generic.IReadOnlyDictionary tags = null) { throw null; } public static Azure.ResourceManager.KeyVault.Models.KeyVaultAccessPolicyParameters KeyVaultAccessPolicyParameters(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), System.Collections.Generic.IEnumerable accessPolicies = null) { throw null; } public static Azure.ResourceManager.KeyVault.Models.KeyVaultCreateOrUpdateContent KeyVaultCreateOrUpdateContent(Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.KeyVault.Models.KeyVaultProperties properties = null) { throw null; } - public static Azure.ResourceManager.KeyVault.KeyVaultData KeyVaultData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.KeyVault.Models.KeyVaultProperties properties = null) { throw null; } - public static Azure.ResourceManager.KeyVault.Models.KeyVaultNameAvailabilityContent KeyVaultNameAvailabilityContent(string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType)) { throw null; } + public static Azure.ResourceManager.KeyVault.KeyVaultData KeyVaultData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.KeyVault.Models.KeyVaultProperties properties = null, System.Collections.Generic.IReadOnlyDictionary tags = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?)) { throw null; } public static Azure.ResourceManager.KeyVault.Models.KeyVaultNameAvailabilityResult KeyVaultNameAvailabilityResult(bool? nameAvailable = default(bool?), Azure.ResourceManager.KeyVault.Models.KeyVaultNameUnavailableReason? reason = default(Azure.ResourceManager.KeyVault.Models.KeyVaultNameUnavailableReason?), string message = null) { throw null; } - public static Azure.ResourceManager.KeyVault.KeyVaultPrivateEndpointConnectionData KeyVaultPrivateEndpointConnectionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ETag? etag = default(Azure.ETag?), Azure.Core.ResourceIdentifier privateEndpointId = null, Azure.ResourceManager.KeyVault.Models.KeyVaultPrivateLinkServiceConnectionState connectionState = null, Azure.ResourceManager.KeyVault.Models.KeyVaultPrivateEndpointConnectionProvisioningState? provisioningState = default(Azure.ResourceManager.KeyVault.Models.KeyVaultPrivateEndpointConnectionProvisioningState?), Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), System.Collections.Generic.IReadOnlyDictionary tags = null) { throw null; } + public static Azure.ResourceManager.KeyVault.KeyVaultPrivateEndpointConnectionData KeyVaultPrivateEndpointConnectionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.ResourceIdentifier privateEndpointId = null, Azure.ResourceManager.KeyVault.Models.KeyVaultPrivateLinkServiceConnectionState connectionState = null, Azure.ResourceManager.KeyVault.Models.KeyVaultPrivateEndpointConnectionProvisioningState? provisioningState = default(Azure.ResourceManager.KeyVault.Models.KeyVaultPrivateEndpointConnectionProvisioningState?), Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), System.Collections.Generic.IReadOnlyDictionary tags = null, Azure.ETag? etag = default(Azure.ETag?)) { throw null; } public static Azure.ResourceManager.KeyVault.Models.KeyVaultPrivateEndpointConnectionItemData KeyVaultPrivateEndpointConnectionItemData(string id = null, Azure.ETag? etag = default(Azure.ETag?), Azure.Core.ResourceIdentifier privateEndpointId = null, Azure.ResourceManager.KeyVault.Models.KeyVaultPrivateLinkServiceConnectionState connectionState = null, Azure.ResourceManager.KeyVault.Models.KeyVaultPrivateEndpointConnectionProvisioningState? provisioningState = default(Azure.ResourceManager.KeyVault.Models.KeyVaultPrivateEndpointConnectionProvisioningState?)) { throw null; } public static Azure.ResourceManager.KeyVault.Models.KeyVaultPrivateLinkResourceData KeyVaultPrivateLinkResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string groupId = null, System.Collections.Generic.IEnumerable requiredMembers = null, System.Collections.Generic.IEnumerable requiredZoneNames = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), System.Collections.Generic.IReadOnlyDictionary tags = null) { throw null; } public static Azure.ResourceManager.KeyVault.Models.KeyVaultProperties KeyVaultProperties(System.Guid tenantId = default(System.Guid), Azure.ResourceManager.KeyVault.Models.KeyVaultSku sku = null, System.Collections.Generic.IEnumerable accessPolicies = null, System.Uri vaultUri = null, string hsmPoolResourceId = null, bool? enabledForDeployment = default(bool?), bool? enabledForDiskEncryption = default(bool?), bool? enabledForTemplateDeployment = default(bool?), bool? enableSoftDelete = default(bool?), int? softDeleteRetentionInDays = default(int?), bool? enableRbacAuthorization = default(bool?), Azure.ResourceManager.KeyVault.Models.KeyVaultCreateMode? createMode = default(Azure.ResourceManager.KeyVault.Models.KeyVaultCreateMode?), bool? enablePurgeProtection = default(bool?), Azure.ResourceManager.KeyVault.Models.KeyVaultNetworkRuleSet networkRuleSet = null, Azure.ResourceManager.KeyVault.Models.KeyVaultProvisioningState? provisioningState = default(Azure.ResourceManager.KeyVault.Models.KeyVaultProvisioningState?), System.Collections.Generic.IEnumerable privateEndpointConnections = null, string publicNetworkAccess = null) { throw null; } @@ -493,13 +494,11 @@ public static partial class ArmKeyVaultModelFactory public static Azure.ResourceManager.KeyVault.ManagedHsmData ManagedHsmData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.KeyVault.Models.ManagedHsmProperties properties = null, Azure.ResourceManager.KeyVault.Models.ManagedHsmSku sku = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } public static Azure.ResourceManager.KeyVault.Models.ManagedHsmGeoReplicatedRegion ManagedHsmGeoReplicatedRegion(string name = null, Azure.ResourceManager.KeyVault.Models.ManagedHsmGeoReplicatedRegionProvisioningState? provisioningState = default(Azure.ResourceManager.KeyVault.Models.ManagedHsmGeoReplicatedRegionProvisioningState?), bool? isPrimary = default(bool?)) { throw null; } public static Azure.ResourceManager.KeyVault.Models.ManagedHsmNameAvailabilityResult ManagedHsmNameAvailabilityResult(bool? isNameAvailable = default(bool?), Azure.ResourceManager.KeyVault.Models.ManagedHsmNameUnavailableReason? reason = default(Azure.ResourceManager.KeyVault.Models.ManagedHsmNameUnavailableReason?), string message = null) { throw null; } + public static Azure.ResourceManager.KeyVault.ManagedHsmPrivateEndpointConnectionData ManagedHsmPrivateEndpointConnectionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.Core.ResourceIdentifier privateEndpointId = null, Azure.ResourceManager.KeyVault.Models.ManagedHsmPrivateLinkServiceConnectionState privateLinkServiceConnectionState = null, Azure.ResourceManager.KeyVault.Models.ManagedHsmPrivateEndpointConnectionProvisioningState? provisioningState = default(Azure.ResourceManager.KeyVault.Models.ManagedHsmPrivateEndpointConnectionProvisioningState?), Azure.ResourceManager.KeyVault.Models.ManagedHsmSku sku = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ETag? etag = default(Azure.ETag?)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.ResourceManager.KeyVault.ManagedHsmPrivateEndpointConnectionData ManagedHsmPrivateEndpointConnectionData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, Azure.ETag? etag, Azure.Core.ResourceIdentifier privateEndpointId, Azure.ResourceManager.KeyVault.Models.ManagedHsmPrivateLinkServiceConnectionState privateLinkServiceConnectionState, Azure.ResourceManager.KeyVault.Models.ManagedHsmPrivateEndpointConnectionProvisioningState? provisioningState, Azure.ResourceManager.KeyVault.Models.ManagedHsmSku sku) { throw null; } - public static Azure.ResourceManager.KeyVault.ManagedHsmPrivateEndpointConnectionData ManagedHsmPrivateEndpointConnectionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ETag? etag = default(Azure.ETag?), Azure.Core.ResourceIdentifier privateEndpointId = null, Azure.ResourceManager.KeyVault.Models.ManagedHsmPrivateLinkServiceConnectionState privateLinkServiceConnectionState = null, Azure.ResourceManager.KeyVault.Models.ManagedHsmPrivateEndpointConnectionProvisioningState? provisioningState = default(Azure.ResourceManager.KeyVault.Models.ManagedHsmPrivateEndpointConnectionProvisioningState?), Azure.ResourceManager.KeyVault.Models.ManagedHsmSku sku = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } public static Azure.ResourceManager.KeyVault.Models.ManagedHsmPrivateEndpointConnectionItemData ManagedHsmPrivateEndpointConnectionItemData(Azure.Core.ResourceIdentifier id = null, Azure.ETag? etag = default(Azure.ETag?), Azure.Core.ResourceIdentifier privateEndpointId = null, Azure.ResourceManager.KeyVault.Models.ManagedHsmPrivateLinkServiceConnectionState privateLinkServiceConnectionState = null, Azure.ResourceManager.KeyVault.Models.ManagedHsmPrivateEndpointConnectionProvisioningState? provisioningState = default(Azure.ResourceManager.KeyVault.Models.ManagedHsmPrivateEndpointConnectionProvisioningState?)) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public static Azure.ResourceManager.KeyVault.Models.ManagedHsmPrivateLinkResourceData ManagedHsmPrivateLinkResourceData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, string groupId, System.Collections.Generic.IEnumerable requiredMembers, System.Collections.Generic.IEnumerable requiredZoneNames, Azure.ResourceManager.KeyVault.Models.ManagedHsmSku sku) { throw null; } - public static Azure.ResourceManager.KeyVault.Models.ManagedHsmPrivateLinkResourceData ManagedHsmPrivateLinkResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), string groupId = null, System.Collections.Generic.IEnumerable requiredMembers = null, System.Collections.Generic.IEnumerable requiredZoneNames = null, Azure.ResourceManager.KeyVault.Models.ManagedHsmSku sku = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } + public static Azure.ResourceManager.KeyVault.Models.ManagedHsmPrivateLinkResourceData ManagedHsmPrivateLinkResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string groupId = null, System.Collections.Generic.IEnumerable requiredMembers = null, System.Collections.Generic.IEnumerable requiredZoneNames = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), Azure.ResourceManager.KeyVault.Models.ManagedHsmSku sku = null, System.Collections.Generic.IReadOnlyDictionary tags = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } public static Azure.ResourceManager.KeyVault.Models.ManagedHsmProperties ManagedHsmProperties(System.Guid? tenantId = default(System.Guid?), System.Collections.Generic.IEnumerable initialAdminObjectIds = null, System.Uri hsmUri = null, bool? enableSoftDelete = default(bool?), int? softDeleteRetentionInDays = default(int?), bool? enablePurgeProtection = default(bool?), Azure.ResourceManager.KeyVault.Models.ManagedHsmCreateMode? createMode = default(Azure.ResourceManager.KeyVault.Models.ManagedHsmCreateMode?), string statusMessage = null, Azure.ResourceManager.KeyVault.Models.ManagedHsmProvisioningState? provisioningState = default(Azure.ResourceManager.KeyVault.Models.ManagedHsmProvisioningState?), Azure.ResourceManager.KeyVault.Models.ManagedHsmNetworkRuleSet networkRuleSet = null, System.Collections.Generic.IEnumerable regions = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null, Azure.ResourceManager.KeyVault.Models.ManagedHsmPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.KeyVault.Models.ManagedHsmPublicNetworkAccess?), System.DateTimeOffset? scheduledPurgeOn = default(System.DateTimeOffset?), Azure.ResourceManager.KeyVault.Models.ManagedHSMSecurityDomainProperties securityDomainProperties = null) { throw null; } public static Azure.ResourceManager.KeyVault.Models.ManagedHSMSecurityDomainProperties ManagedHSMSecurityDomainProperties(Azure.ResourceManager.KeyVault.Models.ManagedHSMSecurityDomainActivationStatus? activationStatus = default(Azure.ResourceManager.KeyVault.Models.ManagedHSMSecurityDomainActivationStatus?), string activationStatusMessage = null) { throw null; } public static Azure.ResourceManager.KeyVault.Models.SecretAttributes SecretAttributes(bool? enabled = default(bool?), System.DateTimeOffset? notBefore = default(System.DateTimeOffset?), System.DateTimeOffset? expires = default(System.DateTimeOffset?), System.DateTimeOffset? created = default(System.DateTimeOffset?), System.DateTimeOffset? updated = default(System.DateTimeOffset?)) { throw null; } @@ -769,7 +768,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer } public partial class KeyVaultNameAvailabilityContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public KeyVaultNameAvailabilityContent(string name) { } + public KeyVaultNameAvailabilityContent(string name, Azure.Core.ResourceType resourceType) { } public string Name { get { throw null; } } public Azure.Core.ResourceType ResourceType { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -946,11 +945,11 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer } public partial class KeyVaultPrivateLinkResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public KeyVaultPrivateLinkResourceData() { } + internal KeyVaultPrivateLinkResourceData() { } public string GroupId { get { throw null; } } public Azure.Core.AzureLocation? Location { get { throw null; } } public System.Collections.Generic.IReadOnlyList RequiredMembers { get { throw null; } } - public System.Collections.Generic.IList RequiredZoneNames { get { throw null; } } + public System.Collections.Generic.IReadOnlyList RequiredZoneNames { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary Tags { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.KeyVault.Models.KeyVaultPrivateLinkResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1240,7 +1239,7 @@ public ManagedHsmNetworkRuleSet() { } public Azure.ResourceManager.KeyVault.Models.ManagedHsmNetworkRuleAction? DefaultAction { get { throw null; } set { } } public System.Collections.Generic.IList IPRules { get { throw null; } } public System.Collections.Generic.IList ServiceTags { get { throw null; } } - public System.Collections.Generic.IList VirtualNetworkRules { get { throw null; } } + public System.Collections.Generic.IList VirtualNetworkRules { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.KeyVault.Models.ManagedHsmNetworkRuleSet System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -1305,14 +1304,16 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.KeyVault.Models.ManagedHsmPrivateEndpointServiceConnectionStatus left, Azure.ResourceManager.KeyVault.Models.ManagedHsmPrivateEndpointServiceConnectionStatus right) { throw null; } public override string ToString() { throw null; } } - public partial class ManagedHsmPrivateLinkResourceData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class ManagedHsmPrivateLinkResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public ManagedHsmPrivateLinkResourceData(Azure.Core.AzureLocation location) { } + internal ManagedHsmPrivateLinkResourceData() { } public string GroupId { get { throw null; } } - public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } } + public Azure.Core.AzureLocation? Location { get { throw null; } } public System.Collections.Generic.IReadOnlyList RequiredMembers { get { throw null; } } - public System.Collections.Generic.IList RequiredZoneNames { get { throw null; } } - public Azure.ResourceManager.KeyVault.Models.ManagedHsmSku Sku { get { throw null; } set { } } + public System.Collections.Generic.IReadOnlyList RequiredZoneNames { get { throw null; } } + public Azure.ResourceManager.KeyVault.Models.ManagedHsmSku Sku { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary Tags { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.KeyVault.Models.ManagedHsmPrivateLinkResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -1481,17 +1482,6 @@ public enum ManagedHsmSkuName CustomC42 = 3, CustomC10 = 4, } - public partial class ManagedHsmVirtualNetworkRule : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public ManagedHsmVirtualNetworkRule(Azure.Core.ResourceIdentifier subnetId) { } - public Azure.Core.ResourceIdentifier SubnetId { get { throw null; } set { } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.KeyVault.Models.ManagedHsmVirtualNetworkRule System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.KeyVault.Models.ManagedHsmVirtualNetworkRule System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } public partial class SecretAttributes : Azure.ResourceManager.KeyVault.Models.SecretBaseAttributes, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public SecretAttributes() { } diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/ArmKeyVaultModelFactory.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/ArmKeyVaultModelFactory.cs index ab20a59df3e6..a9a6823dc44f 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/ArmKeyVaultModelFactory.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/ArmKeyVaultModelFactory.cs @@ -17,16 +17,28 @@ namespace Azure.ResourceManager.KeyVault.Models /// Model factory for models. public static partial class ArmKeyVaultModelFactory { - /// Initializes a new instance of . - /// The supported Azure location where the key vault should be created. - /// The tags that will be assigned to the key vault. + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. /// Properties of the vault. - /// A new instance for mocking. - public static KeyVaultCreateOrUpdateContent KeyVaultCreateOrUpdateContent(AzureLocation location = default, IDictionary tags = null, KeyVaultProperties properties = null) + /// Resource tags. + /// The geo-location where the resource lives. + /// A new instance for mocking. + public static KeyVaultData KeyVaultData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, KeyVaultProperties properties = null, IReadOnlyDictionary tags = null, AzureLocation? location = null) { tags ??= new Dictionary(); - return new KeyVaultCreateOrUpdateContent(location, tags, properties, serializedAdditionalRawData: null); + return new KeyVaultData( + id, + name, + resourceType, + systemData, + properties, + tags, + location, + serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -92,28 +104,16 @@ public static KeyVaultPrivateEndpointConnectionItemData KeyVaultPrivateEndpointC serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. + /// Initializes a new instance of . + /// The supported Azure location where the key vault should be created. + /// The tags that will be assigned to the key vault. /// Properties of the vault. - /// A new instance for mocking. - public static KeyVaultData KeyVaultData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, KeyVaultProperties properties = null) + /// A new instance for mocking. + public static KeyVaultCreateOrUpdateContent KeyVaultCreateOrUpdateContent(AzureLocation location = default, IDictionary tags = null, KeyVaultProperties properties = null) { tags ??= new Dictionary(); - return new KeyVaultData( - id, - name, - resourceType, - systemData, - tags, - location, - properties, - serializedAdditionalRawData: null); + return new KeyVaultCreateOrUpdateContent(location, tags, properties, serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -138,6 +138,36 @@ public static KeyVaultAccessPolicyParameters KeyVaultAccessPolicyParameters(Reso serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Group identifier of private link resource. + /// Required member names of private link resource. + /// Required DNS zone names of the the private link resource. + /// Azure location of the key vault resource. + /// Tags assigned to the key vault resource. + /// A new instance for mocking. + public static KeyVaultPrivateLinkResourceData KeyVaultPrivateLinkResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string groupId = null, IEnumerable requiredMembers = null, IEnumerable requiredZoneNames = null, AzureLocation? location = null, IReadOnlyDictionary tags = null) + { + requiredMembers ??= new List(); + requiredZoneNames ??= new List(); + tags ??= new Dictionary(); + + return new KeyVaultPrivateLinkResourceData( + id, + name, + resourceType, + systemData, + groupId, + requiredMembers?.ToList(), + requiredZoneNames?.ToList(), + location, + tags, + serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The id. /// The name. @@ -178,38 +208,19 @@ public static DeletedKeyVaultProperties DeletedKeyVaultProperties(ResourceIdenti serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The vault name. - /// The type of resource, Microsoft.KeyVault/vaults. - /// A new instance for mocking. - public static KeyVaultNameAvailabilityContent KeyVaultNameAvailabilityContent(string name = null, ResourceType resourceType = default) - { - return new KeyVaultNameAvailabilityContent(name, resourceType, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// A boolean value that indicates whether the name is available for you to use. If true, the name is available. If false, the name has already been taken or is invalid and cannot be used. - /// The reason that a vault name could not be used. The Reason element is only returned if NameAvailable is false. - /// An error message explaining the Reason value in more detail. - /// A new instance for mocking. - public static KeyVaultNameAvailabilityResult KeyVaultNameAvailabilityResult(bool? nameAvailable = null, KeyVaultNameUnavailableReason? reason = null, string message = null) - { - return new KeyVaultNameAvailabilityResult(nameAvailable, reason, message, serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. /// The systemData. - /// 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. /// Azure location of the key vault resource. /// Tags assigned to the key vault resource. + /// Modified whenever there is a change in the state of private endpoint connection. /// A new instance for mocking. - public static KeyVaultPrivateEndpointConnectionData KeyVaultPrivateEndpointConnectionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ETag? etag = null, ResourceIdentifier privateEndpointId = null, KeyVaultPrivateLinkServiceConnectionState connectionState = null, KeyVaultPrivateEndpointConnectionProvisioningState? provisioningState = null, AzureLocation? location = null, IReadOnlyDictionary tags = null) + public static KeyVaultPrivateEndpointConnectionData KeyVaultPrivateEndpointConnectionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ResourceIdentifier privateEndpointId = null, KeyVaultPrivateLinkServiceConnectionState connectionState = null, KeyVaultPrivateEndpointConnectionProvisioningState? provisioningState = null, AzureLocation? location = null, IReadOnlyDictionary tags = null, ETag? etag = null) { tags ??= new Dictionary(); @@ -218,42 +229,12 @@ public static KeyVaultPrivateEndpointConnectionData KeyVaultPrivateEndpointConne name, resourceType, systemData, - etag, privateEndpointId != null ? ResourceManagerModelFactory.SubResource(privateEndpointId) : null, connectionState, provisioningState, location, tags, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Group identifier of private link resource. - /// Required member names of private link resource. - /// Required DNS zone names of the the private link resource. - /// Azure location of the key vault resource. - /// Tags assigned to the key vault resource. - /// A new instance for mocking. - public static KeyVaultPrivateLinkResourceData KeyVaultPrivateLinkResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string groupId = null, IEnumerable requiredMembers = null, IEnumerable requiredZoneNames = null, AzureLocation? location = null, IReadOnlyDictionary tags = null) - { - requiredMembers ??= new List(); - requiredZoneNames ??= new List(); - tags ??= new Dictionary(); - - return new KeyVaultPrivateLinkResourceData( - id, - name, - resourceType, - systemData, - groupId, - requiredMembers?.ToList(), - requiredZoneNames?.ToList(), - location, - tags, + etag, serializedAdditionalRawData: null); } @@ -266,7 +247,7 @@ public static KeyVaultPrivateLinkResourceData KeyVaultPrivateLinkResourceData(Re /// The location. /// Properties of the managed HSM. /// SKU details. - /// Managed service identity (system assigned and/or user assigned identities). + /// Managed service identity. /// A new instance for mocking. public static ManagedHsmData ManagedHsmData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ManagedHsmProperties properties = null, ManagedHsmSku sku = null, ManagedServiceIdentity identity = null) { @@ -364,36 +345,36 @@ public static ManagedHSMSecurityDomainProperties ManagedHSMSecurityDomainPropert return new ManagedHSMSecurityDomainProperties(activationStatus, activationStatusMessage, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. /// The systemData. - /// The tags. - /// The location. - /// 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. + /// Group identifier of private link resource. + /// Required member names of private link resource. + /// Required DNS zone names of the the private link resource. + /// The supported Azure location where the managed HSM Pool should be created. /// SKU details. + /// Resource tags. /// Managed service identity (system assigned and/or user assigned identities). - /// A new instance for mocking. - public static ManagedHsmPrivateEndpointConnectionData ManagedHsmPrivateEndpointConnectionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ETag? etag = null, ResourceIdentifier privateEndpointId = null, ManagedHsmPrivateLinkServiceConnectionState privateLinkServiceConnectionState = null, ManagedHsmPrivateEndpointConnectionProvisioningState? provisioningState = null, ManagedHsmSku sku = null, ManagedServiceIdentity identity = null) + /// A new instance for mocking. + public static ManagedHsmPrivateLinkResourceData ManagedHsmPrivateLinkResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string groupId = null, IEnumerable requiredMembers = null, IEnumerable requiredZoneNames = null, AzureLocation? location = null, ManagedHsmSku sku = null, IReadOnlyDictionary tags = null, ManagedServiceIdentity identity = null) { + requiredMembers ??= new List(); + requiredZoneNames ??= new List(); tags ??= new Dictionary(); - return new ManagedHsmPrivateEndpointConnectionData( + return new ManagedHsmPrivateLinkResourceData( id, name, resourceType, systemData, - tags, + groupId, + requiredMembers?.ToList(), + requiredZoneNames?.ToList(), location, - etag, - privateEndpointId != null ? ResourceManagerModelFactory.SubResource(privateEndpointId) : null, - privateLinkServiceConnectionState, - provisioningState, sku, + tags, identity, serializedAdditionalRawData: null); } @@ -438,59 +419,62 @@ public static DeletedManagedHsmProperties DeletedManagedHsmProperties(ResourceId serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. /// The systemData. /// The tags. /// The location. - /// Group identifier of private link resource. - /// Required member names of private link resource. - /// Required DNS zone names of the the private link resource. + /// Properties of the private endpoint object. + /// Approval state of the private link connection. + /// Provisioning state of the private endpoint connection. /// SKU details. - /// Managed service identity (system assigned and/or user assigned identities). - /// A new instance for mocking. - public static ManagedHsmPrivateLinkResourceData ManagedHsmPrivateLinkResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string groupId = null, IEnumerable requiredMembers = null, IEnumerable requiredZoneNames = null, ManagedHsmSku sku = null, ManagedServiceIdentity identity = null) + /// Managed service identity. + /// Modified whenever there is a change in the state of private endpoint connection. + /// A new instance for mocking. + public static ManagedHsmPrivateEndpointConnectionData ManagedHsmPrivateEndpointConnectionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ResourceIdentifier privateEndpointId = null, ManagedHsmPrivateLinkServiceConnectionState privateLinkServiceConnectionState = null, ManagedHsmPrivateEndpointConnectionProvisioningState? provisioningState = null, ManagedHsmSku sku = null, ManagedServiceIdentity identity = null, ETag? etag = null) { tags ??= new Dictionary(); - requiredMembers ??= new List(); - requiredZoneNames ??= new List(); - return new ManagedHsmPrivateLinkResourceData( + return new ManagedHsmPrivateEndpointConnectionData( id, name, resourceType, systemData, tags, location, - groupId, - requiredMembers?.ToList(), - requiredZoneNames?.ToList(), + privateEndpointId != null ? ResourceManagerModelFactory.SubResource(privateEndpointId) : null, + privateLinkServiceConnectionState, + provisioningState, sku, identity, + etag, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// A boolean value that indicates whether the name is available for you to use. If true, the name is available. If false, the name has already been taken or is invalid and cannot be used. - /// The reason that a managed hsm name could not be used. The reason element is only returned if NameAvailable is false. - /// An error message explaining the Reason value in more detail. - /// A new instance for mocking. - public static ManagedHsmNameAvailabilityResult ManagedHsmNameAvailabilityResult(bool? isNameAvailable = null, ManagedHsmNameUnavailableReason? reason = null, string message = null) - { - return new ManagedHsmNameAvailabilityResult(isNameAvailable, reason, message, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The tags that will be assigned to the secret. + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. /// Properties of the secret. - /// A new instance for mocking. - public static KeyVaultSecretCreateOrUpdateContent KeyVaultSecretCreateOrUpdateContent(IDictionary tags = null, SecretProperties properties = null) + /// Azure location of the key vault resource. + /// Tags assigned to the key vault resource. + /// A new instance for mocking. + public static KeyVaultSecretData KeyVaultSecretData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, SecretProperties properties = null, AzureLocation? location = null, IReadOnlyDictionary tags = null) { tags ??= new Dictionary(); - return new KeyVaultSecretCreateOrUpdateContent(tags, properties, serializedAdditionalRawData: null); + return new KeyVaultSecretData( + id, + name, + resourceType, + systemData, + properties, + location, + tags, + serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -547,28 +531,35 @@ public static SecretBaseAttributes SecretBaseAttributes(bool? enabled = null, Da serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. + /// Initializes a new instance of . + /// The tags that will be assigned to the secret. /// Properties of the secret. - /// Azure location of the key vault resource. - /// Tags assigned to the key vault resource. - /// A new instance for mocking. - public static KeyVaultSecretData KeyVaultSecretData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, SecretProperties properties = null, AzureLocation? location = null, IReadOnlyDictionary tags = null) + /// A new instance for mocking. + public static KeyVaultSecretCreateOrUpdateContent KeyVaultSecretCreateOrUpdateContent(IDictionary tags = null, SecretProperties properties = null) { tags ??= new Dictionary(); - return new KeyVaultSecretData( - id, - name, - resourceType, - systemData, - properties, - location, - tags, - serializedAdditionalRawData: null); + return new KeyVaultSecretCreateOrUpdateContent(tags, properties, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// A boolean value that indicates whether the name is available for you to use. If true, the name is available. If false, the name has already been taken or is invalid and cannot be used. + /// The reason that a vault name could not be used. The Reason element is only returned if NameAvailable is false. + /// An error message explaining the Reason value in more detail. + /// A new instance for mocking. + public static KeyVaultNameAvailabilityResult KeyVaultNameAvailabilityResult(bool? nameAvailable = null, KeyVaultNameUnavailableReason? reason = null, string message = null) + { + return new KeyVaultNameAvailabilityResult(nameAvailable, reason, message, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// A boolean value that indicates whether the name is available for you to use. If true, the name is available. If false, the name has already been taken or is invalid and cannot be used. + /// The reason that a managed hsm name could not be used. The reason element is only returned if NameAvailable is false. + /// An error message explaining the Reason value in more detail. + /// A new instance for mocking. + public static ManagedHsmNameAvailabilityResult ManagedHsmNameAvailabilityResult(bool? isNameAvailable = null, ManagedHsmNameUnavailableReason? reason = null, string message = null) + { + return new ManagedHsmNameAvailabilityResult(isNameAvailable, reason, message, serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -603,25 +594,7 @@ public static ManagedHsmData ManagedHsmData(ResourceIdentifier id, string name, [EditorBrowsable(EditorBrowsableState.Never)] public static ManagedHsmPrivateEndpointConnectionData ManagedHsmPrivateEndpointConnectionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ETag? etag, ResourceIdentifier privateEndpointId, ManagedHsmPrivateLinkServiceConnectionState privateLinkServiceConnectionState, ManagedHsmPrivateEndpointConnectionProvisioningState? provisioningState, ManagedHsmSku sku) { - return ManagedHsmPrivateEndpointConnectionData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, etag: etag, privateEndpointId: privateEndpointId, privateLinkServiceConnectionState: privateLinkServiceConnectionState, provisioningState: provisioningState, sku: sku, identity: default); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// Group identifier of private link resource. - /// Required member names of private link resource. - /// Required DNS zone names of the the private link resource. - /// SKU details. - /// A new instance for mocking. - [EditorBrowsable(EditorBrowsableState.Never)] - public static ManagedHsmPrivateLinkResourceData ManagedHsmPrivateLinkResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string groupId, IEnumerable requiredMembers, IEnumerable requiredZoneNames, ManagedHsmSku sku) - { - return ManagedHsmPrivateLinkResourceData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, groupId: groupId, requiredMembers: requiredMembers, requiredZoneNames: requiredZoneNames, sku: sku, identity: default); + return ManagedHsmPrivateEndpointConnectionData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, privateEndpointId: privateEndpointId, privateLinkServiceConnectionState: privateLinkServiceConnectionState, provisioningState: provisioningState, sku: sku, identity: default, etag: etag); } } } diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/DeletedKeyVaultCollection.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/DeletedKeyVaultCollection.cs index 2c49e1438863..aa01998b19a0 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/DeletedKeyVaultCollection.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/DeletedKeyVaultCollection.cs @@ -22,8 +22,8 @@ namespace Azure.ResourceManager.KeyVault /// public partial class DeletedKeyVaultCollection : ArmCollection { - private readonly ClientDiagnostics _deletedKeyVaultVaultsClientDiagnostics; - private readonly VaultsRestOperations _deletedKeyVaultVaultsRestClient; + private readonly ClientDiagnostics _deletedKeyVaultDeletedVaultsClientDiagnostics; + private readonly DeletedVaultsRestOperations _deletedKeyVaultDeletedVaultsRestClient; /// Initializes a new instance of the class for mocking. protected DeletedKeyVaultCollection() @@ -35,9 +35,9 @@ protected DeletedKeyVaultCollection() /// The identifier of the parent resource that is the target of operations. internal DeletedKeyVaultCollection(ArmClient client, ResourceIdentifier id) : base(client, id) { - _deletedKeyVaultVaultsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.KeyVault", DeletedKeyVaultResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(DeletedKeyVaultResource.ResourceType, out string deletedKeyVaultVaultsApiVersion); - _deletedKeyVaultVaultsRestClient = new VaultsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, deletedKeyVaultVaultsApiVersion); + _deletedKeyVaultDeletedVaultsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.KeyVault", DeletedKeyVaultResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(DeletedKeyVaultResource.ResourceType, out string deletedKeyVaultDeletedVaultsApiVersion); + _deletedKeyVaultDeletedVaultsRestClient = new DeletedVaultsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, deletedKeyVaultDeletedVaultsApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -58,7 +58,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Operation Id - /// Vaults_GetDeleted + /// DeletedVault_GetDeleted /// /// /// Default Api Version @@ -70,7 +70,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// - /// The location of the deleted vault. + /// The name of the Azure region. /// The name of the vault. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. @@ -79,11 +79,11 @@ public virtual async Task> GetAsync(AzureLocat { Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); - using var scope = _deletedKeyVaultVaultsClientDiagnostics.CreateScope("DeletedKeyVaultCollection.Get"); + using var scope = _deletedKeyVaultDeletedVaultsClientDiagnostics.CreateScope("DeletedKeyVaultCollection.Get"); scope.Start(); try { - var response = await _deletedKeyVaultVaultsRestClient.GetDeletedAsync(Id.SubscriptionId, location, vaultName, cancellationToken).ConfigureAwait(false); + var response = await _deletedKeyVaultDeletedVaultsRestClient.GetDeletedAsync(Id.SubscriptionId, location, vaultName, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new DeletedKeyVaultResource(Client, response.Value), response.GetRawResponse()); @@ -104,7 +104,7 @@ public virtual async Task> GetAsync(AzureLocat /// /// /// Operation Id - /// Vaults_GetDeleted + /// DeletedVault_GetDeleted /// /// /// Default Api Version @@ -116,7 +116,7 @@ public virtual async Task> GetAsync(AzureLocat /// /// /// - /// The location of the deleted vault. + /// The name of the Azure region. /// The name of the vault. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. @@ -125,11 +125,11 @@ public virtual Response Get(AzureLocation location, str { Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); - using var scope = _deletedKeyVaultVaultsClientDiagnostics.CreateScope("DeletedKeyVaultCollection.Get"); + using var scope = _deletedKeyVaultDeletedVaultsClientDiagnostics.CreateScope("DeletedKeyVaultCollection.Get"); scope.Start(); try { - var response = _deletedKeyVaultVaultsRestClient.GetDeleted(Id.SubscriptionId, location, vaultName, cancellationToken); + var response = _deletedKeyVaultDeletedVaultsRestClient.GetDeleted(Id.SubscriptionId, location, vaultName, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new DeletedKeyVaultResource(Client, response.Value), response.GetRawResponse()); @@ -150,7 +150,7 @@ public virtual Response Get(AzureLocation location, str /// /// /// Operation Id - /// Vaults_GetDeleted + /// DeletedVault_GetDeleted /// /// /// Default Api Version @@ -162,7 +162,7 @@ public virtual Response Get(AzureLocation location, str /// /// /// - /// The location of the deleted vault. + /// The name of the Azure region. /// The name of the vault. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. @@ -171,11 +171,11 @@ public virtual async Task> ExistsAsync(AzureLocation location, st { Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); - using var scope = _deletedKeyVaultVaultsClientDiagnostics.CreateScope("DeletedKeyVaultCollection.Exists"); + using var scope = _deletedKeyVaultDeletedVaultsClientDiagnostics.CreateScope("DeletedKeyVaultCollection.Exists"); scope.Start(); try { - var response = await _deletedKeyVaultVaultsRestClient.GetDeletedAsync(Id.SubscriptionId, location, vaultName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _deletedKeyVaultDeletedVaultsRestClient.GetDeletedAsync(Id.SubscriptionId, location, vaultName, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -194,7 +194,7 @@ public virtual async Task> ExistsAsync(AzureLocation location, st /// /// /// Operation Id - /// Vaults_GetDeleted + /// DeletedVault_GetDeleted /// /// /// Default Api Version @@ -206,7 +206,7 @@ public virtual async Task> ExistsAsync(AzureLocation location, st /// /// /// - /// The location of the deleted vault. + /// The name of the Azure region. /// The name of the vault. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. @@ -215,11 +215,11 @@ public virtual Response Exists(AzureLocation location, string vaultName, C { Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); - using var scope = _deletedKeyVaultVaultsClientDiagnostics.CreateScope("DeletedKeyVaultCollection.Exists"); + using var scope = _deletedKeyVaultDeletedVaultsClientDiagnostics.CreateScope("DeletedKeyVaultCollection.Exists"); scope.Start(); try { - var response = _deletedKeyVaultVaultsRestClient.GetDeleted(Id.SubscriptionId, location, vaultName, cancellationToken: cancellationToken); + var response = _deletedKeyVaultDeletedVaultsRestClient.GetDeleted(Id.SubscriptionId, location, vaultName, cancellationToken: cancellationToken); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -238,7 +238,7 @@ public virtual Response Exists(AzureLocation location, string vaultName, C /// /// /// Operation Id - /// Vaults_GetDeleted + /// DeletedVault_GetDeleted /// /// /// Default Api Version @@ -250,7 +250,7 @@ public virtual Response Exists(AzureLocation location, string vaultName, C /// /// /// - /// The location of the deleted vault. + /// The name of the Azure region. /// The name of the vault. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. @@ -259,11 +259,11 @@ public virtual async Task> GetIfExists { Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); - using var scope = _deletedKeyVaultVaultsClientDiagnostics.CreateScope("DeletedKeyVaultCollection.GetIfExists"); + using var scope = _deletedKeyVaultDeletedVaultsClientDiagnostics.CreateScope("DeletedKeyVaultCollection.GetIfExists"); scope.Start(); try { - var response = await _deletedKeyVaultVaultsRestClient.GetDeletedAsync(Id.SubscriptionId, location, vaultName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _deletedKeyVaultDeletedVaultsRestClient.GetDeletedAsync(Id.SubscriptionId, location, vaultName, cancellationToken: cancellationToken).ConfigureAwait(false); if (response.Value == null) return new NoValueResponse(response.GetRawResponse()); return Response.FromValue(new DeletedKeyVaultResource(Client, response.Value), response.GetRawResponse()); @@ -284,7 +284,7 @@ public virtual async Task> GetIfExists /// /// /// Operation Id - /// Vaults_GetDeleted + /// DeletedVault_GetDeleted /// /// /// Default Api Version @@ -296,7 +296,7 @@ public virtual async Task> GetIfExists /// /// /// - /// The location of the deleted vault. + /// The name of the Azure region. /// The name of the vault. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. @@ -305,11 +305,11 @@ public virtual NullableResponse GetIfExists(AzureLocati { Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); - using var scope = _deletedKeyVaultVaultsClientDiagnostics.CreateScope("DeletedKeyVaultCollection.GetIfExists"); + using var scope = _deletedKeyVaultDeletedVaultsClientDiagnostics.CreateScope("DeletedKeyVaultCollection.GetIfExists"); scope.Start(); try { - var response = _deletedKeyVaultVaultsRestClient.GetDeleted(Id.SubscriptionId, location, vaultName, cancellationToken: cancellationToken); + var response = _deletedKeyVaultDeletedVaultsRestClient.GetDeleted(Id.SubscriptionId, location, vaultName, cancellationToken: cancellationToken); if (response.Value == null) return new NoValueResponse(response.GetRawResponse()); return Response.FromValue(new DeletedKeyVaultResource(Client, response.Value), response.GetRawResponse()); diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/DeletedKeyVaultResource.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/DeletedKeyVaultResource.cs index 23c208f85218..d7fb79c9c865 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/DeletedKeyVaultResource.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/DeletedKeyVaultResource.cs @@ -33,8 +33,8 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, return new ResourceIdentifier(resourceId); } - private readonly ClientDiagnostics _deletedKeyVaultVaultsClientDiagnostics; - private readonly VaultsRestOperations _deletedKeyVaultVaultsRestClient; + private readonly ClientDiagnostics _deletedKeyVaultDeletedVaultsClientDiagnostics; + private readonly DeletedVaultsRestOperations _deletedKeyVaultDeletedVaultsRestClient; private readonly DeletedKeyVaultData _data; /// Gets the resource type for the operations. @@ -59,9 +59,9 @@ internal DeletedKeyVaultResource(ArmClient client, DeletedKeyVaultData data) : t /// The identifier of the resource that is the target of operations. internal DeletedKeyVaultResource(ArmClient client, ResourceIdentifier id) : base(client, id) { - _deletedKeyVaultVaultsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.KeyVault", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string deletedKeyVaultVaultsApiVersion); - _deletedKeyVaultVaultsRestClient = new VaultsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, deletedKeyVaultVaultsApiVersion); + _deletedKeyVaultDeletedVaultsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.KeyVault", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string deletedKeyVaultDeletedVaultsApiVersion); + _deletedKeyVaultDeletedVaultsRestClient = new DeletedVaultsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, deletedKeyVaultDeletedVaultsApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -97,7 +97,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Operation Id - /// Vaults_GetDeleted + /// DeletedVault_GetDeleted /// /// /// Default Api Version @@ -112,11 +112,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// The cancellation token to use. public virtual async Task> GetAsync(CancellationToken cancellationToken = default) { - using var scope = _deletedKeyVaultVaultsClientDiagnostics.CreateScope("DeletedKeyVaultResource.Get"); + using var scope = _deletedKeyVaultDeletedVaultsClientDiagnostics.CreateScope("DeletedKeyVaultResource.Get"); scope.Start(); try { - var response = await _deletedKeyVaultVaultsRestClient.GetDeletedAsync(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _deletedKeyVaultDeletedVaultsRestClient.GetDeletedAsync(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new DeletedKeyVaultResource(Client, response.Value), response.GetRawResponse()); @@ -137,7 +137,7 @@ public virtual async Task> GetAsync(Cancellati /// /// /// Operation Id - /// Vaults_GetDeleted + /// DeletedVault_GetDeleted /// /// /// Default Api Version @@ -152,11 +152,11 @@ public virtual async Task> GetAsync(Cancellati /// The cancellation token to use. public virtual Response Get(CancellationToken cancellationToken = default) { - using var scope = _deletedKeyVaultVaultsClientDiagnostics.CreateScope("DeletedKeyVaultResource.Get"); + using var scope = _deletedKeyVaultDeletedVaultsClientDiagnostics.CreateScope("DeletedKeyVaultResource.Get"); scope.Start(); try { - var response = _deletedKeyVaultVaultsRestClient.GetDeleted(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken); + var response = _deletedKeyVaultDeletedVaultsRestClient.GetDeleted(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new DeletedKeyVaultResource(Client, response.Value), response.GetRawResponse()); @@ -177,7 +177,7 @@ public virtual Response Get(CancellationToken cancellat /// /// /// Operation Id - /// Vaults_PurgeDeleted + /// DeletedVaults_PurgeDeleted /// /// /// Default Api Version @@ -193,12 +193,12 @@ public virtual Response Get(CancellationToken cancellat /// The cancellation token to use. public virtual async Task PurgeDeletedAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _deletedKeyVaultVaultsClientDiagnostics.CreateScope("DeletedKeyVaultResource.PurgeDeleted"); + using var scope = _deletedKeyVaultDeletedVaultsClientDiagnostics.CreateScope("DeletedKeyVaultResource.PurgeDeleted"); scope.Start(); try { - var response = await _deletedKeyVaultVaultsRestClient.PurgeDeletedAsync(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new KeyVaultArmOperation(_deletedKeyVaultVaultsClientDiagnostics, Pipeline, _deletedKeyVaultVaultsRestClient.CreatePurgeDeletedRequest(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name).Request, response, OperationFinalStateVia.Location); + var response = await _deletedKeyVaultDeletedVaultsRestClient.PurgeDeletedAsync(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new KeyVaultArmOperation(_deletedKeyVaultDeletedVaultsClientDiagnostics, Pipeline, _deletedKeyVaultDeletedVaultsRestClient.CreatePurgeDeletedRequest(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -219,7 +219,7 @@ public virtual async Task PurgeDeletedAsync(WaitUntil waitUntil, C /// /// /// Operation Id - /// Vaults_PurgeDeleted + /// DeletedVaults_PurgeDeleted /// /// /// Default Api Version @@ -235,12 +235,12 @@ public virtual async Task PurgeDeletedAsync(WaitUntil waitUntil, C /// The cancellation token to use. public virtual ArmOperation PurgeDeleted(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _deletedKeyVaultVaultsClientDiagnostics.CreateScope("DeletedKeyVaultResource.PurgeDeleted"); + using var scope = _deletedKeyVaultDeletedVaultsClientDiagnostics.CreateScope("DeletedKeyVaultResource.PurgeDeleted"); scope.Start(); try { - var response = _deletedKeyVaultVaultsRestClient.PurgeDeleted(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken); - var operation = new KeyVaultArmOperation(_deletedKeyVaultVaultsClientDiagnostics, Pipeline, _deletedKeyVaultVaultsRestClient.CreatePurgeDeletedRequest(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name).Request, response, OperationFinalStateVia.Location); + var response = _deletedKeyVaultDeletedVaultsRestClient.PurgeDeleted(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken); + var operation = new KeyVaultArmOperation(_deletedKeyVaultDeletedVaultsClientDiagnostics, Pipeline, _deletedKeyVaultDeletedVaultsRestClient.CreatePurgeDeletedRequest(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/DeletedManagedHsmCollection.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/DeletedManagedHsmCollection.cs index a2dd9bed6317..2cfbe1bf608a 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/DeletedManagedHsmCollection.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/DeletedManagedHsmCollection.cs @@ -22,8 +22,8 @@ namespace Azure.ResourceManager.KeyVault /// public partial class DeletedManagedHsmCollection : ArmCollection { - private readonly ClientDiagnostics _deletedManagedHsmManagedHsmsClientDiagnostics; - private readonly ManagedHsmsRestOperations _deletedManagedHsmManagedHsmsRestClient; + private readonly ClientDiagnostics _deletedManagedHsmClientDiagnostics; + private readonly DeletedManagedHsmsRestOperations _deletedManagedHsmRestClient; /// Initializes a new instance of the class for mocking. protected DeletedManagedHsmCollection() @@ -35,9 +35,9 @@ protected DeletedManagedHsmCollection() /// The identifier of the parent resource that is the target of operations. internal DeletedManagedHsmCollection(ArmClient client, ResourceIdentifier id) : base(client, id) { - _deletedManagedHsmManagedHsmsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.KeyVault", DeletedManagedHsmResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(DeletedManagedHsmResource.ResourceType, out string deletedManagedHsmManagedHsmsApiVersion); - _deletedManagedHsmManagedHsmsRestClient = new ManagedHsmsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, deletedManagedHsmManagedHsmsApiVersion); + _deletedManagedHsmClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.KeyVault", DeletedManagedHsmResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(DeletedManagedHsmResource.ResourceType, out string deletedManagedHsmApiVersion); + _deletedManagedHsmRestClient = new DeletedManagedHsmsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, deletedManagedHsmApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -58,7 +58,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Operation Id - /// ManagedHsms_GetDeleted + /// DeletedManagedHsm_GetDeleted /// /// /// Default Api Version @@ -70,7 +70,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// - /// The location of the deleted managed HSM. + /// The name of the Azure region. /// The name of the deleted managed HSM. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. @@ -79,11 +79,11 @@ public virtual async Task> GetAsync(AzureLoc { Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var scope = _deletedManagedHsmManagedHsmsClientDiagnostics.CreateScope("DeletedManagedHsmCollection.Get"); + using var scope = _deletedManagedHsmClientDiagnostics.CreateScope("DeletedManagedHsmCollection.Get"); scope.Start(); try { - var response = await _deletedManagedHsmManagedHsmsRestClient.GetDeletedAsync(Id.SubscriptionId, location, name, cancellationToken).ConfigureAwait(false); + var response = await _deletedManagedHsmRestClient.GetDeletedAsync(Id.SubscriptionId, location, name, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new DeletedManagedHsmResource(Client, response.Value), response.GetRawResponse()); @@ -104,7 +104,7 @@ public virtual async Task> GetAsync(AzureLoc /// /// /// Operation Id - /// ManagedHsms_GetDeleted + /// DeletedManagedHsm_GetDeleted /// /// /// Default Api Version @@ -116,7 +116,7 @@ public virtual async Task> GetAsync(AzureLoc /// /// /// - /// The location of the deleted managed HSM. + /// The name of the Azure region. /// The name of the deleted managed HSM. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. @@ -125,11 +125,11 @@ public virtual Response Get(AzureLocation location, s { Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var scope = _deletedManagedHsmManagedHsmsClientDiagnostics.CreateScope("DeletedManagedHsmCollection.Get"); + using var scope = _deletedManagedHsmClientDiagnostics.CreateScope("DeletedManagedHsmCollection.Get"); scope.Start(); try { - var response = _deletedManagedHsmManagedHsmsRestClient.GetDeleted(Id.SubscriptionId, location, name, cancellationToken); + var response = _deletedManagedHsmRestClient.GetDeleted(Id.SubscriptionId, location, name, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new DeletedManagedHsmResource(Client, response.Value), response.GetRawResponse()); @@ -150,7 +150,7 @@ public virtual Response Get(AzureLocation location, s /// /// /// Operation Id - /// ManagedHsms_GetDeleted + /// DeletedManagedHsm_GetDeleted /// /// /// Default Api Version @@ -162,7 +162,7 @@ public virtual Response Get(AzureLocation location, s /// /// /// - /// The location of the deleted managed HSM. + /// The name of the Azure region. /// The name of the deleted managed HSM. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. @@ -171,11 +171,11 @@ public virtual async Task> ExistsAsync(AzureLocation location, st { Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var scope = _deletedManagedHsmManagedHsmsClientDiagnostics.CreateScope("DeletedManagedHsmCollection.Exists"); + using var scope = _deletedManagedHsmClientDiagnostics.CreateScope("DeletedManagedHsmCollection.Exists"); scope.Start(); try { - var response = await _deletedManagedHsmManagedHsmsRestClient.GetDeletedAsync(Id.SubscriptionId, location, name, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _deletedManagedHsmRestClient.GetDeletedAsync(Id.SubscriptionId, location, name, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -194,7 +194,7 @@ public virtual async Task> ExistsAsync(AzureLocation location, st /// /// /// Operation Id - /// ManagedHsms_GetDeleted + /// DeletedManagedHsm_GetDeleted /// /// /// Default Api Version @@ -206,7 +206,7 @@ public virtual async Task> ExistsAsync(AzureLocation location, st /// /// /// - /// The location of the deleted managed HSM. + /// The name of the Azure region. /// The name of the deleted managed HSM. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. @@ -215,11 +215,11 @@ public virtual Response Exists(AzureLocation location, string name, Cancel { Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var scope = _deletedManagedHsmManagedHsmsClientDiagnostics.CreateScope("DeletedManagedHsmCollection.Exists"); + using var scope = _deletedManagedHsmClientDiagnostics.CreateScope("DeletedManagedHsmCollection.Exists"); scope.Start(); try { - var response = _deletedManagedHsmManagedHsmsRestClient.GetDeleted(Id.SubscriptionId, location, name, cancellationToken: cancellationToken); + var response = _deletedManagedHsmRestClient.GetDeleted(Id.SubscriptionId, location, name, cancellationToken: cancellationToken); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -238,7 +238,7 @@ public virtual Response Exists(AzureLocation location, string name, Cancel /// /// /// Operation Id - /// ManagedHsms_GetDeleted + /// DeletedManagedHsm_GetDeleted /// /// /// Default Api Version @@ -250,7 +250,7 @@ public virtual Response Exists(AzureLocation location, string name, Cancel /// /// /// - /// The location of the deleted managed HSM. + /// The name of the Azure region. /// The name of the deleted managed HSM. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. @@ -259,11 +259,11 @@ public virtual async Task> GetIfExis { Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var scope = _deletedManagedHsmManagedHsmsClientDiagnostics.CreateScope("DeletedManagedHsmCollection.GetIfExists"); + using var scope = _deletedManagedHsmClientDiagnostics.CreateScope("DeletedManagedHsmCollection.GetIfExists"); scope.Start(); try { - var response = await _deletedManagedHsmManagedHsmsRestClient.GetDeletedAsync(Id.SubscriptionId, location, name, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _deletedManagedHsmRestClient.GetDeletedAsync(Id.SubscriptionId, location, name, cancellationToken: cancellationToken).ConfigureAwait(false); if (response.Value == null) return new NoValueResponse(response.GetRawResponse()); return Response.FromValue(new DeletedManagedHsmResource(Client, response.Value), response.GetRawResponse()); @@ -284,7 +284,7 @@ public virtual async Task> GetIfExis /// /// /// Operation Id - /// ManagedHsms_GetDeleted + /// DeletedManagedHsm_GetDeleted /// /// /// Default Api Version @@ -296,7 +296,7 @@ public virtual async Task> GetIfExis /// /// /// - /// The location of the deleted managed HSM. + /// The name of the Azure region. /// The name of the deleted managed HSM. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. @@ -305,11 +305,11 @@ public virtual NullableResponse GetIfExists(AzureLoca { Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var scope = _deletedManagedHsmManagedHsmsClientDiagnostics.CreateScope("DeletedManagedHsmCollection.GetIfExists"); + using var scope = _deletedManagedHsmClientDiagnostics.CreateScope("DeletedManagedHsmCollection.GetIfExists"); scope.Start(); try { - var response = _deletedManagedHsmManagedHsmsRestClient.GetDeleted(Id.SubscriptionId, location, name, cancellationToken: cancellationToken); + var response = _deletedManagedHsmRestClient.GetDeleted(Id.SubscriptionId, location, name, cancellationToken: cancellationToken); if (response.Value == null) return new NoValueResponse(response.GetRawResponse()); return Response.FromValue(new DeletedManagedHsmResource(Client, response.Value), response.GetRawResponse()); diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/DeletedManagedHsmData.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/DeletedManagedHsmData.cs index 24e0c5d90779..64e9675594da 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/DeletedManagedHsmData.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/DeletedManagedHsmData.cs @@ -13,7 +13,10 @@ namespace Azure.ResourceManager.KeyVault { - /// A class representing the DeletedManagedHsm data model. + /// + /// A class representing the DeletedManagedHsm data model. + /// Concrete proxy resource types can be created by aliasing this type using a specific property type. + /// public partial class DeletedManagedHsmData : ResourceData { /// diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/DeletedManagedHsmResource.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/DeletedManagedHsmResource.cs index abfe33176efd..3f1284536b62 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/DeletedManagedHsmResource.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/DeletedManagedHsmResource.cs @@ -33,8 +33,8 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, return new ResourceIdentifier(resourceId); } - private readonly ClientDiagnostics _deletedManagedHsmManagedHsmsClientDiagnostics; - private readonly ManagedHsmsRestOperations _deletedManagedHsmManagedHsmsRestClient; + private readonly ClientDiagnostics _deletedManagedHsmClientDiagnostics; + private readonly DeletedManagedHsmsRestOperations _deletedManagedHsmRestClient; private readonly DeletedManagedHsmData _data; /// Gets the resource type for the operations. @@ -59,9 +59,9 @@ internal DeletedManagedHsmResource(ArmClient client, DeletedManagedHsmData data) /// The identifier of the resource that is the target of operations. internal DeletedManagedHsmResource(ArmClient client, ResourceIdentifier id) : base(client, id) { - _deletedManagedHsmManagedHsmsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.KeyVault", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string deletedManagedHsmManagedHsmsApiVersion); - _deletedManagedHsmManagedHsmsRestClient = new ManagedHsmsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, deletedManagedHsmManagedHsmsApiVersion); + _deletedManagedHsmClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.KeyVault", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string deletedManagedHsmApiVersion); + _deletedManagedHsmRestClient = new DeletedManagedHsmsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, deletedManagedHsmApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -97,7 +97,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Operation Id - /// ManagedHsms_GetDeleted + /// DeletedManagedHsm_GetDeleted /// /// /// Default Api Version @@ -112,11 +112,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// The cancellation token to use. public virtual async Task> GetAsync(CancellationToken cancellationToken = default) { - using var scope = _deletedManagedHsmManagedHsmsClientDiagnostics.CreateScope("DeletedManagedHsmResource.Get"); + using var scope = _deletedManagedHsmClientDiagnostics.CreateScope("DeletedManagedHsmResource.Get"); scope.Start(); try { - var response = await _deletedManagedHsmManagedHsmsRestClient.GetDeletedAsync(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _deletedManagedHsmRestClient.GetDeletedAsync(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new DeletedManagedHsmResource(Client, response.Value), response.GetRawResponse()); @@ -137,7 +137,7 @@ public virtual async Task> GetAsync(Cancella /// /// /// Operation Id - /// ManagedHsms_GetDeleted + /// DeletedManagedHsm_GetDeleted /// /// /// Default Api Version @@ -152,11 +152,11 @@ public virtual async Task> GetAsync(Cancella /// The cancellation token to use. public virtual Response Get(CancellationToken cancellationToken = default) { - using var scope = _deletedManagedHsmManagedHsmsClientDiagnostics.CreateScope("DeletedManagedHsmResource.Get"); + using var scope = _deletedManagedHsmClientDiagnostics.CreateScope("DeletedManagedHsmResource.Get"); scope.Start(); try { - var response = _deletedManagedHsmManagedHsmsRestClient.GetDeleted(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken); + var response = _deletedManagedHsmRestClient.GetDeleted(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new DeletedManagedHsmResource(Client, response.Value), response.GetRawResponse()); @@ -177,7 +177,7 @@ public virtual Response Get(CancellationToken cancell /// /// /// Operation Id - /// ManagedHsms_PurgeDeleted + /// DeletedManagedHsms_PurgeDeleted /// /// /// Default Api Version @@ -193,12 +193,12 @@ public virtual Response Get(CancellationToken cancell /// The cancellation token to use. public virtual async Task PurgeDeletedAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _deletedManagedHsmManagedHsmsClientDiagnostics.CreateScope("DeletedManagedHsmResource.PurgeDeleted"); + using var scope = _deletedManagedHsmClientDiagnostics.CreateScope("DeletedManagedHsmResource.PurgeDeleted"); scope.Start(); try { - var response = await _deletedManagedHsmManagedHsmsRestClient.PurgeDeletedAsync(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new KeyVaultArmOperation(_deletedManagedHsmManagedHsmsClientDiagnostics, Pipeline, _deletedManagedHsmManagedHsmsRestClient.CreatePurgeDeletedRequest(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name).Request, response, OperationFinalStateVia.Location); + var response = await _deletedManagedHsmRestClient.PurgeDeletedAsync(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new KeyVaultArmOperation(_deletedManagedHsmClientDiagnostics, Pipeline, _deletedManagedHsmRestClient.CreatePurgeDeletedRequest(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -219,7 +219,7 @@ public virtual async Task PurgeDeletedAsync(WaitUntil waitUntil, C /// /// /// Operation Id - /// ManagedHsms_PurgeDeleted + /// DeletedManagedHsms_PurgeDeleted /// /// /// Default Api Version @@ -235,12 +235,12 @@ public virtual async Task PurgeDeletedAsync(WaitUntil waitUntil, C /// The cancellation token to use. public virtual ArmOperation PurgeDeleted(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _deletedManagedHsmManagedHsmsClientDiagnostics.CreateScope("DeletedManagedHsmResource.PurgeDeleted"); + using var scope = _deletedManagedHsmClientDiagnostics.CreateScope("DeletedManagedHsmResource.PurgeDeleted"); scope.Start(); try { - var response = _deletedManagedHsmManagedHsmsRestClient.PurgeDeleted(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken); - var operation = new KeyVaultArmOperation(_deletedManagedHsmManagedHsmsClientDiagnostics, Pipeline, _deletedManagedHsmManagedHsmsRestClient.CreatePurgeDeletedRequest(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name).Request, response, OperationFinalStateVia.Location); + var response = _deletedManagedHsmRestClient.PurgeDeleted(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken); + var operation = new KeyVaultArmOperation(_deletedManagedHsmClientDiagnostics, Pipeline, _deletedManagedHsmRestClient.CreatePurgeDeletedRequest(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Extensions/KeyVaultExtensions.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Extensions/KeyVaultExtensions.cs index eb12d44186d5..fffce432ce5b 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Extensions/KeyVaultExtensions.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Extensions/KeyVaultExtensions.cs @@ -192,7 +192,7 @@ public static KeyVaultCollection GetKeyVaults(this ResourceGroupResource resourc /// /// /// Operation Id - /// Vaults_Get + /// Vault_Get /// /// /// Default Api Version @@ -230,7 +230,7 @@ public static async Task> GetKeyVaultAsync(this Resou /// /// /// Operation Id - /// Vaults_Get + /// Vault_Get /// /// /// Default Api Version @@ -285,7 +285,7 @@ public static ManagedHsmCollection GetManagedHsms(this ResourceGroupResource res /// /// /// Operation Id - /// ManagedHsms_Get + /// ManagedHsm_Get /// /// /// Default Api Version @@ -323,7 +323,7 @@ public static async Task> GetManagedHsmAsync(this R /// /// /// Operation Id - /// ManagedHsms_Get + /// ManagedHsm_Get /// /// /// Default Api Version @@ -378,7 +378,7 @@ public static DeletedKeyVaultCollection GetDeletedKeyVaults(this SubscriptionRes /// /// /// Operation Id - /// Vaults_GetDeleted + /// DeletedVault_GetDeleted /// /// /// Default Api Version @@ -395,7 +395,7 @@ public static DeletedKeyVaultCollection GetDeletedKeyVaults(this SubscriptionRes /// /// /// The instance the method will execute against. - /// The location of the deleted vault. + /// The name of the Azure region. /// The name of the vault. /// The cancellation token to use. /// or is null. @@ -417,7 +417,7 @@ public static async Task> GetDeletedKeyVaultAs /// /// /// Operation Id - /// Vaults_GetDeleted + /// DeletedVault_GetDeleted /// /// /// Default Api Version @@ -434,7 +434,7 @@ public static async Task> GetDeletedKeyVaultAs /// /// /// The instance the method will execute against. - /// The location of the deleted vault. + /// The name of the Azure region. /// The name of the vault. /// The cancellation token to use. /// or is null. @@ -473,7 +473,7 @@ public static DeletedManagedHsmCollection GetDeletedManagedHsms(this Subscriptio /// /// /// Operation Id - /// ManagedHsms_GetDeleted + /// DeletedManagedHsm_GetDeleted /// /// /// Default Api Version @@ -490,7 +490,7 @@ public static DeletedManagedHsmCollection GetDeletedManagedHsms(this Subscriptio /// /// /// The instance the method will execute against. - /// The location of the deleted managed HSM. + /// The name of the Azure region. /// The name of the deleted managed HSM. /// The cancellation token to use. /// or is null. @@ -512,7 +512,7 @@ public static async Task> GetDeletedManagedH /// /// /// Operation Id - /// ManagedHsms_GetDeleted + /// DeletedManagedHsm_GetDeleted /// /// /// Default Api Version @@ -529,7 +529,7 @@ public static async Task> GetDeletedManagedH /// /// /// The instance the method will execute against. - /// The location of the deleted managed HSM. + /// The name of the Azure region. /// The name of the deleted managed HSM. /// The cancellation token to use. /// or is null. @@ -551,7 +551,7 @@ public static Response GetDeletedManagedHsm(this Subs /// /// /// Operation Id - /// Vaults_ListBySubscription + /// Vault_ListBySubscription /// /// /// Default Api Version @@ -588,7 +588,7 @@ public static AsyncPageable GetKeyVaultsAsync(this Subscriptio /// /// /// Operation Id - /// Vaults_ListBySubscription + /// Vault_ListBySubscription /// /// /// Default Api Version @@ -617,213 +617,205 @@ public static Pageable GetKeyVaults(this SubscriptionResource } /// - /// Gets information about the deleted vaults in a subscription. + /// The List operation gets information about the managed HSM Pools associated with the subscription. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/deletedVaults + /// /subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/managedHSMs /// /// /// Operation Id - /// Vaults_ListDeleted + /// ManagedHsm_ListBySubscription /// /// /// Default Api Version /// 2025-05-01 /// + /// + /// Resource + /// + /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. + /// Maximum number of results to return. /// The cancellation token to use. /// is null. - /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetDeletedKeyVaultsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetManagedHsmsAsync(this SubscriptionResource subscriptionResource, int? top = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockableKeyVaultSubscriptionResource(subscriptionResource).GetDeletedKeyVaultsAsync(cancellationToken); + return GetMockableKeyVaultSubscriptionResource(subscriptionResource).GetManagedHsmsAsync(top, cancellationToken); } /// - /// Gets information about the deleted vaults in a subscription. + /// The List operation gets information about the managed HSM Pools associated with the subscription. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/deletedVaults + /// /subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/managedHSMs /// /// /// Operation Id - /// Vaults_ListDeleted + /// ManagedHsm_ListBySubscription /// /// /// Default Api Version /// 2025-05-01 /// + /// + /// Resource + /// + /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. + /// Maximum number of results to return. /// The cancellation token to use. /// is null. - /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetDeletedKeyVaults(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetManagedHsms(this SubscriptionResource subscriptionResource, int? top = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockableKeyVaultSubscriptionResource(subscriptionResource).GetDeletedKeyVaults(cancellationToken); + return GetMockableKeyVaultSubscriptionResource(subscriptionResource).GetManagedHsms(top, cancellationToken); } /// - /// Checks that the vault name is valid and is not already in use. + /// Gets information about the deleted vaults in a subscription. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/checkNameAvailability + /// /subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/deletedVaults /// /// /// Operation Id - /// Vaults_CheckNameAvailability + /// VaultsOperationGroup_ListDeleted /// /// /// Default Api Version /// 2025-05-01 /// - /// - /// Resource - /// - /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. - /// The name of the vault. /// The cancellation token to use. - /// or is null. - public static async Task> CheckKeyVaultNameAvailabilityAsync(this SubscriptionResource subscriptionResource, KeyVaultNameAvailabilityContent content, CancellationToken cancellationToken = default) + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetDeletedKeyVaultsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return await GetMockableKeyVaultSubscriptionResource(subscriptionResource).CheckKeyVaultNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); + return GetMockableKeyVaultSubscriptionResource(subscriptionResource).GetDeletedKeyVaultsAsync(cancellationToken); } /// - /// Checks that the vault name is valid and is not already in use. + /// Gets information about the deleted vaults in a subscription. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/checkNameAvailability + /// /subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/deletedVaults /// /// /// Operation Id - /// Vaults_CheckNameAvailability + /// VaultsOperationGroup_ListDeleted /// /// /// Default Api Version /// 2025-05-01 /// - /// - /// Resource - /// - /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. - /// The name of the vault. /// The cancellation token to use. - /// or is null. - public static Response CheckKeyVaultNameAvailability(this SubscriptionResource subscriptionResource, KeyVaultNameAvailabilityContent content, CancellationToken cancellationToken = default) + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetDeletedKeyVaults(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockableKeyVaultSubscriptionResource(subscriptionResource).CheckKeyVaultNameAvailability(content, cancellationToken); + return GetMockableKeyVaultSubscriptionResource(subscriptionResource).GetDeletedKeyVaults(cancellationToken); } /// - /// The List operation gets information about the managed HSM Pools associated with the subscription. + /// Checks that the vault name is valid and is not already in use. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/managedHSMs + /// /subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/checkNameAvailability /// /// /// Operation Id - /// ManagedHsms_ListBySubscription + /// VaultsOperationGroup_CheckKeyVaultNameAvailability /// /// /// Default Api Version /// 2025-05-01 /// - /// - /// Resource - /// - /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. - /// Maximum number of results to return. + /// The name of the vault. /// The cancellation token to use. - /// is null. - /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetManagedHsmsAsync(this SubscriptionResource subscriptionResource, int? top = null, CancellationToken cancellationToken = default) + /// or is null. + public static async Task> CheckKeyVaultNameAvailabilityAsync(this SubscriptionResource subscriptionResource, KeyVaultNameAvailabilityContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockableKeyVaultSubscriptionResource(subscriptionResource).GetManagedHsmsAsync(top, cancellationToken); + return await GetMockableKeyVaultSubscriptionResource(subscriptionResource).CheckKeyVaultNameAvailabilityAsync(content, cancellationToken).ConfigureAwait(false); } /// - /// The List operation gets information about the managed HSM Pools associated with the subscription. + /// Checks that the vault name is valid and is not already in use. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/managedHSMs + /// /subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/checkNameAvailability /// /// /// Operation Id - /// ManagedHsms_ListBySubscription + /// VaultsOperationGroup_CheckKeyVaultNameAvailability /// /// /// Default Api Version /// 2025-05-01 /// - /// - /// Resource - /// - /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. - /// Maximum number of results to return. + /// The name of the vault. /// The cancellation token to use. - /// is null. - /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetManagedHsms(this SubscriptionResource subscriptionResource, int? top = null, CancellationToken cancellationToken = default) + /// or is null. + public static Response CheckKeyVaultNameAvailability(this SubscriptionResource subscriptionResource, KeyVaultNameAvailabilityContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockableKeyVaultSubscriptionResource(subscriptionResource).GetManagedHsms(top, cancellationToken); + return GetMockableKeyVaultSubscriptionResource(subscriptionResource).CheckKeyVaultNameAvailability(content, cancellationToken); } /// @@ -835,7 +827,7 @@ public static Pageable GetManagedHsms(this SubscriptionResou /// /// /// Operation Id - /// ManagedHsms_ListDeleted + /// ManagedHsmsOperationGroup_ListDeleted /// /// /// Default Api Version @@ -867,7 +859,7 @@ public static AsyncPageable GetDeletedManagedHsmsAsyn /// /// /// Operation Id - /// ManagedHsms_ListDeleted + /// ManagedHsmsOperationGroup_ListDeleted /// /// /// Default Api Version @@ -899,16 +891,12 @@ public static Pageable GetDeletedManagedHsms(this Sub /// /// /// Operation Id - /// ManagedHsms_CheckManagedHsmNameAvailability + /// ManagedHsmsOperationGroup_CheckManagedHsmNameAvailability /// /// /// Default Api Version /// 2025-05-01 /// - /// - /// Resource - /// - /// /// /// /// Mocking @@ -916,7 +904,7 @@ public static Pageable GetDeletedManagedHsms(this Sub /// /// /// The instance the method will execute against. - /// The name of the managed hsm. + /// The request body. /// The cancellation token to use. /// or is null. public static async Task> CheckManagedHsmNameAvailabilityAsync(this SubscriptionResource subscriptionResource, ManagedHsmNameAvailabilityContent content, CancellationToken cancellationToken = default) @@ -935,16 +923,12 @@ public static async Task> CheckManage /// /// /// Operation Id - /// ManagedHsms_CheckManagedHsmNameAvailability + /// ManagedHsmsOperationGroup_CheckManagedHsmNameAvailability /// /// /// Default Api Version /// 2025-05-01 /// - /// - /// Resource - /// - /// /// /// /// Mocking @@ -952,7 +936,7 @@ public static async Task> CheckManage /// /// /// The instance the method will execute against. - /// The name of the managed hsm. + /// The request body. /// The cancellation token to use. /// or is null. public static Response CheckManagedHsmNameAvailability(this SubscriptionResource subscriptionResource, ManagedHsmNameAvailabilityContent content, CancellationToken cancellationToken = default) diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Extensions/MockableKeyVaultResourceGroupResource.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Extensions/MockableKeyVaultResourceGroupResource.cs index fc725405cff3..51363581e5c6 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Extensions/MockableKeyVaultResourceGroupResource.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Extensions/MockableKeyVaultResourceGroupResource.cs @@ -49,7 +49,7 @@ public virtual KeyVaultCollection GetKeyVaults() /// /// /// Operation Id - /// Vaults_Get + /// Vault_Get /// /// /// Default Api Version @@ -80,7 +80,7 @@ public virtual async Task> GetKeyVaultAsync(string va /// /// /// Operation Id - /// Vaults_Get + /// Vault_Get /// /// /// Default Api Version @@ -118,7 +118,7 @@ public virtual ManagedHsmCollection GetManagedHsms() /// /// /// Operation Id - /// ManagedHsms_Get + /// ManagedHsm_Get /// /// /// Default Api Version @@ -149,7 +149,7 @@ public virtual async Task> GetManagedHsmAsync(strin /// /// /// Operation Id - /// ManagedHsms_Get + /// ManagedHsm_Get /// /// /// Default Api Version diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Extensions/MockableKeyVaultSubscriptionResource.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Extensions/MockableKeyVaultSubscriptionResource.cs index b13848ea6138..0a4fd319a370 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Extensions/MockableKeyVaultSubscriptionResource.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Extensions/MockableKeyVaultSubscriptionResource.cs @@ -20,12 +20,12 @@ public partial class MockableKeyVaultSubscriptionResource : ArmResource { private ClientDiagnostics _keyVaultVaultsClientDiagnostics; private VaultsRestOperations _keyVaultVaultsRestClient; - private ClientDiagnostics _vaultsClientDiagnostics; - private VaultsRestOperations _vaultsRestClient; private ClientDiagnostics _managedHsmClientDiagnostics; private ManagedHsmsRestOperations _managedHsmRestClient; - private ClientDiagnostics _managedHsmsClientDiagnostics; - private ManagedHsmsRestOperations _managedHsmsRestClient; + private ClientDiagnostics _vaultsOperationGroupClientDiagnostics; + private VaultsOperationGroupRestOperations _vaultsOperationGroupRestClient; + private ClientDiagnostics _managedHsmsOperationGroupClientDiagnostics; + private ManagedHsmsOperationGroupRestOperations _managedHsmsOperationGroupRestClient; /// Initializes a new instance of the class for mocking. protected MockableKeyVaultSubscriptionResource() @@ -41,12 +41,12 @@ internal MockableKeyVaultSubscriptionResource(ArmClient client, ResourceIdentifi private ClientDiagnostics KeyVaultVaultsClientDiagnostics => _keyVaultVaultsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.KeyVault", KeyVaultResource.ResourceType.Namespace, Diagnostics); private VaultsRestOperations KeyVaultVaultsRestClient => _keyVaultVaultsRestClient ??= new VaultsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(KeyVaultResource.ResourceType)); - private ClientDiagnostics VaultsClientDiagnostics => _vaultsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.KeyVault", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private VaultsRestOperations VaultsRestClient => _vaultsRestClient ??= new VaultsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); private ClientDiagnostics ManagedHsmClientDiagnostics => _managedHsmClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.KeyVault", ManagedHsmResource.ResourceType.Namespace, Diagnostics); private ManagedHsmsRestOperations ManagedHsmRestClient => _managedHsmRestClient ??= new ManagedHsmsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(ManagedHsmResource.ResourceType)); - private ClientDiagnostics ManagedHsmsClientDiagnostics => _managedHsmsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.KeyVault", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private ManagedHsmsRestOperations ManagedHsmsRestClient => _managedHsmsRestClient ??= new ManagedHsmsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + private ClientDiagnostics VaultsOperationGroupClientDiagnostics => _vaultsOperationGroupClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.KeyVault", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private VaultsOperationGroupRestOperations VaultsOperationGroupRestClient => _vaultsOperationGroupRestClient ??= new VaultsOperationGroupRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + private ClientDiagnostics ManagedHsmsOperationGroupClientDiagnostics => _managedHsmsOperationGroupClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.KeyVault", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private ManagedHsmsOperationGroupRestOperations ManagedHsmsOperationGroupRestClient => _managedHsmsOperationGroupRestClient ??= new ManagedHsmsOperationGroupRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); private string GetApiVersionOrNull(ResourceType resourceType) { @@ -70,7 +70,7 @@ public virtual DeletedKeyVaultCollection GetDeletedKeyVaults() /// /// /// Operation Id - /// Vaults_GetDeleted + /// DeletedVault_GetDeleted /// /// /// Default Api Version @@ -82,7 +82,7 @@ public virtual DeletedKeyVaultCollection GetDeletedKeyVaults() /// /// /// - /// The location of the deleted vault. + /// The name of the Azure region. /// The name of the vault. /// The cancellation token to use. /// is null. @@ -102,7 +102,7 @@ public virtual async Task> GetDeletedKeyVaultA /// /// /// Operation Id - /// Vaults_GetDeleted + /// DeletedVault_GetDeleted /// /// /// Default Api Version @@ -114,7 +114,7 @@ public virtual async Task> GetDeletedKeyVaultA /// /// /// - /// The location of the deleted vault. + /// The name of the Azure region. /// The name of the vault. /// The cancellation token to use. /// is null. @@ -141,7 +141,7 @@ public virtual DeletedManagedHsmCollection GetDeletedManagedHsms() /// /// /// Operation Id - /// ManagedHsms_GetDeleted + /// DeletedManagedHsm_GetDeleted /// /// /// Default Api Version @@ -153,7 +153,7 @@ public virtual DeletedManagedHsmCollection GetDeletedManagedHsms() /// /// /// - /// The location of the deleted managed HSM. + /// The name of the Azure region. /// The name of the deleted managed HSM. /// The cancellation token to use. /// is null. @@ -173,7 +173,7 @@ public virtual async Task> GetDeletedManaged /// /// /// Operation Id - /// ManagedHsms_GetDeleted + /// DeletedManagedHsm_GetDeleted /// /// /// Default Api Version @@ -185,7 +185,7 @@ public virtual async Task> GetDeletedManaged /// /// /// - /// The location of the deleted managed HSM. + /// The name of the Azure region. /// The name of the deleted managed HSM. /// The cancellation token to use. /// is null. @@ -205,7 +205,7 @@ public virtual Response GetDeletedManagedHsm(AzureLoc /// /// /// Operation Id - /// Vaults_ListBySubscription + /// Vault_ListBySubscription /// /// /// Default Api Version @@ -236,7 +236,7 @@ public virtual AsyncPageable GetKeyVaultsAsync(int? top = null /// /// /// Operation Id - /// Vaults_ListBySubscription + /// Vault_ListBySubscription /// /// /// Default Api Version @@ -258,6 +258,68 @@ public virtual Pageable GetKeyVaults(int? top = null, Cancella return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new KeyVaultResource(Client, KeyVaultData.DeserializeKeyVaultData(e)), KeyVaultVaultsClientDiagnostics, Pipeline, "MockableKeyVaultSubscriptionResource.GetKeyVaults", "value", "nextLink", cancellationToken); } + /// + /// The List operation gets information about the managed HSM Pools associated with the subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/managedHSMs + /// + /// + /// Operation Id + /// ManagedHsm_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-05-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Maximum number of results to return. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetManagedHsmsAsync(int? top = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => ManagedHsmRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, top); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ManagedHsmRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, top); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ManagedHsmResource(Client, ManagedHsmData.DeserializeManagedHsmData(e)), ManagedHsmClientDiagnostics, Pipeline, "MockableKeyVaultSubscriptionResource.GetManagedHsms", "value", "nextLink", cancellationToken); + } + + /// + /// The List operation gets information about the managed HSM Pools associated with the subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/managedHSMs + /// + /// + /// Operation Id + /// ManagedHsm_ListBySubscription + /// + /// + /// Default Api Version + /// 2025-05-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Maximum number of results to return. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetManagedHsms(int? top = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => ManagedHsmRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, top); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ManagedHsmRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, top); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ManagedHsmResource(Client, ManagedHsmData.DeserializeManagedHsmData(e)), ManagedHsmClientDiagnostics, Pipeline, "MockableKeyVaultSubscriptionResource.GetManagedHsms", "value", "nextLink", cancellationToken); + } + /// /// Gets information about the deleted vaults in a subscription. /// @@ -267,7 +329,7 @@ public virtual Pageable GetKeyVaults(int? top = null, Cancella /// /// /// Operation Id - /// Vaults_ListDeleted + /// VaultsOperationGroup_ListDeleted /// /// /// Default Api Version @@ -279,9 +341,9 @@ public virtual Pageable GetKeyVaults(int? top = null, Cancella /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetDeletedKeyVaultsAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => VaultsRestClient.CreateListDeletedRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => VaultsRestClient.CreateListDeletedNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DeletedKeyVaultResource(Client, DeletedKeyVaultData.DeserializeDeletedKeyVaultData(e)), VaultsClientDiagnostics, Pipeline, "MockableKeyVaultSubscriptionResource.GetDeletedKeyVaults", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => VaultsOperationGroupRestClient.CreateListDeletedRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => VaultsOperationGroupRestClient.CreateListDeletedNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DeletedKeyVaultResource(Client, DeletedKeyVaultData.DeserializeDeletedKeyVaultData(e)), VaultsOperationGroupClientDiagnostics, Pipeline, "MockableKeyVaultSubscriptionResource.GetDeletedKeyVaults", "value", "nextLink", cancellationToken); } /// @@ -293,7 +355,7 @@ public virtual AsyncPageable GetDeletedKeyVaultsAsync(C /// /// /// Operation Id - /// Vaults_ListDeleted + /// VaultsOperationGroup_ListDeleted /// /// /// Default Api Version @@ -305,9 +367,9 @@ public virtual AsyncPageable GetDeletedKeyVaultsAsync(C /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetDeletedKeyVaults(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => VaultsRestClient.CreateListDeletedRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => VaultsRestClient.CreateListDeletedNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DeletedKeyVaultResource(Client, DeletedKeyVaultData.DeserializeDeletedKeyVaultData(e)), VaultsClientDiagnostics, Pipeline, "MockableKeyVaultSubscriptionResource.GetDeletedKeyVaults", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => VaultsOperationGroupRestClient.CreateListDeletedRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => VaultsOperationGroupRestClient.CreateListDeletedNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DeletedKeyVaultResource(Client, DeletedKeyVaultData.DeserializeDeletedKeyVaultData(e)), VaultsOperationGroupClientDiagnostics, Pipeline, "MockableKeyVaultSubscriptionResource.GetDeletedKeyVaults", "value", "nextLink", cancellationToken); } /// @@ -319,16 +381,12 @@ public virtual Pageable GetDeletedKeyVaults(Cancellatio /// /// /// Operation Id - /// Vaults_CheckNameAvailability + /// VaultsOperationGroup_CheckKeyVaultNameAvailability /// /// /// Default Api Version /// 2025-05-01 /// - /// - /// Resource - /// - /// /// /// /// The name of the vault. @@ -338,11 +396,11 @@ public virtual async Task> CheckKeyVaul { Argument.AssertNotNull(content, nameof(content)); - using var scope = KeyVaultVaultsClientDiagnostics.CreateScope("MockableKeyVaultSubscriptionResource.CheckKeyVaultNameAvailability"); + using var scope = VaultsOperationGroupClientDiagnostics.CreateScope("MockableKeyVaultSubscriptionResource.CheckKeyVaultNameAvailability"); scope.Start(); try { - var response = await KeyVaultVaultsRestClient.CheckNameAvailabilityAsync(Id.SubscriptionId, content, cancellationToken).ConfigureAwait(false); + var response = await VaultsOperationGroupRestClient.CheckKeyVaultNameAvailabilityAsync(Id.SubscriptionId, content, cancellationToken).ConfigureAwait(false); return response; } catch (Exception e) @@ -361,16 +419,12 @@ public virtual async Task> CheckKeyVaul /// /// /// Operation Id - /// Vaults_CheckNameAvailability + /// VaultsOperationGroup_CheckKeyVaultNameAvailability /// /// /// Default Api Version /// 2025-05-01 /// - /// - /// Resource - /// - /// /// /// /// The name of the vault. @@ -380,11 +434,11 @@ public virtual Response CheckKeyVaultNameAvailab { Argument.AssertNotNull(content, nameof(content)); - using var scope = KeyVaultVaultsClientDiagnostics.CreateScope("MockableKeyVaultSubscriptionResource.CheckKeyVaultNameAvailability"); + using var scope = VaultsOperationGroupClientDiagnostics.CreateScope("MockableKeyVaultSubscriptionResource.CheckKeyVaultNameAvailability"); scope.Start(); try { - var response = KeyVaultVaultsRestClient.CheckNameAvailability(Id.SubscriptionId, content, cancellationToken); + var response = VaultsOperationGroupRestClient.CheckKeyVaultNameAvailability(Id.SubscriptionId, content, cancellationToken); return response; } catch (Exception e) @@ -394,68 +448,6 @@ public virtual Response CheckKeyVaultNameAvailab } } - /// - /// The List operation gets information about the managed HSM Pools associated with the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/managedHSMs - /// - /// - /// Operation Id - /// ManagedHsms_ListBySubscription - /// - /// - /// Default Api Version - /// 2025-05-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// Maximum number of results to return. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetManagedHsmsAsync(int? top = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => ManagedHsmRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, top); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ManagedHsmRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, top); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ManagedHsmResource(Client, ManagedHsmData.DeserializeManagedHsmData(e)), ManagedHsmClientDiagnostics, Pipeline, "MockableKeyVaultSubscriptionResource.GetManagedHsms", "value", "nextLink", cancellationToken); - } - - /// - /// The List operation gets information about the managed HSM Pools associated with the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/managedHSMs - /// - /// - /// Operation Id - /// ManagedHsms_ListBySubscription - /// - /// - /// Default Api Version - /// 2025-05-01 - /// - /// - /// Resource - /// - /// - /// - /// - /// Maximum number of results to return. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetManagedHsms(int? top = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => ManagedHsmRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, top); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ManagedHsmRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, top); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ManagedHsmResource(Client, ManagedHsmData.DeserializeManagedHsmData(e)), ManagedHsmClientDiagnostics, Pipeline, "MockableKeyVaultSubscriptionResource.GetManagedHsms", "value", "nextLink", cancellationToken); - } - /// /// The List operation gets information about the deleted managed HSMs associated with the subscription. /// @@ -465,7 +457,7 @@ public virtual Pageable GetManagedHsms(int? top = null, Canc /// /// /// Operation Id - /// ManagedHsms_ListDeleted + /// ManagedHsmsOperationGroup_ListDeleted /// /// /// Default Api Version @@ -477,9 +469,9 @@ public virtual Pageable GetManagedHsms(int? top = null, Canc /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetDeletedManagedHsmsAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => ManagedHsmsRestClient.CreateListDeletedRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ManagedHsmsRestClient.CreateListDeletedNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DeletedManagedHsmResource(Client, DeletedManagedHsmData.DeserializeDeletedManagedHsmData(e)), ManagedHsmsClientDiagnostics, Pipeline, "MockableKeyVaultSubscriptionResource.GetDeletedManagedHsms", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => ManagedHsmsOperationGroupRestClient.CreateListDeletedRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ManagedHsmsOperationGroupRestClient.CreateListDeletedNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DeletedManagedHsmResource(Client, DeletedManagedHsmData.DeserializeDeletedManagedHsmData(e)), ManagedHsmsOperationGroupClientDiagnostics, Pipeline, "MockableKeyVaultSubscriptionResource.GetDeletedManagedHsms", "value", "nextLink", cancellationToken); } /// @@ -491,7 +483,7 @@ public virtual AsyncPageable GetDeletedManagedHsmsAsy /// /// /// Operation Id - /// ManagedHsms_ListDeleted + /// ManagedHsmsOperationGroup_ListDeleted /// /// /// Default Api Version @@ -503,9 +495,9 @@ public virtual AsyncPageable GetDeletedManagedHsmsAsy /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetDeletedManagedHsms(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => ManagedHsmsRestClient.CreateListDeletedRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ManagedHsmsRestClient.CreateListDeletedNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DeletedManagedHsmResource(Client, DeletedManagedHsmData.DeserializeDeletedManagedHsmData(e)), ManagedHsmsClientDiagnostics, Pipeline, "MockableKeyVaultSubscriptionResource.GetDeletedManagedHsms", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => ManagedHsmsOperationGroupRestClient.CreateListDeletedRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ManagedHsmsOperationGroupRestClient.CreateListDeletedNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DeletedManagedHsmResource(Client, DeletedManagedHsmData.DeserializeDeletedManagedHsmData(e)), ManagedHsmsOperationGroupClientDiagnostics, Pipeline, "MockableKeyVaultSubscriptionResource.GetDeletedManagedHsms", "value", "nextLink", cancellationToken); } /// @@ -517,30 +509,26 @@ public virtual Pageable GetDeletedManagedHsms(Cancell /// /// /// Operation Id - /// ManagedHsms_CheckManagedHsmNameAvailability + /// ManagedHsmsOperationGroup_CheckManagedHsmNameAvailability /// /// /// Default Api Version /// 2025-05-01 /// - /// - /// Resource - /// - /// /// /// - /// The name of the managed hsm. + /// The request body. /// The cancellation token to use. /// is null. public virtual async Task> CheckManagedHsmNameAvailabilityAsync(ManagedHsmNameAvailabilityContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNull(content, nameof(content)); - using var scope = ManagedHsmClientDiagnostics.CreateScope("MockableKeyVaultSubscriptionResource.CheckManagedHsmNameAvailability"); + using var scope = ManagedHsmsOperationGroupClientDiagnostics.CreateScope("MockableKeyVaultSubscriptionResource.CheckManagedHsmNameAvailability"); scope.Start(); try { - var response = await ManagedHsmRestClient.CheckManagedHsmNameAvailabilityAsync(Id.SubscriptionId, content, cancellationToken).ConfigureAwait(false); + var response = await ManagedHsmsOperationGroupRestClient.CheckManagedHsmNameAvailabilityAsync(Id.SubscriptionId, content, cancellationToken).ConfigureAwait(false); return response; } catch (Exception e) @@ -559,30 +547,26 @@ public virtual async Task> CheckManag /// /// /// Operation Id - /// ManagedHsms_CheckManagedHsmNameAvailability + /// ManagedHsmsOperationGroup_CheckManagedHsmNameAvailability /// /// /// Default Api Version /// 2025-05-01 /// - /// - /// Resource - /// - /// /// /// - /// The name of the managed hsm. + /// The request body. /// The cancellation token to use. /// is null. public virtual Response CheckManagedHsmNameAvailability(ManagedHsmNameAvailabilityContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNull(content, nameof(content)); - using var scope = ManagedHsmClientDiagnostics.CreateScope("MockableKeyVaultSubscriptionResource.CheckManagedHsmNameAvailability"); + using var scope = ManagedHsmsOperationGroupClientDiagnostics.CreateScope("MockableKeyVaultSubscriptionResource.CheckManagedHsmNameAvailability"); scope.Start(); try { - var response = ManagedHsmRestClient.CheckManagedHsmNameAvailability(Id.SubscriptionId, content, cancellationToken); + var response = ManagedHsmsOperationGroupRestClient.CheckManagedHsmNameAvailability(Id.SubscriptionId, content, cancellationToken); return response; } catch (Exception e) diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultCollection.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultCollection.cs index 7685b3b601fb..54422386bacd 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultCollection.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultCollection.cs @@ -62,7 +62,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Operation Id - /// Vaults_CreateOrUpdate + /// Vault_CreateOrUpdate /// /// /// Default Api Version @@ -75,7 +75,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Name of the vault. + /// The name of the vault. /// Parameters to create or update the vault. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. @@ -111,7 +111,7 @@ public virtual async Task> CreateOrUpdateAsync(Wa /// /// /// Operation Id - /// Vaults_CreateOrUpdate + /// Vault_CreateOrUpdate /// /// /// Default Api Version @@ -124,7 +124,7 @@ public virtual async Task> CreateOrUpdateAsync(Wa /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Name of the vault. + /// The name of the vault. /// Parameters to create or update the vault. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. @@ -160,7 +160,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil /// /// /// Operation Id - /// Vaults_Get + /// Vault_Get /// /// /// Default Api Version @@ -205,7 +205,7 @@ public virtual async Task> GetAsync(string vaultName, /// /// /// Operation Id - /// Vaults_Get + /// Vault_Get /// /// /// Default Api Version @@ -250,7 +250,7 @@ public virtual Response Get(string vaultName, CancellationToke /// /// /// Operation Id - /// Vaults_ListByResourceGroup + /// Vault_ListByResourceGroup /// /// /// Default Api Version @@ -281,7 +281,7 @@ public virtual AsyncPageable GetAllAsync(int? top = null, Canc /// /// /// Operation Id - /// Vaults_ListByResourceGroup + /// Vault_ListByResourceGroup /// /// /// Default Api Version @@ -312,7 +312,7 @@ public virtual Pageable GetAll(int? top = null, CancellationTo /// /// /// Operation Id - /// Vaults_Get + /// Vault_Get /// /// /// Default Api Version @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string vaultName, Cancella /// /// /// Operation Id - /// Vaults_Get + /// Vault_Get /// /// /// Default Api Version @@ -398,7 +398,7 @@ public virtual Response Exists(string vaultName, CancellationToken cancell /// /// /// Operation Id - /// Vaults_Get + /// Vault_Get /// /// /// Default Api Version @@ -443,7 +443,7 @@ public virtual async Task> GetIfExistsAsync(s /// /// /// Operation Id - /// Vaults_Get + /// Vault_Get /// /// /// Default Api Version diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultData.Serialization.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultData.Serialization.cs index 1c5f419ccc5d..182c56552c7a 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultData.Serialization.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultData.Serialization.cs @@ -41,6 +41,22 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri base.JsonModelWriteCore(writer, options); writer.WritePropertyName("properties"u8); writer.WriteObjectValue(Properties, options); + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(Location)) + { + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location.Value); + } } KeyVaultData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -64,8 +80,8 @@ internal static KeyVaultData DeserializeKeyVaultData(JsonElement element, ModelR return null; } Models.KeyVaultProperties properties = default; - IDictionary tags = default; - AzureLocation location = default; + IReadOnlyDictionary tags = default; + AzureLocation? location = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; @@ -95,6 +111,10 @@ internal static KeyVaultData DeserializeKeyVaultData(JsonElement element, ModelR } if (property.NameEquals("location"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } location = new AzureLocation(property.Value.GetString()); continue; } @@ -133,9 +153,9 @@ internal static KeyVaultData DeserializeKeyVaultData(JsonElement element, ModelR name, type, systemData, + properties, tags ?? new ChangeTrackingDictionary(), location, - properties, serializedAdditionalRawData); } @@ -181,8 +201,11 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } else { - builder.Append(" location: "); - builder.AppendLine($"'{Location.ToString()}'"); + if (Optional.IsDefined(Location)) + { + builder.Append(" location: "); + builder.AppendLine($"'{Location.Value.ToString()}'"); + } } hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Tags), out propertyOverride); diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultData.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultData.cs index cdb24d19be23..d0e55d453bc9 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultData.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultData.cs @@ -17,7 +17,7 @@ namespace Azure.ResourceManager.KeyVault /// A class representing the KeyVault data model. /// Resource information with extended details. /// - public partial class KeyVaultData : TrackedResourceData + public partial class KeyVaultData : ResourceData { /// /// Keeps track of any properties unknown to the library. @@ -52,14 +52,14 @@ public partial class KeyVaultData : TrackedResourceData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The location. /// Properties of the vault. /// is null. - public KeyVaultData(AzureLocation location, Models.KeyVaultProperties properties) : base(location) + internal KeyVaultData(Models.KeyVaultProperties properties) { Argument.AssertNotNull(properties, nameof(properties)); Properties = properties; + Tags = new ChangeTrackingDictionary(); } /// Initializes a new instance of . @@ -67,13 +67,15 @@ public KeyVaultData(AzureLocation location, Models.KeyVaultProperties properties /// The name. /// The resourceType. /// The systemData. - /// The tags. - /// The location. /// Properties of the vault. + /// Resource tags. + /// The geo-location where the resource lives. /// Keeps track of any properties unknown to the library. - internal KeyVaultData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, Models.KeyVaultProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal KeyVaultData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, Models.KeyVaultProperties properties, IReadOnlyDictionary tags, AzureLocation? location, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { Properties = properties; + Tags = tags; + Location = location; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -84,6 +86,12 @@ internal KeyVaultData() /// Properties of the vault. [WirePath("properties")] - public Models.KeyVaultProperties Properties { get; set; } + public Models.KeyVaultProperties Properties { get; } + /// Resource tags. + [WirePath("tags")] + public IReadOnlyDictionary Tags { get; } + /// The geo-location where the resource lives. + [WirePath("location")] + public AzureLocation? Location { get; } } } diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultPrivateEndpointConnectionCollection.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultPrivateEndpointConnectionCollection.cs index 4842a47425cc..dbe2683baf09 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultPrivateEndpointConnectionCollection.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultPrivateEndpointConnectionCollection.cs @@ -60,7 +60,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Operation Id - /// PrivateEndpointConnections_Put + /// PrivateEndpointConnection_Put /// /// /// Default Api Version @@ -111,7 +111,7 @@ public virtual async Task /// /// Operation Id - /// PrivateEndpointConnections_Put + /// PrivateEndpointConnection_Put /// /// /// Default Api Version @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrU /// /// /// Operation Id - /// PrivateEndpointConnections_Get + /// PrivateEndpointConnection_Get /// /// /// Default Api Version @@ -207,7 +207,7 @@ public virtual async Task> G /// /// /// Operation Id - /// PrivateEndpointConnections_Get + /// PrivateEndpointConnection_Get /// /// /// Default Api Version @@ -252,7 +252,7 @@ public virtual Response Get(string pr /// /// /// Operation Id - /// PrivateEndpointConnections_ListByResource + /// PrivateEndpointConnection_ListByResource /// /// /// Default Api Version @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAs /// /// /// Operation Id - /// PrivateEndpointConnections_ListByResource + /// PrivateEndpointConnection_ListByResource /// /// /// Default Api Version @@ -312,7 +312,7 @@ public virtual Pageable GetAll(Cancel /// /// /// Operation Id - /// PrivateEndpointConnections_Get + /// PrivateEndpointConnection_Get /// /// /// Default Api Version @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string privateEndpointConn /// /// /// Operation Id - /// PrivateEndpointConnections_Get + /// PrivateEndpointConnection_Get /// /// /// Default Api Version @@ -398,7 +398,7 @@ public virtual Response Exists(string privateEndpointConnectionName, Cance /// /// /// Operation Id - /// PrivateEndpointConnections_Get + /// PrivateEndpointConnection_Get /// /// /// Default Api Version @@ -443,7 +443,7 @@ public virtual async Task /// /// Operation Id - /// PrivateEndpointConnections_Get + /// PrivateEndpointConnection_Get /// /// /// Default Api Version diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultPrivateEndpointConnectionData.Serialization.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultPrivateEndpointConnectionData.Serialization.cs index 6e5f9e51bfd2..2a63ac50bfdd 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultPrivateEndpointConnectionData.Serialization.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultPrivateEndpointConnectionData.Serialization.cs @@ -40,11 +40,6 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); - if (Optional.IsDefined(ETag)) - { - writer.WritePropertyName("etag"u8); - writer.WriteStringValue(ETag.Value.ToString()); - } if (options.Format != "W" && Optional.IsDefined(Location)) { writer.WritePropertyName("location"u8); @@ -61,6 +56,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } writer.WriteEndObject(); } + if (Optional.IsDefined(ETag)) + { + writer.WritePropertyName("etag"u8); + writer.WriteStringValue(ETag.Value.ToString()); + } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(PrivateEndpoint)) @@ -101,9 +101,9 @@ internal static KeyVaultPrivateEndpointConnectionData DeserializeKeyVaultPrivate { return null; } - ETag? etag = default; AzureLocation? location = default; IReadOnlyDictionary tags = default; + ETag? etag = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; @@ -115,15 +115,6 @@ internal static KeyVaultPrivateEndpointConnectionData DeserializeKeyVaultPrivate Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("etag"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - etag = new ETag(property.Value.GetString()); - continue; - } if (property.NameEquals("location"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -147,6 +138,15 @@ internal static KeyVaultPrivateEndpointConnectionData DeserializeKeyVaultPrivate tags = dictionary; continue; } + if (property.NameEquals("etag"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + etag = new ETag(property.Value.GetString()); + continue; + } if (property.NameEquals("id"u8)) { id = new ResourceIdentifier(property.Value.GetString()); @@ -221,12 +221,12 @@ internal static KeyVaultPrivateEndpointConnectionData DeserializeKeyVaultPrivate name, type, systemData, - etag, privateEndpoint, privateLinkServiceConnectionState, provisioningState, location, tags ?? new ChangeTrackingDictionary(), + etag, serializedAdditionalRawData); } diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultPrivateEndpointConnectionData.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultPrivateEndpointConnectionData.cs index e8e2de635d24..25b40b2dcbda 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultPrivateEndpointConnectionData.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultPrivateEndpointConnectionData.cs @@ -63,27 +63,24 @@ public KeyVaultPrivateEndpointConnectionData() /// The name. /// The resourceType. /// The systemData. - /// 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. /// Azure location of the key vault resource. /// Tags assigned to the key vault resource. + /// Modified whenever there is a change in the state of private endpoint connection. /// Keeps track of any properties unknown to the library. - internal KeyVaultPrivateEndpointConnectionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ETag? etag, SubResource privateEndpoint, KeyVaultPrivateLinkServiceConnectionState connectionState, KeyVaultPrivateEndpointConnectionProvisioningState? provisioningState, AzureLocation? location, IReadOnlyDictionary tags, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal KeyVaultPrivateEndpointConnectionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, SubResource privateEndpoint, KeyVaultPrivateLinkServiceConnectionState connectionState, KeyVaultPrivateEndpointConnectionProvisioningState? provisioningState, AzureLocation? location, IReadOnlyDictionary tags, ETag? etag, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { - ETag = etag; PrivateEndpoint = privateEndpoint; ConnectionState = connectionState; ProvisioningState = provisioningState; Location = location; Tags = tags; + ETag = etag; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Modified whenever there is a change in the state of private endpoint connection. - [WirePath("etag")] - public ETag? ETag { get; set; } /// Properties of the private endpoint object. internal SubResource PrivateEndpoint { get; set; } /// Gets Id. @@ -105,5 +102,8 @@ public ResourceIdentifier PrivateEndpointId /// Tags assigned to the key vault resource. [WirePath("tags")] public IReadOnlyDictionary Tags { get; } + /// Modified whenever there is a change in the state of private endpoint connection. + [WirePath("etag")] + public ETag? ETag { get; set; } } } diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultPrivateEndpointConnectionResource.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultPrivateEndpointConnectionResource.cs index 0943851e07af..aefea3e6aaee 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultPrivateEndpointConnectionResource.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultPrivateEndpointConnectionResource.cs @@ -97,7 +97,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Operation Id - /// PrivateEndpointConnections_Get + /// PrivateEndpointConnection_Get /// /// /// Default Api Version @@ -137,7 +137,7 @@ public virtual async Task> G /// /// /// Operation Id - /// PrivateEndpointConnections_Get + /// PrivateEndpointConnection_Get /// /// /// Default Api Version @@ -177,7 +177,7 @@ public virtual Response Get(Cancellat /// /// /// Operation Id - /// PrivateEndpointConnections_Delete + /// PrivateEndpointConnection_Delete /// /// /// Default Api Version @@ -219,7 +219,7 @@ public virtual async Task /// /// Operation Id - /// PrivateEndpointConnections_Delete + /// PrivateEndpointConnection_Delete /// /// /// Default Api Version @@ -261,7 +261,7 @@ public virtual ArmOperation Delete(Wa /// /// /// Operation Id - /// PrivateEndpointConnections_Put + /// PrivateEndpointConnection_Put /// /// /// Default Api Version @@ -309,7 +309,7 @@ public virtual async Task /// /// Operation Id - /// PrivateEndpointConnections_Put + /// PrivateEndpointConnection_Put /// /// /// Default Api Version diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultResource.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultResource.cs index da0a74b99c37..7484fe86a7ef 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultResource.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultResource.cs @@ -38,8 +38,6 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, private readonly ClientDiagnostics _keyVaultVaultsClientDiagnostics; private readonly VaultsRestOperations _keyVaultVaultsRestClient; - private readonly ClientDiagnostics _privateLinkResourcesClientDiagnostics; - private readonly PrivateLinkResourcesRestOperations _privateLinkResourcesRestClient; private readonly KeyVaultData _data; /// Gets the resource type for the operations. @@ -67,8 +65,6 @@ internal KeyVaultResource(ArmClient client, ResourceIdentifier id) : base(client _keyVaultVaultsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.KeyVault", ResourceType.Namespace, Diagnostics); TryGetApiVersion(ResourceType, out string keyVaultVaultsApiVersion); _keyVaultVaultsRestClient = new VaultsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, keyVaultVaultsApiVersion); - _privateLinkResourcesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.KeyVault", ProviderConstants.DefaultProviderNamespace, Diagnostics); - _privateLinkResourcesRestClient = new PrivateLinkResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); #if DEBUG ValidateResourceId(Id); #endif @@ -111,7 +107,7 @@ public virtual KeyVaultPrivateEndpointConnectionCollection GetKeyVaultPrivateEnd /// /// /// Operation Id - /// PrivateEndpointConnections_Get + /// PrivateEndpointConnection_Get /// /// /// Default Api Version @@ -142,7 +138,7 @@ public virtual async Task> G /// /// /// Operation Id - /// PrivateEndpointConnections_Get + /// PrivateEndpointConnection_Get /// /// /// Default Api Version @@ -180,7 +176,7 @@ public virtual KeyVaultSecretCollection GetKeyVaultSecrets() /// /// /// Operation Id - /// Secrets_Get + /// Secret_Get /// /// /// Default Api Version @@ -211,7 +207,7 @@ public virtual async Task> GetKeyVaultSecretAsy /// /// /// Operation Id - /// Secrets_Get + /// Secret_Get /// /// /// Default Api Version @@ -242,7 +238,7 @@ public virtual Response GetKeyVaultSecret(string secretN /// /// /// Operation Id - /// Vaults_Get + /// Vault_Get /// /// /// Default Api Version @@ -282,7 +278,7 @@ public virtual async Task> GetAsync(CancellationToken /// /// /// Operation Id - /// Vaults_Get + /// Vault_Get /// /// /// Default Api Version @@ -322,7 +318,7 @@ public virtual Response Get(CancellationToken cancellationToke /// /// /// Operation Id - /// Vaults_Delete + /// Vault_Delete /// /// /// Default Api Version @@ -366,7 +362,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Operation Id - /// Vaults_Delete + /// Vault_Delete /// /// /// Default Api Version @@ -410,7 +406,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Operation Id - /// Vaults_Update + /// Vault_Update /// /// /// Default Api Version @@ -452,7 +448,7 @@ public virtual async Task> UpdateAsync(KeyVaultPatch /// /// /// Operation Id - /// Vaults_Update + /// Vault_Update /// /// /// Default Api Version @@ -500,6 +496,10 @@ public virtual Response Update(KeyVaultPatch patch, Cancellati /// Default Api Version /// 2025-05-01 /// + /// + /// Resource + /// + /// /// /// /// Name of the operation. @@ -539,6 +539,10 @@ public virtual async Task> UpdateAccess /// Default Api Version /// 2025-05-01 /// + /// + /// Resource + /// + /// /// /// /// Name of the operation. @@ -572,20 +576,24 @@ public virtual Response UpdateAccessPolicy(Acces /// /// /// Operation Id - /// PrivateLinkResources_ListByVault + /// Vaults_GetPrivateLinkResources /// /// /// Default Api Version /// 2025-05-01 /// + /// + /// Resource + /// + /// /// /// /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetPrivateLinkResourcesAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _privateLinkResourcesRestClient.CreateListByVaultRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => KeyVaultPrivateLinkResourceData.DeserializeKeyVaultPrivateLinkResourceData(e), _privateLinkResourcesClientDiagnostics, Pipeline, "KeyVaultResource.GetPrivateLinkResources", "value", null, cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _keyVaultVaultsRestClient.CreateGetPrivateLinkResourcesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => KeyVaultPrivateLinkResourceData.DeserializeKeyVaultPrivateLinkResourceData(e), _keyVaultVaultsClientDiagnostics, Pipeline, "KeyVaultResource.GetPrivateLinkResources", "value", null, cancellationToken); } /// @@ -597,20 +605,24 @@ public virtual AsyncPageable GetPrivateLinkReso /// /// /// Operation Id - /// PrivateLinkResources_ListByVault + /// Vaults_GetPrivateLinkResources /// /// /// Default Api Version /// 2025-05-01 /// + /// + /// Resource + /// + /// /// /// /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetPrivateLinkResources(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _privateLinkResourcesRestClient.CreateListByVaultRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => KeyVaultPrivateLinkResourceData.DeserializeKeyVaultPrivateLinkResourceData(e), _privateLinkResourcesClientDiagnostics, Pipeline, "KeyVaultResource.GetPrivateLinkResources", "value", null, cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _keyVaultVaultsRestClient.CreateGetPrivateLinkResourcesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => KeyVaultPrivateLinkResourceData.DeserializeKeyVaultPrivateLinkResourceData(e), _keyVaultVaultsClientDiagnostics, Pipeline, "KeyVaultResource.GetPrivateLinkResources", "value", null, cancellationToken); } /// @@ -622,7 +634,7 @@ public virtual Pageable GetPrivateLinkResources /// /// /// Operation Id - /// Vaults_Get + /// Vault_Get /// /// /// Default Api Version @@ -684,7 +696,7 @@ public virtual async Task> AddTagAsync(string key, st /// /// /// Operation Id - /// Vaults_Get + /// Vault_Get /// /// /// Default Api Version @@ -746,7 +758,7 @@ public virtual Response AddTag(string key, string value, Cance /// /// /// Operation Id - /// Vaults_Get + /// Vault_Get /// /// /// Default Api Version @@ -803,7 +815,7 @@ public virtual async Task> SetTagsAsync(IDictionary /// /// Operation Id - /// Vaults_Get + /// Vault_Get /// /// /// Default Api Version @@ -860,7 +872,7 @@ public virtual Response SetTags(IDictionary ta /// /// /// Operation Id - /// Vaults_Get + /// Vault_Get /// /// /// Default Api Version @@ -920,7 +932,7 @@ public virtual async Task> RemoveTagAsync(string key, /// /// /// Operation Id - /// Vaults_Get + /// Vault_Get /// /// /// Default Api Version diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultSecretCollection.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultSecretCollection.cs index 6a2a1d5a3825..8d170f8ec06e 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultSecretCollection.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultSecretCollection.cs @@ -61,7 +61,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Operation Id - /// Secrets_CreateOrUpdate + /// Secret_CreateOrUpdate /// /// /// Default Api Version @@ -74,7 +74,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Name of the secret. The value you provide may be copied globally for the purpose of running the service. The value provided should not include personally identifiable or sensitive information. + /// The name of the secret. /// Parameters to create or update the secret. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. @@ -112,7 +112,7 @@ public virtual async Task> CreateOrUpdateAs /// /// /// Operation Id - /// Secrets_CreateOrUpdate + /// Secret_CreateOrUpdate /// /// /// Default Api Version @@ -125,7 +125,7 @@ public virtual async Task> CreateOrUpdateAs /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Name of the secret. The value you provide may be copied globally for the purpose of running the service. The value provided should not include personally identifiable or sensitive information. + /// The name of the secret. /// Parameters to create or update the secret. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wai /// /// /// Operation Id - /// Secrets_Get + /// Secret_Get /// /// /// Default Api Version @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string secr /// /// /// Operation Id - /// Secrets_Get + /// Secret_Get /// /// /// Default Api Version @@ -253,7 +253,7 @@ public virtual Response Get(string secretName, Cancellat /// /// /// Operation Id - /// Secrets_List + /// Secret_List /// /// /// Default Api Version @@ -284,7 +284,7 @@ public virtual AsyncPageable GetAllAsync(int? top = null /// /// /// Operation Id - /// Secrets_List + /// Secret_List /// /// /// Default Api Version @@ -315,7 +315,7 @@ public virtual Pageable GetAll(int? top = null, Cancella /// /// /// Operation Id - /// Secrets_Get + /// Secret_Get /// /// /// Default Api Version @@ -358,7 +358,7 @@ public virtual async Task> ExistsAsync(string secretName, Cancell /// /// /// Operation Id - /// Secrets_Get + /// Secret_Get /// /// /// Default Api Version @@ -401,7 +401,7 @@ public virtual Response Exists(string secretName, CancellationToken cancel /// /// /// Operation Id - /// Secrets_Get + /// Secret_Get /// /// /// Default Api Version @@ -446,7 +446,7 @@ public virtual async Task> GetIfExistsA /// /// /// Operation Id - /// Secrets_Get + /// Secret_Get /// /// /// Default Api Version diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultSecretData.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultSecretData.cs index c28b1fcc8921..d7b25eacfbc5 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultSecretData.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultSecretData.cs @@ -54,7 +54,7 @@ public partial class KeyVaultSecretData : ResourceData /// Initializes a new instance of . /// Properties of the secret. /// is null. - public KeyVaultSecretData(SecretProperties properties) + internal KeyVaultSecretData(SecretProperties properties) { Argument.AssertNotNull(properties, nameof(properties)); @@ -86,7 +86,7 @@ internal KeyVaultSecretData() /// Properties of the secret. [WirePath("properties")] - public SecretProperties Properties { get; set; } + public SecretProperties Properties { get; } /// Azure location of the key vault resource. [WirePath("location")] public AzureLocation? Location { get; } diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultSecretResource.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultSecretResource.cs index 8a10c378c6e7..63980185b538 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultSecretResource.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/KeyVaultSecretResource.cs @@ -98,7 +98,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Operation Id - /// Secrets_Get + /// Secret_Get /// /// /// Default Api Version @@ -138,7 +138,7 @@ public virtual async Task> GetAsync(Cancellatio /// /// /// Operation Id - /// Secrets_Get + /// Secret_Get /// /// /// Default Api Version @@ -178,7 +178,7 @@ public virtual Response Get(CancellationToken cancellati /// /// /// Operation Id - /// Secrets_Update + /// Secret_Update /// /// /// Default Api Version @@ -220,7 +220,7 @@ public virtual async Task> UpdateAsync(KeyVault /// /// /// Operation Id - /// Secrets_Update + /// Secret_Update /// /// /// Default Api Version diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/ManagedHsmCollection.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/ManagedHsmCollection.cs index eec89928c614..16012e8de438 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/ManagedHsmCollection.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/ManagedHsmCollection.cs @@ -61,7 +61,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Operation Id - /// ManagedHsms_CreateOrUpdate + /// ManagedHsm_CreateOrUpdate /// /// /// Default Api Version @@ -74,7 +74,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Name of the managed HSM Pool. + /// The name of the managed HSM Pool. /// Parameters to create or update the managed HSM Pool. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. @@ -110,7 +110,7 @@ public virtual async Task> CreateOrUpdateAsync( /// /// /// Operation Id - /// ManagedHsms_CreateOrUpdate + /// ManagedHsm_CreateOrUpdate /// /// /// Default Api Version @@ -123,7 +123,7 @@ public virtual async Task> CreateOrUpdateAsync( /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Name of the managed HSM Pool. + /// The name of the managed HSM Pool. /// Parameters to create or update the managed HSM Pool. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. @@ -159,7 +159,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitUnt /// /// /// Operation Id - /// ManagedHsms_Get + /// ManagedHsm_Get /// /// /// Default Api Version @@ -204,7 +204,7 @@ public virtual async Task> GetAsync(string name, Ca /// /// /// Operation Id - /// ManagedHsms_Get + /// ManagedHsm_Get /// /// /// Default Api Version @@ -249,7 +249,7 @@ public virtual Response Get(string name, CancellationToken c /// /// /// Operation Id - /// ManagedHsms_ListByResourceGroup + /// ManagedHsm_ListByResourceGroup /// /// /// Default Api Version @@ -280,7 +280,7 @@ public virtual AsyncPageable GetAllAsync(int? top = null, Ca /// /// /// Operation Id - /// ManagedHsms_ListByResourceGroup + /// ManagedHsm_ListByResourceGroup /// /// /// Default Api Version @@ -311,7 +311,7 @@ public virtual Pageable GetAll(int? top = null, Cancellation /// /// /// Operation Id - /// ManagedHsms_Get + /// ManagedHsm_Get /// /// /// Default Api Version @@ -354,7 +354,7 @@ public virtual async Task> ExistsAsync(string name, CancellationT /// /// /// Operation Id - /// ManagedHsms_Get + /// ManagedHsm_Get /// /// /// Default Api Version @@ -397,7 +397,7 @@ public virtual Response Exists(string name, CancellationToken cancellation /// /// /// Operation Id - /// ManagedHsms_Get + /// ManagedHsm_Get /// /// /// Default Api Version @@ -442,7 +442,7 @@ public virtual async Task> GetIfExistsAsync /// /// /// Operation Id - /// ManagedHsms_Get + /// ManagedHsm_Get /// /// /// Default Api Version diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/ManagedHsmData.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/ManagedHsmData.cs index f1a5cd0fe4d8..9ae105f1588a 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/ManagedHsmData.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/ManagedHsmData.cs @@ -66,7 +66,7 @@ public ManagedHsmData(AzureLocation location) : base(location) /// The location. /// Properties of the managed HSM. /// SKU details. - /// Managed service identity (system assigned and/or user assigned identities). + /// Managed service identity. /// Keeps track of any properties unknown to the library. internal ManagedHsmData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ManagedHsmProperties properties, ManagedHsmSku sku, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { @@ -87,7 +87,7 @@ internal ManagedHsmData() /// SKU details. [WirePath("sku")] public ManagedHsmSku Sku { get; set; } - /// Managed service identity (system assigned and/or user assigned identities). + /// Managed service identity. [WirePath("identity")] public ManagedServiceIdentity Identity { get; set; } } diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/ManagedHsmPrivateEndpointConnectionCollection.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/ManagedHsmPrivateEndpointConnectionCollection.cs index 18033464e994..e615d81b172e 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/ManagedHsmPrivateEndpointConnectionCollection.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/ManagedHsmPrivateEndpointConnectionCollection.cs @@ -24,8 +24,8 @@ namespace Azure.ResourceManager.KeyVault /// public partial class ManagedHsmPrivateEndpointConnectionCollection : ArmCollection, IEnumerable, IAsyncEnumerable { - private readonly ClientDiagnostics _managedHsmPrivateEndpointConnectionMHSMPrivateEndpointConnectionsClientDiagnostics; - private readonly MhsmPrivateEndpointConnectionsRestOperations _managedHsmPrivateEndpointConnectionMHSMPrivateEndpointConnectionsRestClient; + private readonly ClientDiagnostics _managedHsmPrivateEndpointConnectionMhsmPrivateEndpointConnectionsClientDiagnostics; + private readonly MhsmPrivateEndpointConnectionsRestOperations _managedHsmPrivateEndpointConnectionMhsmPrivateEndpointConnectionsRestClient; /// Initializes a new instance of the class for mocking. protected ManagedHsmPrivateEndpointConnectionCollection() @@ -37,9 +37,9 @@ protected ManagedHsmPrivateEndpointConnectionCollection() /// The identifier of the parent resource that is the target of operations. internal ManagedHsmPrivateEndpointConnectionCollection(ArmClient client, ResourceIdentifier id) : base(client, id) { - _managedHsmPrivateEndpointConnectionMHSMPrivateEndpointConnectionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.KeyVault", ManagedHsmPrivateEndpointConnectionResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ManagedHsmPrivateEndpointConnectionResource.ResourceType, out string managedHsmPrivateEndpointConnectionMHSMPrivateEndpointConnectionsApiVersion); - _managedHsmPrivateEndpointConnectionMHSMPrivateEndpointConnectionsRestClient = new MhsmPrivateEndpointConnectionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, managedHsmPrivateEndpointConnectionMHSMPrivateEndpointConnectionsApiVersion); + _managedHsmPrivateEndpointConnectionMhsmPrivateEndpointConnectionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.KeyVault", ManagedHsmPrivateEndpointConnectionResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ManagedHsmPrivateEndpointConnectionResource.ResourceType, out string managedHsmPrivateEndpointConnectionMhsmPrivateEndpointConnectionsApiVersion); + _managedHsmPrivateEndpointConnectionMhsmPrivateEndpointConnectionsRestClient = new MhsmPrivateEndpointConnectionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, managedHsmPrivateEndpointConnectionMhsmPrivateEndpointConnectionsApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -60,7 +60,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Operation Id - /// MHSMPrivateEndpointConnections_Put + /// MhsmPrivateEndpointConnection_Put /// /// /// Default Api Version @@ -83,12 +83,12 @@ public virtual async Task(Response.FromValue(new ManagedHsmPrivateEndpointConnectionResource(Client, response), response.GetRawResponse()), rehydrationToken); if (waitUntil == WaitUntil.Completed) @@ -111,7 +111,7 @@ public virtual async Task /// /// Operation Id - /// MHSMPrivateEndpointConnections_Put + /// MhsmPrivateEndpointConnection_Put /// /// /// Default Api Version @@ -134,12 +134,12 @@ public virtual ArmOperation CreateO Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); Argument.AssertNotNull(data, nameof(data)); - using var scope = _managedHsmPrivateEndpointConnectionMHSMPrivateEndpointConnectionsClientDiagnostics.CreateScope("ManagedHsmPrivateEndpointConnectionCollection.CreateOrUpdate"); + using var scope = _managedHsmPrivateEndpointConnectionMhsmPrivateEndpointConnectionsClientDiagnostics.CreateScope("ManagedHsmPrivateEndpointConnectionCollection.CreateOrUpdate"); scope.Start(); try { - var response = _managedHsmPrivateEndpointConnectionMHSMPrivateEndpointConnectionsRestClient.Put(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, data, cancellationToken); - var uri = _managedHsmPrivateEndpointConnectionMHSMPrivateEndpointConnectionsRestClient.CreatePutRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, data); + var response = _managedHsmPrivateEndpointConnectionMhsmPrivateEndpointConnectionsRestClient.Put(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, data, cancellationToken); + var uri = _managedHsmPrivateEndpointConnectionMhsmPrivateEndpointConnectionsRestClient.CreatePutRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, data); var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); var operation = new KeyVaultArmOperation(Response.FromValue(new ManagedHsmPrivateEndpointConnectionResource(Client, response), response.GetRawResponse()), rehydrationToken); if (waitUntil == WaitUntil.Completed) @@ -162,7 +162,7 @@ public virtual ArmOperation CreateO /// /// /// Operation Id - /// MHSMPrivateEndpointConnections_Get + /// MhsmPrivateEndpointConnection_Get /// /// /// Default Api Version @@ -182,11 +182,11 @@ public virtual async Task> { Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); - using var scope = _managedHsmPrivateEndpointConnectionMHSMPrivateEndpointConnectionsClientDiagnostics.CreateScope("ManagedHsmPrivateEndpointConnectionCollection.Get"); + using var scope = _managedHsmPrivateEndpointConnectionMhsmPrivateEndpointConnectionsClientDiagnostics.CreateScope("ManagedHsmPrivateEndpointConnectionCollection.Get"); scope.Start(); try { - var response = await _managedHsmPrivateEndpointConnectionMHSMPrivateEndpointConnectionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken).ConfigureAwait(false); + var response = await _managedHsmPrivateEndpointConnectionMhsmPrivateEndpointConnectionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ManagedHsmPrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); @@ -207,7 +207,7 @@ public virtual async Task> /// /// /// Operation Id - /// MHSMPrivateEndpointConnections_Get + /// MhsmPrivateEndpointConnection_Get /// /// /// Default Api Version @@ -227,11 +227,11 @@ public virtual Response Get(string { Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); - using var scope = _managedHsmPrivateEndpointConnectionMHSMPrivateEndpointConnectionsClientDiagnostics.CreateScope("ManagedHsmPrivateEndpointConnectionCollection.Get"); + using var scope = _managedHsmPrivateEndpointConnectionMhsmPrivateEndpointConnectionsClientDiagnostics.CreateScope("ManagedHsmPrivateEndpointConnectionCollection.Get"); scope.Start(); try { - var response = _managedHsmPrivateEndpointConnectionMHSMPrivateEndpointConnectionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken); + var response = _managedHsmPrivateEndpointConnectionMhsmPrivateEndpointConnectionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ManagedHsmPrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); @@ -252,7 +252,7 @@ public virtual Response Get(string /// /// /// Operation Id - /// MHSMPrivateEndpointConnections_ListByResource + /// MhsmPrivateEndpointConnection_ListByResource /// /// /// Default Api Version @@ -268,9 +268,9 @@ public virtual Response Get(string /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _managedHsmPrivateEndpointConnectionMHSMPrivateEndpointConnectionsRestClient.CreateListByResourceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _managedHsmPrivateEndpointConnectionMHSMPrivateEndpointConnectionsRestClient.CreateListByResourceNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ManagedHsmPrivateEndpointConnectionResource(Client, ManagedHsmPrivateEndpointConnectionData.DeserializeManagedHsmPrivateEndpointConnectionData(e)), _managedHsmPrivateEndpointConnectionMHSMPrivateEndpointConnectionsClientDiagnostics, Pipeline, "ManagedHsmPrivateEndpointConnectionCollection.GetAll", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _managedHsmPrivateEndpointConnectionMhsmPrivateEndpointConnectionsRestClient.CreateListByResourceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _managedHsmPrivateEndpointConnectionMhsmPrivateEndpointConnectionsRestClient.CreateListByResourceNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ManagedHsmPrivateEndpointConnectionResource(Client, ManagedHsmPrivateEndpointConnectionData.DeserializeManagedHsmPrivateEndpointConnectionData(e)), _managedHsmPrivateEndpointConnectionMhsmPrivateEndpointConnectionsClientDiagnostics, Pipeline, "ManagedHsmPrivateEndpointConnectionCollection.GetAll", "value", "nextLink", cancellationToken); } /// @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAll /// /// /// Operation Id - /// MHSMPrivateEndpointConnections_ListByResource + /// MhsmPrivateEndpointConnection_ListByResource /// /// /// Default Api Version @@ -298,9 +298,9 @@ public virtual AsyncPageable GetAll /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetAll(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _managedHsmPrivateEndpointConnectionMHSMPrivateEndpointConnectionsRestClient.CreateListByResourceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _managedHsmPrivateEndpointConnectionMHSMPrivateEndpointConnectionsRestClient.CreateListByResourceNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ManagedHsmPrivateEndpointConnectionResource(Client, ManagedHsmPrivateEndpointConnectionData.DeserializeManagedHsmPrivateEndpointConnectionData(e)), _managedHsmPrivateEndpointConnectionMHSMPrivateEndpointConnectionsClientDiagnostics, Pipeline, "ManagedHsmPrivateEndpointConnectionCollection.GetAll", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _managedHsmPrivateEndpointConnectionMhsmPrivateEndpointConnectionsRestClient.CreateListByResourceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _managedHsmPrivateEndpointConnectionMhsmPrivateEndpointConnectionsRestClient.CreateListByResourceNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ManagedHsmPrivateEndpointConnectionResource(Client, ManagedHsmPrivateEndpointConnectionData.DeserializeManagedHsmPrivateEndpointConnectionData(e)), _managedHsmPrivateEndpointConnectionMhsmPrivateEndpointConnectionsClientDiagnostics, Pipeline, "ManagedHsmPrivateEndpointConnectionCollection.GetAll", "value", "nextLink", cancellationToken); } /// @@ -312,7 +312,7 @@ public virtual Pageable GetAll(Canc /// /// /// Operation Id - /// MHSMPrivateEndpointConnections_Get + /// MhsmPrivateEndpointConnection_Get /// /// /// Default Api Version @@ -332,11 +332,11 @@ public virtual async Task> ExistsAsync(string privateEndpointConn { Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); - using var scope = _managedHsmPrivateEndpointConnectionMHSMPrivateEndpointConnectionsClientDiagnostics.CreateScope("ManagedHsmPrivateEndpointConnectionCollection.Exists"); + using var scope = _managedHsmPrivateEndpointConnectionMhsmPrivateEndpointConnectionsClientDiagnostics.CreateScope("ManagedHsmPrivateEndpointConnectionCollection.Exists"); scope.Start(); try { - var response = await _managedHsmPrivateEndpointConnectionMHSMPrivateEndpointConnectionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _managedHsmPrivateEndpointConnectionMhsmPrivateEndpointConnectionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string privateEndpointConn /// /// /// Operation Id - /// MHSMPrivateEndpointConnections_Get + /// MhsmPrivateEndpointConnection_Get /// /// /// Default Api Version @@ -375,11 +375,11 @@ public virtual Response Exists(string privateEndpointConnectionName, Cance { Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); - using var scope = _managedHsmPrivateEndpointConnectionMHSMPrivateEndpointConnectionsClientDiagnostics.CreateScope("ManagedHsmPrivateEndpointConnectionCollection.Exists"); + using var scope = _managedHsmPrivateEndpointConnectionMhsmPrivateEndpointConnectionsClientDiagnostics.CreateScope("ManagedHsmPrivateEndpointConnectionCollection.Exists"); scope.Start(); try { - var response = _managedHsmPrivateEndpointConnectionMHSMPrivateEndpointConnectionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken: cancellationToken); + var response = _managedHsmPrivateEndpointConnectionMhsmPrivateEndpointConnectionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken: cancellationToken); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -398,7 +398,7 @@ public virtual Response Exists(string privateEndpointConnectionName, Cance /// /// /// Operation Id - /// MHSMPrivateEndpointConnections_Get + /// MhsmPrivateEndpointConnection_Get /// /// /// Default Api Version @@ -418,11 +418,11 @@ public virtual async Task(response.GetRawResponse()); return Response.FromValue(new ManagedHsmPrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); @@ -443,7 +443,7 @@ public virtual async Task /// /// Operation Id - /// MHSMPrivateEndpointConnections_Get + /// MhsmPrivateEndpointConnection_Get /// /// /// Default Api Version @@ -463,11 +463,11 @@ public virtual NullableResponse Get { Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); - using var scope = _managedHsmPrivateEndpointConnectionMHSMPrivateEndpointConnectionsClientDiagnostics.CreateScope("ManagedHsmPrivateEndpointConnectionCollection.GetIfExists"); + using var scope = _managedHsmPrivateEndpointConnectionMhsmPrivateEndpointConnectionsClientDiagnostics.CreateScope("ManagedHsmPrivateEndpointConnectionCollection.GetIfExists"); scope.Start(); try { - var response = _managedHsmPrivateEndpointConnectionMHSMPrivateEndpointConnectionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken: cancellationToken); + var response = _managedHsmPrivateEndpointConnectionMhsmPrivateEndpointConnectionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken: cancellationToken); if (response.Value == null) return new NoValueResponse(response.GetRawResponse()); return Response.FromValue(new ManagedHsmPrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/ManagedHsmPrivateEndpointConnectionData.Serialization.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/ManagedHsmPrivateEndpointConnectionData.Serialization.cs index 4e91c6c1d5d7..7862ee7f6dab 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/ManagedHsmPrivateEndpointConnectionData.Serialization.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/ManagedHsmPrivateEndpointConnectionData.Serialization.cs @@ -40,11 +40,6 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); - if (Optional.IsDefined(ETag)) - { - writer.WritePropertyName("etag"u8); - writer.WriteStringValue(ETag.Value.ToString()); - } if (Optional.IsDefined(Sku)) { writer.WritePropertyName("sku"u8); @@ -55,6 +50,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("identity"u8); ((IJsonModel)Identity).Write(writer, ModelSerializationExtensions.WireV3Options); } + if (Optional.IsDefined(ETag)) + { + writer.WritePropertyName("etag"u8); + writer.WriteStringValue(ETag.Value.ToString()); + } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(PrivateEndpoint)) @@ -95,9 +95,9 @@ internal static ManagedHsmPrivateEndpointConnectionData DeserializeManagedHsmPri { return null; } - ETag? etag = default; ManagedHsmSku sku = default; ManagedServiceIdentity identity = default; + ETag? etag = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -111,31 +111,31 @@ internal static ManagedHsmPrivateEndpointConnectionData DeserializeManagedHsmPri Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("etag"u8)) + if (property.NameEquals("sku"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - etag = new ETag(property.Value.GetString()); + sku = ManagedHsmSku.DeserializeManagedHsmSku(property.Value, options); continue; } - if (property.NameEquals("sku"u8)) + if (property.NameEquals("identity"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - sku = ManagedHsmSku.DeserializeManagedHsmSku(property.Value, options); + identity = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), ModelSerializationExtensions.WireV3Options, AzureResourceManagerKeyVaultContext.Default); continue; } - if (property.NameEquals("identity"u8)) + if (property.NameEquals("etag"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - identity = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), ModelSerializationExtensions.WireV3Options, AzureResourceManagerKeyVaultContext.Default); + etag = new ETag(property.Value.GetString()); continue; } if (property.NameEquals("tags"u8)) @@ -233,12 +233,12 @@ internal static ManagedHsmPrivateEndpointConnectionData DeserializeManagedHsmPri systemData, tags ?? new ChangeTrackingDictionary(), location, - etag, privateEndpoint, privateLinkServiceConnectionState, provisioningState, sku, identity, + etag, serializedAdditionalRawData); } @@ -325,21 +325,6 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ETag), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" etag: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(ETag)) - { - builder.Append(" etag: "); - builder.AppendLine($"'{ETag.Value.ToString()}'"); - } - } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Sku), out propertyOverride); if (hasPropertyOverride) { @@ -370,6 +355,21 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ETag), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" etag: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ETag)) + { + builder.Append(" etag: "); + builder.AppendLine($"'{ETag.Value.ToString()}'"); + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/ManagedHsmPrivateEndpointConnectionData.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/ManagedHsmPrivateEndpointConnectionData.cs index 1d0e205b73dc..badb408aca33 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/ManagedHsmPrivateEndpointConnectionData.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/ManagedHsmPrivateEndpointConnectionData.cs @@ -65,21 +65,21 @@ public ManagedHsmPrivateEndpointConnectionData(AzureLocation location) : base(lo /// The systemData. /// The tags. /// The location. - /// 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. /// SKU details. - /// Managed service identity (system assigned and/or user assigned identities). + /// Managed service identity. + /// Modified whenever there is a change in the state of private endpoint connection. /// Keeps track of any properties unknown to the library. - internal ManagedHsmPrivateEndpointConnectionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ETag? etag, SubResource privateEndpoint, ManagedHsmPrivateLinkServiceConnectionState privateLinkServiceConnectionState, ManagedHsmPrivateEndpointConnectionProvisioningState? provisioningState, ManagedHsmSku sku, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal ManagedHsmPrivateEndpointConnectionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, SubResource privateEndpoint, ManagedHsmPrivateLinkServiceConnectionState privateLinkServiceConnectionState, ManagedHsmPrivateEndpointConnectionProvisioningState? provisioningState, ManagedHsmSku sku, ManagedServiceIdentity identity, ETag? etag, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { - ETag = etag; PrivateEndpoint = privateEndpoint; PrivateLinkServiceConnectionState = privateLinkServiceConnectionState; ProvisioningState = provisioningState; Sku = sku; Identity = identity; + ETag = etag; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -88,9 +88,6 @@ internal ManagedHsmPrivateEndpointConnectionData() { } - /// Modified whenever there is a change in the state of private endpoint connection. - [WirePath("etag")] - public ETag? ETag { get; set; } /// Properties of the private endpoint object. internal SubResource PrivateEndpoint { get; set; } /// Gets Id. @@ -109,8 +106,11 @@ public ResourceIdentifier PrivateEndpointId /// SKU details. [WirePath("sku")] public ManagedHsmSku Sku { get; set; } - /// Managed service identity (system assigned and/or user assigned identities). + /// Managed service identity. [WirePath("identity")] public ManagedServiceIdentity Identity { get; set; } + /// Modified whenever there is a change in the state of private endpoint connection. + [WirePath("etag")] + public ETag? ETag { get; set; } } } diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/ManagedHsmPrivateEndpointConnectionResource.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/ManagedHsmPrivateEndpointConnectionResource.cs index 0e985793511b..7789748dac2a 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/ManagedHsmPrivateEndpointConnectionResource.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/ManagedHsmPrivateEndpointConnectionResource.cs @@ -34,8 +34,8 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, return new ResourceIdentifier(resourceId); } - private readonly ClientDiagnostics _managedHsmPrivateEndpointConnectionMHSMPrivateEndpointConnectionsClientDiagnostics; - private readonly MhsmPrivateEndpointConnectionsRestOperations _managedHsmPrivateEndpointConnectionMHSMPrivateEndpointConnectionsRestClient; + private readonly ClientDiagnostics _managedHsmPrivateEndpointConnectionMhsmPrivateEndpointConnectionsClientDiagnostics; + private readonly MhsmPrivateEndpointConnectionsRestOperations _managedHsmPrivateEndpointConnectionMhsmPrivateEndpointConnectionsRestClient; private readonly ManagedHsmPrivateEndpointConnectionData _data; /// Gets the resource type for the operations. @@ -60,9 +60,9 @@ internal ManagedHsmPrivateEndpointConnectionResource(ArmClient client, ManagedHs /// The identifier of the resource that is the target of operations. internal ManagedHsmPrivateEndpointConnectionResource(ArmClient client, ResourceIdentifier id) : base(client, id) { - _managedHsmPrivateEndpointConnectionMHSMPrivateEndpointConnectionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.KeyVault", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string managedHsmPrivateEndpointConnectionMHSMPrivateEndpointConnectionsApiVersion); - _managedHsmPrivateEndpointConnectionMHSMPrivateEndpointConnectionsRestClient = new MhsmPrivateEndpointConnectionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, managedHsmPrivateEndpointConnectionMHSMPrivateEndpointConnectionsApiVersion); + _managedHsmPrivateEndpointConnectionMhsmPrivateEndpointConnectionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.KeyVault", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string managedHsmPrivateEndpointConnectionMhsmPrivateEndpointConnectionsApiVersion); + _managedHsmPrivateEndpointConnectionMhsmPrivateEndpointConnectionsRestClient = new MhsmPrivateEndpointConnectionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, managedHsmPrivateEndpointConnectionMhsmPrivateEndpointConnectionsApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -98,7 +98,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Operation Id - /// MHSMPrivateEndpointConnections_Get + /// MhsmPrivateEndpointConnection_Get /// /// /// Default Api Version @@ -113,11 +113,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// The cancellation token to use. public virtual async Task> GetAsync(CancellationToken cancellationToken = default) { - using var scope = _managedHsmPrivateEndpointConnectionMHSMPrivateEndpointConnectionsClientDiagnostics.CreateScope("ManagedHsmPrivateEndpointConnectionResource.Get"); + using var scope = _managedHsmPrivateEndpointConnectionMhsmPrivateEndpointConnectionsClientDiagnostics.CreateScope("ManagedHsmPrivateEndpointConnectionResource.Get"); scope.Start(); try { - var response = await _managedHsmPrivateEndpointConnectionMHSMPrivateEndpointConnectionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _managedHsmPrivateEndpointConnectionMhsmPrivateEndpointConnectionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ManagedHsmPrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); @@ -138,7 +138,7 @@ public virtual async Task> /// /// /// Operation Id - /// MHSMPrivateEndpointConnections_Get + /// MhsmPrivateEndpointConnection_Get /// /// /// Default Api Version @@ -153,11 +153,11 @@ public virtual async Task> /// The cancellation token to use. public virtual Response Get(CancellationToken cancellationToken = default) { - using var scope = _managedHsmPrivateEndpointConnectionMHSMPrivateEndpointConnectionsClientDiagnostics.CreateScope("ManagedHsmPrivateEndpointConnectionResource.Get"); + using var scope = _managedHsmPrivateEndpointConnectionMhsmPrivateEndpointConnectionsClientDiagnostics.CreateScope("ManagedHsmPrivateEndpointConnectionResource.Get"); scope.Start(); try { - var response = _managedHsmPrivateEndpointConnectionMHSMPrivateEndpointConnectionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var response = _managedHsmPrivateEndpointConnectionMhsmPrivateEndpointConnectionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ManagedHsmPrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); @@ -178,7 +178,7 @@ public virtual Response Get(Cancell /// /// /// Operation Id - /// MHSMPrivateEndpointConnections_Delete + /// MhsmPrivateEndpointConnection_Delete /// /// /// Default Api Version @@ -194,12 +194,12 @@ public virtual Response Get(Cancell /// The cancellation token to use. public virtual async Task> DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _managedHsmPrivateEndpointConnectionMHSMPrivateEndpointConnectionsClientDiagnostics.CreateScope("ManagedHsmPrivateEndpointConnectionResource.Delete"); + using var scope = _managedHsmPrivateEndpointConnectionMhsmPrivateEndpointConnectionsClientDiagnostics.CreateScope("ManagedHsmPrivateEndpointConnectionResource.Delete"); scope.Start(); try { - var response = await _managedHsmPrivateEndpointConnectionMHSMPrivateEndpointConnectionsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new KeyVaultArmOperation(new ManagedHsmPrivateEndpointConnectionOperationSource(Client), _managedHsmPrivateEndpointConnectionMHSMPrivateEndpointConnectionsClientDiagnostics, Pipeline, _managedHsmPrivateEndpointConnectionMHSMPrivateEndpointConnectionsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = await _managedHsmPrivateEndpointConnectionMhsmPrivateEndpointConnectionsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new KeyVaultArmOperation(new ManagedHsmPrivateEndpointConnectionOperationSource(Client), _managedHsmPrivateEndpointConnectionMhsmPrivateEndpointConnectionsClientDiagnostics, Pipeline, _managedHsmPrivateEndpointConnectionMhsmPrivateEndpointConnectionsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -220,7 +220,7 @@ public virtual async Task /// /// Operation Id - /// MHSMPrivateEndpointConnections_Delete + /// MhsmPrivateEndpointConnection_Delete /// /// /// Default Api Version @@ -236,12 +236,12 @@ public virtual async Task The cancellation token to use. public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _managedHsmPrivateEndpointConnectionMHSMPrivateEndpointConnectionsClientDiagnostics.CreateScope("ManagedHsmPrivateEndpointConnectionResource.Delete"); + using var scope = _managedHsmPrivateEndpointConnectionMhsmPrivateEndpointConnectionsClientDiagnostics.CreateScope("ManagedHsmPrivateEndpointConnectionResource.Delete"); scope.Start(); try { - var response = _managedHsmPrivateEndpointConnectionMHSMPrivateEndpointConnectionsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new KeyVaultArmOperation(new ManagedHsmPrivateEndpointConnectionOperationSource(Client), _managedHsmPrivateEndpointConnectionMHSMPrivateEndpointConnectionsClientDiagnostics, Pipeline, _managedHsmPrivateEndpointConnectionMHSMPrivateEndpointConnectionsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = _managedHsmPrivateEndpointConnectionMhsmPrivateEndpointConnectionsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new KeyVaultArmOperation(new ManagedHsmPrivateEndpointConnectionOperationSource(Client), _managedHsmPrivateEndpointConnectionMhsmPrivateEndpointConnectionsClientDiagnostics, Pipeline, _managedHsmPrivateEndpointConnectionMhsmPrivateEndpointConnectionsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -262,7 +262,7 @@ public virtual ArmOperation Delete( /// /// /// Operation Id - /// MHSMPrivateEndpointConnections_Put + /// MhsmPrivateEndpointConnection_Put /// /// /// Default Api Version @@ -282,12 +282,12 @@ public virtual async Task(Response.FromValue(new ManagedHsmPrivateEndpointConnectionResource(Client, response), response.GetRawResponse()), rehydrationToken); if (waitUntil == WaitUntil.Completed) @@ -310,7 +310,7 @@ public virtual async Task /// /// Operation Id - /// MHSMPrivateEndpointConnections_Put + /// MhsmPrivateEndpointConnection_Put /// /// /// Default Api Version @@ -330,12 +330,12 @@ public virtual ArmOperation Update( { Argument.AssertNotNull(data, nameof(data)); - using var scope = _managedHsmPrivateEndpointConnectionMHSMPrivateEndpointConnectionsClientDiagnostics.CreateScope("ManagedHsmPrivateEndpointConnectionResource.Update"); + using var scope = _managedHsmPrivateEndpointConnectionMhsmPrivateEndpointConnectionsClientDiagnostics.CreateScope("ManagedHsmPrivateEndpointConnectionResource.Update"); scope.Start(); try { - var response = _managedHsmPrivateEndpointConnectionMHSMPrivateEndpointConnectionsRestClient.Put(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); - var uri = _managedHsmPrivateEndpointConnectionMHSMPrivateEndpointConnectionsRestClient.CreatePutRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data); + var response = _managedHsmPrivateEndpointConnectionMhsmPrivateEndpointConnectionsRestClient.Put(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var uri = _managedHsmPrivateEndpointConnectionMhsmPrivateEndpointConnectionsRestClient.CreatePutRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data); var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); var operation = new KeyVaultArmOperation(Response.FromValue(new ManagedHsmPrivateEndpointConnectionResource(Client, response), response.GetRawResponse()), rehydrationToken); if (waitUntil == WaitUntil.Completed) @@ -358,7 +358,7 @@ public virtual ArmOperation Update( /// /// /// Operation Id - /// MHSMPrivateEndpointConnections_Get + /// MhsmPrivateEndpointConnection_Get /// /// /// Default Api Version @@ -379,7 +379,7 @@ public virtual async Task> Argument.AssertNotNull(key, nameof(key)); Argument.AssertNotNull(value, nameof(value)); - using var scope = _managedHsmPrivateEndpointConnectionMHSMPrivateEndpointConnectionsClientDiagnostics.CreateScope("ManagedHsmPrivateEndpointConnectionResource.AddTag"); + using var scope = _managedHsmPrivateEndpointConnectionMhsmPrivateEndpointConnectionsClientDiagnostics.CreateScope("ManagedHsmPrivateEndpointConnectionResource.AddTag"); scope.Start(); try { @@ -388,7 +388,7 @@ public virtual async Task> var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues[key] = value; await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _managedHsmPrivateEndpointConnectionMHSMPrivateEndpointConnectionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var originalResponse = await _managedHsmPrivateEndpointConnectionMhsmPrivateEndpointConnectionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); return Response.FromValue(new ManagedHsmPrivateEndpointConnectionResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else @@ -415,7 +415,7 @@ public virtual async Task> /// /// /// Operation Id - /// MHSMPrivateEndpointConnections_Get + /// MhsmPrivateEndpointConnection_Get /// /// /// Default Api Version @@ -436,7 +436,7 @@ public virtual Response AddTag(stri Argument.AssertNotNull(key, nameof(key)); Argument.AssertNotNull(value, nameof(value)); - using var scope = _managedHsmPrivateEndpointConnectionMHSMPrivateEndpointConnectionsClientDiagnostics.CreateScope("ManagedHsmPrivateEndpointConnectionResource.AddTag"); + using var scope = _managedHsmPrivateEndpointConnectionMhsmPrivateEndpointConnectionsClientDiagnostics.CreateScope("ManagedHsmPrivateEndpointConnectionResource.AddTag"); scope.Start(); try { @@ -445,7 +445,7 @@ public virtual Response AddTag(stri var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues[key] = value; GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _managedHsmPrivateEndpointConnectionMHSMPrivateEndpointConnectionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var originalResponse = _managedHsmPrivateEndpointConnectionMhsmPrivateEndpointConnectionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); return Response.FromValue(new ManagedHsmPrivateEndpointConnectionResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else @@ -472,7 +472,7 @@ public virtual Response AddTag(stri /// /// /// Operation Id - /// MHSMPrivateEndpointConnections_Get + /// MhsmPrivateEndpointConnection_Get /// /// /// Default Api Version @@ -491,7 +491,7 @@ public virtual async Task> { Argument.AssertNotNull(tags, nameof(tags)); - using var scope = _managedHsmPrivateEndpointConnectionMHSMPrivateEndpointConnectionsClientDiagnostics.CreateScope("ManagedHsmPrivateEndpointConnectionResource.SetTags"); + using var scope = _managedHsmPrivateEndpointConnectionMhsmPrivateEndpointConnectionsClientDiagnostics.CreateScope("ManagedHsmPrivateEndpointConnectionResource.SetTags"); scope.Start(); try { @@ -501,7 +501,7 @@ public virtual async Task> var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues.ReplaceWith(tags); await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _managedHsmPrivateEndpointConnectionMHSMPrivateEndpointConnectionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var originalResponse = await _managedHsmPrivateEndpointConnectionMhsmPrivateEndpointConnectionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); return Response.FromValue(new ManagedHsmPrivateEndpointConnectionResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else @@ -528,7 +528,7 @@ public virtual async Task> /// /// /// Operation Id - /// MHSMPrivateEndpointConnections_Get + /// MhsmPrivateEndpointConnection_Get /// /// /// Default Api Version @@ -547,7 +547,7 @@ public virtual Response SetTags(IDi { Argument.AssertNotNull(tags, nameof(tags)); - using var scope = _managedHsmPrivateEndpointConnectionMHSMPrivateEndpointConnectionsClientDiagnostics.CreateScope("ManagedHsmPrivateEndpointConnectionResource.SetTags"); + using var scope = _managedHsmPrivateEndpointConnectionMhsmPrivateEndpointConnectionsClientDiagnostics.CreateScope("ManagedHsmPrivateEndpointConnectionResource.SetTags"); scope.Start(); try { @@ -557,7 +557,7 @@ public virtual Response SetTags(IDi var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues.ReplaceWith(tags); GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _managedHsmPrivateEndpointConnectionMHSMPrivateEndpointConnectionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var originalResponse = _managedHsmPrivateEndpointConnectionMhsmPrivateEndpointConnectionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); return Response.FromValue(new ManagedHsmPrivateEndpointConnectionResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else @@ -584,7 +584,7 @@ public virtual Response SetTags(IDi /// /// /// Operation Id - /// MHSMPrivateEndpointConnections_Get + /// MhsmPrivateEndpointConnection_Get /// /// /// Default Api Version @@ -603,7 +603,7 @@ public virtual async Task> { Argument.AssertNotNull(key, nameof(key)); - using var scope = _managedHsmPrivateEndpointConnectionMHSMPrivateEndpointConnectionsClientDiagnostics.CreateScope("ManagedHsmPrivateEndpointConnectionResource.RemoveTag"); + using var scope = _managedHsmPrivateEndpointConnectionMhsmPrivateEndpointConnectionsClientDiagnostics.CreateScope("ManagedHsmPrivateEndpointConnectionResource.RemoveTag"); scope.Start(); try { @@ -612,7 +612,7 @@ public virtual async Task> var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues.Remove(key); await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _managedHsmPrivateEndpointConnectionMHSMPrivateEndpointConnectionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var originalResponse = await _managedHsmPrivateEndpointConnectionMhsmPrivateEndpointConnectionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); return Response.FromValue(new ManagedHsmPrivateEndpointConnectionResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else @@ -639,7 +639,7 @@ public virtual async Task> /// /// /// Operation Id - /// MHSMPrivateEndpointConnections_Get + /// MhsmPrivateEndpointConnection_Get /// /// /// Default Api Version @@ -658,7 +658,7 @@ public virtual Response RemoveTag(s { Argument.AssertNotNull(key, nameof(key)); - using var scope = _managedHsmPrivateEndpointConnectionMHSMPrivateEndpointConnectionsClientDiagnostics.CreateScope("ManagedHsmPrivateEndpointConnectionResource.RemoveTag"); + using var scope = _managedHsmPrivateEndpointConnectionMhsmPrivateEndpointConnectionsClientDiagnostics.CreateScope("ManagedHsmPrivateEndpointConnectionResource.RemoveTag"); scope.Start(); try { @@ -667,7 +667,7 @@ public virtual Response RemoveTag(s var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues.Remove(key); GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _managedHsmPrivateEndpointConnectionMHSMPrivateEndpointConnectionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var originalResponse = _managedHsmPrivateEndpointConnectionMhsmPrivateEndpointConnectionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); return Response.FromValue(new ManagedHsmPrivateEndpointConnectionResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/ManagedHsmResource.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/ManagedHsmResource.cs index b1a2dcabee76..109f41324478 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/ManagedHsmResource.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/ManagedHsmResource.cs @@ -38,10 +38,6 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, private readonly ClientDiagnostics _managedHsmClientDiagnostics; private readonly ManagedHsmsRestOperations _managedHsmRestClient; - private readonly ClientDiagnostics _mhsmPrivateLinkResourcesClientDiagnostics; - private readonly MhsmPrivateLinkResourcesRestOperations _mhsmPrivateLinkResourcesRestClient; - private readonly ClientDiagnostics _mhsmRegionsClientDiagnostics; - private readonly MhsmRegionsRestOperations _mhsmRegionsRestClient; private readonly ManagedHsmData _data; /// Gets the resource type for the operations. @@ -69,10 +65,6 @@ internal ManagedHsmResource(ArmClient client, ResourceIdentifier id) : base(clie _managedHsmClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.KeyVault", ResourceType.Namespace, Diagnostics); TryGetApiVersion(ResourceType, out string managedHsmApiVersion); _managedHsmRestClient = new ManagedHsmsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, managedHsmApiVersion); - _mhsmPrivateLinkResourcesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.KeyVault", ProviderConstants.DefaultProviderNamespace, Diagnostics); - _mhsmPrivateLinkResourcesRestClient = new MhsmPrivateLinkResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - _mhsmRegionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.KeyVault", ProviderConstants.DefaultProviderNamespace, Diagnostics); - _mhsmRegionsRestClient = new MhsmRegionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); #if DEBUG ValidateResourceId(Id); #endif @@ -115,7 +107,7 @@ public virtual ManagedHsmPrivateEndpointConnectionCollection GetManagedHsmPrivat /// /// /// Operation Id - /// MHSMPrivateEndpointConnections_Get + /// MhsmPrivateEndpointConnection_Get /// /// /// Default Api Version @@ -146,7 +138,7 @@ public virtual async Task> /// /// /// Operation Id - /// MHSMPrivateEndpointConnections_Get + /// MhsmPrivateEndpointConnection_Get /// /// /// Default Api Version @@ -177,7 +169,7 @@ public virtual Response GetManagedH /// /// /// Operation Id - /// ManagedHsms_Get + /// ManagedHsm_Get /// /// /// Default Api Version @@ -217,7 +209,7 @@ public virtual async Task> GetAsync(CancellationTok /// /// /// Operation Id - /// ManagedHsms_Get + /// ManagedHsm_Get /// /// /// Default Api Version @@ -257,7 +249,7 @@ public virtual Response Get(CancellationToken cancellationTo /// /// /// Operation Id - /// ManagedHsms_Delete + /// ManagedHsm_Delete /// /// /// Default Api Version @@ -299,7 +291,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Operation Id - /// ManagedHsms_Delete + /// ManagedHsm_Delete /// /// /// Default Api Version @@ -341,7 +333,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Operation Id - /// ManagedHsms_Update + /// ManagedHsm_Update /// /// /// Default Api Version @@ -387,7 +379,7 @@ public virtual async Task> UpdateAsync(WaitUnti /// /// /// Operation Id - /// ManagedHsms_Update + /// ManagedHsm_Update /// /// /// Default Api Version @@ -433,20 +425,24 @@ public virtual ArmOperation Update(WaitUntil waitUntil, Mana /// /// /// Operation Id - /// MHSMPrivateLinkResources_ListByManagedHsmResource + /// ManagedHsms_GetPrivateLinkResources /// /// /// Default Api Version /// 2025-05-01 /// + /// + /// Resource + /// + /// /// /// /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetMHSMPrivateLinkResourcesByManagedHsmResourceAsync(CancellationToken cancellationToken = default) + public virtual AsyncPageable GetPrivateLinkResourcesAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _mhsmPrivateLinkResourcesRestClient.CreateListByManagedHsmResourceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => ManagedHsmPrivateLinkResourceData.DeserializeManagedHsmPrivateLinkResourceData(e), _mhsmPrivateLinkResourcesClientDiagnostics, Pipeline, "ManagedHsmResource.GetMHSMPrivateLinkResourcesByManagedHsmResource", "value", null, cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _managedHsmRestClient.CreateGetPrivateLinkResourcesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => ManagedHsmPrivateLinkResourceData.DeserializeManagedHsmPrivateLinkResourceData(e), _managedHsmClientDiagnostics, Pipeline, "ManagedHsmResource.GetPrivateLinkResources", "value", null, cancellationToken); } /// @@ -458,20 +454,24 @@ public virtual AsyncPageable GetMHSMPrivateLi /// /// /// Operation Id - /// MHSMPrivateLinkResources_ListByManagedHsmResource + /// ManagedHsms_GetPrivateLinkResources /// /// /// Default Api Version /// 2025-05-01 /// + /// + /// Resource + /// + /// /// /// /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetMHSMPrivateLinkResourcesByManagedHsmResource(CancellationToken cancellationToken = default) + public virtual Pageable GetPrivateLinkResources(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _mhsmPrivateLinkResourcesRestClient.CreateListByManagedHsmResourceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => ManagedHsmPrivateLinkResourceData.DeserializeManagedHsmPrivateLinkResourceData(e), _mhsmPrivateLinkResourcesClientDiagnostics, Pipeline, "ManagedHsmResource.GetMHSMPrivateLinkResourcesByManagedHsmResource", "value", null, cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _managedHsmRestClient.CreateGetPrivateLinkResourcesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => ManagedHsmPrivateLinkResourceData.DeserializeManagedHsmPrivateLinkResourceData(e), _managedHsmClientDiagnostics, Pipeline, "ManagedHsmResource.GetPrivateLinkResources", "value", null, cancellationToken); } /// @@ -483,21 +483,25 @@ public virtual Pageable GetMHSMPrivateLinkRes /// /// /// Operation Id - /// MHSMRegions_ListByResource + /// ManagedHsms_GetRegions /// /// /// Default Api Version /// 2025-05-01 /// + /// + /// Resource + /// + /// /// /// /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetMHSMRegionsByResourceAsync(CancellationToken cancellationToken = default) + public virtual AsyncPageable GetRegionsAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _mhsmRegionsRestClient.CreateListByResourceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _mhsmRegionsRestClient.CreateListByResourceNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => ManagedHsmGeoReplicatedRegion.DeserializeManagedHsmGeoReplicatedRegion(e), _mhsmRegionsClientDiagnostics, Pipeline, "ManagedHsmResource.GetMHSMRegionsByResource", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _managedHsmRestClient.CreateGetRegionsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _managedHsmRestClient.CreateGetRegionsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => ManagedHsmGeoReplicatedRegion.DeserializeManagedHsmGeoReplicatedRegion(e), _managedHsmClientDiagnostics, Pipeline, "ManagedHsmResource.GetRegions", "value", "nextLink", cancellationToken); } /// @@ -509,21 +513,25 @@ public virtual AsyncPageable GetMHSMRegionsByReso /// /// /// Operation Id - /// MHSMRegions_ListByResource + /// ManagedHsms_GetRegions /// /// /// Default Api Version /// 2025-05-01 /// + /// + /// Resource + /// + /// /// /// /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetMHSMRegionsByResource(CancellationToken cancellationToken = default) + public virtual Pageable GetRegions(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _mhsmRegionsRestClient.CreateListByResourceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _mhsmRegionsRestClient.CreateListByResourceNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => ManagedHsmGeoReplicatedRegion.DeserializeManagedHsmGeoReplicatedRegion(e), _mhsmRegionsClientDiagnostics, Pipeline, "ManagedHsmResource.GetMHSMRegionsByResource", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _managedHsmRestClient.CreateGetRegionsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _managedHsmRestClient.CreateGetRegionsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => ManagedHsmGeoReplicatedRegion.DeserializeManagedHsmGeoReplicatedRegion(e), _managedHsmClientDiagnostics, Pipeline, "ManagedHsmResource.GetRegions", "value", "nextLink", cancellationToken); } /// @@ -535,7 +543,7 @@ public virtual Pageable GetMHSMRegionsByResource( /// /// /// Operation Id - /// ManagedHsms_Get + /// ManagedHsm_Get /// /// /// Default Api Version @@ -597,7 +605,7 @@ public virtual async Task> AddTagAsync(string key, /// /// /// Operation Id - /// ManagedHsms_Get + /// ManagedHsm_Get /// /// /// Default Api Version @@ -659,7 +667,7 @@ public virtual Response AddTag(string key, string value, Can /// /// /// Operation Id - /// ManagedHsms_Get + /// ManagedHsm_Get /// /// /// Default Api Version @@ -716,7 +724,7 @@ public virtual async Task> SetTagsAsync(IDictionary /// /// /// Operation Id - /// ManagedHsms_Get + /// ManagedHsm_Get /// /// /// Default Api Version @@ -773,7 +781,7 @@ public virtual Response SetTags(IDictionary /// /// /// Operation Id - /// ManagedHsms_Get + /// ManagedHsm_Get /// /// /// Default Api Version @@ -833,7 +841,7 @@ public virtual async Task> RemoveTagAsync(string ke /// /// /// Operation Id - /// ManagedHsms_Get + /// ManagedHsm_Get /// /// /// Default Api Version diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/AzureResourceManagerKeyVaultContext.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/AzureResourceManagerKeyVaultContext.cs index 2701d7184caf..20ffeb86f20a 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/AzureResourceManagerKeyVaultContext.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/AzureResourceManagerKeyVaultContext.cs @@ -61,7 +61,6 @@ namespace Azure.ResourceManager.KeyVault [ModelReaderWriterBuildable(typeof(ManagedHsmPrivateEndpointConnectionData))] [ModelReaderWriterBuildable(typeof(ManagedHsmPrivateEndpointConnectionItemData))] [ModelReaderWriterBuildable(typeof(ManagedHsmPrivateEndpointConnectionResource))] - [ModelReaderWriterBuildable(typeof(ManagedHsmPrivateEndpointConnectionsListResult))] [ModelReaderWriterBuildable(typeof(ManagedHsmPrivateLinkResourceData))] [ModelReaderWriterBuildable(typeof(ManagedHsmPrivateLinkResourceListResult))] [ModelReaderWriterBuildable(typeof(ManagedHsmPrivateLinkServiceConnectionState))] @@ -71,8 +70,9 @@ namespace Azure.ResourceManager.KeyVault [ModelReaderWriterBuildable(typeof(ManagedHSMSecurityDomainProperties))] [ModelReaderWriterBuildable(typeof(ManagedHsmServiceTagRule))] [ModelReaderWriterBuildable(typeof(ManagedHsmSku))] - [ModelReaderWriterBuildable(typeof(ManagedHsmVirtualNetworkRule))] [ModelReaderWriterBuildable(typeof(ManagedServiceIdentity))] + [ModelReaderWriterBuildable(typeof(MHSMPrivateEndpointConnectionsListResult))] + [ModelReaderWriterBuildable(typeof(ResponseError))] [ModelReaderWriterBuildable(typeof(SecretAttributes))] [ModelReaderWriterBuildable(typeof(SecretBaseAttributes))] [ModelReaderWriterBuildable(typeof(SecretListResult))] @@ -82,6 +82,7 @@ namespace Azure.ResourceManager.KeyVault [ModelReaderWriterBuildable(typeof(SystemData))] [ModelReaderWriterBuildable(typeof(UserAssignedIdentity))] [ModelReaderWriterBuildable(typeof(VaultListResult))] + [ModelReaderWriterBuildable(typeof(WritableSubResource))] public partial class AzureResourceManagerKeyVaultContext : ModelReaderWriterContext { } diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/DeletedManagedHsmListResult.Serialization.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/DeletedManagedHsmListResult.Serialization.cs index 3d50ae33b7e7..8fc172b693e8 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/DeletedManagedHsmListResult.Serialization.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/DeletedManagedHsmListResult.Serialization.cs @@ -36,20 +36,17 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(DeletedManagedHsmListResult)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -89,17 +86,13 @@ internal static DeletedManagedHsmListResult DeserializeDeletedManagedHsmListResu return null; } IReadOnlyList value = default; - string nextLink = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -110,7 +103,11 @@ internal static DeletedManagedHsmListResult DeserializeDeletedManagedHsmListResu } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -119,7 +116,7 @@ internal static DeletedManagedHsmListResult DeserializeDeletedManagedHsmListResu } } serializedAdditionalRawData = rawDataDictionary; - return new DeletedManagedHsmListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new DeletedManagedHsmListResult(value, nextLink, serializedAdditionalRawData); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) @@ -167,15 +164,7 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) if (Optional.IsDefined(NextLink)) { builder.Append(" nextLink: "); - if (NextLink.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{NextLink}'''"); - } - else - { - builder.AppendLine($"'{NextLink}'"); - } + builder.AppendLine($"'{NextLink.AbsoluteUri}'"); } } diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/DeletedManagedHsmListResult.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/DeletedManagedHsmListResult.cs index 4fd65696131f..1f76a7f60182 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/DeletedManagedHsmListResult.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/DeletedManagedHsmListResult.cs @@ -7,10 +7,11 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.KeyVault.Models { - /// List of deleted managed HSM Pools. + /// The response of a DeletedManagedHsm list operation. internal partial class DeletedManagedHsmListResult { /// @@ -46,25 +47,36 @@ internal partial class DeletedManagedHsmListResult private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal DeletedManagedHsmListResult() + /// The DeletedManagedHsm items on this page. + /// is null. + internal DeletedManagedHsmListResult(IEnumerable value) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } /// Initializes a new instance of . - /// The list of deleted managed HSM Pools. - /// The URL to get the next set of deleted managed HSM Pools. + /// The DeletedManagedHsm items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal DeletedManagedHsmListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal DeletedManagedHsmListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The list of deleted managed HSM Pools. + /// Initializes a new instance of for deserialization. + internal DeletedManagedHsmListResult() + { + } + + /// The DeletedManagedHsm items on this page. + [WirePath("value")] public IReadOnlyList Value { get; } - /// The URL to get the next set of deleted managed HSM Pools. - public string NextLink { get; } + /// The link to the next page of items. + [WirePath("nextLink")] + public Uri NextLink { get; } } } diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/DeletedManagedHsmProperties.Serialization.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/DeletedManagedHsmProperties.Serialization.cs index 4105282a543d..392cbc4be984 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/DeletedManagedHsmProperties.Serialization.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/DeletedManagedHsmProperties.Serialization.cs @@ -109,7 +109,7 @@ internal static DeletedManagedHsmProperties DeserializeDeletedManagedHsmProperti { return null; } - ResourceIdentifier managedHsmId = default; + ResourceIdentifier mhsmId = default; AzureLocation? location = default; DateTimeOffset? deletionDate = default; DateTimeOffset? scheduledPurgeDate = default; @@ -125,7 +125,7 @@ internal static DeletedManagedHsmProperties DeserializeDeletedManagedHsmProperti { continue; } - managedHsmId = new ResourceIdentifier(property.Value.GetString()); + mhsmId = new ResourceIdentifier(property.Value.GetString()); continue; } if (property.NameEquals("location"u8)) @@ -185,7 +185,7 @@ internal static DeletedManagedHsmProperties DeserializeDeletedManagedHsmProperti } serializedAdditionalRawData = rawDataDictionary; return new DeletedManagedHsmProperties( - managedHsmId, + mhsmId, location, deletionDate, scheduledPurgeDate, diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/DeletedVaultListResult.Serialization.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/DeletedVaultListResult.Serialization.cs index 631f2329e77d..3b74da044b33 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/DeletedVaultListResult.Serialization.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/DeletedVaultListResult.Serialization.cs @@ -36,20 +36,17 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(DeletedVaultListResult)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -89,17 +86,13 @@ internal static DeletedVaultListResult DeserializeDeletedVaultListResult(JsonEle return null; } IReadOnlyList value = default; - string nextLink = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -110,7 +103,11 @@ internal static DeletedVaultListResult DeserializeDeletedVaultListResult(JsonEle } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -119,7 +116,7 @@ internal static DeletedVaultListResult DeserializeDeletedVaultListResult(JsonEle } } serializedAdditionalRawData = rawDataDictionary; - return new DeletedVaultListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new DeletedVaultListResult(value, nextLink, serializedAdditionalRawData); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) @@ -167,15 +164,7 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) if (Optional.IsDefined(NextLink)) { builder.Append(" nextLink: "); - if (NextLink.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{NextLink}'''"); - } - else - { - builder.AppendLine($"'{NextLink}'"); - } + builder.AppendLine($"'{NextLink.AbsoluteUri}'"); } } diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/DeletedVaultListResult.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/DeletedVaultListResult.cs index 1ff1458c8fc9..baa0e1337e58 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/DeletedVaultListResult.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/DeletedVaultListResult.cs @@ -7,10 +7,11 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.KeyVault.Models { - /// List of vaults. + /// The response of a DeletedVault list operation. internal partial class DeletedVaultListResult { /// @@ -46,25 +47,36 @@ internal partial class DeletedVaultListResult private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal DeletedVaultListResult() + /// The DeletedVault items on this page. + /// is null. + internal DeletedVaultListResult(IEnumerable value) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } /// Initializes a new instance of . - /// The list of deleted vaults. - /// The URL to get the next set of deleted vaults. + /// The DeletedVault items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal DeletedVaultListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal DeletedVaultListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The list of deleted vaults. + /// Initializes a new instance of for deserialization. + internal DeletedVaultListResult() + { + } + + /// The DeletedVault items on this page. + [WirePath("value")] public IReadOnlyList Value { get; } - /// The URL to get the next set of deleted vaults. - public string NextLink { get; } + /// The link to the next page of items. + [WirePath("nextLink")] + public Uri NextLink { get; } } } diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/KeyVaultNameAvailabilityContent.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/KeyVaultNameAvailabilityContent.cs index a42af3ea60cf..d7ab1b25d040 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/KeyVaultNameAvailabilityContent.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/KeyVaultNameAvailabilityContent.cs @@ -48,13 +48,14 @@ public partial class KeyVaultNameAvailabilityContent /// Initializes a new instance of . /// The vault name. + /// The type of resource, Microsoft.KeyVault/vaults. /// is null. - public KeyVaultNameAvailabilityContent(string name) + public KeyVaultNameAvailabilityContent(string name, ResourceType resourceType) { Argument.AssertNotNull(name, nameof(name)); Name = name; - ResourceType = "Microsoft.KeyVault/vaults"; + ResourceType = resourceType; } /// Initializes a new instance of . diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/KeyVaultPrivateEndpointConnectionListResult.Serialization.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/KeyVaultPrivateEndpointConnectionListResult.Serialization.cs index ff28ea401242..83a4df45b8b2 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/KeyVaultPrivateEndpointConnectionListResult.Serialization.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/KeyVaultPrivateEndpointConnectionListResult.Serialization.cs @@ -36,20 +36,17 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(KeyVaultPrivateEndpointConnectionListResult)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -89,17 +86,13 @@ internal static KeyVaultPrivateEndpointConnectionListResult DeserializeKeyVaultP return null; } IReadOnlyList value = default; - string nextLink = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -110,7 +103,11 @@ internal static KeyVaultPrivateEndpointConnectionListResult DeserializeKeyVaultP } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -119,7 +116,7 @@ internal static KeyVaultPrivateEndpointConnectionListResult DeserializeKeyVaultP } } serializedAdditionalRawData = rawDataDictionary; - return new KeyVaultPrivateEndpointConnectionListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new KeyVaultPrivateEndpointConnectionListResult(value, nextLink, serializedAdditionalRawData); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) @@ -167,15 +164,7 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) if (Optional.IsDefined(NextLink)) { builder.Append(" nextLink: "); - if (NextLink.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{NextLink}'''"); - } - else - { - builder.AppendLine($"'{NextLink}'"); - } + builder.AppendLine($"'{NextLink.AbsoluteUri}'"); } } diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/KeyVaultPrivateEndpointConnectionListResult.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/KeyVaultPrivateEndpointConnectionListResult.cs index ab320efdd898..7c062f4347cf 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/KeyVaultPrivateEndpointConnectionListResult.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/KeyVaultPrivateEndpointConnectionListResult.cs @@ -7,10 +7,11 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.KeyVault.Models { - /// List of private endpoint connections. + /// The response of a PrivateEndpointConnection list operation. internal partial class KeyVaultPrivateEndpointConnectionListResult { /// @@ -46,25 +47,36 @@ internal partial class KeyVaultPrivateEndpointConnectionListResult private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal KeyVaultPrivateEndpointConnectionListResult() + /// The PrivateEndpointConnection items on this page. + /// is null. + internal KeyVaultPrivateEndpointConnectionListResult(IEnumerable value) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } /// Initializes a new instance of . - /// The list of private endpoint connections. - /// The URL to get the next set of private endpoint connections. + /// The PrivateEndpointConnection items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal KeyVaultPrivateEndpointConnectionListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal KeyVaultPrivateEndpointConnectionListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The list of private endpoint connections. + /// Initializes a new instance of for deserialization. + internal KeyVaultPrivateEndpointConnectionListResult() + { + } + + /// The PrivateEndpointConnection items on this page. + [WirePath("value")] public IReadOnlyList Value { get; } - /// The URL to get the next set of private endpoint connections. - public string NextLink { get; } + /// The link to the next page of items. + [WirePath("nextLink")] + public Uri NextLink { get; } } } diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/KeyVaultPrivateLinkResourceData.Serialization.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/KeyVaultPrivateLinkResourceData.Serialization.cs index dd87c8b1f5bf..c9f65a3fe424 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/KeyVaultPrivateLinkResourceData.Serialization.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/KeyVaultPrivateLinkResourceData.Serialization.cs @@ -112,7 +112,7 @@ internal static KeyVaultPrivateLinkResourceData DeserializeKeyVaultPrivateLinkRe SystemData systemData = default; string groupId = default; IReadOnlyList requiredMembers = default; - IList requiredZoneNames = default; + IReadOnlyList requiredZoneNames = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/KeyVaultPrivateLinkResourceData.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/KeyVaultPrivateLinkResourceData.cs index c81ebc6148f8..b8f865452679 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/KeyVaultPrivateLinkResourceData.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/KeyVaultPrivateLinkResourceData.cs @@ -48,7 +48,7 @@ public partial class KeyVaultPrivateLinkResourceData : ResourceData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - public KeyVaultPrivateLinkResourceData() + internal KeyVaultPrivateLinkResourceData() { RequiredMembers = new ChangeTrackingList(); RequiredZoneNames = new ChangeTrackingList(); @@ -66,7 +66,7 @@ public KeyVaultPrivateLinkResourceData() /// Azure location of the key vault resource. /// Tags assigned to the key vault resource. /// Keeps track of any properties unknown to the library. - internal KeyVaultPrivateLinkResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string groupId, IReadOnlyList requiredMembers, IList requiredZoneNames, AzureLocation? location, IReadOnlyDictionary tags, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal KeyVaultPrivateLinkResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string groupId, IReadOnlyList requiredMembers, IReadOnlyList requiredZoneNames, AzureLocation? location, IReadOnlyDictionary tags, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { GroupId = groupId; RequiredMembers = requiredMembers; @@ -84,7 +84,7 @@ internal KeyVaultPrivateLinkResourceData(ResourceIdentifier id, string name, Res public IReadOnlyList RequiredMembers { get; } /// Required DNS zone names of the the private link resource. [WirePath("properties.requiredZoneNames")] - public IList RequiredZoneNames { get; } + public IReadOnlyList RequiredZoneNames { get; } /// Azure location of the key vault resource. [WirePath("location")] public AzureLocation? Location { get; } diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmPrivateEndpointConnectionsListResult.Serialization.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/MHSMPrivateEndpointConnectionsListResult.Serialization.cs similarity index 65% rename from sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmPrivateEndpointConnectionsListResult.Serialization.cs rename to sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/MHSMPrivateEndpointConnectionsListResult.Serialization.cs index 3c06283ad596..bbae31b58ec7 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmPrivateEndpointConnectionsListResult.Serialization.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/MHSMPrivateEndpointConnectionsListResult.Serialization.cs @@ -15,11 +15,11 @@ namespace Azure.ResourceManager.KeyVault.Models { - internal partial class ManagedHsmPrivateEndpointConnectionsListResult : IUtf8JsonSerializable, IJsonModel + internal partial class MHSMPrivateEndpointConnectionsListResult : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -30,26 +30,23 @@ void IJsonModel.Write(Utf8JsonWr /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ManagedHsmPrivateEndpointConnectionsListResult)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(MHSMPrivateEndpointConnectionsListResult)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -68,19 +65,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ManagedHsmPrivateEndpointConnectionsListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + MHSMPrivateEndpointConnectionsListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ManagedHsmPrivateEndpointConnectionsListResult)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(MHSMPrivateEndpointConnectionsListResult)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedHsmPrivateEndpointConnectionsListResult(document.RootElement, options); + return DeserializeMHSMPrivateEndpointConnectionsListResult(document.RootElement, options); } - internal static ManagedHsmPrivateEndpointConnectionsListResult DeserializeManagedHsmPrivateEndpointConnectionsListResult(JsonElement element, ModelReaderWriterOptions options = null) + internal static MHSMPrivateEndpointConnectionsListResult DeserializeMHSMPrivateEndpointConnectionsListResult(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -89,17 +86,13 @@ internal static ManagedHsmPrivateEndpointConnectionsListResult DeserializeManage return null; } IReadOnlyList value = default; - string nextLink = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -110,7 +103,11 @@ internal static ManagedHsmPrivateEndpointConnectionsListResult DeserializeManage } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -119,7 +116,7 @@ internal static ManagedHsmPrivateEndpointConnectionsListResult DeserializeManage } } serializedAdditionalRawData = rawDataDictionary; - return new ManagedHsmPrivateEndpointConnectionsListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new MHSMPrivateEndpointConnectionsListResult(value, nextLink, serializedAdditionalRawData); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) @@ -167,15 +164,7 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) if (Optional.IsDefined(NextLink)) { builder.Append(" nextLink: "); - if (NextLink.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{NextLink}'''"); - } - else - { - builder.AppendLine($"'{NextLink}'"); - } + builder.AppendLine($"'{NextLink.AbsoluteUri}'"); } } @@ -183,9 +172,9 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) return BinaryData.FromString(builder.ToString()); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { @@ -194,26 +183,26 @@ BinaryData IPersistableModel.Wri case "bicep": return SerializeBicep(options); default: - throw new FormatException($"The model {nameof(ManagedHsmPrivateEndpointConnectionsListResult)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(MHSMPrivateEndpointConnectionsListResult)} does not support writing '{options.Format}' format."); } } - ManagedHsmPrivateEndpointConnectionsListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + MHSMPrivateEndpointConnectionsListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeManagedHsmPrivateEndpointConnectionsListResult(document.RootElement, options); + return DeserializeMHSMPrivateEndpointConnectionsListResult(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ManagedHsmPrivateEndpointConnectionsListResult)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(MHSMPrivateEndpointConnectionsListResult)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmPrivateEndpointConnectionsListResult.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/MHSMPrivateEndpointConnectionsListResult.cs similarity index 60% rename from sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmPrivateEndpointConnectionsListResult.cs rename to sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/MHSMPrivateEndpointConnectionsListResult.cs index b056f262873b..8b42ee11da93 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmPrivateEndpointConnectionsListResult.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/MHSMPrivateEndpointConnectionsListResult.cs @@ -7,11 +7,12 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.KeyVault.Models { /// List of private endpoint connections associated with a managed HSM Pools. - internal partial class ManagedHsmPrivateEndpointConnectionsListResult + internal partial class MHSMPrivateEndpointConnectionsListResult { /// /// Keeps track of any properties unknown to the library. @@ -45,26 +46,37 @@ internal partial class ManagedHsmPrivateEndpointConnectionsListResult /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal ManagedHsmPrivateEndpointConnectionsListResult() + /// Initializes a new instance of . + /// The MhsmPrivateEndpointConnection items on this page. + /// is null. + internal MHSMPrivateEndpointConnectionsListResult(IEnumerable value) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } - /// Initializes a new instance of . - /// The private endpoint connection associated with a managed HSM Pools. - /// The URL to get the next set of managed HSM Pools. + /// Initializes a new instance of . + /// The MhsmPrivateEndpointConnection items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal ManagedHsmPrivateEndpointConnectionsListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal MHSMPrivateEndpointConnectionsListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The private endpoint connection associated with a managed HSM Pools. + /// Initializes a new instance of for deserialization. + internal MHSMPrivateEndpointConnectionsListResult() + { + } + + /// The MhsmPrivateEndpointConnection items on this page. + [WirePath("value")] public IReadOnlyList Value { get; } - /// The URL to get the next set of managed HSM Pools. - public string NextLink { get; } + /// The link to the next page of items. + [WirePath("nextLink")] + public Uri NextLink { get; } } } diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmCreateMode.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmCreateMode.cs index 3796ebe6c48f..efd7289bf519 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmCreateMode.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmCreateMode.cs @@ -10,9 +10,9 @@ namespace Azure.ResourceManager.KeyVault.Models /// The create mode to indicate whether the resource is being created or is being recovered from a deleted resource. public enum ManagedHsmCreateMode { - /// Create a new managed HSM pool. This is the default option. + /// default. Default, - /// Recover the managed HSM pool from a soft-deleted resource. + /// recover. Recover } } diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmListResult.Serialization.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmListResult.Serialization.cs index 9f30e8eb03b3..4ca2eda9d015 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmListResult.Serialization.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmListResult.Serialization.cs @@ -36,20 +36,17 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(ManagedHsmListResult)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -89,17 +86,13 @@ internal static ManagedHsmListResult DeserializeManagedHsmListResult(JsonElement return null; } IReadOnlyList value = default; - string nextLink = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -110,7 +103,11 @@ internal static ManagedHsmListResult DeserializeManagedHsmListResult(JsonElement } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -119,7 +116,7 @@ internal static ManagedHsmListResult DeserializeManagedHsmListResult(JsonElement } } serializedAdditionalRawData = rawDataDictionary; - return new ManagedHsmListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new ManagedHsmListResult(value, nextLink, serializedAdditionalRawData); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) @@ -167,15 +164,7 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) if (Optional.IsDefined(NextLink)) { builder.Append(" nextLink: "); - if (NextLink.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{NextLink}'''"); - } - else - { - builder.AppendLine($"'{NextLink}'"); - } + builder.AppendLine($"'{NextLink.AbsoluteUri}'"); } } diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmListResult.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmListResult.cs index 6ac8db1941d2..a07adfe95e3e 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmListResult.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmListResult.cs @@ -7,10 +7,11 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.KeyVault.Models { - /// List of managed HSM Pools. + /// The response of a ManagedHsm list operation. internal partial class ManagedHsmListResult { /// @@ -46,25 +47,36 @@ internal partial class ManagedHsmListResult private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal ManagedHsmListResult() + /// The ManagedHsm items on this page. + /// is null. + internal ManagedHsmListResult(IEnumerable value) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } /// Initializes a new instance of . - /// The list of managed HSM Pools. - /// The URL to get the next set of managed HSM Pools. + /// The ManagedHsm items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal ManagedHsmListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal ManagedHsmListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The list of managed HSM Pools. + /// Initializes a new instance of for deserialization. + internal ManagedHsmListResult() + { + } + + /// The ManagedHsm items on this page. + [WirePath("value")] public IReadOnlyList Value { get; } - /// The URL to get the next set of managed HSM Pools. - public string NextLink { get; } + /// The link to the next page of items. + [WirePath("nextLink")] + public Uri NextLink { get; } } } diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmNameUnavailableReason.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmNameUnavailableReason.cs index 13568a705b04..4d726688f1c4 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmNameUnavailableReason.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmNameUnavailableReason.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.KeyVault.Models { - /// The reason that a managed hsm name could not be used. The reason element is only returned if NameAvailable is false. + /// The reason that a vault name could not be used. The Reason element is only returned if NameAvailable is false. public readonly partial struct ManagedHsmNameUnavailableReason : IEquatable { private readonly string _value; diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmNetworkRuleSet.Serialization.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmNetworkRuleSet.Serialization.cs index 5456f0ca2b07..f7e1d71632a5 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmNetworkRuleSet.Serialization.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmNetworkRuleSet.Serialization.cs @@ -12,6 +12,7 @@ using System.Text; using System.Text.Json; using Azure.Core; +using Azure.ResourceManager.Resources.Models; namespace Azure.ResourceManager.KeyVault.Models { @@ -72,7 +73,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStartArray(); foreach (var item in VirtualNetworkRules) { - writer.WriteObjectValue(item, options); + ((IJsonModel)item).Write(writer, options); } writer.WriteEndArray(); } @@ -117,7 +118,7 @@ internal static ManagedHsmNetworkRuleSet DeserializeManagedHsmNetworkRuleSet(Jso ManagedHsmNetworkRuleAction? defaultAction = default; IList ipRules = default; IList serviceTags = default; - IList virtualNetworkRules = default; + IList virtualNetworkRules = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -174,10 +175,10 @@ internal static ManagedHsmNetworkRuleSet DeserializeManagedHsmNetworkRuleSet(Jso { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(ManagedHsmVirtualNetworkRule.DeserializeManagedHsmVirtualNetworkRule(item, options)); + array.Add(ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(item.GetRawText())), options, AzureResourceManagerKeyVaultContext.Default)); } virtualNetworkRules = array; continue; @@ -193,7 +194,7 @@ internal static ManagedHsmNetworkRuleSet DeserializeManagedHsmNetworkRuleSet(Jso defaultAction, ipRules ?? new ChangeTrackingList(), serviceTags ?? new ChangeTrackingList(), - virtualNetworkRules ?? new ChangeTrackingList(), + virtualNetworkRules ?? new ChangeTrackingList(), serializedAdditionalRawData); } diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmNetworkRuleSet.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmNetworkRuleSet.cs index 7562020c3333..3988a2533f89 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmNetworkRuleSet.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmNetworkRuleSet.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using Azure.ResourceManager.Resources.Models; namespace Azure.ResourceManager.KeyVault.Models { @@ -50,7 +51,7 @@ public ManagedHsmNetworkRuleSet() { IPRules = new ChangeTrackingList(); ServiceTags = new ChangeTrackingList(); - VirtualNetworkRules = new ChangeTrackingList(); + VirtualNetworkRules = new ChangeTrackingList(); } /// Initializes a new instance of . @@ -60,7 +61,7 @@ public ManagedHsmNetworkRuleSet() /// The list of service tags. /// The list of virtual network rules. /// Keeps track of any properties unknown to the library. - internal ManagedHsmNetworkRuleSet(ManagedHsmNetworkRuleBypassOption? bypass, ManagedHsmNetworkRuleAction? defaultAction, IList ipRules, IList serviceTags, IList virtualNetworkRules, IDictionary serializedAdditionalRawData) + internal ManagedHsmNetworkRuleSet(ManagedHsmNetworkRuleBypassOption? bypass, ManagedHsmNetworkRuleAction? defaultAction, IList ipRules, IList serviceTags, IList virtualNetworkRules, IDictionary serializedAdditionalRawData) { Bypass = bypass; DefaultAction = defaultAction; @@ -84,6 +85,6 @@ internal ManagedHsmNetworkRuleSet(ManagedHsmNetworkRuleBypassOption? bypass, Man public IList ServiceTags { get; } /// The list of virtual network rules. [WirePath("virtualNetworkRules")] - public IList VirtualNetworkRules { get; } + public IList VirtualNetworkRules { get; } } } diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmPrivateLinkResourceData.Serialization.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmPrivateLinkResourceData.Serialization.cs index 22224bebf50c..356cc38c7044 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmPrivateLinkResourceData.Serialization.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmPrivateLinkResourceData.Serialization.cs @@ -38,11 +38,27 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Location)) + { + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location.Value); + } if (Optional.IsDefined(Sku)) { writer.WritePropertyName("sku"u8); writer.WriteObjectValue(Sku, options); } + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } if (Optional.IsDefined(Identity)) { writer.WritePropertyName("identity"u8); @@ -98,37 +114,37 @@ internal static ManagedHsmPrivateLinkResourceData DeserializeManagedHsmPrivateLi { return null; } + AzureLocation? location = default; ManagedHsmSku sku = default; + IReadOnlyDictionary tags = default; ManagedServiceIdentity identity = default; - IDictionary tags = default; - AzureLocation location = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; SystemData systemData = default; string groupId = default; IReadOnlyList requiredMembers = default; - IList requiredZoneNames = default; + IReadOnlyList requiredZoneNames = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("sku"u8)) + if (property.NameEquals("location"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - sku = ManagedHsmSku.DeserializeManagedHsmSku(property.Value, options); + location = new AzureLocation(property.Value.GetString()); continue; } - if (property.NameEquals("identity"u8)) + if (property.NameEquals("sku"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - identity = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), ModelSerializationExtensions.WireV3Options, AzureResourceManagerKeyVaultContext.Default); + sku = ManagedHsmSku.DeserializeManagedHsmSku(property.Value, options); continue; } if (property.NameEquals("tags"u8)) @@ -145,9 +161,13 @@ internal static ManagedHsmPrivateLinkResourceData DeserializeManagedHsmPrivateLi tags = dictionary; continue; } - if (property.NameEquals("location"u8)) + if (property.NameEquals("identity"u8)) { - location = new AzureLocation(property.Value.GetString()); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + identity = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), ModelSerializationExtensions.WireV3Options, AzureResourceManagerKeyVaultContext.Default); continue; } if (property.NameEquals("id"u8)) @@ -230,12 +250,12 @@ internal static ManagedHsmPrivateLinkResourceData DeserializeManagedHsmPrivateLi name, type, systemData, - tags ?? new ChangeTrackingDictionary(), - location, groupId, requiredMembers ?? new ChangeTrackingList(), requiredZoneNames ?? new ChangeTrackingList(), + location, sku, + tags ?? new ChangeTrackingDictionary(), identity, serializedAdditionalRawData); } @@ -282,8 +302,11 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } else { - builder.Append(" location: "); - builder.AppendLine($"'{Location.ToString()}'"); + if (Optional.IsDefined(Location)) + { + builder.Append(" location: "); + builder.AppendLine($"'{Location.Value.ToString()}'"); + } } hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Tags), out propertyOverride); diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmPrivateLinkResourceData.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmPrivateLinkResourceData.cs index dedb7a19193b..3f4bbc2de28d 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmPrivateLinkResourceData.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmPrivateLinkResourceData.cs @@ -13,7 +13,7 @@ namespace Azure.ResourceManager.KeyVault.Models { /// A private link resource. - public partial class ManagedHsmPrivateLinkResourceData : TrackedResourceData + public partial class ManagedHsmPrivateLinkResourceData : ResourceData { /// /// Keeps track of any properties unknown to the library. @@ -48,11 +48,11 @@ public partial class ManagedHsmPrivateLinkResourceData : TrackedResourceData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The location. - public ManagedHsmPrivateLinkResourceData(AzureLocation location) : base(location) + internal ManagedHsmPrivateLinkResourceData() { RequiredMembers = new ChangeTrackingList(); RequiredZoneNames = new ChangeTrackingList(); + Tags = new ChangeTrackingDictionary(); } /// Initializes a new instance of . @@ -60,29 +60,26 @@ public ManagedHsmPrivateLinkResourceData(AzureLocation location) : base(location /// The name. /// The resourceType. /// The systemData. - /// The tags. - /// The location. /// Group identifier of private link resource. /// Required member names of private link resource. /// Required DNS zone names of the the private link resource. + /// The supported Azure location where the managed HSM Pool should be created. /// SKU details. + /// Resource tags. /// Managed service identity (system assigned and/or user assigned identities). /// Keeps track of any properties unknown to the library. - internal ManagedHsmPrivateLinkResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string groupId, IReadOnlyList requiredMembers, IList requiredZoneNames, ManagedHsmSku sku, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal ManagedHsmPrivateLinkResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string groupId, IReadOnlyList requiredMembers, IReadOnlyList requiredZoneNames, AzureLocation? location, ManagedHsmSku sku, IReadOnlyDictionary tags, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { GroupId = groupId; RequiredMembers = requiredMembers; RequiredZoneNames = requiredZoneNames; + Location = location; Sku = sku; + Tags = tags; Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal ManagedHsmPrivateLinkResourceData() - { - } - /// Group identifier of private link resource. [WirePath("properties.groupId")] public string GroupId { get; } @@ -91,12 +88,18 @@ internal ManagedHsmPrivateLinkResourceData() public IReadOnlyList RequiredMembers { get; } /// Required DNS zone names of the the private link resource. [WirePath("properties.requiredZoneNames")] - public IList RequiredZoneNames { get; } + public IReadOnlyList RequiredZoneNames { get; } + /// The supported Azure location where the managed HSM Pool should be created. + [WirePath("location")] + public AzureLocation? Location { get; } /// SKU details. [WirePath("sku")] - public ManagedHsmSku Sku { get; set; } + public ManagedHsmSku Sku { get; } + /// Resource tags. + [WirePath("tags")] + public IReadOnlyDictionary Tags { get; } /// Managed service identity (system assigned and/or user assigned identities). [WirePath("identity")] - public ManagedServiceIdentity Identity { get; set; } + public ManagedServiceIdentity Identity { get; } } } diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmRegionsListResult.Serialization.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmRegionsListResult.Serialization.cs index a4c47bebda8a..4ac58ede6b92 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmRegionsListResult.Serialization.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmRegionsListResult.Serialization.cs @@ -36,20 +36,17 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(ManagedHsmRegionsListResult)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -89,17 +86,13 @@ internal static ManagedHsmRegionsListResult DeserializeManagedHsmRegionsListResu return null; } IReadOnlyList value = default; - string nextLink = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -110,7 +103,11 @@ internal static ManagedHsmRegionsListResult DeserializeManagedHsmRegionsListResu } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -119,7 +116,7 @@ internal static ManagedHsmRegionsListResult DeserializeManagedHsmRegionsListResu } } serializedAdditionalRawData = rawDataDictionary; - return new ManagedHsmRegionsListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new ManagedHsmRegionsListResult(value, nextLink, serializedAdditionalRawData); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) @@ -167,15 +164,7 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) if (Optional.IsDefined(NextLink)) { builder.Append(" nextLink: "); - if (NextLink.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{NextLink}'''"); - } - else - { - builder.AppendLine($"'{NextLink}'"); - } + builder.AppendLine($"'{NextLink.AbsoluteUri}'"); } } diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmRegionsListResult.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmRegionsListResult.cs index d749d4a45ceb..b660c00b6d84 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmRegionsListResult.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmRegionsListResult.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.KeyVault.Models { @@ -46,25 +47,36 @@ internal partial class ManagedHsmRegionsListResult private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal ManagedHsmRegionsListResult() + /// The MhsmGeoReplicatedRegion items on this page. + /// is null. + internal ManagedHsmRegionsListResult(IEnumerable value) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } /// Initializes a new instance of . - /// The region associated with a managed HSM Pools. - /// The URL to get the next set of managed HSM Pools. + /// The MhsmGeoReplicatedRegion items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal ManagedHsmRegionsListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal ManagedHsmRegionsListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The region associated with a managed HSM Pools. + /// Initializes a new instance of for deserialization. + internal ManagedHsmRegionsListResult() + { + } + + /// The MhsmGeoReplicatedRegion items on this page. + [WirePath("value")] public IReadOnlyList Value { get; } - /// The URL to get the next set of managed HSM Pools. - public string NextLink { get; } + /// The link to the next page of items. + [WirePath("nextLink")] + public Uri NextLink { get; } } } diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmVirtualNetworkRule.Serialization.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmVirtualNetworkRule.Serialization.cs deleted file mode 100644 index 50b209808cb3..000000000000 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmVirtualNetworkRule.Serialization.cs +++ /dev/null @@ -1,159 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.KeyVault.Models -{ - public partial class ManagedHsmVirtualNetworkRule : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedHsmVirtualNetworkRule)} does not support writing '{format}' format."); - } - - writer.WritePropertyName("id"u8); - writer.WriteStringValue(SubnetId); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - ManagedHsmVirtualNetworkRule IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(ManagedHsmVirtualNetworkRule)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeManagedHsmVirtualNetworkRule(document.RootElement, options); - } - - internal static ManagedHsmVirtualNetworkRule DeserializeManagedHsmVirtualNetworkRule(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ManagedHsmVirtualNetworkRule(id, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SubnetId), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(SubnetId)) - { - builder.Append(" id: "); - builder.AppendLine($"'{SubnetId.ToString()}'"); - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options, AzureResourceManagerKeyVaultContext.Default); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(ManagedHsmVirtualNetworkRule)} does not support writing '{options.Format}' format."); - } - } - - ManagedHsmVirtualNetworkRule IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeManagedHsmVirtualNetworkRule(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ManagedHsmVirtualNetworkRule)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmVirtualNetworkRule.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmVirtualNetworkRule.cs deleted file mode 100644 index 6957ee9e7083..000000000000 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/ManagedHsmVirtualNetworkRule.cs +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.KeyVault.Models -{ - /// A rule governing the accessibility of a managed hsm pool from a specific virtual network. - public partial class ManagedHsmVirtualNetworkRule - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// Full resource id of a vnet subnet, such as '/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1'. - /// is null. - public ManagedHsmVirtualNetworkRule(ResourceIdentifier subnetId) - { - Argument.AssertNotNull(subnetId, nameof(subnetId)); - - SubnetId = subnetId; - } - - /// Initializes a new instance of . - /// Full resource id of a vnet subnet, such as '/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1'. - /// Keeps track of any properties unknown to the library. - internal ManagedHsmVirtualNetworkRule(ResourceIdentifier subnetId, IDictionary serializedAdditionalRawData) - { - SubnetId = subnetId; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal ManagedHsmVirtualNetworkRule() - { - } - - /// Full resource id of a vnet subnet, such as '/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1'. - [WirePath("id")] - public ResourceIdentifier SubnetId { get; set; } - } -} diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/SecretListResult.Serialization.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/SecretListResult.Serialization.cs index 7191a265f09c..be16103207b1 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/SecretListResult.Serialization.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/SecretListResult.Serialization.cs @@ -36,20 +36,17 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(SecretListResult)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -89,17 +86,13 @@ internal static SecretListResult DeserializeSecretListResult(JsonElement element return null; } IReadOnlyList value = default; - string nextLink = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -110,7 +103,11 @@ internal static SecretListResult DeserializeSecretListResult(JsonElement element } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -119,7 +116,7 @@ internal static SecretListResult DeserializeSecretListResult(JsonElement element } } serializedAdditionalRawData = rawDataDictionary; - return new SecretListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new SecretListResult(value, nextLink, serializedAdditionalRawData); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) @@ -167,15 +164,7 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) if (Optional.IsDefined(NextLink)) { builder.Append(" nextLink: "); - if (NextLink.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{NextLink}'''"); - } - else - { - builder.AppendLine($"'{NextLink}'"); - } + builder.AppendLine($"'{NextLink.AbsoluteUri}'"); } } diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/SecretListResult.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/SecretListResult.cs index 76efd4c9accb..16caffc46e21 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/SecretListResult.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/SecretListResult.cs @@ -7,10 +7,11 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.KeyVault.Models { - /// List of secrets. + /// The response of a Secret list operation. internal partial class SecretListResult { /// @@ -46,25 +47,36 @@ internal partial class SecretListResult private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal SecretListResult() + /// The Secret items on this page. + /// is null. + internal SecretListResult(IEnumerable value) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } /// Initializes a new instance of . - /// The list of secrets. - /// The URL to get the next set of secrets. + /// The Secret items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal SecretListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal SecretListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The list of secrets. + /// Initializes a new instance of for deserialization. + internal SecretListResult() + { + } + + /// The Secret items on this page. + [WirePath("value")] public IReadOnlyList Value { get; } - /// The URL to get the next set of secrets. - public string NextLink { get; } + /// The link to the next page of items. + [WirePath("nextLink")] + public Uri NextLink { get; } } } diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/VaultListResult.Serialization.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/VaultListResult.Serialization.cs index ccb9d30a30e3..93dc6a9943ca 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/VaultListResult.Serialization.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/VaultListResult.Serialization.cs @@ -36,20 +36,17 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(VaultListResult)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -89,17 +86,13 @@ internal static VaultListResult DeserializeVaultListResult(JsonElement element, return null; } IReadOnlyList value = default; - string nextLink = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -110,7 +103,11 @@ internal static VaultListResult DeserializeVaultListResult(JsonElement element, } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -119,7 +116,7 @@ internal static VaultListResult DeserializeVaultListResult(JsonElement element, } } serializedAdditionalRawData = rawDataDictionary; - return new VaultListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new VaultListResult(value, nextLink, serializedAdditionalRawData); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) @@ -167,15 +164,7 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) if (Optional.IsDefined(NextLink)) { builder.Append(" nextLink: "); - if (NextLink.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{NextLink}'''"); - } - else - { - builder.AppendLine($"'{NextLink}'"); - } + builder.AppendLine($"'{NextLink.AbsoluteUri}'"); } } diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/VaultListResult.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/VaultListResult.cs index 5ccd44b0cc19..acdc9c2abcd3 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/VaultListResult.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/Models/VaultListResult.cs @@ -7,10 +7,11 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.KeyVault.Models { - /// List of vaults. + /// The response of a Vault list operation. internal partial class VaultListResult { /// @@ -46,25 +47,36 @@ internal partial class VaultListResult private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal VaultListResult() + /// The Vault items on this page. + /// is null. + internal VaultListResult(IEnumerable value) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } /// Initializes a new instance of . - /// The list of vaults. - /// The URL to get the next set of vaults. + /// The Vault items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal VaultListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal VaultListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The list of vaults. + /// Initializes a new instance of for deserialization. + internal VaultListResult() + { + } + + /// The Vault items on this page. + [WirePath("value")] public IReadOnlyList Value { get; } - /// The URL to get the next set of vaults. - public string NextLink { get; } + /// The link to the next page of items. + [WirePath("nextLink")] + public Uri NextLink { get; } } } diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/DeletedManagedHsmsRestOperations.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/DeletedManagedHsmsRestOperations.cs new file mode 100644 index 000000000000..cf250f2afe3a --- /dev/null +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/DeletedManagedHsmsRestOperations.cs @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.KeyVault +{ + internal partial class DeletedManagedHsmsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of DeletedManagedHsmsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public DeletedManagedHsmsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-05-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetDeletedRequestUri(string subscriptionId, AzureLocation location, string name) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.KeyVault/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/deletedManagedHSMs/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetDeletedRequest(string subscriptionId, AzureLocation location, 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("/providers/Microsoft.KeyVault/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/deletedManagedHSMs/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the specified deleted managed HSM. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// The name of the deleted managed HSM. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> GetDeletedAsync(string subscriptionId, AzureLocation location, string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var message = CreateGetDeletedRequest(subscriptionId, location, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DeletedManagedHsmData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DeletedManagedHsmData.DeserializeDeletedManagedHsmData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DeletedManagedHsmData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the specified deleted managed HSM. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// The name of the deleted managed HSM. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response GetDeleted(string subscriptionId, AzureLocation location, string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var message = CreateGetDeletedRequest(subscriptionId, location, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DeletedManagedHsmData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DeletedManagedHsmData.DeserializeDeletedManagedHsmData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DeletedManagedHsmData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreatePurgeDeletedRequestUri(string subscriptionId, AzureLocation location, string name) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.KeyVault/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/deletedManagedHSMs/", false); + uri.AppendPath(name, true); + uri.AppendPath("/purge", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreatePurgeDeletedRequest(string subscriptionId, AzureLocation location, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.KeyVault/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/deletedManagedHSMs/", false); + uri.AppendPath(name, true); + uri.AppendPath("/purge", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + _userAgent.Apply(message); + return message; + } + + /// Permanently deletes the specified managed HSM. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// The name of the deleted managed HSM. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task PurgeDeletedAsync(string subscriptionId, AzureLocation location, string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var message = CreatePurgeDeletedRequest(subscriptionId, location, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Permanently deletes the specified managed HSM. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// The name of the deleted managed HSM. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response PurgeDeleted(string subscriptionId, AzureLocation location, string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var message = CreatePurgeDeletedRequest(subscriptionId, location, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/DeletedVaultsRestOperations.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/DeletedVaultsRestOperations.cs new file mode 100644 index 000000000000..a095e531586c --- /dev/null +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/DeletedVaultsRestOperations.cs @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.KeyVault +{ + internal partial class DeletedVaultsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of DeletedVaultsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public DeletedVaultsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-05-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetDeletedRequestUri(string subscriptionId, AzureLocation location, string vaultName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.KeyVault/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/deletedVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetDeletedRequest(string subscriptionId, AzureLocation location, string vaultName) + { + 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("/providers/Microsoft.KeyVault/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/deletedVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the deleted Azure key vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// The name of the vault. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> GetDeletedAsync(string subscriptionId, AzureLocation location, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateGetDeletedRequest(subscriptionId, location, vaultName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DeletedKeyVaultData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DeletedKeyVaultData.DeserializeDeletedKeyVaultData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DeletedKeyVaultData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the deleted Azure key vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// The name of the vault. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response GetDeleted(string subscriptionId, AzureLocation location, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateGetDeletedRequest(subscriptionId, location, vaultName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DeletedKeyVaultData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DeletedKeyVaultData.DeserializeDeletedKeyVaultData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DeletedKeyVaultData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreatePurgeDeletedRequestUri(string subscriptionId, AzureLocation location, string vaultName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.KeyVault/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/deletedVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/purge", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreatePurgeDeletedRequest(string subscriptionId, AzureLocation location, string vaultName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.KeyVault/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/deletedVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/purge", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + _userAgent.Apply(message); + return message; + } + + /// Permanently deletes the specified vault. aka Purges the deleted Azure key vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// The name of the vault. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task PurgeDeletedAsync(string subscriptionId, AzureLocation location, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreatePurgeDeletedRequest(subscriptionId, location, vaultName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Permanently deletes the specified vault. aka Purges the deleted Azure key vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// The name of the vault. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response PurgeDeleted(string subscriptionId, AzureLocation location, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreatePurgeDeletedRequest(subscriptionId, location, vaultName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/ManagedHsmsOperationGroupRestOperations.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/ManagedHsmsOperationGroupRestOperations.cs new file mode 100644 index 000000000000..d062915b32be --- /dev/null +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/ManagedHsmsOperationGroupRestOperations.cs @@ -0,0 +1,279 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.KeyVault.Models; + +namespace Azure.ResourceManager.KeyVault +{ + internal partial class ManagedHsmsOperationGroupRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ManagedHsmsOperationGroupRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public ManagedHsmsOperationGroupRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-05-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListDeletedRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.KeyVault/deletedManagedHSMs", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListDeletedRequest(string subscriptionId) + { + 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("/providers/Microsoft.KeyVault/deletedManagedHSMs", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// The List operation gets information about the deleted managed HSMs associated with the subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListDeletedAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListDeletedRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DeletedManagedHsmListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DeletedManagedHsmListResult.DeserializeDeletedManagedHsmListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// The List operation gets information about the deleted managed HSMs associated with the subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListDeleted(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListDeletedRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DeletedManagedHsmListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DeletedManagedHsmListResult.DeserializeDeletedManagedHsmListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCheckManagedHsmNameAvailabilityRequestUri(string subscriptionId, ManagedHsmNameAvailabilityContent content) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.KeyVault/checkMhsmNameAvailability", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCheckManagedHsmNameAvailabilityRequest(string subscriptionId, ManagedHsmNameAvailabilityContent content) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.KeyVault/checkMhsmNameAvailability", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; + _userAgent.Apply(message); + return message; + } + + /// Checks that the managed hsm name is valid and is not already in use. + /// The ID of the target subscription. The value must be an UUID. + /// The request body. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> CheckManagedHsmNameAvailabilityAsync(string subscriptionId, ManagedHsmNameAvailabilityContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateCheckManagedHsmNameAvailabilityRequest(subscriptionId, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ManagedHsmNameAvailabilityResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ManagedHsmNameAvailabilityResult.DeserializeManagedHsmNameAvailabilityResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Checks that the managed hsm name is valid and is not already in use. + /// The ID of the target subscription. The value must be an UUID. + /// The request body. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response CheckManagedHsmNameAvailability(string subscriptionId, ManagedHsmNameAvailabilityContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateCheckManagedHsmNameAvailabilityRequest(subscriptionId, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ManagedHsmNameAvailabilityResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ManagedHsmNameAvailabilityResult.DeserializeManagedHsmNameAvailabilityResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListDeletedNextPageRequestUri(string nextLink, string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListDeletedNextPageRequest(string nextLink, string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// The List operation gets information about the deleted managed HSMs associated with the subscription. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListDeletedNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListDeletedNextPageRequest(nextLink, subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DeletedManagedHsmListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DeletedManagedHsmListResult.DeserializeDeletedManagedHsmListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// The List operation gets information about the deleted managed HSMs associated with the subscription. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListDeletedNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListDeletedNextPageRequest(nextLink, subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DeletedManagedHsmListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DeletedManagedHsmListResult.DeserializeDeletedManagedHsmListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/ManagedHsmsRestOperations.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/ManagedHsmsRestOperations.cs index 5ff245ff4a28..d9f30e777fa7 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/ManagedHsmsRestOperations.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/ManagedHsmsRestOperations.cs @@ -25,8 +25,8 @@ internal partial class ManagedHsmsRestOperations /// Initializes a new instance of ManagedHsmsRestOperations. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The application id to use for user agent. - /// server parameter. - /// Api Version. + /// Service host. + /// The API version to use for this operation. /// or is null. public ManagedHsmsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) { @@ -36,7 +36,7 @@ public ManagedHsmsRestOperations(HttpPipeline pipeline, string applicationId, Ur _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string name, ManagedHsmData data) + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string name) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -50,11 +50,11 @@ internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, return uri; } - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string name, ManagedHsmData data) + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string name) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Put; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -66,69 +66,75 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); - request.Content = content; _userAgent.Apply(message); return message; } - /// Create or update a managed HSM Pool in the specified subscription. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// Name of the resource group that contains the managed HSM pool. - /// Name of the managed HSM Pool. - /// Parameters to create or update the managed HSM Pool. + /// Gets the specified managed HSM Pool. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed HSM Pool. /// The cancellation token to use. - /// , , or is null. + /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string name, ManagedHsmData data, CancellationToken cancellationToken = default) + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, name, data); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, name); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 202: - return message.Response; + { + ManagedHsmData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ManagedHsmData.DeserializeManagedHsmData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 204: + case 404: + return Response.FromValue((ManagedHsmData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Create or update a managed HSM Pool in the specified subscription. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// Name of the resource group that contains the managed HSM pool. - /// Name of the managed HSM Pool. - /// Parameters to create or update the managed HSM Pool. + /// Gets the specified managed HSM Pool. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed HSM Pool. /// The cancellation token to use. - /// , , or is null. + /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string name, ManagedHsmData data, CancellationToken cancellationToken = default) + public Response Get(string subscriptionId, string resourceGroupName, string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, name, data); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, name); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 202: - return message.Response; + { + ManagedHsmData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ManagedHsmData.DeserializeManagedHsmData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 204: + case 404: + return Response.FromValue((ManagedHsmData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string name, ManagedHsmData data) + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string name, ManagedHsmData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -142,11 +148,11 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string name, ManagedHsmData data) + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string name, ManagedHsmData data) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Patch; + request.Method = RequestMethod.Put; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -166,22 +172,22 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG return message; } - /// Update a managed HSM Pool in the specified subscription. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// Name of the resource group that contains the managed HSM pool. - /// Name of the managed HSM Pool. - /// Parameters to patch the managed HSM Pool. + /// Create or update a managed HSM Pool in the specified subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed HSM Pool. + /// Parameters to create or update the managed HSM Pool. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string name, ManagedHsmData data, CancellationToken cancellationToken = default) + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string name, ManagedHsmData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); Argument.AssertNotNull(data, nameof(data)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, name, data); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, name, data); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -193,22 +199,22 @@ public async Task UpdateAsync(string subscriptionId, string resourceGr } } - /// Update a managed HSM Pool in the specified subscription. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// Name of the resource group that contains the managed HSM pool. - /// Name of the managed HSM Pool. - /// Parameters to patch the managed HSM Pool. + /// Create or update a managed HSM Pool in the specified subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed HSM Pool. + /// Parameters to create or update the managed HSM Pool. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string name, ManagedHsmData data, CancellationToken cancellationToken = default) + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string name, ManagedHsmData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); Argument.AssertNotNull(data, nameof(data)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, name, data); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, name, data); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -220,7 +226,7 @@ public Response Update(string subscriptionId, string resourceGroupName, string n } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string name) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string name, ManagedHsmData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -234,11 +240,11 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string name) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string name, ManagedHsmData data) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Delete; + request.Method = RequestMethod.Patch; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -250,63 +256,69 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// Deletes the specified managed HSM Pool. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// Name of the resource group that contains the managed HSM pool. - /// The name of the managed HSM Pool to delete. + /// Update a managed HSM Pool in the specified subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed HSM Pool. + /// Parameters to patch the managed HSM Pool. /// The cancellation token to use. - /// , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string name, CancellationToken cancellationToken = default) + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string name, ManagedHsmData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, name); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, name, data); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: case 202: - case 204: return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Deletes the specified managed HSM Pool. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// Name of the resource group that contains the managed HSM pool. - /// The name of the managed HSM Pool to delete. + /// Update a managed HSM Pool in the specified subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed HSM Pool. + /// Parameters to patch the managed HSM Pool. /// The cancellation token to use. - /// , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string name, CancellationToken cancellationToken = default) + public Response Update(string subscriptionId, string resourceGroupName, string name, ManagedHsmData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, name); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, name, data); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: case 202: - case 204: return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string name) + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string name) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -320,11 +332,11 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string res return uri; } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string name) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string name) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Delete; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -335,70 +347,57 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou uri.AppendPath(name, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; - request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); return message; } - /// Gets the specified managed HSM Pool. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// Name of the resource group that contains the managed HSM pool. + /// Deletes the specified managed HSM Pool. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the managed HSM Pool. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string name, CancellationToken cancellationToken = default) + public async Task DeleteAsync(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 = CreateGetRequest(subscriptionId, resourceGroupName, name); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, name); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - { - ManagedHsmData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ManagedHsmData.DeserializeManagedHsmData(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: case 204: - case 404: - return Response.FromValue((ManagedHsmData)null, message.Response); + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Gets the specified managed HSM Pool. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// Name of the resource group that contains the managed HSM pool. + /// Deletes the specified managed HSM Pool. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the managed HSM Pool. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string name, CancellationToken cancellationToken = default) + public Response Delete(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 = CreateGetRequest(subscriptionId, resourceGroupName, name); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, name); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - { - ManagedHsmData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ManagedHsmData.DeserializeManagedHsmData(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: case 204: - case 404: - return Response.FromValue((ManagedHsmData)null, message.Response); + return message.Response; default: throw new RequestFailedException(message.Response); } @@ -413,11 +412,11 @@ internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscripti uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.KeyVault/managedHSMs", false); + uri.AppendQuery("api-version", _apiVersion, true); if (top != null) { uri.AppendQuery("$top", top.Value, true); } - uri.AppendQuery("api-version", _apiVersion, true); return uri; } @@ -433,11 +432,11 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.KeyVault/managedHSMs", false); + uri.AppendQuery("api-version", _apiVersion, true); if (top != null) { uri.AppendQuery("$top", top.Value, true); } - uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -445,8 +444,8 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str } /// The List operation gets information about the managed HSM Pools associated with the subscription and within the specified resource group. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// Name of the resource group that contains the managed HSM pool. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// Maximum number of results to return. /// The cancellation token to use. /// or is null. @@ -473,8 +472,8 @@ public async Task> ListByResourceGroupAsync(strin } /// The List operation gets information about the managed HSM Pools associated with the subscription and within the specified resource group. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// Name of the resource group that contains the managed HSM pool. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// Maximum number of results to return. /// The cancellation token to use. /// or is null. @@ -507,11 +506,11 @@ internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptio uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); uri.AppendPath("/providers/Microsoft.KeyVault/managedHSMs", false); + uri.AppendQuery("api-version", _apiVersion, true); if (top != null) { uri.AppendQuery("$top", top.Value, true); } - uri.AppendQuery("api-version", _apiVersion, true); return uri; } @@ -525,11 +524,11 @@ internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId, int? uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); uri.AppendPath("/providers/Microsoft.KeyVault/managedHSMs", false); + uri.AppendQuery("api-version", _apiVersion, true); if (top != null) { uri.AppendQuery("$top", top.Value, true); } - uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -537,7 +536,7 @@ internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId, int? } /// The List operation gets information about the managed HSM Pools associated with the subscription. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// The ID of the target subscription. The value must be an UUID. /// Maximum number of results to return. /// The cancellation token to use. /// is null. @@ -563,7 +562,7 @@ public async Task> ListBySubscriptionAsync(string } /// The List operation gets information about the managed HSM Pools associated with the subscription. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// The ID of the target subscription. The value must be an UUID. /// Maximum number of results to return. /// The cancellation token to use. /// is null. @@ -588,99 +587,22 @@ public Response ListBySubscription(string subscriptionId, } } - internal RequestUriBuilder CreateListDeletedRequestUri(string subscriptionId) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.KeyVault/deletedManagedHSMs", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListDeletedRequest(string subscriptionId) - { - 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("/providers/Microsoft.KeyVault/deletedManagedHSMs", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// The List operation gets information about the deleted managed HSMs associated with the subscription. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListDeletedAsync(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListDeletedRequest(subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DeletedManagedHsmListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DeletedManagedHsmListResult.DeserializeDeletedManagedHsmListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// The List operation gets information about the deleted managed HSMs associated with the subscription. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response ListDeleted(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListDeletedRequest(subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DeletedManagedHsmListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DeletedManagedHsmListResult.DeserializeDeletedManagedHsmListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateGetDeletedRequestUri(string subscriptionId, AzureLocation location, string name) + internal RequestUriBuilder CreateGetPrivateLinkResourcesRequestUri(string subscriptionId, string resourceGroupName, string name) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.KeyVault/locations/", false); - uri.AppendPath(location, true); - uri.AppendPath("/deletedManagedHSMs/", false); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.KeyVault/managedHSMs/", false); uri.AppendPath(name, true); + uri.AppendPath("/privateLinkResources", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateGetDeletedRequest(string subscriptionId, AzureLocation location, string name) + internal HttpMessage CreateGetPrivateLinkResourcesRequest(string subscriptionId, string resourceGroupName, string name) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -689,10 +611,11 @@ internal HttpMessage CreateGetDeletedRequest(string subscriptionId, AzureLocatio uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.KeyVault/locations/", false); - uri.AppendPath(location, true); - uri.AppendPath("/deletedManagedHSMs/", false); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.KeyVault/managedHSMs/", false); uri.AppendPath(name, true); + uri.AppendPath("/privateLinkResources", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -700,95 +623,93 @@ internal HttpMessage CreateGetDeletedRequest(string subscriptionId, AzureLocatio return message; } - /// Gets the specified deleted managed HSM. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The location of the deleted managed HSM. - /// The name of the deleted managed HSM. + /// Gets the private link resources supported for the managed hsm pool. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed HSM Pool. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> GetDeletedAsync(string subscriptionId, AzureLocation location, string name, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetPrivateLinkResourcesAsync(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 = CreateGetDeletedRequest(subscriptionId, location, name); + using var message = CreateGetPrivateLinkResourcesRequest(subscriptionId, resourceGroupName, name); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - DeletedManagedHsmData value = default; + ManagedHsmPrivateLinkResourceListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DeletedManagedHsmData.DeserializeDeletedManagedHsmData(document.RootElement); + value = ManagedHsmPrivateLinkResourceListResult.DeserializeManagedHsmPrivateLinkResourceListResult(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((DeletedManagedHsmData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Gets the specified deleted managed HSM. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The location of the deleted managed HSM. - /// The name of the deleted managed HSM. + /// Gets the private link resources supported for the managed hsm pool. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed HSM Pool. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response GetDeleted(string subscriptionId, AzureLocation location, string name, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response GetPrivateLinkResources(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 = CreateGetDeletedRequest(subscriptionId, location, name); + using var message = CreateGetPrivateLinkResourcesRequest(subscriptionId, resourceGroupName, name); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - DeletedManagedHsmData value = default; + ManagedHsmPrivateLinkResourceListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DeletedManagedHsmData.DeserializeDeletedManagedHsmData(document.RootElement); + value = ManagedHsmPrivateLinkResourceListResult.DeserializeManagedHsmPrivateLinkResourceListResult(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((DeletedManagedHsmData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreatePurgeDeletedRequestUri(string subscriptionId, AzureLocation location, string name) + internal RequestUriBuilder CreateGetRegionsRequestUri(string subscriptionId, string resourceGroupName, string name) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.KeyVault/locations/", false); - uri.AppendPath(location, true); - uri.AppendPath("/deletedManagedHSMs/", false); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.KeyVault/managedHSMs/", false); uri.AppendPath(name, true); - uri.AppendPath("/purge", false); + uri.AppendPath("/regions", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreatePurgeDeletedRequest(string subscriptionId, AzureLocation location, string name) + internal HttpMessage CreateGetRegionsRequest(string subscriptionId, string resourceGroupName, string name) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Post; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.KeyVault/locations/", false); - uri.AppendPath(location, true); - uri.AppendPath("/deletedManagedHSMs/", false); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.KeyVault/managedHSMs/", false); uri.AppendPath(name, true); - uri.AppendPath("/purge", false); + uri.AppendPath("/regions", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -796,104 +717,28 @@ internal HttpMessage CreatePurgeDeletedRequest(string subscriptionId, AzureLocat return message; } - /// Permanently deletes the specified managed HSM. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The location of the soft-deleted managed HSM. - /// The name of the soft-deleted managed HSM. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task PurgeDeletedAsync(string subscriptionId, AzureLocation location, string name, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(name, nameof(name)); - - using var message = CreatePurgeDeletedRequest(subscriptionId, location, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Permanently deletes the specified managed HSM. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The location of the soft-deleted managed HSM. - /// The name of the soft-deleted managed HSM. + /// The List operation gets information about the regions associated with the managed HSM Pool. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed HSM Pool. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response PurgeDeleted(string subscriptionId, AzureLocation location, string name, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetRegionsAsync(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 = CreatePurgeDeletedRequest(subscriptionId, location, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateCheckManagedHsmNameAvailabilityRequestUri(string subscriptionId, ManagedHsmNameAvailabilityContent content) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.KeyVault/checkMhsmNameAvailability", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateCheckManagedHsmNameAvailabilityRequest(string subscriptionId, ManagedHsmNameAvailabilityContent content) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.KeyVault/checkMhsmNameAvailability", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); - request.Content = content0; - _userAgent.Apply(message); - return message; - } - - /// Checks that the managed hsm name is valid and is not already in use. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the managed hsm. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> CheckManagedHsmNameAvailabilityAsync(string subscriptionId, ManagedHsmNameAvailabilityContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateCheckManagedHsmNameAvailabilityRequest(subscriptionId, content); + using var message = CreateGetRegionsRequest(subscriptionId, resourceGroupName, name); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - ManagedHsmNameAvailabilityResult value = default; + ManagedHsmRegionsListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ManagedHsmNameAvailabilityResult.DeserializeManagedHsmNameAvailabilityResult(document.RootElement); + value = ManagedHsmRegionsListResult.DeserializeManagedHsmRegionsListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -901,26 +746,28 @@ public async Task> CheckManagedHsmNam } } - /// Checks that the managed hsm name is valid and is not already in use. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the managed hsm. + /// The List operation gets information about the regions associated with the managed HSM Pool. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed HSM Pool. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response CheckManagedHsmNameAvailability(string subscriptionId, ManagedHsmNameAvailabilityContent content, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response GetRegions(string subscriptionId, string resourceGroupName, string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var message = CreateCheckManagedHsmNameAvailabilityRequest(subscriptionId, content); + using var message = CreateGetRegionsRequest(subscriptionId, resourceGroupName, name); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - ManagedHsmNameAvailabilityResult value = default; + ManagedHsmRegionsListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ManagedHsmNameAvailabilityResult.DeserializeManagedHsmNameAvailabilityResult(document.RootElement); + value = ManagedHsmRegionsListResult.DeserializeManagedHsmRegionsListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -952,8 +799,8 @@ internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, s /// The List operation gets information about the managed HSM Pools associated with the subscription and within the specified resource group. /// The URL to the next page of results. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// Name of the resource group that contains the managed HSM pool. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// Maximum number of results to return. /// The cancellation token to use. /// , or is null. @@ -982,8 +829,8 @@ public async Task> ListByResourceGroupNextPageAsy /// The List operation gets information about the managed HSM Pools associated with the subscription and within the specified resource group. /// The URL to the next page of results. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// Name of the resource group that contains the managed HSM pool. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// Maximum number of results to return. /// The cancellation token to use. /// , or is null. @@ -1034,7 +881,7 @@ internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, st /// The List operation gets information about the managed HSM Pools associated with the subscription. /// The URL to the next page of results. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// The ID of the target subscription. The value must be an UUID. /// Maximum number of results to return. /// The cancellation token to use. /// or is null. @@ -1062,7 +909,7 @@ public async Task> ListBySubscriptionNextPageAsyn /// The List operation gets information about the managed HSM Pools associated with the subscription. /// The URL to the next page of results. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// The ID of the target subscription. The value must be an UUID. /// Maximum number of results to return. /// The cancellation token to use. /// or is null. @@ -1088,7 +935,7 @@ public Response ListBySubscriptionNextPage(string nextLink } } - internal RequestUriBuilder CreateListDeletedNextPageRequestUri(string nextLink, string subscriptionId) + internal RequestUriBuilder CreateGetRegionsNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string name) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -1096,7 +943,7 @@ internal RequestUriBuilder CreateListDeletedNextPageRequestUri(string nextLink, return uri; } - internal HttpMessage CreateListDeletedNextPageRequest(string nextLink, string subscriptionId) + internal HttpMessage CreateGetRegionsNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string name) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -1110,26 +957,30 @@ internal HttpMessage CreateListDeletedNextPageRequest(string nextLink, string su return message; } - /// The List operation gets information about the deleted managed HSMs associated with the subscription. + /// The List operation gets information about the regions associated with the managed HSM Pool. /// The URL to the next page of results. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed HSM Pool. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListDeletedNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetRegionsNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string name, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var message = CreateListDeletedNextPageRequest(nextLink, subscriptionId); + using var message = CreateGetRegionsNextPageRequest(nextLink, subscriptionId, resourceGroupName, name); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - DeletedManagedHsmListResult value = default; + ManagedHsmRegionsListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DeletedManagedHsmListResult.DeserializeDeletedManagedHsmListResult(document.RootElement); + value = ManagedHsmRegionsListResult.DeserializeManagedHsmRegionsListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -1137,26 +988,30 @@ public async Task> ListDeletedNextPageAsyn } } - /// The List operation gets information about the deleted managed HSMs associated with the subscription. + /// The List operation gets information about the regions associated with the managed HSM Pool. /// The URL to the next page of results. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed HSM Pool. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListDeletedNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response GetRegionsNextPage(string nextLink, string subscriptionId, string resourceGroupName, string name, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var message = CreateListDeletedNextPageRequest(nextLink, subscriptionId); + using var message = CreateGetRegionsNextPageRequest(nextLink, subscriptionId, resourceGroupName, name); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - DeletedManagedHsmListResult value = default; + ManagedHsmRegionsListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DeletedManagedHsmListResult.DeserializeDeletedManagedHsmListResult(document.RootElement); + value = ManagedHsmRegionsListResult.DeserializeManagedHsmRegionsListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/MhsmPrivateEndpointConnectionsRestOperations.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/MhsmPrivateEndpointConnectionsRestOperations.cs index 28a5c9f20e38..0dd189678f7e 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/MhsmPrivateEndpointConnectionsRestOperations.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/MhsmPrivateEndpointConnectionsRestOperations.cs @@ -25,8 +25,8 @@ internal partial class MhsmPrivateEndpointConnectionsRestOperations /// Initializes a new instance of MhsmPrivateEndpointConnectionsRestOperations. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The application id to use for user agent. - /// server parameter. - /// Api Version. + /// Service host. + /// The API version to use for this operation. /// or is null. public MhsmPrivateEndpointConnectionsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) { @@ -36,100 +36,6 @@ public MhsmPrivateEndpointConnectionsRestOperations(HttpPipeline pipeline, strin _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateListByResourceRequestUri(string subscriptionId, string resourceGroupName, string name) - { - 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.KeyVault/managedHSMs/", false); - uri.AppendPath(name, true); - uri.AppendPath("/privateEndpointConnections", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListByResourceRequest(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.KeyVault/managedHSMs/", false); - uri.AppendPath(name, true); - uri.AppendPath("/privateEndpointConnections", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// The List operation gets information about the private endpoint connections associated with the managed HSM Pool. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// Name of the resource group that contains the managed HSM pool. - /// Name of the managed HSM Pool. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceAsync(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 = CreateListByResourceRequest(subscriptionId, resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ManagedHsmPrivateEndpointConnectionsListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ManagedHsmPrivateEndpointConnectionsListResult.DeserializeManagedHsmPrivateEndpointConnectionsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// The List operation gets information about the private endpoint connections associated with the managed HSM Pool. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// Name of the resource group that contains the managed HSM pool. - /// Name of the managed HSM Pool. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListByResource(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 = CreateListByResourceRequest(subscriptionId, resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ManagedHsmPrivateEndpointConnectionsListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ManagedHsmPrivateEndpointConnectionsListResult.DeserializeManagedHsmPrivateEndpointConnectionsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string name, string privateEndpointConnectionName) { var uri = new RawRequestUriBuilder(); @@ -169,9 +75,9 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Gets the specified private endpoint connection associated with the managed HSM Pool. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// Name of the resource group that contains the managed HSM pool. - /// Name of the managed HSM Pool. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed HSM Pool. /// Name of the private endpoint connection associated with the managed hsm pool. /// The cancellation token to use. /// , , or is null. @@ -202,9 +108,9 @@ public async Task> GetAsync(st } /// Gets the specified private endpoint connection associated with the managed HSM Pool. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// Name of the resource group that contains the managed HSM pool. - /// Name of the managed HSM Pool. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed HSM Pool. /// Name of the private endpoint connection associated with the managed hsm pool. /// The cancellation token to use. /// , , or is null. @@ -277,9 +183,9 @@ internal HttpMessage CreatePutRequest(string subscriptionId, string resourceGrou } /// Updates the specified private endpoint connection associated with the managed hsm pool. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// Name of the resource group that contains the managed HSM pool. - /// Name of the managed HSM Pool. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed HSM Pool. /// Name of the private endpoint connection associated with the managed hsm pool. /// The intended state of private endpoint connection. /// The cancellation token to use. @@ -310,9 +216,9 @@ public async Task> PutAsync(st } /// Updates the specified private endpoint connection associated with the managed hsm pool. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// Name of the resource group that contains the managed HSM pool. - /// Name of the managed HSM Pool. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed HSM Pool. /// Name of the private endpoint connection associated with the managed hsm pool. /// The intended state of private endpoint connection. /// The cancellation token to use. @@ -381,9 +287,9 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Deletes the specified private endpoint connection associated with the managed hsm pool. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// Name of the resource group that contains the managed HSM pool. - /// Name of the managed HSM Pool. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed HSM Pool. /// Name of the private endpoint connection associated with the managed hsm pool. /// The cancellation token to use. /// , , or is null. @@ -409,9 +315,9 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Deletes the specified private endpoint connection associated with the managed hsm pool. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// Name of the resource group that contains the managed HSM pool. - /// Name of the managed HSM Pool. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed HSM Pool. /// Name of the private endpoint connection associated with the managed hsm pool. /// The cancellation token to use. /// , , or is null. @@ -436,6 +342,100 @@ public Response Delete(string subscriptionId, string resourceGroupName, string n } } + internal RequestUriBuilder CreateListByResourceRequestUri(string subscriptionId, string resourceGroupName, string name) + { + 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.KeyVault/managedHSMs/", false); + uri.AppendPath(name, true); + uri.AppendPath("/privateEndpointConnections", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByResourceRequest(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.KeyVault/managedHSMs/", false); + uri.AppendPath(name, true); + uri.AppendPath("/privateEndpointConnections", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// The List operation gets information about the private endpoint connections associated with the managed HSM Pool. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed HSM Pool. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceAsync(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 = CreateListByResourceRequest(subscriptionId, resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MHSMPrivateEndpointConnectionsListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = MHSMPrivateEndpointConnectionsListResult.DeserializeMHSMPrivateEndpointConnectionsListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// The List operation gets information about the private endpoint connections associated with the managed HSM Pool. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed HSM Pool. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByResource(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 = CreateListByResourceRequest(subscriptionId, resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MHSMPrivateEndpointConnectionsListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = MHSMPrivateEndpointConnectionsListResult.DeserializeMHSMPrivateEndpointConnectionsListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + internal RequestUriBuilder CreateListByResourceNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string name) { var uri = new RawRequestUriBuilder(); @@ -460,13 +460,13 @@ internal HttpMessage CreateListByResourceNextPageRequest(string nextLink, string /// The List operation gets information about the private endpoint connections associated with the managed HSM Pool. /// The URL to the next page of results. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// Name of the resource group that contains the managed HSM pool. - /// Name of the managed HSM Pool. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed HSM Pool. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string name, CancellationToken cancellationToken = default) + public async Task> ListByResourceNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string name, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -479,9 +479,9 @@ public async Task> List { case 200: { - ManagedHsmPrivateEndpointConnectionsListResult value = default; + MHSMPrivateEndpointConnectionsListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ManagedHsmPrivateEndpointConnectionsListResult.DeserializeManagedHsmPrivateEndpointConnectionsListResult(document.RootElement); + value = MHSMPrivateEndpointConnectionsListResult.DeserializeMHSMPrivateEndpointConnectionsListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -491,13 +491,13 @@ public async Task> List /// The List operation gets information about the private endpoint connections associated with the managed HSM Pool. /// The URL to the next page of results. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// Name of the resource group that contains the managed HSM pool. - /// Name of the managed HSM Pool. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the managed HSM Pool. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response ListByResourceNextPage(string nextLink, string subscriptionId, string resourceGroupName, string name, CancellationToken cancellationToken = default) + public Response ListByResourceNextPage(string nextLink, string subscriptionId, string resourceGroupName, string name, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -510,9 +510,9 @@ public Response ListByResourceNe { case 200: { - ManagedHsmPrivateEndpointConnectionsListResult value = default; + MHSMPrivateEndpointConnectionsListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ManagedHsmPrivateEndpointConnectionsListResult.DeserializeManagedHsmPrivateEndpointConnectionsListResult(document.RootElement); + value = MHSMPrivateEndpointConnectionsListResult.DeserializeMHSMPrivateEndpointConnectionsListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/MhsmPrivateLinkResourcesRestOperations.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/MhsmPrivateLinkResourcesRestOperations.cs deleted file mode 100644 index b3ebc31c9c2b..000000000000 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/MhsmPrivateLinkResourcesRestOperations.cs +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.KeyVault.Models; - -namespace Azure.ResourceManager.KeyVault -{ - internal partial class MhsmPrivateLinkResourcesRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of MhsmPrivateLinkResourcesRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public MhsmPrivateLinkResourcesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2025-05-01"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal RequestUriBuilder CreateListByManagedHsmResourceRequestUri(string subscriptionId, string resourceGroupName, string name) - { - 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.KeyVault/managedHSMs/", false); - uri.AppendPath(name, true); - uri.AppendPath("/privateLinkResources", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListByManagedHsmResourceRequest(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.KeyVault/managedHSMs/", false); - uri.AppendPath(name, true); - uri.AppendPath("/privateLinkResources", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets the private link resources supported for the managed hsm pool. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// Name of the resource group that contains the managed HSM pool. - /// Name of the managed HSM Pool. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListByManagedHsmResourceAsync(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 = CreateListByManagedHsmResourceRequest(subscriptionId, resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ManagedHsmPrivateLinkResourceListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ManagedHsmPrivateLinkResourceListResult.DeserializeManagedHsmPrivateLinkResourceListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets the private link resources supported for the managed hsm pool. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// Name of the resource group that contains the managed HSM pool. - /// Name of the managed HSM Pool. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListByManagedHsmResource(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 = CreateListByManagedHsmResourceRequest(subscriptionId, resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ManagedHsmPrivateLinkResourceListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ManagedHsmPrivateLinkResourceListResult.DeserializeManagedHsmPrivateLinkResourceListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/MhsmRegionsRestOperations.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/MhsmRegionsRestOperations.cs deleted file mode 100644 index 4c0ec35fca6d..000000000000 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/MhsmRegionsRestOperations.cs +++ /dev/null @@ -1,217 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.KeyVault.Models; - -namespace Azure.ResourceManager.KeyVault -{ - internal partial class MhsmRegionsRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of MhsmRegionsRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public MhsmRegionsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2025-05-01"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal RequestUriBuilder CreateListByResourceRequestUri(string subscriptionId, string resourceGroupName, string name) - { - 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.KeyVault/managedHSMs/", false); - uri.AppendPath(name, true); - uri.AppendPath("/regions", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListByResourceRequest(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.KeyVault/managedHSMs/", false); - uri.AppendPath(name, true); - uri.AppendPath("/regions", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// The List operation gets information about the regions associated with the managed HSM Pool. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// Name of the resource group that contains the managed HSM pool. - /// Name of the managed HSM Pool. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceAsync(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 = CreateListByResourceRequest(subscriptionId, resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ManagedHsmRegionsListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ManagedHsmRegionsListResult.DeserializeManagedHsmRegionsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// The List operation gets information about the regions associated with the managed HSM Pool. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// Name of the resource group that contains the managed HSM pool. - /// Name of the managed HSM Pool. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListByResource(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 = CreateListByResourceRequest(subscriptionId, resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ManagedHsmRegionsListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ManagedHsmRegionsListResult.DeserializeManagedHsmRegionsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListByResourceNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string name) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateListByResourceNextPageRequest(string nextLink, 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.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// The List operation gets information about the regions associated with the managed HSM Pool. - /// The URL to the next page of results. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// Name of the resource group that contains the managed HSM pool. - /// Name of the managed HSM Pool. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(name, nameof(name)); - - using var message = CreateListByResourceNextPageRequest(nextLink, subscriptionId, resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ManagedHsmRegionsListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ManagedHsmRegionsListResult.DeserializeManagedHsmRegionsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// The List operation gets information about the regions associated with the managed HSM Pool. - /// The URL to the next page of results. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// Name of the resource group that contains the managed HSM pool. - /// Name of the managed HSM Pool. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListByResourceNextPage(string nextLink, string subscriptionId, string resourceGroupName, string name, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(name, nameof(name)); - - using var message = CreateListByResourceNextPageRequest(nextLink, subscriptionId, resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ManagedHsmRegionsListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ManagedHsmRegionsListResult.DeserializeManagedHsmRegionsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs index 139bc5c0e004..cc819b1611e7 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs @@ -25,8 +25,8 @@ internal partial class PrivateEndpointConnectionsRestOperations /// Initializes a new instance of PrivateEndpointConnectionsRestOperations. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The application id to use for user agent. - /// server parameter. - /// Api Version. + /// Service host. + /// The API version to use for this operation. /// or is null. public PrivateEndpointConnectionsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) { @@ -75,9 +75,9 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Gets the specified private endpoint connection associated with the key vault. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// Name of the resource group that contains the key vault. - /// The name of the key vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the vault. /// Name of the private endpoint connection associated with the key vault. /// The cancellation token to use. /// , , or is null. @@ -109,9 +109,9 @@ public async Task> GetAsync(stri } /// Gets the specified private endpoint connection associated with the key vault. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// Name of the resource group that contains the key vault. - /// The name of the key vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the vault. /// Name of the private endpoint connection associated with the key vault. /// The cancellation token to use. /// , , or is null. @@ -185,9 +185,9 @@ internal HttpMessage CreatePutRequest(string subscriptionId, string resourceGrou } /// Updates the specified private endpoint connection associated with the key vault. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// Name of the resource group that contains the key vault. - /// The name of the key vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the vault. /// Name of the private endpoint connection associated with the key vault. /// The intended state of private endpoint connection. /// The cancellation token to use. @@ -218,9 +218,9 @@ public async Task> PutAsync(stri } /// Updates the specified private endpoint connection associated with the key vault. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// Name of the resource group that contains the key vault. - /// The name of the key vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the vault. /// Name of the private endpoint connection associated with the key vault. /// The intended state of private endpoint connection. /// The cancellation token to use. @@ -289,9 +289,9 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Deletes the specified private endpoint connection associated with the key vault. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// Name of the resource group that contains the key vault. - /// The name of the key vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the vault. /// Name of the private endpoint connection associated with the key vault. /// The cancellation token to use. /// , , or is null. @@ -317,9 +317,9 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Deletes the specified private endpoint connection associated with the key vault. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// Name of the resource group that contains the key vault. - /// The name of the key vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the vault. /// Name of the private endpoint connection associated with the key vault. /// The cancellation token to use. /// , , or is null. @@ -381,9 +381,9 @@ internal HttpMessage CreateListByResourceRequest(string subscriptionId, string r } /// The List operation gets information about the private endpoint connections associated with the vault. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// Name of the resource group that contains the key vault. - /// The name of the key vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the vault. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -410,9 +410,9 @@ public async Task> ListByR } /// The List operation gets information about the private endpoint connections associated with the vault. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// Name of the resource group that contains the key vault. - /// The name of the key vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the vault. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -462,9 +462,9 @@ internal HttpMessage CreateListByResourceNextPageRequest(string nextLink, string /// The List operation gets information about the private endpoint connections associated with the vault. /// The URL to the next page of results. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// Name of the resource group that contains the key vault. - /// The name of the key vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the vault. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -493,9 +493,9 @@ public async Task> ListByR /// The List operation gets information about the private endpoint connections associated with the vault. /// The URL to the next page of results. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// Name of the resource group that contains the key vault. - /// The name of the key vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the vault. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs deleted file mode 100644 index 4bace6b72ef5..000000000000 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.KeyVault.Models; - -namespace Azure.ResourceManager.KeyVault -{ - internal partial class PrivateLinkResourcesRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of PrivateLinkResourcesRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public PrivateLinkResourcesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2025-05-01"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal RequestUriBuilder CreateListByVaultRequestUri(string subscriptionId, string resourceGroupName, string vaultName) - { - 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.KeyVault/vaults/", false); - uri.AppendPath(vaultName, true); - uri.AppendPath("/privateLinkResources", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListByVaultRequest(string subscriptionId, string resourceGroupName, string vaultName) - { - 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.KeyVault/vaults/", false); - uri.AppendPath(vaultName, true); - uri.AppendPath("/privateLinkResources", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets the private link resources supported for the key vault. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// Name of the resource group that contains the key vault. - /// The name of the key vault. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListByVaultAsync(string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); - - using var message = CreateListByVaultRequest(subscriptionId, resourceGroupName, vaultName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - KeyVaultPrivateLinkResourceListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = KeyVaultPrivateLinkResourceListResult.DeserializeKeyVaultPrivateLinkResourceListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets the private link resources supported for the key vault. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// Name of the resource group that contains the key vault. - /// The name of the key vault. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListByVault(string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); - - using var message = CreateListByVaultRequest(subscriptionId, resourceGroupName, vaultName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - KeyVaultPrivateLinkResourceListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = KeyVaultPrivateLinkResourceListResult.DeserializeKeyVaultPrivateLinkResourceListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/SecretsRestOperations.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/SecretsRestOperations.cs index d469b770aae7..40723b2b7cd9 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/SecretsRestOperations.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/SecretsRestOperations.cs @@ -25,8 +25,8 @@ internal partial class SecretsRestOperations /// Initializes a new instance of SecretsRestOperations. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The application id to use for user agent. - /// server parameter. - /// Api Version. + /// Service host. + /// The API version to use for this operation. /// or is null. public SecretsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) { @@ -36,7 +36,7 @@ public SecretsRestOperations(HttpPipeline pipeline, string applicationId, Uri en _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string secretName, KeyVaultSecretCreateOrUpdateContent content) + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string secretName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -52,11 +52,11 @@ internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, return uri; } - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string vaultName, string secretName, KeyVaultSecretCreateOrUpdateContent content) + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string vaultName, string secretName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Put; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -70,83 +70,77 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); - request.Content = content0; _userAgent.Apply(message); return message; } - /// Create or update a secret in a key vault in the specified subscription. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the Resource Group to which the vault belongs. - /// Name of the vault. - /// Name of the secret. The value you provide may be copied globally for the purpose of running the service. The value provided should not include personally identifiable or sensitive information. - /// Parameters to create or update the secret. + /// Gets the specified secret. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the vault. + /// The name of the secret. /// The cancellation token to use. - /// , , , or is null. + /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string vaultName, string secretName, KeyVaultSecretCreateOrUpdateContent content, CancellationToken cancellationToken = default) + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string vaultName, string secretName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); Argument.AssertNotNullOrEmpty(secretName, nameof(secretName)); - Argument.AssertNotNull(content, nameof(content)); - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, vaultName, secretName, content); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, secretName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 201: { KeyVaultSecretData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); value = KeyVaultSecretData.DeserializeKeyVaultSecretData(document.RootElement); return Response.FromValue(value, message.Response); } + case 404: + return Response.FromValue((KeyVaultSecretData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Create or update a secret in a key vault in the specified subscription. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the Resource Group to which the vault belongs. - /// Name of the vault. - /// Name of the secret. The value you provide may be copied globally for the purpose of running the service. The value provided should not include personally identifiable or sensitive information. - /// Parameters to create or update the secret. + /// Gets the specified secret. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the vault. + /// The name of the secret. /// The cancellation token to use. - /// , , , or is null. + /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string vaultName, string secretName, KeyVaultSecretCreateOrUpdateContent content, CancellationToken cancellationToken = default) + public Response Get(string subscriptionId, string resourceGroupName, string vaultName, string secretName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); Argument.AssertNotNullOrEmpty(secretName, nameof(secretName)); - Argument.AssertNotNull(content, nameof(content)); - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, vaultName, secretName, content); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, secretName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 201: { KeyVaultSecretData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); value = KeyVaultSecretData.DeserializeKeyVaultSecretData(document.RootElement); return Response.FromValue(value, message.Response); } + case 404: + return Response.FromValue((KeyVaultSecretData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string secretName, KeyVaultSecretPatch patch) + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string secretName, KeyVaultSecretCreateOrUpdateContent content) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -162,11 +156,11 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string vaultName, string secretName, KeyVaultSecretPatch patch) + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string vaultName, string secretName, KeyVaultSecretCreateOrUpdateContent content) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Patch; + request.Method = RequestMethod.Put; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -181,31 +175,31 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG request.Uri = uri; request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); - request.Content = content; + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; _userAgent.Apply(message); return message; } - /// Update a secret in the specified subscription. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the Resource Group to which the vault belongs. - /// Name of the vault. - /// Name of the secret. - /// Parameters to patch the secret. + /// Create or update a secret in a key vault in the specified subscription. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the vault. + /// The name of the secret. + /// Parameters to create or update the secret. /// The cancellation token to use. - /// , , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string vaultName, string secretName, KeyVaultSecretPatch patch, CancellationToken cancellationToken = default) + public async Task> CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string vaultName, string secretName, KeyVaultSecretCreateOrUpdateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); Argument.AssertNotNullOrEmpty(secretName, nameof(secretName)); - Argument.AssertNotNull(patch, nameof(patch)); + Argument.AssertNotNull(content, nameof(content)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, vaultName, secretName, patch); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, vaultName, secretName, content); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -222,24 +216,24 @@ public async Task> UpdateAsync(string subscriptionI } } - /// Update a secret in the specified subscription. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the Resource Group to which the vault belongs. - /// Name of the vault. - /// Name of the secret. - /// Parameters to patch the secret. + /// Create or update a secret in a key vault in the specified subscription. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the vault. + /// The name of the secret. + /// Parameters to create or update the secret. /// The cancellation token to use. - /// , , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string vaultName, string secretName, KeyVaultSecretPatch patch, CancellationToken cancellationToken = default) + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string vaultName, string secretName, KeyVaultSecretCreateOrUpdateContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); Argument.AssertNotNullOrEmpty(secretName, nameof(secretName)); - Argument.AssertNotNull(patch, nameof(patch)); + Argument.AssertNotNull(content, nameof(content)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, vaultName, secretName, patch); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, vaultName, secretName, content); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -256,7 +250,7 @@ public Response Update(string subscriptionId, string resourc } } - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string secretName) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string secretName, KeyVaultSecretPatch patch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -272,11 +266,11 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string res return uri; } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string vaultName, string secretName) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string vaultName, string secretName, KeyVaultSecretPatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Patch; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -290,71 +284,77 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// Gets the specified secret. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the Resource Group to which the vault belongs. + /// Update a secret in the specified subscription. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the vault. /// The name of the secret. + /// Parameters to patch the secret. /// The cancellation token to use. - /// , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string vaultName, string secretName, CancellationToken cancellationToken = default) + public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string vaultName, string secretName, KeyVaultSecretPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); Argument.AssertNotNullOrEmpty(secretName, nameof(secretName)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, secretName); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, vaultName, secretName, patch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: + case 201: { KeyVaultSecretData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); value = KeyVaultSecretData.DeserializeKeyVaultSecretData(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((KeyVaultSecretData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Gets the specified secret. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the Resource Group to which the vault belongs. + /// Update a secret in the specified subscription. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the vault. /// The name of the secret. + /// Parameters to patch the secret. /// The cancellation token to use. - /// , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string vaultName, string secretName, CancellationToken cancellationToken = default) + public Response Update(string subscriptionId, string resourceGroupName, string vaultName, string secretName, KeyVaultSecretPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); Argument.AssertNotNullOrEmpty(secretName, nameof(secretName)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, secretName); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, vaultName, secretName, patch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: + case 201: { KeyVaultSecretData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); value = KeyVaultSecretData.DeserializeKeyVaultSecretData(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((KeyVaultSecretData)null, message.Response); default: throw new RequestFailedException(message.Response); } @@ -371,11 +371,11 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re uri.AppendPath("/providers/Microsoft.KeyVault/vaults/", false); uri.AppendPath(vaultName, true); uri.AppendPath("/secrets", false); + uri.AppendQuery("api-version", _apiVersion, true); if (top != null) { uri.AppendQuery("$top", top.Value, true); } - uri.AppendQuery("api-version", _apiVersion, true); return uri; } @@ -393,11 +393,11 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro uri.AppendPath("/providers/Microsoft.KeyVault/vaults/", false); uri.AppendPath(vaultName, true); uri.AppendPath("/secrets", false); + uri.AppendQuery("api-version", _apiVersion, true); if (top != null) { uri.AppendQuery("$top", top.Value, true); } - uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); @@ -405,8 +405,8 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } /// The List operation gets information about the secrets in a vault. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the Resource Group to which the vault belongs. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the vault. /// Maximum number of results to return. /// The cancellation token to use. @@ -435,8 +435,8 @@ public async Task> ListAsync(string subscriptionId, s } /// The List operation gets information about the secrets in a vault. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the Resource Group to which the vault belongs. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the vault. /// Maximum number of results to return. /// The cancellation token to use. @@ -488,8 +488,8 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// The List operation gets information about the secrets in a vault. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. /// The URL to the next page of results. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the Resource Group to which the vault belongs. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the vault. /// Maximum number of results to return. /// The cancellation token to use. @@ -520,8 +520,8 @@ public async Task> ListNextPageAsync(string nextLink, /// The List operation gets information about the secrets in a vault. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane REST service for interaction with vault secrets. /// The URL to the next page of results. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the Resource Group to which the vault belongs. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the vault. /// Maximum number of results to return. /// The cancellation token to use. diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/VaultsOperationGroupRestOperations.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/VaultsOperationGroupRestOperations.cs new file mode 100644 index 000000000000..8e47c090e6d0 --- /dev/null +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/VaultsOperationGroupRestOperations.cs @@ -0,0 +1,279 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.KeyVault.Models; + +namespace Azure.ResourceManager.KeyVault +{ + internal partial class VaultsOperationGroupRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of VaultsOperationGroupRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public VaultsOperationGroupRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-05-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListDeletedRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.KeyVault/deletedVaults", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListDeletedRequest(string subscriptionId) + { + 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("/providers/Microsoft.KeyVault/deletedVaults", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets information about the deleted vaults in a subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListDeletedAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListDeletedRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DeletedVaultListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DeletedVaultListResult.DeserializeDeletedVaultListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets information about the deleted vaults in a subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListDeleted(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListDeletedRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DeletedVaultListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DeletedVaultListResult.DeserializeDeletedVaultListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCheckKeyVaultNameAvailabilityRequestUri(string subscriptionId, KeyVaultNameAvailabilityContent content) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.KeyVault/checkNameAvailability", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCheckKeyVaultNameAvailabilityRequest(string subscriptionId, KeyVaultNameAvailabilityContent content) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.KeyVault/checkNameAvailability", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; + _userAgent.Apply(message); + return message; + } + + /// Checks that the vault name is valid and is not already in use. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the vault. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> CheckKeyVaultNameAvailabilityAsync(string subscriptionId, KeyVaultNameAvailabilityContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateCheckKeyVaultNameAvailabilityRequest(subscriptionId, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + KeyVaultNameAvailabilityResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = KeyVaultNameAvailabilityResult.DeserializeKeyVaultNameAvailabilityResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Checks that the vault name is valid and is not already in use. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the vault. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response CheckKeyVaultNameAvailability(string subscriptionId, KeyVaultNameAvailabilityContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateCheckKeyVaultNameAvailabilityRequest(subscriptionId, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + KeyVaultNameAvailabilityResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = KeyVaultNameAvailabilityResult.DeserializeKeyVaultNameAvailabilityResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListDeletedNextPageRequestUri(string nextLink, string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListDeletedNextPageRequest(string nextLink, string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets information about the deleted vaults in a subscription. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListDeletedNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListDeletedNextPageRequest(nextLink, subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DeletedVaultListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DeletedVaultListResult.DeserializeDeletedVaultListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets information about the deleted vaults in a subscription. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListDeletedNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListDeletedNextPageRequest(nextLink, subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DeletedVaultListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DeletedVaultListResult.DeserializeDeletedVaultListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/VaultsRestOperations.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/VaultsRestOperations.cs index bb9c6e099f8c..cc154d6fd01b 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/VaultsRestOperations.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/Generated/RestOperations/VaultsRestOperations.cs @@ -25,8 +25,8 @@ internal partial class VaultsRestOperations /// Initializes a new instance of VaultsRestOperations. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The application id to use for user agent. - /// server parameter. - /// Api Version. + /// Service host. + /// The API version to use for this operation. /// or is null. public VaultsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) { @@ -36,6 +36,102 @@ public VaultsRestOperations(HttpPipeline pipeline, string applicationId, Uri end _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string vaultName) + { + 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.KeyVault/vaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string vaultName) + { + 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.KeyVault/vaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the specified Azure key vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the vault. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + KeyVaultData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = KeyVaultData.DeserializeKeyVaultData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((KeyVaultData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the specified Azure key vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the vault. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + KeyVaultData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = KeyVaultData.DeserializeKeyVaultData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((KeyVaultData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string vaultName, KeyVaultCreateOrUpdateContent content) { var uri = new RawRequestUriBuilder(); @@ -75,9 +171,9 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r } /// Create or update a key vault in the specified subscription. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the Resource Group to which the server belongs. - /// Name of the vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the vault. /// Parameters to create or update the vault. /// The cancellation token to use. /// , , or is null. @@ -102,9 +198,9 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re } /// Create or update a key vault in the specified subscription. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the Resource Group to which the server belongs. - /// Name of the vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the vault. /// Parameters to create or update the vault. /// The cancellation token to use. /// , , or is null. @@ -167,9 +263,9 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG } /// Update a key vault in the specified subscription. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the Resource Group to which the server belongs. - /// Name of the vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the vault. /// Parameters to patch the vault. /// The cancellation token to use. /// , , or is null. @@ -199,9 +295,9 @@ public async Task> UpdateAsync(string subscriptionId, str } /// Update a key vault in the specified subscription. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the Resource Group to which the server belongs. - /// Name of the vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the vault. /// Parameters to patch the vault. /// The cancellation token to use. /// , , or is null. @@ -259,15 +355,14 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendPath(vaultName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; - request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); return message; } /// Deletes the specified Azure key vault. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the Resource Group to which the vault belongs. - /// The name of the vault to delete. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the vault. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -290,9 +385,9 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Deletes the specified Azure key vault. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the Resource Group to which the vault belongs. - /// The name of the vault to delete. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the vault. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -314,7 +409,7 @@ public Response Delete(string subscriptionId, string resourceGroupName, string v } } - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string vaultName) + internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName, int? top) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -322,13 +417,16 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string res uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.KeyVault/vaults/", false); - uri.AppendPath(vaultName, true); + uri.AppendPath("/providers/Microsoft.KeyVault/vaults", false); uri.AppendQuery("api-version", _apiVersion, true); + if (top != null) + { + uri.AppendQuery("$top", top.Value, true); + } return uri; } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string vaultName) + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName, int? top) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -339,72 +437,157 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.KeyVault/vaults/", false); - uri.AppendPath(vaultName, true); + uri.AppendPath("/providers/Microsoft.KeyVault/vaults", false); uri.AppendQuery("api-version", _apiVersion, true); + if (top != null) + { + uri.AppendQuery("$top", top.Value, true); + } request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); return message; } - /// Gets the specified Azure key vault. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the Resource Group to which the vault belongs. - /// The name of the vault. + /// The List operation gets information about the vaults associated with the subscription and within the specified resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Maximum number of results to return. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, int? top = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, top); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - KeyVaultData value = default; + VaultListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = KeyVaultData.DeserializeKeyVaultData(document.RootElement); + value = VaultListResult.DeserializeVaultListResult(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((KeyVaultData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Gets the specified Azure key vault. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the Resource Group to which the vault belongs. - /// The name of the vault. + /// The List operation gets information about the vaults associated with the subscription and within the specified resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Maximum number of results to return. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, int? top = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName); + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, top); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - KeyVaultData value = default; + VaultListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = KeyVaultData.DeserializeKeyVaultData(document.RootElement); + value = VaultListResult.DeserializeVaultListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId, int? top) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.KeyVault/vaults", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (top != null) + { + uri.AppendQuery("$top", top.Value, true); + } + return uri; + } + + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId, int? top) + { + 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("/providers/Microsoft.KeyVault/vaults", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (top != null) + { + uri.AppendQuery("$top", top.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// The List operation gets information about the vaults associated with the subscription. + /// The ID of the target subscription. The value must be an UUID. + /// Maximum number of results to return. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, int? top = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId, top); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + VaultListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = VaultListResult.DeserializeVaultListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// The List operation gets information about the vaults associated with the subscription. + /// The ID of the target subscription. The value must be an UUID. + /// Maximum number of results to return. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, int? top = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId, top); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + VaultListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = VaultListResult.DeserializeVaultListResult(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((KeyVaultData)null, message.Response); default: throw new RequestFailedException(message.Response); } @@ -453,8 +636,8 @@ internal HttpMessage CreateUpdateAccessPolicyRequest(string subscriptionId, stri } /// Update access policies in a key vault in the specified subscription. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the Resource Group to which the vault belongs. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// Name of the vault. /// Name of the operation. /// Access policy to merge into the vault. @@ -486,8 +669,8 @@ public async Task> UpdateAccessPolicyAs } /// Update access policies in a key vault in the specified subscription. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the Resource Group to which the vault belongs. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// Name of the vault. /// Name of the operation. /// Access policy to merge into the vault. @@ -518,7 +701,7 @@ public Response UpdateAccessPolicy(string subscr } } - internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName, int? top) + internal RequestUriBuilder CreateGetPrivateLinkResourcesRequestUri(string subscriptionId, string resourceGroupName, string vaultName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -526,16 +709,14 @@ internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscripti uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.KeyVault/vaults", false); - if (top != null) - { - uri.AppendQuery("$top", top.Value, true); - } + uri.AppendPath("/providers/Microsoft.KeyVault/vaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/privateLinkResources", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName, int? top) + internal HttpMessage CreateGetPrivateLinkResourcesRequest(string subscriptionId, string resourceGroupName, string vaultName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -546,267 +727,9 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.KeyVault/vaults", false); - if (top != null) - { - uri.AppendQuery("$top", top.Value, true); - } - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// The List operation gets information about the vaults associated with the subscription and within the specified resource group. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the Resource Group to which the vault belongs. - /// Maximum number of results to return. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, int? top = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, top); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - VaultListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = VaultListResult.DeserializeVaultListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// The List operation gets information about the vaults associated with the subscription and within the specified resource group. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the Resource Group to which the vault belongs. - /// Maximum number of results to return. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, int? top = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, top); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - VaultListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = VaultListResult.DeserializeVaultListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId, int? top) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.KeyVault/vaults", false); - if (top != null) - { - uri.AppendQuery("$top", top.Value, true); - } - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId, int? top) - { - 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("/providers/Microsoft.KeyVault/vaults", false); - if (top != null) - { - uri.AppendQuery("$top", top.Value, true); - } - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// The List operation gets information about the vaults associated with the subscription. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// Maximum number of results to return. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionAsync(string subscriptionId, int? top = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionRequest(subscriptionId, top); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - VaultListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = VaultListResult.DeserializeVaultListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// The List operation gets information about the vaults associated with the subscription. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// Maximum number of results to return. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscription(string subscriptionId, int? top = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionRequest(subscriptionId, top); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - VaultListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = VaultListResult.DeserializeVaultListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListDeletedRequestUri(string subscriptionId) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.KeyVault/deletedVaults", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListDeletedRequest(string subscriptionId) - { - 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("/providers/Microsoft.KeyVault/deletedVaults", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets information about the deleted vaults in a subscription. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListDeletedAsync(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListDeletedRequest(subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DeletedVaultListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DeletedVaultListResult.DeserializeDeletedVaultListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets information about the deleted vaults in a subscription. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response ListDeleted(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListDeletedRequest(subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DeletedVaultListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DeletedVaultListResult.DeserializeDeletedVaultListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateGetDeletedRequestUri(string subscriptionId, AzureLocation location, string vaultName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.KeyVault/locations/", false); - uri.AppendPath(location, true); - uri.AppendPath("/deletedVaults/", false); - uri.AppendPath(vaultName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateGetDeletedRequest(string subscriptionId, AzureLocation location, string vaultName) - { - 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("/providers/Microsoft.KeyVault/locations/", false); - uri.AppendPath(location, true); - uri.AppendPath("/deletedVaults/", false); + uri.AppendPath("/providers/Microsoft.KeyVault/vaults/", false); uri.AppendPath(vaultName, true); + uri.AppendPath("/privateLinkResources", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -814,229 +737,57 @@ internal HttpMessage CreateGetDeletedRequest(string subscriptionId, AzureLocatio return message; } - /// Gets the deleted Azure key vault. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The location of the deleted vault. + /// Gets the private link resources supported for the key vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the vault. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> GetDeletedAsync(string subscriptionId, AzureLocation location, string vaultName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetPrivateLinkResourcesAsync(string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); - using var message = CreateGetDeletedRequest(subscriptionId, location, vaultName); + using var message = CreateGetPrivateLinkResourcesRequest(subscriptionId, resourceGroupName, vaultName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - DeletedKeyVaultData value = default; + KeyVaultPrivateLinkResourceListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DeletedKeyVaultData.DeserializeDeletedKeyVaultData(document.RootElement); + value = KeyVaultPrivateLinkResourceListResult.DeserializeKeyVaultPrivateLinkResourceListResult(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((DeletedKeyVaultData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Gets the deleted Azure key vault. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The location of the deleted vault. + /// Gets the private link resources supported for the key vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the vault. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response GetDeleted(string subscriptionId, AzureLocation location, string vaultName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response GetPrivateLinkResources(string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); - using var message = CreateGetDeletedRequest(subscriptionId, location, vaultName); + using var message = CreateGetPrivateLinkResourcesRequest(subscriptionId, resourceGroupName, vaultName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - DeletedKeyVaultData value = default; + KeyVaultPrivateLinkResourceListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DeletedKeyVaultData.DeserializeDeletedKeyVaultData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((DeletedKeyVaultData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreatePurgeDeletedRequestUri(string subscriptionId, AzureLocation location, string vaultName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.KeyVault/locations/", false); - uri.AppendPath(location, true); - uri.AppendPath("/deletedVaults/", false); - uri.AppendPath(vaultName, true); - uri.AppendPath("/purge", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreatePurgeDeletedRequest(string subscriptionId, AzureLocation location, string vaultName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.KeyVault/locations/", false); - uri.AppendPath(location, true); - uri.AppendPath("/deletedVaults/", false); - uri.AppendPath(vaultName, true); - uri.AppendPath("/purge", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Permanently deletes the specified vault. aka Purges the deleted Azure key vault. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The location of the soft-deleted vault. - /// The name of the soft-deleted vault. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task PurgeDeletedAsync(string subscriptionId, AzureLocation location, string vaultName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); - - using var message = CreatePurgeDeletedRequest(subscriptionId, location, vaultName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Permanently deletes the specified vault. aka Purges the deleted Azure key vault. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The location of the soft-deleted vault. - /// The name of the soft-deleted vault. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response PurgeDeleted(string subscriptionId, AzureLocation location, string vaultName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); - - using var message = CreatePurgeDeletedRequest(subscriptionId, location, vaultName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateCheckNameAvailabilityRequestUri(string subscriptionId, KeyVaultNameAvailabilityContent content) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.KeyVault/checkNameAvailability", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateCheckNameAvailabilityRequest(string subscriptionId, KeyVaultNameAvailabilityContent content) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.KeyVault/checkNameAvailability", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); - request.Content = content0; - _userAgent.Apply(message); - return message; - } - - /// Checks that the vault name is valid and is not already in use. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the vault. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> CheckNameAvailabilityAsync(string subscriptionId, KeyVaultNameAvailabilityContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateCheckNameAvailabilityRequest(subscriptionId, content); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - KeyVaultNameAvailabilityResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = KeyVaultNameAvailabilityResult.DeserializeKeyVaultNameAvailabilityResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Checks that the vault name is valid and is not already in use. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the vault. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response CheckNameAvailability(string subscriptionId, KeyVaultNameAvailabilityContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateCheckNameAvailabilityRequest(subscriptionId, content); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - KeyVaultNameAvailabilityResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = KeyVaultNameAvailabilityResult.DeserializeKeyVaultNameAvailabilityResult(document.RootElement); + value = KeyVaultPrivateLinkResourceListResult.DeserializeKeyVaultPrivateLinkResourceListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -1068,8 +819,8 @@ internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, s /// The List operation gets information about the vaults associated with the subscription and within the specified resource group. /// The URL to the next page of results. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the Resource Group to which the vault belongs. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// Maximum number of results to return. /// The cancellation token to use. /// , or is null. @@ -1098,8 +849,8 @@ public async Task> ListByResourceGroupNextPageAsync(st /// The List operation gets information about the vaults associated with the subscription and within the specified resource group. /// The URL to the next page of results. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The name of the Resource Group to which the vault belongs. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// Maximum number of results to return. /// The cancellation token to use. /// , or is null. @@ -1150,7 +901,7 @@ internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, st /// The List operation gets information about the vaults associated with the subscription. /// The URL to the next page of results. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// The ID of the target subscription. The value must be an UUID. /// Maximum number of results to return. /// The cancellation token to use. /// or is null. @@ -1178,7 +929,7 @@ public async Task> ListBySubscriptionNextPageAsync(str /// The List operation gets information about the vaults associated with the subscription. /// The URL to the next page of results. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// The ID of the target subscription. The value must be an UUID. /// Maximum number of results to return. /// The cancellation token to use. /// or is null. @@ -1203,81 +954,5 @@ public Response ListBySubscriptionNextPage(string nextLink, str throw new RequestFailedException(message.Response); } } - - internal RequestUriBuilder CreateListDeletedNextPageRequestUri(string nextLink, string subscriptionId) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateListDeletedNextPageRequest(string nextLink, string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets information about the deleted vaults in a subscription. - /// The URL to the next page of results. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListDeletedNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListDeletedNextPageRequest(nextLink, subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DeletedVaultListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DeletedVaultListResult.DeserializeDeletedVaultListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets information about the deleted vaults in a subscription. - /// The URL to the next page of results. - /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListDeletedNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListDeletedNextPageRequest(nextLink, subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DeletedVaultListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DeletedVaultListResult.DeserializeDeletedVaultListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } } } diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/autorest.md b/sdk/keyvault/Azure.ResourceManager.KeyVault/src/autorest.md deleted file mode 100644 index 76ecfd09857e..000000000000 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/src/autorest.md +++ /dev/null @@ -1,180 +0,0 @@ -# Generated code configuration - -Run `dotnet build /t:GenerateCode` to generate code. - -``` yaml -azure-arm: true -csharp: true -library-name: KeyVault -namespace: Azure.ResourceManager.KeyVault -require: https://github.com/Azure/azure-rest-api-specs/blob/402675202904b97229b067bf3b03ac8519de5125/specification/keyvault/resource-manager/readme.md -#tag: package-2023-07 -output-folder: $(this-folder)/Generated -clear-output-folder: true -sample-gen: - output-folder: $(this-folder)/../tests/Generated - clear-output-folder: true -skip-csproj: true -modelerfour: - flatten-payloads: false -use-model-reader-writer: true -enable-bicep-serialization: true - -override-operation-name: - Vaults_CheckNameAvailability: CheckKeyVaultNameAvailability - MHSMPrivateLinkResources_ListByMhsmResource: GetManagedHsmPrivateLinkResources - ManagedHsms_CheckManagedHsmNameAvailability: CheckManagedHsmNameAvailability -list-exception: -- /subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/locations/{location}/deletedVaults/{vaultName} -- /subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/locations/{location}/deletedManagedHSMs/{name} - -format-by-name-rules: - 'tenantId': 'uuid' - 'ETag': 'etag' - 'location': 'azure-location' - '*Uri': 'Uri' - '*Uris': 'Uri' - -no-property-type-replacement: -- ManagedHsmVirtualNetworkRule - -acronym-mapping: - CPU: Cpu - CPUs: Cpus - Os: OS - Ip: IP - Ips: IPs|ips - ID: Id - IDs: Ids - VM: Vm - VMs: Vms - Vmos: VmOS - VMScaleSet: VmScaleSet - DNS: Dns - VPN: Vpn - NAT: Nat - WAN: Wan - Ipv4: IPv4|ipv4 - Ipv6: IPv6|ipv6 - Ipsec: IPsec|ipsec - SSO: Sso - URI: Uri - Etag: ETag|etag - Managecontacts: ManageContacts - Getissuers: GetIssuers - Listissuers: ListIssuers - Setissuers: SetIssuers - Deleteissuers: DeleteIssuers - Manageissuers: ManageIssuers - Regeneratekey: RegenerateKey - Deletesas: DeleteSas - Getsas: GetSas - Listsas: ListSas - Setsas: SetSas - Mhsm: ManagedHsm - -rename-mapping: - CheckMhsmNameAvailabilityResult: ManagedHsmNameAvailabilityResult - CheckMhsmNameAvailabilityResult.nameAvailable : IsNameAvailable - CheckMhsmNameAvailabilityParameters: MhsmNameAvailabilityParameters - Reason: ManagedHsmNameUnavailableReason - ActivationStatus: ManagedHSMSecurityDomainActivationStatus - Attributes: SecretBaseAttributes - GeoReplicationRegionProvisioningState: ManagedHsmGeoReplicatedRegionProvisioningState - ManagedHsmPrivateEndpointConnectionItemData.id: -|arm-id - Secret: KeyVaultSecret - MhsmPrivateEndpointConnectionItem: ManagedHsmPrivateEndpointConnectionItemData - MhsmPrivateEndpointConnectionItem.id: -|arm-id - MhsmPrivateLinkResource: ManagedHsmPrivateLinkResourceData - ActionsRequired: ManagedHsmActionsRequiredMessage - NetworkRuleAction: ManagedHsmNetworkRuleAction - NetworkRuleBypassOptions: ManagedHsmNetworkRuleBypassOption - MhsmVirtualNetworkRule.id: SubnetId|arm-id - PublicNetworkAccess: ManagedHsmPublicNetworkAccess - CreateMode: ManagedHsmCreateMode - ManagedHsmProperties.networkAcls: NetworkRuleSet - MhsmipRule: ManagedHsmIPRule - DeletedManagedHsmProperties.mhsmId: -|arm-id - DeletedVaultProperties: DeletedKeyVaultProperties - DeletedVault: DeletedKeyVault - MhsmipRule.value: AddressRange - PrivateLinkResource: KeyVaultPrivateLinkResourceData - AccessPolicyEntry: KeyVaultAccessPolicy - NetworkRuleSet: KeyVaultNetworkRuleSet - VaultCheckNameAvailabilityParameters: KeyVaultNameAvailabilityContent - VaultAccessPolicyProperties: KeyVaultAccessPolicyProperties - PrivateEndpointConnectionItem: KeyVaultPrivateEndpointConnectionItemData - VaultCheckNameAvailabilityParameters.type: -|resource-type - VaultPatchProperties: KeyVaultPatchProperties - VaultAccessPolicyParameters: KeyVaultAccessPolicyParameters - VaultPatchProperties.networkAcls: NetworkRuleSet - VaultProperties: KeyVaultProperties - VaultProperties.networkAcls: NetworkRuleSet - Vault: KeyVault - VirtualNetworkRule: KeyVaultVirtualNetworkRule - DeletedVaultProperties.vaultId: -|arm-id - Permissions: IdentityAccessPermissions - IPRule: KeyVaultIPRule - KeyPermissions: IdentityAccessKeyPermission - SecretPermissions: IdentityAccessSecretPermission - StoragePermissions: IdentityAccessStoragePermission - CertificatePermissions: IdentityAccessCertificatePermission - IPRule.value: AddressRange - CheckNameAvailabilityResult: KeyVaultNameAvailabilityResult - Trigger: KeyRotationTrigger - Action: KeyRotationAction - Key: KeyVaultKey - Key.properties.kty: keyType - KeyAttributes.enabled: isEnabled - KeyAttributes.exportable: canExported - KeyProperties.kty: keyType - ManagedHsmKeyAttributes.enabled: isEnabled - ManagedHsmKeyAttributes.exportable: canExported - ManagedHsmKeyProperties.kty: keyType - -prompted-enum-values: Default - -directive: - - from: swagger-document - where: $.paths - transform: delete $['/subscriptions/{subscriptionId}/resources'] - - from: swagger-document - where: $.definitions.Sku.properties.family - transform: delete $['x-ms-client-default'] - - from: swagger-document - where: $.definitions.ManagedHsmSku.properties.family - transform: delete $['x-ms-client-default'] - - from: managedHsm.json - where: $.definitions - transform: > # these directives are here on purpose because we do not want them to merge with others otherwise we get breaking changes - $.MHSMPrivateEndpointConnectionProvisioningState['x-ms-enum']['name'] = 'ManagedHsmPrivateEndpointConnectionProvisioningState'; - $.MHSMPrivateEndpointServiceConnectionStatus['x-ms-enum']['name'] = 'ManagedHsmPrivateEndpointServiceConnectionStatus'; - $.ManagedHsmProperties.properties.provisioningState['x-ms-enum']['name'] = 'ManagedHsmProvisioningState'; - - from: keyvault.json - where: $.definitions - transform: > - $.VaultCheckNameAvailabilityParameters.properties.type['x-ms-constant'] = true; - $.NetworkRuleSet.properties.bypass['x-ms-enum']['name'] = 'KeyVaultNetworkRuleBypassOption'; - $.NetworkRuleSet.properties.defaultAction['x-ms-enum']['name'] = 'KeyVaultNetworkRuleAction'; - $.PrivateLinkServiceConnectionState.properties.actionsRequired['x-ms-enum']['name'] = 'KeyVaultActionsRequiredMessage'; - $.VaultPatchProperties.properties.createMode['x-ms-enum']['name'] = 'KeyVaultPatchMode'; - $.VaultProperties.properties.createMode['x-ms-enum']['name'] = 'KeyVaultCreateMode'; - $.VaultProperties.properties.provisioningState['x-ms-enum']['name'] = 'KeyVaultProvisioningState'; - $.Vault['x-csharp-usage'] = 'model,input,output'; - $.CheckNameAvailabilityResult.properties.reason['x-ms-enum']['name'] = 'KeyVaultNameUnavailableReason'; - # Remove keysManagedHsm.json and keys.json since these 2 are part of data plane - - from: keysManagedHsm.json - where: $.paths - transform: > - for (var path in $) - { - delete $[path]; - } - - from: keys.json - where: $.paths - transform: > - for (var path in $) - { - delete $[path]; - } -``` diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/tests/Generated/Samples/Sample_DeletedKeyVaultCollection.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/tests/Generated/Samples/Sample_DeletedKeyVaultCollection.cs deleted file mode 100644 index f1c607b05cd9..000000000000 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/tests/Generated/Samples/Sample_DeletedKeyVaultCollection.cs +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.Resources; -using NUnit.Framework; - -namespace Azure.ResourceManager.KeyVault.Samples -{ - public partial class Sample_DeletedKeyVaultCollection - { - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Get_RetrieveADeletedVault() - { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2025-05-01/examples/getDeletedVault.json - // this example is just showing the usage of "Vaults_GetDeleted" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this SubscriptionResource created on azure - // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); - SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); - - // get the collection of this DeletedKeyVaultResource - DeletedKeyVaultCollection collection = subscriptionResource.GetDeletedKeyVaults(); - - // invoke the operation - AzureLocation location = new AzureLocation("westus"); - string vaultName = "sample-vault"; - DeletedKeyVaultResource result = await collection.GetAsync(location, vaultName); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - DeletedKeyVaultData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Exists_RetrieveADeletedVault() - { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2025-05-01/examples/getDeletedVault.json - // this example is just showing the usage of "Vaults_GetDeleted" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this SubscriptionResource created on azure - // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); - SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); - - // get the collection of this DeletedKeyVaultResource - DeletedKeyVaultCollection collection = subscriptionResource.GetDeletedKeyVaults(); - - // invoke the operation - AzureLocation location = new AzureLocation("westus"); - string vaultName = "sample-vault"; - bool result = await collection.ExistsAsync(location, vaultName); - - Console.WriteLine($"Succeeded: {result}"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task GetIfExists_RetrieveADeletedVault() - { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2025-05-01/examples/getDeletedVault.json - // this example is just showing the usage of "Vaults_GetDeleted" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this SubscriptionResource created on azure - // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); - SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); - - // get the collection of this DeletedKeyVaultResource - DeletedKeyVaultCollection collection = subscriptionResource.GetDeletedKeyVaults(); - - // invoke the operation - AzureLocation location = new AzureLocation("westus"); - string vaultName = "sample-vault"; - NullableResponse response = await collection.GetIfExistsAsync(location, vaultName); - DeletedKeyVaultResource result = response.HasValue ? response.Value : null; - - if (result == null) - { - Console.WriteLine("Succeeded with null as result"); - } - else - { - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - DeletedKeyVaultData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } - } -} diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/tests/Generated/Samples/Sample_DeletedKeyVaultResource.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/tests/Generated/Samples/Sample_DeletedKeyVaultResource.cs deleted file mode 100644 index f25ff5642c9b..000000000000 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/tests/Generated/Samples/Sample_DeletedKeyVaultResource.cs +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using NUnit.Framework; - -namespace Azure.ResourceManager.KeyVault.Samples -{ - public partial class Sample_DeletedKeyVaultResource - { - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Get_RetrieveADeletedVault() - { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2025-05-01/examples/getDeletedVault.json - // this example is just showing the usage of "Vaults_GetDeleted" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this DeletedKeyVaultResource created on azure - // for more information of creating DeletedKeyVaultResource, please refer to the document of DeletedKeyVaultResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - AzureLocation location = new AzureLocation("westus"); - string vaultName = "sample-vault"; - ResourceIdentifier deletedKeyVaultResourceId = DeletedKeyVaultResource.CreateResourceIdentifier(subscriptionId, location, vaultName); - DeletedKeyVaultResource deletedKeyVault = client.GetDeletedKeyVaultResource(deletedKeyVaultResourceId); - - // invoke the operation - DeletedKeyVaultResource result = await deletedKeyVault.GetAsync(); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - DeletedKeyVaultData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task PurgeDeleted_PurgeADeletedVault() - { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2025-05-01/examples/purgeDeletedVault.json - // this example is just showing the usage of "Vaults_PurgeDeleted" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this DeletedKeyVaultResource created on azure - // for more information of creating DeletedKeyVaultResource, please refer to the document of DeletedKeyVaultResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - AzureLocation location = new AzureLocation("westus"); - string vaultName = "sample-vault"; - ResourceIdentifier deletedKeyVaultResourceId = DeletedKeyVaultResource.CreateResourceIdentifier(subscriptionId, location, vaultName); - DeletedKeyVaultResource deletedKeyVault = client.GetDeletedKeyVaultResource(deletedKeyVaultResourceId); - - // invoke the operation - await deletedKeyVault.PurgeDeletedAsync(WaitUntil.Completed); - - Console.WriteLine("Succeeded"); - } - } -} diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/tests/Generated/Samples/Sample_DeletedManagedHsmCollection.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/tests/Generated/Samples/Sample_DeletedManagedHsmCollection.cs deleted file mode 100644 index 055fe20f1e2e..000000000000 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/tests/Generated/Samples/Sample_DeletedManagedHsmCollection.cs +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.Resources; -using NUnit.Framework; - -namespace Azure.ResourceManager.KeyVault.Samples -{ - public partial class Sample_DeletedManagedHsmCollection - { - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Get_RetrieveADeletedManagedHSM() - { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2025-05-01/examples/DeletedManagedHsm_Get.json - // this example is just showing the usage of "ManagedHsms_GetDeleted" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this SubscriptionResource created on azure - // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); - SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); - - // get the collection of this DeletedManagedHsmResource - DeletedManagedHsmCollection collection = subscriptionResource.GetDeletedManagedHsms(); - - // invoke the operation - AzureLocation location = new AzureLocation("westus"); - string name = "hsm1"; - DeletedManagedHsmResource result = await collection.GetAsync(location, name); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - DeletedManagedHsmData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Exists_RetrieveADeletedManagedHSM() - { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2025-05-01/examples/DeletedManagedHsm_Get.json - // this example is just showing the usage of "ManagedHsms_GetDeleted" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this SubscriptionResource created on azure - // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); - SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); - - // get the collection of this DeletedManagedHsmResource - DeletedManagedHsmCollection collection = subscriptionResource.GetDeletedManagedHsms(); - - // invoke the operation - AzureLocation location = new AzureLocation("westus"); - string name = "hsm1"; - bool result = await collection.ExistsAsync(location, name); - - Console.WriteLine($"Succeeded: {result}"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task GetIfExists_RetrieveADeletedManagedHSM() - { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2025-05-01/examples/DeletedManagedHsm_Get.json - // this example is just showing the usage of "ManagedHsms_GetDeleted" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this SubscriptionResource created on azure - // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); - SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); - - // get the collection of this DeletedManagedHsmResource - DeletedManagedHsmCollection collection = subscriptionResource.GetDeletedManagedHsms(); - - // invoke the operation - AzureLocation location = new AzureLocation("westus"); - string name = "hsm1"; - NullableResponse response = await collection.GetIfExistsAsync(location, name); - DeletedManagedHsmResource result = response.HasValue ? response.Value : null; - - if (result == null) - { - Console.WriteLine("Succeeded with null as result"); - } - else - { - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - DeletedManagedHsmData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } - } -} diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/tests/Generated/Samples/Sample_DeletedManagedHsmResource.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/tests/Generated/Samples/Sample_DeletedManagedHsmResource.cs deleted file mode 100644 index 6d633a64a9ed..000000000000 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/tests/Generated/Samples/Sample_DeletedManagedHsmResource.cs +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using NUnit.Framework; - -namespace Azure.ResourceManager.KeyVault.Samples -{ - public partial class Sample_DeletedManagedHsmResource - { - [Test] - [Ignore("Only validating compilation of examples")] - public async Task Get_RetrieveADeletedManagedHSM() - { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2025-05-01/examples/DeletedManagedHsm_Get.json - // this example is just showing the usage of "ManagedHsms_GetDeleted" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this DeletedManagedHsmResource created on azure - // for more information of creating DeletedManagedHsmResource, please refer to the document of DeletedManagedHsmResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - AzureLocation location = new AzureLocation("westus"); - string name = "hsm1"; - ResourceIdentifier deletedManagedHsmResourceId = DeletedManagedHsmResource.CreateResourceIdentifier(subscriptionId, location, name); - DeletedManagedHsmResource deletedManagedHsm = client.GetDeletedManagedHsmResource(deletedManagedHsmResourceId); - - // invoke the operation - DeletedManagedHsmResource result = await deletedManagedHsm.GetAsync(); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - DeletedManagedHsmData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task PurgeDeleted_PurgeAManagedHSMPool() - { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2025-05-01/examples/DeletedManagedHsm_Purge.json - // this example is just showing the usage of "ManagedHsms_PurgeDeleted" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this DeletedManagedHsmResource created on azure - // for more information of creating DeletedManagedHsmResource, please refer to the document of DeletedManagedHsmResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - AzureLocation location = new AzureLocation("westus"); - string name = "hsm1"; - ResourceIdentifier deletedManagedHsmResourceId = DeletedManagedHsmResource.CreateResourceIdentifier(subscriptionId, location, name); - DeletedManagedHsmResource deletedManagedHsm = client.GetDeletedManagedHsmResource(deletedManagedHsmResourceId); - - // invoke the operation - await deletedManagedHsm.PurgeDeletedAsync(WaitUntil.Completed); - - Console.WriteLine("Succeeded"); - } - } -} diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/tests/Generated/Samples/Sample_KeyVaultCollection.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/tests/Generated/Samples/Sample_KeyVaultCollection.cs index 0633ba633911..65f226a019e9 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/tests/Generated/Samples/Sample_KeyVaultCollection.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/tests/Generated/Samples/Sample_KeyVaultCollection.cs @@ -21,8 +21,8 @@ public partial class Sample_KeyVaultCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateANewVaultOrUpdateAnExistingVault() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2025-05-01/examples/createVault.json - // this example is just showing the usage of "Vaults_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-05-01/createVault.json + // this example is just showing the usage of "Vault_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -68,8 +68,8 @@ public async Task CreateOrUpdate_CreateANewVaultOrUpdateAnExistingVault() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateOrUpdateAVaultWithNetworkAcls() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2025-05-01/examples/createVaultWithNetworkAcls.json - // this example is just showing the usage of "Vaults_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-05-01/createVaultWithNetworkAcls.json + // this example is just showing the usage of "Vault_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -115,8 +115,8 @@ public async Task CreateOrUpdate_CreateOrUpdateAVaultWithNetworkAcls() [Ignore("Only validating compilation of examples")] public async Task Get_RetrieveAVault() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2025-05-01/examples/getVault.json - // this example is just showing the usage of "Vaults_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-05-01/getVault.json + // this example is just showing the usage of "Vault_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -148,8 +148,8 @@ public async Task Get_RetrieveAVault() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListVaultsInTheSpecifiedResourceGroup() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2025-05-01/examples/listVaultByResourceGroup.json - // this example is just showing the usage of "Vaults_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-05-01/listVaultByResourceGroup.json + // this example is just showing the usage of "Vault_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -167,8 +167,7 @@ public async Task GetAll_ListVaultsInTheSpecifiedResourceGroup() KeyVaultCollection collection = resourceGroupResource.GetKeyVaults(); // invoke the operation and iterate over the result - int? top = 1; - await foreach (KeyVaultResource item in collection.GetAllAsync(top: top)) + await foreach (KeyVaultResource item in collection.GetAllAsync()) { // the variable item is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance @@ -184,8 +183,8 @@ public async Task GetAll_ListVaultsInTheSpecifiedResourceGroup() [Ignore("Only validating compilation of examples")] public async Task Exists_RetrieveAVault() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2025-05-01/examples/getVault.json - // this example is just showing the usage of "Vaults_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-05-01/getVault.json + // this example is just showing the usage of "Vault_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -213,8 +212,8 @@ public async Task Exists_RetrieveAVault() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_RetrieveAVault() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2025-05-01/examples/getVault.json - // this example is just showing the usage of "Vaults_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-05-01/getVault.json + // this example is just showing the usage of "Vault_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/tests/Generated/Samples/Sample_KeyVaultPrivateEndpointConnectionCollection.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/tests/Generated/Samples/Sample_KeyVaultPrivateEndpointConnectionCollection.cs index 14369d860be2..4a4a2c38a0ab 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/tests/Generated/Samples/Sample_KeyVaultPrivateEndpointConnectionCollection.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/tests/Generated/Samples/Sample_KeyVaultPrivateEndpointConnectionCollection.cs @@ -9,7 +9,6 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Identity; -using Azure.ResourceManager.KeyVault.Models; using NUnit.Framework; namespace Azure.ResourceManager.KeyVault.Samples @@ -20,8 +19,8 @@ public partial class Sample_KeyVaultPrivateEndpointConnectionCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_KeyVaultPutPrivateEndpointConnection() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2025-05-01/examples/putPrivateEndpointConnection.json - // this example is just showing the usage of "PrivateEndpointConnections_Put" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-05-01/putPrivateEndpointConnection.json + // this example is just showing the usage of "PrivateEndpointConnection_Put" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -44,11 +43,6 @@ public async Task CreateOrUpdate_KeyVaultPutPrivateEndpointConnection() KeyVaultPrivateEndpointConnectionData data = new KeyVaultPrivateEndpointConnectionData { ETag = new ETag(""), - ConnectionState = new KeyVaultPrivateLinkServiceConnectionState - { - Status = KeyVaultPrivateEndpointServiceConnectionStatus.Approved, - Description = "My name is Joe and I'm approving this.", - }, }; ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, privateEndpointConnectionName, data); KeyVaultPrivateEndpointConnectionResource result = lro.Value; @@ -64,8 +58,8 @@ public async Task CreateOrUpdate_KeyVaultPutPrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task Get_KeyVaultGetPrivateEndpointConnection() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2025-05-01/examples/getPrivateEndpointConnection.json - // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-05-01/getPrivateEndpointConnection.json + // this example is just showing the usage of "PrivateEndpointConnection_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -98,8 +92,8 @@ public async Task Get_KeyVaultGetPrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task GetAll_KeyVaultListPrivateEndpointConnection() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2025-05-01/examples/listPrivateEndpointConnection.json - // this example is just showing the usage of "PrivateEndpointConnections_ListByResource" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-05-01/listPrivateEndpointConnection.json + // this example is just showing the usage of "PrivateEndpointConnection_ListByResource" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -134,8 +128,8 @@ public async Task GetAll_KeyVaultListPrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task Exists_KeyVaultGetPrivateEndpointConnection() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2025-05-01/examples/getPrivateEndpointConnection.json - // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-05-01/getPrivateEndpointConnection.json + // this example is just showing the usage of "PrivateEndpointConnection_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -164,8 +158,8 @@ public async Task Exists_KeyVaultGetPrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_KeyVaultGetPrivateEndpointConnection() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2025-05-01/examples/getPrivateEndpointConnection.json - // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-05-01/getPrivateEndpointConnection.json + // this example is just showing the usage of "PrivateEndpointConnection_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/tests/Generated/Samples/Sample_KeyVaultPrivateEndpointConnectionResource.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/tests/Generated/Samples/Sample_KeyVaultPrivateEndpointConnectionResource.cs index 6afd4f202893..cc8dd5392786 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/tests/Generated/Samples/Sample_KeyVaultPrivateEndpointConnectionResource.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/tests/Generated/Samples/Sample_KeyVaultPrivateEndpointConnectionResource.cs @@ -9,7 +9,6 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Identity; -using Azure.ResourceManager.KeyVault.Models; using NUnit.Framework; namespace Azure.ResourceManager.KeyVault.Samples @@ -20,8 +19,8 @@ public partial class Sample_KeyVaultPrivateEndpointConnectionResource [Ignore("Only validating compilation of examples")] public async Task Get_KeyVaultGetPrivateEndpointConnection() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2025-05-01/examples/getPrivateEndpointConnection.json - // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-05-01/getPrivateEndpointConnection.json + // this example is just showing the usage of "PrivateEndpointConnection_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -51,8 +50,8 @@ public async Task Get_KeyVaultGetPrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task Delete_KeyVaultDeletePrivateEndpointConnection() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2025-05-01/examples/deletePrivateEndpointConnection.json - // this example is just showing the usage of "PrivateEndpointConnections_Delete" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-05-01/deletePrivateEndpointConnection.json + // this example is just showing the usage of "PrivateEndpointConnection_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -83,8 +82,8 @@ public async Task Delete_KeyVaultDeletePrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task Update_KeyVaultPutPrivateEndpointConnection() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2025-05-01/examples/putPrivateEndpointConnection.json - // this example is just showing the usage of "PrivateEndpointConnections_Put" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-05-01/putPrivateEndpointConnection.json + // this example is just showing the usage of "PrivateEndpointConnection_Put" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -104,11 +103,6 @@ public async Task Update_KeyVaultPutPrivateEndpointConnection() KeyVaultPrivateEndpointConnectionData data = new KeyVaultPrivateEndpointConnectionData { ETag = new ETag(""), - ConnectionState = new KeyVaultPrivateLinkServiceConnectionState - { - Status = KeyVaultPrivateEndpointServiceConnectionStatus.Approved, - Description = "My name is Joe and I'm approving this.", - }, }; ArmOperation lro = await keyVaultPrivateEndpointConnection.UpdateAsync(WaitUntil.Completed, data); KeyVaultPrivateEndpointConnectionResource result = lro.Value; diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/tests/Generated/Samples/Sample_KeyVaultResource.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/tests/Generated/Samples/Sample_KeyVaultResource.cs index dd145ab4fc93..3064e20eb46a 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/tests/Generated/Samples/Sample_KeyVaultResource.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/tests/Generated/Samples/Sample_KeyVaultResource.cs @@ -20,8 +20,8 @@ public partial class Sample_KeyVaultResource [Ignore("Only validating compilation of examples")] public async Task Get_RetrieveAVault() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2025-05-01/examples/getVault.json - // this example is just showing the usage of "Vaults_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-05-01/getVault.json + // this example is just showing the usage of "Vault_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -50,8 +50,8 @@ public async Task Get_RetrieveAVault() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteAVault() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2025-05-01/examples/deleteVault.json - // this example is just showing the usage of "Vaults_Delete" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-05-01/deleteVault.json + // this example is just showing the usage of "Vault_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -76,8 +76,8 @@ public async Task Delete_DeleteAVault() [Ignore("Only validating compilation of examples")] public async Task Update_UpdateAnExistingVault() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2025-05-01/examples/updateVault.json - // this example is just showing the usage of "Vaults_Update" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-05-01/updateVault.json + // this example is just showing the usage of "Vault_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -124,7 +124,7 @@ public async Task Update_UpdateAnExistingVault() [Ignore("Only validating compilation of examples")] public async Task UpdateAccessPolicy_AddAnAccessPolicyOrUpdateAnAccessPolicyWithNewPermissions() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2025-05-01/examples/updateAccessPoliciesAdd.json + // Generated from example definition: 2025-05-01/updateAccessPoliciesAdd.json // this example is just showing the usage of "Vaults_UpdateAccessPolicy" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -155,34 +155,5 @@ public async Task UpdateAccessPolicy_AddAnAccessPolicyOrUpdateAnAccessPolicyWith Console.WriteLine($"Succeeded: {result}"); } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task GetPrivateLinkResources_KeyVaultListPrivateLinkResources() - { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2025-05-01/examples/listPrivateLinkResources.json - // this example is just showing the usage of "PrivateLinkResources_ListByVault" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this KeyVaultResource created on azure - // for more information of creating KeyVaultResource, please refer to the document of KeyVaultResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "sample-group"; - string vaultName = "sample-vault"; - ResourceIdentifier keyVaultResourceId = KeyVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); - KeyVaultResource keyVault = client.GetKeyVaultResource(keyVaultResourceId); - - // invoke the operation and iterate over the result - await foreach (KeyVaultPrivateLinkResourceData item in keyVault.GetPrivateLinkResourcesAsync()) - { - Console.WriteLine($"Succeeded: {item}"); - } - - Console.WriteLine("Succeeded"); - } } } diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/tests/Generated/Samples/Sample_KeyVaultSecretCollection.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/tests/Generated/Samples/Sample_KeyVaultSecretCollection.cs index 301dccff1284..8a3c33168263 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/tests/Generated/Samples/Sample_KeyVaultSecretCollection.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/tests/Generated/Samples/Sample_KeyVaultSecretCollection.cs @@ -20,8 +20,8 @@ public partial class Sample_KeyVaultSecretCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateASecret() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2025-05-01/examples/createSecret.json - // this example is just showing the usage of "Secrets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-05-01/createSecret.json + // this example is just showing the usage of "Secret_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -59,8 +59,8 @@ public async Task CreateOrUpdate_CreateASecret() [Ignore("Only validating compilation of examples")] public async Task Get_GetASecret() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2025-05-01/examples/getSecret.json - // this example is just showing the usage of "Secrets_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-05-01/getSecret.json + // this example is just showing the usage of "Secret_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -93,8 +93,8 @@ public async Task Get_GetASecret() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListSecretsInTheVault() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2025-05-01/examples/listSecrets.json - // this example is just showing the usage of "Secrets_List" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-05-01/listSecrets.json + // this example is just showing the usage of "Secret_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -129,8 +129,8 @@ public async Task GetAll_ListSecretsInTheVault() [Ignore("Only validating compilation of examples")] public async Task Exists_GetASecret() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2025-05-01/examples/getSecret.json - // this example is just showing the usage of "Secrets_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-05-01/getSecret.json + // this example is just showing the usage of "Secret_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -159,8 +159,8 @@ public async Task Exists_GetASecret() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetASecret() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2025-05-01/examples/getSecret.json - // this example is just showing the usage of "Secrets_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-05-01/getSecret.json + // this example is just showing the usage of "Secret_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/tests/Generated/Samples/Sample_KeyVaultSecretResource.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/tests/Generated/Samples/Sample_KeyVaultSecretResource.cs index 17cddd5cbcab..ee0d53233022 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/tests/Generated/Samples/Sample_KeyVaultSecretResource.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/tests/Generated/Samples/Sample_KeyVaultSecretResource.cs @@ -20,8 +20,8 @@ public partial class Sample_KeyVaultSecretResource [Ignore("Only validating compilation of examples")] public async Task Get_GetASecret() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2025-05-01/examples/getSecret.json - // this example is just showing the usage of "Secrets_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-05-01/getSecret.json + // this example is just showing the usage of "Secret_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -51,8 +51,8 @@ public async Task Get_GetASecret() [Ignore("Only validating compilation of examples")] public async Task Update_UpdateASecret() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2025-05-01/examples/updateSecret.json - // this example is just showing the usage of "Secrets_Update" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-05-01/updateSecret.json + // this example is just showing the usage of "Secret_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/tests/Generated/Samples/Sample_ManagedHsmCollection.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/tests/Generated/Samples/Sample_ManagedHsmCollection.cs index 9ef567eb1707..2f7c48dc439b 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/tests/Generated/Samples/Sample_ManagedHsmCollection.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/tests/Generated/Samples/Sample_ManagedHsmCollection.cs @@ -21,8 +21,8 @@ public partial class Sample_ManagedHsmCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateANewManagedHSMPoolOrUpdateAnExistingManagedHSMPool() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2025-05-01/examples/ManagedHsm_CreateOrUpdate.json - // this example is just showing the usage of "ManagedHsms_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-05-01/ManagedHsm_CreateOrUpdate.json + // this example is just showing the usage of "ManagedHsm_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -72,8 +72,8 @@ public async Task CreateOrUpdate_CreateANewManagedHSMPoolOrUpdateAnExistingManag [Ignore("Only validating compilation of examples")] public async Task Get_RetrieveAManagedHSMPool() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2025-05-01/examples/ManagedHsm_Get.json - // this example is just showing the usage of "ManagedHsms_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-05-01/ManagedHsm_Get.json + // this example is just showing the usage of "ManagedHsm_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -105,8 +105,8 @@ public async Task Get_RetrieveAManagedHSMPool() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListManagedHSMPoolsInAResourceGroup() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2025-05-01/examples/ManagedHsm_ListByResourceGroup.json - // this example is just showing the usage of "ManagedHsms_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-05-01/ManagedHsm_ListByResourceGroup.json + // this example is just showing the usage of "ManagedHsm_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -140,8 +140,8 @@ public async Task GetAll_ListManagedHSMPoolsInAResourceGroup() [Ignore("Only validating compilation of examples")] public async Task Exists_RetrieveAManagedHSMPool() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2025-05-01/examples/ManagedHsm_Get.json - // this example is just showing the usage of "ManagedHsms_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-05-01/ManagedHsm_Get.json + // this example is just showing the usage of "ManagedHsm_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -169,8 +169,8 @@ public async Task Exists_RetrieveAManagedHSMPool() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_RetrieveAManagedHSMPool() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2025-05-01/examples/ManagedHsm_Get.json - // this example is just showing the usage of "ManagedHsms_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-05-01/ManagedHsm_Get.json + // this example is just showing the usage of "ManagedHsm_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/tests/Generated/Samples/Sample_ManagedHsmPrivateEndpointConnectionCollection.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/tests/Generated/Samples/Sample_ManagedHsmPrivateEndpointConnectionCollection.cs index a27533989cd6..3ddf0c096508 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/tests/Generated/Samples/Sample_ManagedHsmPrivateEndpointConnectionCollection.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/tests/Generated/Samples/Sample_ManagedHsmPrivateEndpointConnectionCollection.cs @@ -9,7 +9,6 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Identity; -using Azure.ResourceManager.KeyVault.Models; using NUnit.Framework; namespace Azure.ResourceManager.KeyVault.Samples @@ -20,8 +19,8 @@ public partial class Sample_ManagedHsmPrivateEndpointConnectionCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_ManagedHsmPutPrivateEndpointConnection() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2025-05-01/examples/ManagedHsm_putPrivateEndpointConnection.json - // this example is just showing the usage of "MHSMPrivateEndpointConnections_Put" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-05-01/ManagedHsm_putPrivateEndpointConnection.json + // this example is just showing the usage of "MhsmPrivateEndpointConnection_Put" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -41,14 +40,7 @@ public async Task CreateOrUpdate_ManagedHsmPutPrivateEndpointConnection() // invoke the operation string privateEndpointConnectionName = "sample-pec"; - ManagedHsmPrivateEndpointConnectionData data = new ManagedHsmPrivateEndpointConnectionData(default) - { - PrivateLinkServiceConnectionState = new ManagedHsmPrivateLinkServiceConnectionState - { - Status = ManagedHsmPrivateEndpointServiceConnectionStatus.Approved, - Description = "My name is Joe and I'm approving this.", - }, - }; + ManagedHsmPrivateEndpointConnectionData data = new ManagedHsmPrivateEndpointConnectionData(default); ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, privateEndpointConnectionName, data); ManagedHsmPrivateEndpointConnectionResource result = lro.Value; @@ -63,8 +55,8 @@ public async Task CreateOrUpdate_ManagedHsmPutPrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task Get_ManagedHsmGetPrivateEndpointConnection() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2025-05-01/examples/ManagedHsm_getPrivateEndpointConnection.json - // this example is just showing the usage of "MHSMPrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-05-01/ManagedHsm_getPrivateEndpointConnection.json + // this example is just showing the usage of "MhsmPrivateEndpointConnection_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -97,8 +89,8 @@ public async Task Get_ManagedHsmGetPrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListManagedHSMPoolsInASubscription() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2025-05-01/examples/ManagedHsm_ListPrivateEndpointConnectionsByResource.json - // this example is just showing the usage of "MHSMPrivateEndpointConnections_ListByResource" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-05-01/ManagedHsm_ListPrivateEndpointConnectionsByResource.json + // this example is just showing the usage of "MhsmPrivateEndpointConnection_ListByResource" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -133,8 +125,8 @@ public async Task GetAll_ListManagedHSMPoolsInASubscription() [Ignore("Only validating compilation of examples")] public async Task Exists_ManagedHsmGetPrivateEndpointConnection() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2025-05-01/examples/ManagedHsm_getPrivateEndpointConnection.json - // this example is just showing the usage of "MHSMPrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-05-01/ManagedHsm_getPrivateEndpointConnection.json + // this example is just showing the usage of "MhsmPrivateEndpointConnection_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -163,8 +155,8 @@ public async Task Exists_ManagedHsmGetPrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_ManagedHsmGetPrivateEndpointConnection() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2025-05-01/examples/ManagedHsm_getPrivateEndpointConnection.json - // this example is just showing the usage of "MHSMPrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-05-01/ManagedHsm_getPrivateEndpointConnection.json + // this example is just showing the usage of "MhsmPrivateEndpointConnection_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/tests/Generated/Samples/Sample_ManagedHsmPrivateEndpointConnectionResource.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/tests/Generated/Samples/Sample_ManagedHsmPrivateEndpointConnectionResource.cs index dcf1f4adf5a2..9fa5f63b8569 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/tests/Generated/Samples/Sample_ManagedHsmPrivateEndpointConnectionResource.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/tests/Generated/Samples/Sample_ManagedHsmPrivateEndpointConnectionResource.cs @@ -9,7 +9,6 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Identity; -using Azure.ResourceManager.KeyVault.Models; using NUnit.Framework; namespace Azure.ResourceManager.KeyVault.Samples @@ -20,8 +19,8 @@ public partial class Sample_ManagedHsmPrivateEndpointConnectionResource [Ignore("Only validating compilation of examples")] public async Task Get_ManagedHsmGetPrivateEndpointConnection() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2025-05-01/examples/ManagedHsm_getPrivateEndpointConnection.json - // this example is just showing the usage of "MHSMPrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-05-01/ManagedHsm_getPrivateEndpointConnection.json + // this example is just showing the usage of "MhsmPrivateEndpointConnection_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -51,8 +50,8 @@ public async Task Get_ManagedHsmGetPrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task Delete_ManagedHsmDeletePrivateEndpointConnection() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2025-05-01/examples/ManagedHsm_deletePrivateEndpointConnection.json - // this example is just showing the usage of "MHSMPrivateEndpointConnections_Delete" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-05-01/ManagedHsm_deletePrivateEndpointConnection.json + // this example is just showing the usage of "MhsmPrivateEndpointConnection_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -83,8 +82,8 @@ public async Task Delete_ManagedHsmDeletePrivateEndpointConnection() [Ignore("Only validating compilation of examples")] public async Task Update_ManagedHsmPutPrivateEndpointConnection() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2025-05-01/examples/ManagedHsm_putPrivateEndpointConnection.json - // this example is just showing the usage of "MHSMPrivateEndpointConnections_Put" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-05-01/ManagedHsm_putPrivateEndpointConnection.json + // this example is just showing the usage of "MhsmPrivateEndpointConnection_Put" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -101,14 +100,7 @@ public async Task Update_ManagedHsmPutPrivateEndpointConnection() ManagedHsmPrivateEndpointConnectionResource managedHsmPrivateEndpointConnection = client.GetManagedHsmPrivateEndpointConnectionResource(managedHsmPrivateEndpointConnectionResourceId); // invoke the operation - ManagedHsmPrivateEndpointConnectionData data = new ManagedHsmPrivateEndpointConnectionData(default) - { - PrivateLinkServiceConnectionState = new ManagedHsmPrivateLinkServiceConnectionState - { - Status = ManagedHsmPrivateEndpointServiceConnectionStatus.Approved, - Description = "My name is Joe and I'm approving this.", - }, - }; + ManagedHsmPrivateEndpointConnectionData data = new ManagedHsmPrivateEndpointConnectionData(default); ArmOperation lro = await managedHsmPrivateEndpointConnection.UpdateAsync(WaitUntil.Completed, data); ManagedHsmPrivateEndpointConnectionResource result = lro.Value; diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/tests/Generated/Samples/Sample_ManagedHsmResource.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/tests/Generated/Samples/Sample_ManagedHsmResource.cs index 29e069b36555..31b6260fa066 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/tests/Generated/Samples/Sample_ManagedHsmResource.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/tests/Generated/Samples/Sample_ManagedHsmResource.cs @@ -9,7 +9,6 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Identity; -using Azure.ResourceManager.KeyVault.Models; using NUnit.Framework; namespace Azure.ResourceManager.KeyVault.Samples @@ -20,8 +19,8 @@ public partial class Sample_ManagedHsmResource [Ignore("Only validating compilation of examples")] public async Task Get_RetrieveAManagedHSMPool() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2025-05-01/examples/ManagedHsm_Get.json - // this example is just showing the usage of "ManagedHsms_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-05-01/ManagedHsm_Get.json + // this example is just showing the usage of "ManagedHsm_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -50,8 +49,8 @@ public async Task Get_RetrieveAManagedHSMPool() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteAManagedHSMPool() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2025-05-01/examples/ManagedHsm_Delete.json - // this example is just showing the usage of "ManagedHsms_Delete" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-05-01/ManagedHsm_Delete.json + // this example is just showing the usage of "ManagedHsm_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -76,8 +75,8 @@ public async Task Delete_DeleteAManagedHSMPool() [Ignore("Only validating compilation of examples")] public async Task Update_UpdateAnExistingManagedHSMPool() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2025-05-01/examples/ManagedHsm_Update.json - // this example is just showing the usage of "ManagedHsms_Update" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-05-01/ManagedHsm_Update.json + // this example is just showing the usage of "ManagedHsm_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -111,63 +110,5 @@ public async Task Update_UpdateAnExistingManagedHSMPool() // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task GetMHSMPrivateLinkResourcesByManagedHsmResource_KeyVaultListPrivateLinkResources() - { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2025-05-01/examples/ManagedHsm_listPrivateLinkResources.json - // this example is just showing the usage of "MHSMPrivateLinkResources_ListByManagedHsmResource" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ManagedHsmResource created on azure - // for more information of creating ManagedHsmResource, please refer to the document of ManagedHsmResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "sample-group"; - string name = "sample-mhsm"; - ResourceIdentifier managedHsmResourceId = ManagedHsmResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); - ManagedHsmResource managedHsm = client.GetManagedHsmResource(managedHsmResourceId); - - // invoke the operation and iterate over the result - await foreach (ManagedHsmPrivateLinkResourceData item in managedHsm.GetMHSMPrivateLinkResourcesByManagedHsmResourceAsync()) - { - Console.WriteLine($"Succeeded: {item}"); - } - - Console.WriteLine("Succeeded"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task GetMHSMRegionsByResource_ListManagedHSMPoolsInASubscription() - { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2025-05-01/examples/ManagedHsm_ListRegionsByResource.json - // this example is just showing the usage of "MHSMRegions_ListByResource" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ManagedHsmResource created on azure - // for more information of creating ManagedHsmResource, please refer to the document of ManagedHsmResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - string resourceGroupName = "sample-group"; - string name = "sample-mhsm"; - ResourceIdentifier managedHsmResourceId = ManagedHsmResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); - ManagedHsmResource managedHsm = client.GetManagedHsmResource(managedHsmResourceId); - - // invoke the operation and iterate over the result - await foreach (ManagedHsmGeoReplicatedRegion item in managedHsm.GetMHSMRegionsByResourceAsync()) - { - Console.WriteLine($"Succeeded: {item}"); - } - - Console.WriteLine("Succeeded"); - } } } diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/tests/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/keyvault/Azure.ResourceManager.KeyVault/tests/Generated/Samples/Sample_SubscriptionResourceExtensions.cs index 0cae07e12992..f9ecfa40c6ca 100644 --- a/sdk/keyvault/Azure.ResourceManager.KeyVault/tests/Generated/Samples/Sample_SubscriptionResourceExtensions.cs +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/tests/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -9,7 +9,6 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Identity; -using Azure.ResourceManager.KeyVault.Models; using Azure.ResourceManager.Resources; using NUnit.Framework; @@ -21,8 +20,8 @@ public partial class Sample_SubscriptionResourceExtensions [Ignore("Only validating compilation of examples")] public async Task GetKeyVaults_ListVaultsInTheSpecifiedSubscription() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2025-05-01/examples/listVaultBySubscription.json - // this example is just showing the usage of "Vaults_ListBySubscription" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-05-01/listVaultBySubscription.json + // this example is just showing the usage of "Vault_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -36,8 +35,7 @@ public async Task GetKeyVaults_ListVaultsInTheSpecifiedSubscription() SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); // invoke the operation and iterate over the result - int? top = 1; - await foreach (KeyVaultResource item in subscriptionResource.GetKeyVaultsAsync(top: top)) + await foreach (KeyVaultResource item in subscriptionResource.GetKeyVaultsAsync()) { // the variable item is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance @@ -49,68 +47,12 @@ public async Task GetKeyVaults_ListVaultsInTheSpecifiedSubscription() Console.WriteLine("Succeeded"); } - [Test] - [Ignore("Only validating compilation of examples")] - public async Task GetDeletedKeyVaults_ListDeletedVaultsInTheSpecifiedSubscription() - { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2025-05-01/examples/listDeletedVaults.json - // this example is just showing the usage of "Vaults_ListDeleted" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this SubscriptionResource created on azure - // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); - SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); - - // invoke the operation and iterate over the result - await foreach (DeletedKeyVaultResource item in subscriptionResource.GetDeletedKeyVaultsAsync()) - { - // the variable item is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - DeletedKeyVaultData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine("Succeeded"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task CheckKeyVaultNameAvailability_ValidateAVaultName() - { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2025-05-01/examples/checkVaultNameAvailability.json - // this example is just showing the usage of "Vaults_CheckNameAvailability" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this SubscriptionResource created on azure - // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); - SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); - - // invoke the operation - KeyVaultNameAvailabilityContent content = new KeyVaultNameAvailabilityContent("sample-vault"); - KeyVaultNameAvailabilityResult result = await subscriptionResource.CheckKeyVaultNameAvailabilityAsync(content); - - Console.WriteLine($"Succeeded: {result}"); - } - [Test] [Ignore("Only validating compilation of examples")] public async Task GetManagedHsms_ListManagedHSMPoolsInASubscription() { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2025-05-01/examples/ManagedHsm_ListBySubscription.json - // this example is just showing the usage of "ManagedHsms_ListBySubscription" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-05-01/ManagedHsm_ListBySubscription.json + // this example is just showing the usage of "ManagedHsm_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -135,61 +77,5 @@ public async Task GetManagedHsms_ListManagedHSMPoolsInASubscription() Console.WriteLine("Succeeded"); } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task GetDeletedManagedHsms_ListDeletedManagedHSMsInTheSpecifiedSubscription() - { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2025-05-01/examples/DeletedManagedHsm_List.json - // this example is just showing the usage of "ManagedHsms_ListDeleted" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this SubscriptionResource created on azure - // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); - SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); - - // invoke the operation and iterate over the result - await foreach (DeletedManagedHsmResource item in subscriptionResource.GetDeletedManagedHsmsAsync()) - { - // the variable item is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - DeletedManagedHsmData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine("Succeeded"); - } - - [Test] - [Ignore("Only validating compilation of examples")] - public async Task CheckManagedHsmNameAvailability_ValidateAManagedHsmName() - { - // Generated from example definition: specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2025-05-01/examples/ManagedHsm_checkMhsmNameAvailability.json - // this example is just showing the usage of "ManagedHsms_CheckManagedHsmNameAvailability" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this SubscriptionResource created on azure - // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "00000000-0000-0000-0000-000000000000"; - ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); - SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); - - // invoke the operation - ManagedHsmNameAvailabilityContent content = new ManagedHsmNameAvailabilityContent("sample-mhsm"); - ManagedHsmNameAvailabilityResult result = await subscriptionResource.CheckManagedHsmNameAvailabilityAsync(content); - - Console.WriteLine($"Succeeded: {result}"); - } } } diff --git a/sdk/keyvault/Azure.ResourceManager.KeyVault/tsp-location.yaml b/sdk/keyvault/Azure.ResourceManager.KeyVault/tsp-location.yaml new file mode 100644 index 000000000000..dfbb58314d11 --- /dev/null +++ b/sdk/keyvault/Azure.ResourceManager.KeyVault/tsp-location.yaml @@ -0,0 +1,3 @@ +directory: specification/keyvault/KeyVault.Management +commit: ec840ab32b39f029da1021637090cfc24b7429a8 +repo: Azure/azure-rest-api-specs