diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/Configuration.json b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/Configuration.json new file mode 100644 index 000000000000..7dbef2c37b2f --- /dev/null +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/Configuration.json @@ -0,0 +1,12 @@ +{ + "package-name": "Azure.ResourceManager.HardwareSecurityModules", + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "model-namespace": true, + "license": { + "name": "MIT License", + "company": "Microsoft Corporation", + "link": "https://mit-license.org", + "header": "Copyright (c) Microsoft Corporation. All rights reserved.\nLicensed under the MIT License.", + "description": "Copyright (c) Microsoft Corporation\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the “Software”), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE." + } +} diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/api/Azure.ResourceManager.HardwareSecurityModules.net8.0.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/api/Azure.ResourceManager.HardwareSecurityModules.net8.0.cs index ebe3eb3f9119..a8a99f9861c5 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/api/Azure.ResourceManager.HardwareSecurityModules.net8.0.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/api/Azure.ResourceManager.HardwareSecurityModules.net8.0.cs @@ -29,7 +29,10 @@ public CloudHsmClusterData(Azure.Core.AzureLocation location) { } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterProperties Properties { get { throw null; } set { } } public Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterSku Sku { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Models.ResourceData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Models.ResourceData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.HardwareSecurityModules.CloudHsmClusterData 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.HardwareSecurityModules.CloudHsmClusterData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -58,7 +61,10 @@ public partial class CloudHsmClusterPrivateEndpointConnectionData : Azure.Resour public CloudHsmClusterPrivateEndpointConnectionData() { } public Azure.ETag? ETag { get { throw null; } set { } } public Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateEndpointConnectionProperties Properties { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Models.ResourceData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Models.ResourceData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.HardwareSecurityModules.CloudHsmClusterPrivateEndpointConnectionData 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.HardwareSecurityModules.CloudHsmClusterPrivateEndpointConnectionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -99,15 +105,11 @@ protected CloudHsmClusterResource() { } public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response GetCloudHsmClusterBackupStatus(string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetCloudHsmClusterBackupStatusAsync(string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetByCloudHsmCluster(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetByCloudHsmClusterAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetCloudHsmClusterPrivateEndpointConnection(string peConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetCloudHsmClusterPrivateEndpointConnectionAsync(string peConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.HardwareSecurityModules.CloudHsmClusterPrivateEndpointConnectionCollection GetCloudHsmClusterPrivateEndpointConnections() { throw null; } - public virtual Azure.Pageable GetCloudHsmClusterPrivateLinkResources(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetCloudHsmClusterPrivateLinkResourcesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response GetCloudHsmClusterRestoreStatus(string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetCloudHsmClusterRestoreStatusAsync(string jobId, 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.ResourceManager.ArmOperation Restore(Azure.WaitUntil waitUntil, Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterRestoreContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -150,7 +152,10 @@ public DedicatedHsmData(Azure.Core.AzureLocation location, Azure.ResourceManager public Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmProperties Properties { get { throw null; } set { } } public Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmSkuName? SkuName { get { throw null; } set { } } public System.Collections.Generic.IList Zones { get { throw null; } } + protected virtual Azure.ResourceManager.Models.ResourceData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Models.ResourceData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.HardwareSecurityModules.DedicatedHsmData 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.HardwareSecurityModules.DedicatedHsmData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -181,15 +186,19 @@ protected DedicatedHsmResource() { } Azure.ResourceManager.HardwareSecurityModules.DedicatedHsmData 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 virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmPatch dedicatedHsmPatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmPatch dedicatedHsmPatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public static partial class HardwareSecurityModulesExtensions { public static Azure.Response GetCloudHsmCluster(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string cloudHsmClusterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetCloudHsmClusterAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string cloudHsmClusterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response GetCloudHsmClusterBackupStatus(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string cloudHsmClusterName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetCloudHsmClusterBackupStatusAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string cloudHsmClusterName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.HardwareSecurityModules.CloudHsmClusterPrivateEndpointConnectionResource GetCloudHsmClusterPrivateEndpointConnectionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.HardwareSecurityModules.CloudHsmClusterResource GetCloudHsmClusterResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetCloudHsmClusterRestoreStatus(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string cloudHsmClusterName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetCloudHsmClusterRestoreStatusAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string cloudHsmClusterName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.HardwareSecurityModules.CloudHsmClusterCollection GetCloudHsmClusters(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } public static Azure.Pageable GetCloudHsmClusters(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable GetCloudHsmClustersAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -215,6 +224,10 @@ public partial class MockableHardwareSecurityModulesResourceGroupResource : Azur protected MockableHardwareSecurityModulesResourceGroupResource() { } public virtual Azure.Response GetCloudHsmCluster(string cloudHsmClusterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetCloudHsmClusterAsync(string cloudHsmClusterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetCloudHsmClusterBackupStatus(string cloudHsmClusterName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetCloudHsmClusterBackupStatusAsync(string cloudHsmClusterName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetCloudHsmClusterRestoreStatus(string cloudHsmClusterName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetCloudHsmClusterRestoreStatusAsync(string cloudHsmClusterName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.HardwareSecurityModules.CloudHsmClusterCollection GetCloudHsmClusters() { throw null; } public virtual Azure.Response GetDedicatedHsm(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetDedicatedHsmAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -239,6 +252,7 @@ public static partial class ArmHardwareSecurityModulesModelFactory public static Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterBackupResult CloudHsmClusterBackupResult(Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterBackupResultProperties properties = null) { throw null; } public static Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterBackupResultProperties CloudHsmClusterBackupResultProperties(Azure.ResourceManager.HardwareSecurityModules.Models.BackupRestoreOperationStatus? status = default(Azure.ResourceManager.HardwareSecurityModules.Models.BackupRestoreOperationStatus?), string statusDetails = null, Azure.ResponseError error = null, System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? endOn = default(System.DateTimeOffset?), string jobId = null, System.Uri azureStorageBlobContainerUri = null, string backupId = null) { throw null; } public static Azure.ResourceManager.HardwareSecurityModules.CloudHsmClusterData CloudHsmClusterData(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.HardwareSecurityModules.Models.CloudHsmClusterProperties properties = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterSku sku = null) { throw null; } + public static Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPatch CloudHsmClusterPatch(System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } public static Azure.ResourceManager.HardwareSecurityModules.CloudHsmClusterPrivateEndpointConnectionData CloudHsmClusterPrivateEndpointConnectionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateEndpointConnectionProperties properties = null, Azure.ETag? etag = default(Azure.ETag?)) { throw null; } public static Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateEndpointConnectionProperties CloudHsmClusterPrivateEndpointConnectionProperties(Azure.Core.ResourceIdentifier privateEndpointId = null, Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateLinkServiceConnectionState connectionState = null, Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateEndpointConnectionProvisioningState? provisioningState = default(Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateEndpointConnectionProvisioningState?), System.Collections.Generic.IEnumerable groupIds = null) { throw null; } public static Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateLinkData CloudHsmClusterPrivateLinkData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateLinkResourceProperties properties = null) { throw null; } @@ -254,6 +268,8 @@ public static partial class ArmHardwareSecurityModulesModelFactory public static Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmEndpointDependency DedicatedHsmEndpointDependency(string domainName = null, System.Collections.Generic.IEnumerable endpointDetails = null) { throw null; } public static Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmEndpointDetail DedicatedHsmEndpointDetail(string ipAddress = null, int? port = default(int?), string protocol = null, string description = null) { throw null; } public static Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmNetworkInterface DedicatedHsmNetworkInterface(Azure.Core.ResourceIdentifier resourceId = null, string privateIPAddress = null) { throw null; } + public static Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmNetworkProfile DedicatedHsmNetworkProfile(Azure.Core.ResourceIdentifier subnetResourceId = null, System.Collections.Generic.IEnumerable networkInterfaces = null) { throw null; } + public static Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmPatch DedicatedHsmPatch(System.Collections.Generic.IDictionary tags = null) { throw null; } public static Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmProperties DedicatedHsmProperties(Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmNetworkProfile networkProfile = null, Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmNetworkProfile managementNetworkProfile = null, string stampId = null, string statusMessage = null, Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmJsonWebKeyType? provisioningState = default(Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmJsonWebKeyType?)) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] @@ -273,6 +289,7 @@ public static partial class ArmHardwareSecurityModulesModelFactory public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.HardwareSecurityModules.Models.AutoGeneratedDomainNameLabelScope left, Azure.ResourceManager.HardwareSecurityModules.Models.AutoGeneratedDomainNameLabelScope right) { throw null; } public static implicit operator Azure.ResourceManager.HardwareSecurityModules.Models.AutoGeneratedDomainNameLabelScope (string value) { throw null; } + public static implicit operator Azure.ResourceManager.HardwareSecurityModules.Models.AutoGeneratedDomainNameLabelScope? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.HardwareSecurityModules.Models.AutoGeneratedDomainNameLabelScope left, Azure.ResourceManager.HardwareSecurityModules.Models.AutoGeneratedDomainNameLabelScope right) { throw null; } public override string ToString() { throw null; } } @@ -285,7 +302,10 @@ internal BackupRestoreBaseResultProperties() { } public System.DateTimeOffset? StartOn { get { throw null; } } public Azure.ResourceManager.HardwareSecurityModules.Models.BackupRestoreOperationStatus? Status { get { throw null; } } public string StatusDetails { get { throw null; } } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.BackupRestoreBaseResultProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.BackupRestoreBaseResultProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.HardwareSecurityModules.Models.BackupRestoreBaseResultProperties 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.HardwareSecurityModules.Models.BackupRestoreBaseResultProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -309,6 +329,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.HardwareSecurityModules.Models.BackupRestoreOperationStatus left, Azure.ResourceManager.HardwareSecurityModules.Models.BackupRestoreOperationStatus right) { throw null; } public static implicit operator Azure.ResourceManager.HardwareSecurityModules.Models.BackupRestoreOperationStatus (string value) { throw null; } + public static implicit operator Azure.ResourceManager.HardwareSecurityModules.Models.BackupRestoreOperationStatus? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.HardwareSecurityModules.Models.BackupRestoreOperationStatus left, Azure.ResourceManager.HardwareSecurityModules.Models.BackupRestoreOperationStatus right) { throw null; } public override string ToString() { throw null; } } @@ -317,7 +338,10 @@ public partial class BackupRestoreRequestBaseProperties : System.ClientModel.Pri public BackupRestoreRequestBaseProperties(System.Uri azureStorageBlobContainerUri) { } public System.Uri AzureStorageBlobContainerUri { get { throw null; } } public string Token { get { throw null; } set { } } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.BackupRestoreRequestBaseProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.BackupRestoreRequestBaseProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.HardwareSecurityModules.Models.BackupRestoreRequestBaseProperties 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.HardwareSecurityModules.Models.BackupRestoreRequestBaseProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -327,7 +351,10 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class CloudHsmClusterBackupContent : Azure.ResourceManager.HardwareSecurityModules.Models.BackupRestoreRequestBaseProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public CloudHsmClusterBackupContent(System.Uri azureStorageBlobContainerUri) : base (default(System.Uri)) { } + protected override Azure.ResourceManager.HardwareSecurityModules.Models.BackupRestoreRequestBaseProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.ResourceManager.HardwareSecurityModules.Models.BackupRestoreRequestBaseProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterBackupContent 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.HardwareSecurityModules.Models.CloudHsmClusterBackupContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -338,7 +365,10 @@ public partial class CloudHsmClusterBackupResult : System.ClientModel.Primitives { internal CloudHsmClusterBackupResult() { } public Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterBackupResultProperties Properties { get { throw null; } } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterBackupResult JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterBackupResult PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterBackupResult 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.HardwareSecurityModules.Models.CloudHsmClusterBackupResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -350,7 +380,10 @@ public partial class CloudHsmClusterBackupResultProperties : Azure.ResourceManag internal CloudHsmClusterBackupResultProperties() { } public System.Uri AzureStorageBlobContainerUri { get { throw null; } } public string BackupId { get { throw null; } } + protected override Azure.ResourceManager.HardwareSecurityModules.Models.BackupRestoreBaseResultProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.ResourceManager.HardwareSecurityModules.Models.BackupRestoreBaseResultProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterBackupResultProperties 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.HardwareSecurityModules.Models.CloudHsmClusterBackupResultProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -362,7 +395,10 @@ public partial class CloudHsmClusterPatch : System.ClientModel.Primitives.IJsonM public CloudHsmClusterPatch() { } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPatch JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPatch PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPatch 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.HardwareSecurityModules.Models.CloudHsmClusterPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -376,7 +412,10 @@ public CloudHsmClusterPrivateEndpointConnectionProperties(Azure.ResourceManager. public System.Collections.Generic.IReadOnlyList GroupIds { get { throw null; } } public Azure.Core.ResourceIdentifier PrivateEndpointId { get { throw null; } } public Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateEndpointConnectionProvisioningState? ProvisioningState { get { throw null; } } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateEndpointConnectionProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateEndpointConnectionProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateEndpointConnectionProperties 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.HardwareSecurityModules.Models.CloudHsmClusterPrivateEndpointConnectionProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -403,6 +442,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateEndpointConnectionProvisioningState left, Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateEndpointConnectionProvisioningState right) { throw null; } public static implicit operator Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateEndpointConnectionProvisioningState (string value) { throw null; } + public static implicit operator Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateEndpointConnectionProvisioningState? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateEndpointConnectionProvisioningState left, Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateEndpointConnectionProvisioningState right) { throw null; } public override string ToString() { throw null; } } @@ -422,6 +462,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateEndpointServiceConnectionStatus left, Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateEndpointServiceConnectionStatus right) { throw null; } public static implicit operator Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateEndpointServiceConnectionStatus (string value) { throw null; } + public static implicit operator Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateEndpointServiceConnectionStatus? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateEndpointServiceConnectionStatus left, Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateEndpointServiceConnectionStatus right) { throw null; } public override string ToString() { throw null; } } @@ -429,7 +470,10 @@ public partial class CloudHsmClusterPrivateLinkData : Azure.ResourceManager.Mode { public CloudHsmClusterPrivateLinkData() { } public Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateLinkResourceProperties Properties { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Models.ResourceData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Models.ResourceData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateLinkData 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.HardwareSecurityModules.Models.CloudHsmClusterPrivateLinkData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -442,7 +486,10 @@ public CloudHsmClusterPrivateLinkResourceProperties() { } public string GroupId { get { throw null; } } public System.Collections.Generic.IReadOnlyList RequiredMembers { get { throw null; } } public System.Collections.Generic.IList RequiredZoneNames { get { throw null; } } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateLinkResourceProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateLinkResourceProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateLinkResourceProperties 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.HardwareSecurityModules.Models.CloudHsmClusterPrivateLinkResourceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -455,7 +502,10 @@ public CloudHsmClusterPrivateLinkServiceConnectionState() { } public string ActionsRequired { get { throw null; } set { } } public string Description { get { throw null; } set { } } public Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateEndpointServiceConnectionStatus? Status { get { throw null; } set { } } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateLinkServiceConnectionState JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateLinkServiceConnectionState PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateLinkServiceConnectionState 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.HardwareSecurityModules.Models.CloudHsmClusterPrivateLinkServiceConnectionState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -472,7 +522,10 @@ public CloudHsmClusterProperties() { } public Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterProvisioningState? ProvisioningState { get { throw null; } } public Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPublicNetworkAccess? PublicNetworkAccess { get { throw null; } set { } } public string StatusMessage { get { throw null; } } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterProperties 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.HardwareSecurityModules.Models.CloudHsmClusterProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -498,6 +551,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterProvisioningState left, Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterProvisioningState right) { throw null; } public static implicit operator Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterProvisioningState (string value) { throw null; } + public static implicit operator Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterProvisioningState? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterProvisioningState left, Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterProvisioningState right) { throw null; } public override string ToString() { throw null; } } @@ -515,6 +569,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPublicNetworkAccess left, Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPublicNetworkAccess right) { throw null; } public static implicit operator Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPublicNetworkAccess (string value) { throw null; } + public static implicit operator Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPublicNetworkAccess? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPublicNetworkAccess left, Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPublicNetworkAccess right) { throw null; } public override string ToString() { throw null; } } @@ -522,7 +577,10 @@ public partial class CloudHsmClusterRestoreContent : Azure.ResourceManager.Hardw { public CloudHsmClusterRestoreContent(System.Uri azureStorageBlobContainerUri, string backupId) : base (default(System.Uri)) { } public string BackupId { get { throw null; } } + protected override Azure.ResourceManager.HardwareSecurityModules.Models.BackupRestoreRequestBaseProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.ResourceManager.HardwareSecurityModules.Models.BackupRestoreRequestBaseProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterRestoreContent 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.HardwareSecurityModules.Models.CloudHsmClusterRestoreContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -533,7 +591,10 @@ public partial class CloudHsmClusterRestoreResult : System.ClientModel.Primitive { internal CloudHsmClusterRestoreResult() { } public Azure.ResourceManager.HardwareSecurityModules.Models.BackupRestoreBaseResultProperties Properties { get { throw null; } } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterRestoreResult JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterRestoreResult PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterRestoreResult 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.HardwareSecurityModules.Models.CloudHsmClusterRestoreResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -546,7 +607,10 @@ public CloudHsmClusterSku(Azure.ResourceManager.HardwareSecurityModules.Models.C public int? Capacity { get { throw null; } set { } } public Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterSkuFamily Family { get { throw null; } set { } } public Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterSkuName Name { get { throw null; } set { } } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterSku JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterSku PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterSku 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.HardwareSecurityModules.Models.CloudHsmClusterSku System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -567,6 +631,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterSkuFamily left, Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterSkuFamily right) { throw null; } public static implicit operator Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterSkuFamily (string value) { throw null; } + public static implicit operator Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterSkuFamily? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterSkuFamily left, Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterSkuFamily right) { throw null; } public override string ToString() { throw null; } } @@ -581,7 +646,10 @@ internal CloudHsmProperties() { } public string Fqdn { get { throw null; } } public string State { get { throw null; } } public string StateMessage { get { throw null; } } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmProperties 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.HardwareSecurityModules.Models.CloudHsmProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -593,7 +661,10 @@ public partial class DedicatedHsmEgressEndpoint : System.ClientModel.Primitives. internal DedicatedHsmEgressEndpoint() { } public string Category { get { throw null; } } public System.Collections.Generic.IReadOnlyList Endpoints { get { throw null; } } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmEgressEndpoint JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmEgressEndpoint PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmEgressEndpoint 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.HardwareSecurityModules.Models.DedicatedHsmEgressEndpoint System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -605,7 +676,10 @@ public partial class DedicatedHsmEndpointDependency : System.ClientModel.Primiti internal DedicatedHsmEndpointDependency() { } public string DomainName { get { throw null; } } public System.Collections.Generic.IReadOnlyList EndpointDetails { get { throw null; } } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmEndpointDependency JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmEndpointDependency PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmEndpointDependency 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.HardwareSecurityModules.Models.DedicatedHsmEndpointDependency System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -619,7 +693,10 @@ internal DedicatedHsmEndpointDetail() { } public string IPAddress { get { throw null; } } public int? Port { get { throw null; } } public string Protocol { get { throw null; } } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmEndpointDetail JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmEndpointDetail PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmEndpointDetail 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.HardwareSecurityModules.Models.DedicatedHsmEndpointDetail System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -646,6 +723,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmJsonWebKeyType left, Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmJsonWebKeyType right) { throw null; } public static implicit operator Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmJsonWebKeyType (string value) { throw null; } + public static implicit operator Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmJsonWebKeyType? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmJsonWebKeyType left, Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmJsonWebKeyType right) { throw null; } public override string ToString() { throw null; } } @@ -654,7 +732,10 @@ public partial class DedicatedHsmNetworkInterface : System.ClientModel.Primitive public DedicatedHsmNetworkInterface() { } public string PrivateIPAddress { get { throw null; } set { } } public Azure.Core.ResourceIdentifier ResourceId { get { throw null; } } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmNetworkInterface JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmNetworkInterface PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmNetworkInterface 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.HardwareSecurityModules.Models.DedicatedHsmNetworkInterface System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -666,7 +747,10 @@ public partial class DedicatedHsmNetworkProfile : System.ClientModel.Primitives. public DedicatedHsmNetworkProfile() { } public System.Collections.Generic.IList NetworkInterfaces { get { throw null; } } public Azure.Core.ResourceIdentifier SubnetResourceId { get { throw null; } set { } } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmNetworkProfile JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmNetworkProfile PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmNetworkProfile 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.HardwareSecurityModules.Models.DedicatedHsmNetworkProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -677,7 +761,10 @@ public partial class DedicatedHsmPatch : System.ClientModel.Primitives.IJsonMode { public DedicatedHsmPatch() { } public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmPatch JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmPatch PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmPatch 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.HardwareSecurityModules.Models.DedicatedHsmPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -692,7 +779,10 @@ public DedicatedHsmProperties() { } public Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmJsonWebKeyType? ProvisioningState { get { throw null; } } public string StampId { get { throw null; } set { } } public string StatusMessage { get { throw null; } } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmProperties 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.HardwareSecurityModules.Models.DedicatedHsmProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -703,7 +793,10 @@ public partial class DedicatedHsmSku : System.ClientModel.Primitives.IJsonModel< { public DedicatedHsmSku() { } public Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmSkuName? Name { get { throw null; } set { } } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmSku JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmSku PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmSku 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.HardwareSecurityModules.Models.DedicatedHsmSku System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -730,6 +823,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmSkuName left, Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmSkuName right) { throw null; } public static implicit operator Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmSkuName (string value) { throw null; } + public static implicit operator Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmSkuName? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmSkuName left, Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmSkuName right) { throw null; } public override string ToString() { throw null; } } @@ -751,6 +845,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.HardwareSecurityModules.Models.SecurityDomainActivationState left, Azure.ResourceManager.HardwareSecurityModules.Models.SecurityDomainActivationState right) { throw null; } public static implicit operator Azure.ResourceManager.HardwareSecurityModules.Models.SecurityDomainActivationState (string value) { throw null; } + public static implicit operator Azure.ResourceManager.HardwareSecurityModules.Models.SecurityDomainActivationState? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.HardwareSecurityModules.Models.SecurityDomainActivationState left, Azure.ResourceManager.HardwareSecurityModules.Models.SecurityDomainActivationState right) { throw null; } public override string ToString() { throw null; } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/api/Azure.ResourceManager.HardwareSecurityModules.netstandard2.0.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/api/Azure.ResourceManager.HardwareSecurityModules.netstandard2.0.cs index ebe3eb3f9119..a8a99f9861c5 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/api/Azure.ResourceManager.HardwareSecurityModules.netstandard2.0.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/api/Azure.ResourceManager.HardwareSecurityModules.netstandard2.0.cs @@ -29,7 +29,10 @@ public CloudHsmClusterData(Azure.Core.AzureLocation location) { } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterProperties Properties { get { throw null; } set { } } public Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterSku Sku { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Models.ResourceData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Models.ResourceData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.HardwareSecurityModules.CloudHsmClusterData 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.HardwareSecurityModules.CloudHsmClusterData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -58,7 +61,10 @@ public partial class CloudHsmClusterPrivateEndpointConnectionData : Azure.Resour public CloudHsmClusterPrivateEndpointConnectionData() { } public Azure.ETag? ETag { get { throw null; } set { } } public Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateEndpointConnectionProperties Properties { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Models.ResourceData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Models.ResourceData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.HardwareSecurityModules.CloudHsmClusterPrivateEndpointConnectionData 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.HardwareSecurityModules.CloudHsmClusterPrivateEndpointConnectionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -99,15 +105,11 @@ protected CloudHsmClusterResource() { } public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response GetCloudHsmClusterBackupStatus(string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetCloudHsmClusterBackupStatusAsync(string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetByCloudHsmCluster(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetByCloudHsmClusterAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetCloudHsmClusterPrivateEndpointConnection(string peConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetCloudHsmClusterPrivateEndpointConnectionAsync(string peConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.HardwareSecurityModules.CloudHsmClusterPrivateEndpointConnectionCollection GetCloudHsmClusterPrivateEndpointConnections() { throw null; } - public virtual Azure.Pageable GetCloudHsmClusterPrivateLinkResources(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetCloudHsmClusterPrivateLinkResourcesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response GetCloudHsmClusterRestoreStatus(string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetCloudHsmClusterRestoreStatusAsync(string jobId, 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.ResourceManager.ArmOperation Restore(Azure.WaitUntil waitUntil, Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterRestoreContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -150,7 +152,10 @@ public DedicatedHsmData(Azure.Core.AzureLocation location, Azure.ResourceManager public Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmProperties Properties { get { throw null; } set { } } public Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmSkuName? SkuName { get { throw null; } set { } } public System.Collections.Generic.IList Zones { get { throw null; } } + protected virtual Azure.ResourceManager.Models.ResourceData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Models.ResourceData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.HardwareSecurityModules.DedicatedHsmData 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.HardwareSecurityModules.DedicatedHsmData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -181,15 +186,19 @@ protected DedicatedHsmResource() { } Azure.ResourceManager.HardwareSecurityModules.DedicatedHsmData 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 virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmPatch dedicatedHsmPatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmPatch dedicatedHsmPatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public static partial class HardwareSecurityModulesExtensions { public static Azure.Response GetCloudHsmCluster(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string cloudHsmClusterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetCloudHsmClusterAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string cloudHsmClusterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response GetCloudHsmClusterBackupStatus(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string cloudHsmClusterName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetCloudHsmClusterBackupStatusAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string cloudHsmClusterName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.HardwareSecurityModules.CloudHsmClusterPrivateEndpointConnectionResource GetCloudHsmClusterPrivateEndpointConnectionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.HardwareSecurityModules.CloudHsmClusterResource GetCloudHsmClusterResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetCloudHsmClusterRestoreStatus(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string cloudHsmClusterName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetCloudHsmClusterRestoreStatusAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string cloudHsmClusterName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.HardwareSecurityModules.CloudHsmClusterCollection GetCloudHsmClusters(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } public static Azure.Pageable GetCloudHsmClusters(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable GetCloudHsmClustersAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -215,6 +224,10 @@ public partial class MockableHardwareSecurityModulesResourceGroupResource : Azur protected MockableHardwareSecurityModulesResourceGroupResource() { } public virtual Azure.Response GetCloudHsmCluster(string cloudHsmClusterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetCloudHsmClusterAsync(string cloudHsmClusterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetCloudHsmClusterBackupStatus(string cloudHsmClusterName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetCloudHsmClusterBackupStatusAsync(string cloudHsmClusterName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetCloudHsmClusterRestoreStatus(string cloudHsmClusterName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetCloudHsmClusterRestoreStatusAsync(string cloudHsmClusterName, string jobId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.HardwareSecurityModules.CloudHsmClusterCollection GetCloudHsmClusters() { throw null; } public virtual Azure.Response GetDedicatedHsm(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetDedicatedHsmAsync(string name, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -239,6 +252,7 @@ public static partial class ArmHardwareSecurityModulesModelFactory public static Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterBackupResult CloudHsmClusterBackupResult(Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterBackupResultProperties properties = null) { throw null; } public static Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterBackupResultProperties CloudHsmClusterBackupResultProperties(Azure.ResourceManager.HardwareSecurityModules.Models.BackupRestoreOperationStatus? status = default(Azure.ResourceManager.HardwareSecurityModules.Models.BackupRestoreOperationStatus?), string statusDetails = null, Azure.ResponseError error = null, System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? endOn = default(System.DateTimeOffset?), string jobId = null, System.Uri azureStorageBlobContainerUri = null, string backupId = null) { throw null; } public static Azure.ResourceManager.HardwareSecurityModules.CloudHsmClusterData CloudHsmClusterData(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.HardwareSecurityModules.Models.CloudHsmClusterProperties properties = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterSku sku = null) { throw null; } + public static Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPatch CloudHsmClusterPatch(System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } public static Azure.ResourceManager.HardwareSecurityModules.CloudHsmClusterPrivateEndpointConnectionData CloudHsmClusterPrivateEndpointConnectionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateEndpointConnectionProperties properties = null, Azure.ETag? etag = default(Azure.ETag?)) { throw null; } public static Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateEndpointConnectionProperties CloudHsmClusterPrivateEndpointConnectionProperties(Azure.Core.ResourceIdentifier privateEndpointId = null, Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateLinkServiceConnectionState connectionState = null, Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateEndpointConnectionProvisioningState? provisioningState = default(Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateEndpointConnectionProvisioningState?), System.Collections.Generic.IEnumerable groupIds = null) { throw null; } public static Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateLinkData CloudHsmClusterPrivateLinkData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateLinkResourceProperties properties = null) { throw null; } @@ -254,6 +268,8 @@ public static partial class ArmHardwareSecurityModulesModelFactory public static Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmEndpointDependency DedicatedHsmEndpointDependency(string domainName = null, System.Collections.Generic.IEnumerable endpointDetails = null) { throw null; } public static Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmEndpointDetail DedicatedHsmEndpointDetail(string ipAddress = null, int? port = default(int?), string protocol = null, string description = null) { throw null; } public static Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmNetworkInterface DedicatedHsmNetworkInterface(Azure.Core.ResourceIdentifier resourceId = null, string privateIPAddress = null) { throw null; } + public static Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmNetworkProfile DedicatedHsmNetworkProfile(Azure.Core.ResourceIdentifier subnetResourceId = null, System.Collections.Generic.IEnumerable networkInterfaces = null) { throw null; } + public static Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmPatch DedicatedHsmPatch(System.Collections.Generic.IDictionary tags = null) { throw null; } public static Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmProperties DedicatedHsmProperties(Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmNetworkProfile networkProfile = null, Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmNetworkProfile managementNetworkProfile = null, string stampId = null, string statusMessage = null, Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmJsonWebKeyType? provisioningState = default(Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmJsonWebKeyType?)) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] @@ -273,6 +289,7 @@ public static partial class ArmHardwareSecurityModulesModelFactory public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.HardwareSecurityModules.Models.AutoGeneratedDomainNameLabelScope left, Azure.ResourceManager.HardwareSecurityModules.Models.AutoGeneratedDomainNameLabelScope right) { throw null; } public static implicit operator Azure.ResourceManager.HardwareSecurityModules.Models.AutoGeneratedDomainNameLabelScope (string value) { throw null; } + public static implicit operator Azure.ResourceManager.HardwareSecurityModules.Models.AutoGeneratedDomainNameLabelScope? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.HardwareSecurityModules.Models.AutoGeneratedDomainNameLabelScope left, Azure.ResourceManager.HardwareSecurityModules.Models.AutoGeneratedDomainNameLabelScope right) { throw null; } public override string ToString() { throw null; } } @@ -285,7 +302,10 @@ internal BackupRestoreBaseResultProperties() { } public System.DateTimeOffset? StartOn { get { throw null; } } public Azure.ResourceManager.HardwareSecurityModules.Models.BackupRestoreOperationStatus? Status { get { throw null; } } public string StatusDetails { get { throw null; } } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.BackupRestoreBaseResultProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.BackupRestoreBaseResultProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.HardwareSecurityModules.Models.BackupRestoreBaseResultProperties 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.HardwareSecurityModules.Models.BackupRestoreBaseResultProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -309,6 +329,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.HardwareSecurityModules.Models.BackupRestoreOperationStatus left, Azure.ResourceManager.HardwareSecurityModules.Models.BackupRestoreOperationStatus right) { throw null; } public static implicit operator Azure.ResourceManager.HardwareSecurityModules.Models.BackupRestoreOperationStatus (string value) { throw null; } + public static implicit operator Azure.ResourceManager.HardwareSecurityModules.Models.BackupRestoreOperationStatus? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.HardwareSecurityModules.Models.BackupRestoreOperationStatus left, Azure.ResourceManager.HardwareSecurityModules.Models.BackupRestoreOperationStatus right) { throw null; } public override string ToString() { throw null; } } @@ -317,7 +338,10 @@ public partial class BackupRestoreRequestBaseProperties : System.ClientModel.Pri public BackupRestoreRequestBaseProperties(System.Uri azureStorageBlobContainerUri) { } public System.Uri AzureStorageBlobContainerUri { get { throw null; } } public string Token { get { throw null; } set { } } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.BackupRestoreRequestBaseProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.BackupRestoreRequestBaseProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.HardwareSecurityModules.Models.BackupRestoreRequestBaseProperties 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.HardwareSecurityModules.Models.BackupRestoreRequestBaseProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -327,7 +351,10 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class CloudHsmClusterBackupContent : Azure.ResourceManager.HardwareSecurityModules.Models.BackupRestoreRequestBaseProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public CloudHsmClusterBackupContent(System.Uri azureStorageBlobContainerUri) : base (default(System.Uri)) { } + protected override Azure.ResourceManager.HardwareSecurityModules.Models.BackupRestoreRequestBaseProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.ResourceManager.HardwareSecurityModules.Models.BackupRestoreRequestBaseProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterBackupContent 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.HardwareSecurityModules.Models.CloudHsmClusterBackupContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -338,7 +365,10 @@ public partial class CloudHsmClusterBackupResult : System.ClientModel.Primitives { internal CloudHsmClusterBackupResult() { } public Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterBackupResultProperties Properties { get { throw null; } } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterBackupResult JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterBackupResult PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterBackupResult 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.HardwareSecurityModules.Models.CloudHsmClusterBackupResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -350,7 +380,10 @@ public partial class CloudHsmClusterBackupResultProperties : Azure.ResourceManag internal CloudHsmClusterBackupResultProperties() { } public System.Uri AzureStorageBlobContainerUri { get { throw null; } } public string BackupId { get { throw null; } } + protected override Azure.ResourceManager.HardwareSecurityModules.Models.BackupRestoreBaseResultProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.ResourceManager.HardwareSecurityModules.Models.BackupRestoreBaseResultProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterBackupResultProperties 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.HardwareSecurityModules.Models.CloudHsmClusterBackupResultProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -362,7 +395,10 @@ public partial class CloudHsmClusterPatch : System.ClientModel.Primitives.IJsonM public CloudHsmClusterPatch() { } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPatch JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPatch PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPatch 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.HardwareSecurityModules.Models.CloudHsmClusterPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -376,7 +412,10 @@ public CloudHsmClusterPrivateEndpointConnectionProperties(Azure.ResourceManager. public System.Collections.Generic.IReadOnlyList GroupIds { get { throw null; } } public Azure.Core.ResourceIdentifier PrivateEndpointId { get { throw null; } } public Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateEndpointConnectionProvisioningState? ProvisioningState { get { throw null; } } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateEndpointConnectionProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateEndpointConnectionProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateEndpointConnectionProperties 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.HardwareSecurityModules.Models.CloudHsmClusterPrivateEndpointConnectionProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -403,6 +442,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateEndpointConnectionProvisioningState left, Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateEndpointConnectionProvisioningState right) { throw null; } public static implicit operator Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateEndpointConnectionProvisioningState (string value) { throw null; } + public static implicit operator Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateEndpointConnectionProvisioningState? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateEndpointConnectionProvisioningState left, Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateEndpointConnectionProvisioningState right) { throw null; } public override string ToString() { throw null; } } @@ -422,6 +462,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateEndpointServiceConnectionStatus left, Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateEndpointServiceConnectionStatus right) { throw null; } public static implicit operator Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateEndpointServiceConnectionStatus (string value) { throw null; } + public static implicit operator Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateEndpointServiceConnectionStatus? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateEndpointServiceConnectionStatus left, Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateEndpointServiceConnectionStatus right) { throw null; } public override string ToString() { throw null; } } @@ -429,7 +470,10 @@ public partial class CloudHsmClusterPrivateLinkData : Azure.ResourceManager.Mode { public CloudHsmClusterPrivateLinkData() { } public Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateLinkResourceProperties Properties { get { throw null; } set { } } + protected virtual Azure.ResourceManager.Models.ResourceData JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.Models.ResourceData PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateLinkData 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.HardwareSecurityModules.Models.CloudHsmClusterPrivateLinkData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -442,7 +486,10 @@ public CloudHsmClusterPrivateLinkResourceProperties() { } public string GroupId { get { throw null; } } public System.Collections.Generic.IReadOnlyList RequiredMembers { get { throw null; } } public System.Collections.Generic.IList RequiredZoneNames { get { throw null; } } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateLinkResourceProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateLinkResourceProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateLinkResourceProperties 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.HardwareSecurityModules.Models.CloudHsmClusterPrivateLinkResourceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -455,7 +502,10 @@ public CloudHsmClusterPrivateLinkServiceConnectionState() { } public string ActionsRequired { get { throw null; } set { } } public string Description { get { throw null; } set { } } public Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateEndpointServiceConnectionStatus? Status { get { throw null; } set { } } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateLinkServiceConnectionState JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateLinkServiceConnectionState PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPrivateLinkServiceConnectionState 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.HardwareSecurityModules.Models.CloudHsmClusterPrivateLinkServiceConnectionState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -472,7 +522,10 @@ public CloudHsmClusterProperties() { } public Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterProvisioningState? ProvisioningState { get { throw null; } } public Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPublicNetworkAccess? PublicNetworkAccess { get { throw null; } set { } } public string StatusMessage { get { throw null; } } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterProperties 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.HardwareSecurityModules.Models.CloudHsmClusterProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -498,6 +551,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterProvisioningState left, Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterProvisioningState right) { throw null; } public static implicit operator Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterProvisioningState (string value) { throw null; } + public static implicit operator Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterProvisioningState? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterProvisioningState left, Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterProvisioningState right) { throw null; } public override string ToString() { throw null; } } @@ -515,6 +569,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPublicNetworkAccess left, Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPublicNetworkAccess right) { throw null; } public static implicit operator Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPublicNetworkAccess (string value) { throw null; } + public static implicit operator Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPublicNetworkAccess? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPublicNetworkAccess left, Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterPublicNetworkAccess right) { throw null; } public override string ToString() { throw null; } } @@ -522,7 +577,10 @@ public partial class CloudHsmClusterRestoreContent : Azure.ResourceManager.Hardw { public CloudHsmClusterRestoreContent(System.Uri azureStorageBlobContainerUri, string backupId) : base (default(System.Uri)) { } public string BackupId { get { throw null; } } + protected override Azure.ResourceManager.HardwareSecurityModules.Models.BackupRestoreRequestBaseProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected override Azure.ResourceManager.HardwareSecurityModules.Models.BackupRestoreRequestBaseProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected override System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterRestoreContent 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.HardwareSecurityModules.Models.CloudHsmClusterRestoreContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -533,7 +591,10 @@ public partial class CloudHsmClusterRestoreResult : System.ClientModel.Primitive { internal CloudHsmClusterRestoreResult() { } public Azure.ResourceManager.HardwareSecurityModules.Models.BackupRestoreBaseResultProperties Properties { get { throw null; } } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterRestoreResult JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterRestoreResult PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterRestoreResult 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.HardwareSecurityModules.Models.CloudHsmClusterRestoreResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -546,7 +607,10 @@ public CloudHsmClusterSku(Azure.ResourceManager.HardwareSecurityModules.Models.C public int? Capacity { get { throw null; } set { } } public Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterSkuFamily Family { get { throw null; } set { } } public Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterSkuName Name { get { throw null; } set { } } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterSku JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterSku PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterSku 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.HardwareSecurityModules.Models.CloudHsmClusterSku System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -567,6 +631,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterSkuFamily left, Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterSkuFamily right) { throw null; } public static implicit operator Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterSkuFamily (string value) { throw null; } + public static implicit operator Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterSkuFamily? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterSkuFamily left, Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmClusterSkuFamily right) { throw null; } public override string ToString() { throw null; } } @@ -581,7 +646,10 @@ internal CloudHsmProperties() { } public string Fqdn { get { throw null; } } public string State { get { throw null; } } public string StateMessage { get { throw null; } } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.HardwareSecurityModules.Models.CloudHsmProperties 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.HardwareSecurityModules.Models.CloudHsmProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -593,7 +661,10 @@ public partial class DedicatedHsmEgressEndpoint : System.ClientModel.Primitives. internal DedicatedHsmEgressEndpoint() { } public string Category { get { throw null; } } public System.Collections.Generic.IReadOnlyList Endpoints { get { throw null; } } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmEgressEndpoint JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmEgressEndpoint PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmEgressEndpoint 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.HardwareSecurityModules.Models.DedicatedHsmEgressEndpoint System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -605,7 +676,10 @@ public partial class DedicatedHsmEndpointDependency : System.ClientModel.Primiti internal DedicatedHsmEndpointDependency() { } public string DomainName { get { throw null; } } public System.Collections.Generic.IReadOnlyList EndpointDetails { get { throw null; } } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmEndpointDependency JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmEndpointDependency PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmEndpointDependency 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.HardwareSecurityModules.Models.DedicatedHsmEndpointDependency System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -619,7 +693,10 @@ internal DedicatedHsmEndpointDetail() { } public string IPAddress { get { throw null; } } public int? Port { get { throw null; } } public string Protocol { get { throw null; } } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmEndpointDetail JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmEndpointDetail PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmEndpointDetail 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.HardwareSecurityModules.Models.DedicatedHsmEndpointDetail System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -646,6 +723,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmJsonWebKeyType left, Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmJsonWebKeyType right) { throw null; } public static implicit operator Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmJsonWebKeyType (string value) { throw null; } + public static implicit operator Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmJsonWebKeyType? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmJsonWebKeyType left, Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmJsonWebKeyType right) { throw null; } public override string ToString() { throw null; } } @@ -654,7 +732,10 @@ public partial class DedicatedHsmNetworkInterface : System.ClientModel.Primitive public DedicatedHsmNetworkInterface() { } public string PrivateIPAddress { get { throw null; } set { } } public Azure.Core.ResourceIdentifier ResourceId { get { throw null; } } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmNetworkInterface JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmNetworkInterface PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmNetworkInterface 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.HardwareSecurityModules.Models.DedicatedHsmNetworkInterface System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -666,7 +747,10 @@ public partial class DedicatedHsmNetworkProfile : System.ClientModel.Primitives. public DedicatedHsmNetworkProfile() { } public System.Collections.Generic.IList NetworkInterfaces { get { throw null; } } public Azure.Core.ResourceIdentifier SubnetResourceId { get { throw null; } set { } } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmNetworkProfile JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmNetworkProfile PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmNetworkProfile 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.HardwareSecurityModules.Models.DedicatedHsmNetworkProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -677,7 +761,10 @@ public partial class DedicatedHsmPatch : System.ClientModel.Primitives.IJsonMode { public DedicatedHsmPatch() { } public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmPatch JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmPatch PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmPatch 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.HardwareSecurityModules.Models.DedicatedHsmPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -692,7 +779,10 @@ public DedicatedHsmProperties() { } public Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmJsonWebKeyType? ProvisioningState { get { throw null; } } public string StampId { get { throw null; } set { } } public string StatusMessage { get { throw null; } } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmProperties JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmProperties PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmProperties 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.HardwareSecurityModules.Models.DedicatedHsmProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -703,7 +793,10 @@ public partial class DedicatedHsmSku : System.ClientModel.Primitives.IJsonModel< { public DedicatedHsmSku() { } public Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmSkuName? Name { get { throw null; } set { } } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmSku JsonModelCreateCore(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + protected virtual Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmSku PersistableModelCreateCore(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + protected virtual System.BinaryData PersistableModelWriteCore(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmSku 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.HardwareSecurityModules.Models.DedicatedHsmSku System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -730,6 +823,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmSkuName left, Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmSkuName right) { throw null; } public static implicit operator Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmSkuName (string value) { throw null; } + public static implicit operator Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmSkuName? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmSkuName left, Azure.ResourceManager.HardwareSecurityModules.Models.DedicatedHsmSkuName right) { throw null; } public override string ToString() { throw null; } } @@ -751,6 +845,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public override int GetHashCode() { throw null; } public static bool operator ==(Azure.ResourceManager.HardwareSecurityModules.Models.SecurityDomainActivationState left, Azure.ResourceManager.HardwareSecurityModules.Models.SecurityDomainActivationState right) { throw null; } public static implicit operator Azure.ResourceManager.HardwareSecurityModules.Models.SecurityDomainActivationState (string value) { throw null; } + public static implicit operator Azure.ResourceManager.HardwareSecurityModules.Models.SecurityDomainActivationState? (string value) { throw null; } public static bool operator !=(Azure.ResourceManager.HardwareSecurityModules.Models.SecurityDomainActivationState left, Azure.ResourceManager.HardwareSecurityModules.Models.SecurityDomainActivationState right) { throw null; } public override string ToString() { throw null; } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/ArmHardwareSecurityModulesModelFactory.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/ArmHardwareSecurityModulesModelFactory.cs index 1fa903d192e4..bc21a0917158 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/ArmHardwareSecurityModulesModelFactory.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/ArmHardwareSecurityModulesModelFactory.cs @@ -8,43 +8,46 @@ using System; using System.Collections.Generic; using System.Linq; +using Azure; using Azure.Core; +using Azure.ResourceManager.HardwareSecurityModules; using Azure.ResourceManager.Models; namespace Azure.ResourceManager.HardwareSecurityModules.Models { - /// Model factory for models. + /// A factory class for creating instances of the models for mocking. public static partial class ArmHardwareSecurityModulesModelFactory { - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. + + /// Resource information with extended details. + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + /// The name of the resource. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// Resource tags. + /// The geo-location where the resource lives. /// Properties of the Cloud HSM Cluster. /// Managed service identity (system assigned and/or user assigned identities). /// SKU details. /// A new instance for mocking. - public static CloudHsmClusterData CloudHsmClusterData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CloudHsmClusterProperties properties = null, ManagedServiceIdentity identity = null, CloudHsmClusterSku sku = null) + public static CloudHsmClusterData CloudHsmClusterData(ResourceIdentifier id = default, string name = default, ResourceType resourceType = default, SystemData systemData = default, IDictionary tags = default, AzureLocation location = default, CloudHsmClusterProperties properties = default, ManagedServiceIdentity identity = default, CloudHsmClusterSku sku = default) { - tags ??= new Dictionary(); + tags ??= new ChangeTrackingDictionary(); return new CloudHsmClusterData( id, name, resourceType, systemData, + additionalBinaryDataProperties: null, tags, location, properties, identity, - sku, - serializedAdditionalRawData: null); + sku); } - /// Initializes a new instance of . + /// Properties of a Cloud HSM Cluster. /// State of security domain activation. /// The Cloud HSM Cluster's auto-generated Domain Name Label Scope. /// An array of Cloud HSM Cluster's HSMs. @@ -53,92 +56,101 @@ public static CloudHsmClusterData CloudHsmClusterData(ResourceIdentifier id = nu /// The Cloud HSM Cluster public network access. /// Cloud HSM Cluster status message. /// A new instance for mocking. - public static CloudHsmClusterProperties CloudHsmClusterProperties(SecurityDomainActivationState? activationState = null, AutoGeneratedDomainNameLabelScope? autoGeneratedDomainNameLabelScope = null, IEnumerable hsms = null, IEnumerable privateEndpointConnections = null, CloudHsmClusterProvisioningState? provisioningState = null, CloudHsmClusterPublicNetworkAccess? publicNetworkAccess = null, string statusMessage = null) + public static CloudHsmClusterProperties CloudHsmClusterProperties(SecurityDomainActivationState? activationState = default, AutoGeneratedDomainNameLabelScope? autoGeneratedDomainNameLabelScope = default, IEnumerable hsms = default, IEnumerable privateEndpointConnections = default, CloudHsmClusterProvisioningState? provisioningState = default, CloudHsmClusterPublicNetworkAccess? publicNetworkAccess = default, string statusMessage = default) { - hsms ??= new List(); - privateEndpointConnections ??= new List(); + hsms ??= new ChangeTrackingList(); + privateEndpointConnections ??= new ChangeTrackingList(); return new CloudHsmClusterProperties( activationState, autoGeneratedDomainNameLabelScope, - hsms?.ToList(), - privateEndpointConnections?.ToList(), + hsms.ToList(), + privateEndpointConnections.ToList(), provisioningState, publicNetworkAccess, statusMessage, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// The Cloud HSM Properties. /// FQDN of the Cloud HSM. /// The Cloud HSM State. Values are: Deploying, ConfiguringSlb, Starting, Starting, Failed, Failed, Deleting, DeletingSlbEntry, InitialProvisioning, Updating. /// The Cloud HSM State message. /// A new instance for mocking. - public static CloudHsmProperties CloudHsmProperties(string fqdn = null, string state = null, string stateMessage = null) + public static CloudHsmProperties CloudHsmProperties(string fqdn = default, string state = default, string stateMessage = default) { - return new CloudHsmProperties(fqdn, state, stateMessage, serializedAdditionalRawData: null); + return new CloudHsmProperties(fqdn, state, stateMessage, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + /// The name of the resource. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. /// Resource properties. /// Modified whenever there is a change in the state of private endpoint connection. /// A new instance for mocking. - public static CloudHsmClusterPrivateEndpointConnectionData CloudHsmClusterPrivateEndpointConnectionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, CloudHsmClusterPrivateEndpointConnectionProperties properties = null, ETag? etag = null) + public static CloudHsmClusterPrivateEndpointConnectionData CloudHsmClusterPrivateEndpointConnectionData(ResourceIdentifier id = default, string name = default, ResourceType resourceType = default, SystemData systemData = default, CloudHsmClusterPrivateEndpointConnectionProperties properties = default, ETag? etag = default) { return new CloudHsmClusterPrivateEndpointConnectionData( id, name, resourceType, systemData, + additionalBinaryDataProperties: null, properties, - etag, - serializedAdditionalRawData: null); + etag); } - /// Initializes a new instance of . - /// The private endpoint resource. + /// The resource identifier of the private endpoint. /// A collection of information about the state of the connection between service consumer and provider. /// The provisioning state of the private endpoint connection resource. /// The group ids for the private endpoint resource. /// A new instance for mocking. - public static CloudHsmClusterPrivateEndpointConnectionProperties CloudHsmClusterPrivateEndpointConnectionProperties(ResourceIdentifier privateEndpointId = null, CloudHsmClusterPrivateLinkServiceConnectionState connectionState = null, CloudHsmClusterPrivateEndpointConnectionProvisioningState? provisioningState = null, IEnumerable groupIds = null) + public static CloudHsmClusterPrivateEndpointConnectionProperties CloudHsmClusterPrivateEndpointConnectionProperties(ResourceIdentifier privateEndpointId = default, CloudHsmClusterPrivateLinkServiceConnectionState connectionState = default, CloudHsmClusterPrivateEndpointConnectionProvisioningState? provisioningState = default, IEnumerable groupIds = default) + { + groupIds ??= new ChangeTrackingList(); + + return new CloudHsmClusterPrivateEndpointConnectionProperties(privateEndpointId is null ? default : new PrivateEndpoint(privateEndpointId, null), connectionState, provisioningState, groupIds.ToList(), additionalBinaryDataProperties: null); + } + + /// Patchable properties of the Cloud HSM Cluster. + /// The Cloud HSM Cluster's tags. + /// Managed service identity (system assigned and/or user assigned identities). + /// A new instance for mocking. + public static CloudHsmClusterPatch CloudHsmClusterPatch(IDictionary tags = default, ManagedServiceIdentity identity = default) { - groupIds ??= new List(); + tags ??= new ChangeTrackingDictionary(); - return new CloudHsmClusterPrivateEndpointConnectionProperties(privateEndpointId != null ? ResourceManagerModelFactory.SubResource(privateEndpointId) : null, connectionState, provisioningState, groupIds?.ToList(), serializedAdditionalRawData: null); + return new CloudHsmClusterPatch(tags, identity, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Backup properties. /// The Azure blob storage container Uri which contains the backup. /// The SAS token pointing to an Azure blob storage container. This property is reserved for Azure Backup Service. /// A new instance for mocking. - public static CloudHsmClusterBackupContent CloudHsmClusterBackupContent(Uri azureStorageBlobContainerUri = null, string token = null) + public static CloudHsmClusterBackupContent CloudHsmClusterBackupContent(Uri azureStorageBlobContainerUri = default, string token = default) { - return new CloudHsmClusterBackupContent(azureStorageBlobContainerUri, token, serializedAdditionalRawData: null); + return new CloudHsmClusterBackupContent(azureStorageBlobContainerUri, token, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Backup and Restore Common properties. /// The Azure blob storage container Uri which contains the backup. /// The SAS token pointing to an Azure blob storage container. This property is reserved for Azure Backup Service. /// A new instance for mocking. - public static BackupRestoreRequestBaseProperties BackupRestoreRequestBaseProperties(Uri azureStorageBlobContainerUri = null, string token = null) + public static BackupRestoreRequestBaseProperties BackupRestoreRequestBaseProperties(Uri azureStorageBlobContainerUri = default, string token = default) { - return new BackupRestoreRequestBaseProperties(azureStorageBlobContainerUri, token, serializedAdditionalRawData: null); + return new BackupRestoreRequestBaseProperties(azureStorageBlobContainerUri, token, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Backup operation Result. /// Properties of the Cloud HSM Cluster. /// A new instance for mocking. - public static CloudHsmClusterBackupResult CloudHsmClusterBackupResult(CloudHsmClusterBackupResultProperties properties = null) + public static CloudHsmClusterBackupResult CloudHsmClusterBackupResult(CloudHsmClusterBackupResultProperties properties = default) { - return new CloudHsmClusterBackupResult(properties, serializedAdditionalRawData: null); + return new CloudHsmClusterBackupResult(properties, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Properties of the Cloud HSM Cluster. /// Status of the backup/restore operation. /// The status details of backup/restore operation. /// Error encountered, if any, during the backup/restore operation. @@ -148,7 +160,7 @@ public static CloudHsmClusterBackupResult CloudHsmClusterBackupResult(CloudHsmCl /// The Azure blob storage container Uri which contains the backup. /// The ID of the backup. /// A new instance for mocking. - public static CloudHsmClusterBackupResultProperties CloudHsmClusterBackupResultProperties(BackupRestoreOperationStatus? status = null, string statusDetails = null, ResponseError error = null, DateTimeOffset? startOn = null, DateTimeOffset? endOn = null, string jobId = null, Uri azureStorageBlobContainerUri = null, string backupId = null) + public static CloudHsmClusterBackupResultProperties CloudHsmClusterBackupResultProperties(BackupRestoreOperationStatus? status = default, string statusDetails = default, ResponseError error = default, DateTimeOffset? startOn = default, DateTimeOffset? endOn = default, string jobId = default, Uri azureStorageBlobContainerUri = default, string backupId = default) { return new CloudHsmClusterBackupResultProperties( status, @@ -157,12 +169,12 @@ public static CloudHsmClusterBackupResultProperties CloudHsmClusterBackupResultP startOn, endOn, jobId, - serializedAdditionalRawData: null, + additionalBinaryDataProperties: null, azureStorageBlobContainerUri, backupId); } - /// Initializes a new instance of . + /// Backup and Restore operation common properties. /// Status of the backup/restore operation. /// The status details of backup/restore operation. /// Error encountered, if any, during the backup/restore operation. @@ -170,7 +182,7 @@ public static CloudHsmClusterBackupResultProperties CloudHsmClusterBackupResultP /// The end time of the backup/restore operation in UTC. /// Identifier for the backup/restore operation. /// A new instance for mocking. - public static BackupRestoreBaseResultProperties BackupRestoreBaseResultProperties(BackupRestoreOperationStatus? status = null, string statusDetails = null, ResponseError error = null, DateTimeOffset? startOn = null, DateTimeOffset? endOn = null, string jobId = null) + public static BackupRestoreBaseResultProperties BackupRestoreBaseResultProperties(BackupRestoreOperationStatus? status = default, string statusDetails = default, ResponseError error = default, DateTimeOffset? startOn = default, DateTimeOffset? endOn = default, string jobId = default) { return new BackupRestoreBaseResultProperties( status, @@ -179,64 +191,63 @@ public static BackupRestoreBaseResultProperties BackupRestoreBaseResultPropertie startOn, endOn, jobId, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Cloud Hsm Cluster restore information. /// The Azure blob storage container Uri which contains the backup. /// The SAS token pointing to an Azure blob storage container. This property is reserved for Azure Backup Service. /// An autogenerated unique string ID for labeling the backup. It contains both a UUID and a date timestamp. /// A new instance for mocking. - public static CloudHsmClusterRestoreContent CloudHsmClusterRestoreContent(Uri azureStorageBlobContainerUri = null, string token = null, string backupId = null) + public static CloudHsmClusterRestoreContent CloudHsmClusterRestoreContent(Uri azureStorageBlobContainerUri = default, string token = default, string backupId = default) { - return new CloudHsmClusterRestoreContent(azureStorageBlobContainerUri, token, serializedAdditionalRawData: null, backupId); + return new CloudHsmClusterRestoreContent(azureStorageBlobContainerUri, token, additionalBinaryDataProperties: null, backupId); } - /// Initializes a new instance of . + /// Restore operation properties. /// Backup and Restore operation common properties. /// A new instance for mocking. - public static CloudHsmClusterRestoreResult CloudHsmClusterRestoreResult(BackupRestoreBaseResultProperties properties = null) + public static CloudHsmClusterRestoreResult CloudHsmClusterRestoreResult(BackupRestoreBaseResultProperties properties = default) { - return new CloudHsmClusterRestoreResult(properties, serializedAdditionalRawData: null); + return new CloudHsmClusterRestoreResult(properties, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + /// The name of the resource. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// Resource tags. + /// The geo-location where the resource lives. /// Properties of the dedicated HSM. - /// SKU details. + /// SKU of the dedicated HSM. /// The availability zones. /// A new instance for mocking. - public static DedicatedHsmData DedicatedHsmData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, DedicatedHsmProperties properties = null, DedicatedHsmSkuName? skuName = null, IEnumerable zones = null) + public static DedicatedHsmData DedicatedHsmData(ResourceIdentifier id = default, string name = default, ResourceType resourceType = default, SystemData systemData = default, IDictionary tags = default, AzureLocation location = default, DedicatedHsmProperties properties = default, DedicatedHsmSkuName? skuName = default, IEnumerable zones = default) { - tags ??= new Dictionary(); - zones ??= new List(); + tags ??= new ChangeTrackingDictionary(); + zones ??= new ChangeTrackingList(); return new DedicatedHsmData( id, name, resourceType, systemData, + additionalBinaryDataProperties: null, tags, location, properties, - skuName != null ? new DedicatedHsmSku(skuName, serializedAdditionalRawData: null) : null, - zones?.ToList(), - serializedAdditionalRawData: null); + skuName is null ? default : new DedicatedHsmSku(skuName, null), + zones.ToList()); } - /// Initializes a new instance of . + /// Properties of the dedicated hsm. /// Specifies the network interfaces of the dedicated hsm. /// Specifies the management network interfaces of the dedicated hsm. /// This field will be used when RP does not support Availability zones. /// Resource Status Message. /// Provisioning state. /// A new instance for mocking. - public static DedicatedHsmProperties DedicatedHsmProperties(DedicatedHsmNetworkProfile networkProfile = null, DedicatedHsmNetworkProfile managementNetworkProfile = null, string stampId = null, string statusMessage = null, DedicatedHsmJsonWebKeyType? provisioningState = null) + public static DedicatedHsmProperties DedicatedHsmProperties(DedicatedHsmNetworkProfile networkProfile = default, DedicatedHsmNetworkProfile managementNetworkProfile = default, string stampId = default, string statusMessage = default, DedicatedHsmJsonWebKeyType? provisioningState = default) { return new DedicatedHsmProperties( networkProfile, @@ -244,80 +255,100 @@ public static DedicatedHsmProperties DedicatedHsmProperties(DedicatedHsmNetworkP stampId, statusMessage, provisioningState, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// The Azure resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... + /// Specifies the list of resource Ids for the network interfaces associated with the dedicated HSM. + /// A new instance for mocking. + public static DedicatedHsmNetworkProfile DedicatedHsmNetworkProfile(ResourceIdentifier subnetResourceId = default, IEnumerable networkInterfaces = default) + { + networkInterfaces ??= new ChangeTrackingList(); + + return new DedicatedHsmNetworkProfile(subnetResourceId is null ? default : new ApiEntityReference(subnetResourceId, null), networkInterfaces.ToList(), additionalBinaryDataProperties: null); + } + + /// The network interface definition. /// The Azure resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... /// Private Ip address of the interface. /// A new instance for mocking. - public static DedicatedHsmNetworkInterface DedicatedHsmNetworkInterface(ResourceIdentifier resourceId = null, string privateIPAddress = null) + public static DedicatedHsmNetworkInterface DedicatedHsmNetworkInterface(ResourceIdentifier resourceId = default, string privateIPAddress = default) { - return new DedicatedHsmNetworkInterface(resourceId, privateIPAddress, serializedAdditionalRawData: null); + return new DedicatedHsmNetworkInterface(resourceId, privateIPAddress, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Patchable properties of the dedicated HSM. + /// Resource tags. + /// A new instance for mocking. + public static DedicatedHsmPatch DedicatedHsmPatch(IDictionary tags = default) + { + tags ??= new ChangeTrackingDictionary(); + + return new DedicatedHsmPatch(tags, additionalBinaryDataProperties: null); + } + + /// Egress endpoints which dedicated hsm service connects to for common purpose. /// The category of endpoints accessed by the dedicated hsm service, e.g. azure-resource-management, apiserver, etc. /// The endpoints that dedicated hsm service connects to. /// A new instance for mocking. - public static DedicatedHsmEgressEndpoint DedicatedHsmEgressEndpoint(string category = null, IEnumerable endpoints = null) + public static DedicatedHsmEgressEndpoint DedicatedHsmEgressEndpoint(string category = default, IEnumerable endpoints = default) { - endpoints ??= new List(); + endpoints ??= new ChangeTrackingList(); - return new DedicatedHsmEgressEndpoint(category, endpoints?.ToList(), serializedAdditionalRawData: null); + return new DedicatedHsmEgressEndpoint(category, endpoints.ToList(), additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// A domain name that dedicated hsm services are reaching at. /// The domain name of the dependency. /// The Ports and Protocols used when connecting to domainName. /// A new instance for mocking. - public static DedicatedHsmEndpointDependency DedicatedHsmEndpointDependency(string domainName = null, IEnumerable endpointDetails = null) + public static DedicatedHsmEndpointDependency DedicatedHsmEndpointDependency(string domainName = default, IEnumerable endpointDetails = default) { - endpointDetails ??= new List(); + endpointDetails ??= new ChangeTrackingList(); - return new DedicatedHsmEndpointDependency(domainName, endpointDetails?.ToList(), serializedAdditionalRawData: null); + return new DedicatedHsmEndpointDependency(domainName, endpointDetails.ToList(), additionalBinaryDataProperties: null); } - /// Initializes a new instance of . + /// Connect information from the dedicated hsm service to a single endpoint. /// An IP Address that Domain Name currently resolves to. /// The port an endpoint is connected to. /// The protocol used for connection. /// Description of the detail. /// A new instance for mocking. - public static DedicatedHsmEndpointDetail DedicatedHsmEndpointDetail(string ipAddress = null, int? port = null, string protocol = null, string description = null) + public static DedicatedHsmEndpointDetail DedicatedHsmEndpointDetail(string ipAddress = default, int? port = default, string protocol = default, string description = default) { - return new DedicatedHsmEndpointDetail(ipAddress, port, protocol, description, serializedAdditionalRawData: null); + return new DedicatedHsmEndpointDetail(ipAddress, port, protocol, description, additionalBinaryDataProperties: null); } - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. + /// A private link resource. + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + /// The name of the resource. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. /// Resource properties. /// A new instance for mocking. - public static CloudHsmClusterPrivateLinkData CloudHsmClusterPrivateLinkData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, CloudHsmClusterPrivateLinkResourceProperties properties = null) + public static CloudHsmClusterPrivateLinkData CloudHsmClusterPrivateLinkData(ResourceIdentifier id = default, string name = default, ResourceType resourceType = default, SystemData systemData = default, CloudHsmClusterPrivateLinkResourceProperties properties = default) { return new CloudHsmClusterPrivateLinkData( id, name, resourceType, systemData, - properties, - serializedAdditionalRawData: null); + additionalBinaryDataProperties: null, + properties); } - /// Initializes a new instance of . + /// Properties of a private link resource. /// The private link resource group id. /// The private link resource required member names. /// The private link resource private link DNS zone name. /// A new instance for mocking. - public static CloudHsmClusterPrivateLinkResourceProperties CloudHsmClusterPrivateLinkResourceProperties(string groupId = null, IEnumerable requiredMembers = null, IEnumerable requiredZoneNames = null) + public static CloudHsmClusterPrivateLinkResourceProperties CloudHsmClusterPrivateLinkResourceProperties(string groupId = default, IEnumerable requiredMembers = default, IEnumerable requiredZoneNames = default) { - requiredMembers ??= new List(); - requiredZoneNames ??= new List(); + requiredMembers ??= new ChangeTrackingList(); + requiredZoneNames ??= new ChangeTrackingList(); - return new CloudHsmClusterPrivateLinkResourceProperties(groupId, requiredMembers?.ToList(), requiredZoneNames?.ToList(), serializedAdditionalRawData: null); + return new CloudHsmClusterPrivateLinkResourceProperties(groupId, requiredMembers.ToList(), requiredZoneNames.ToList(), additionalBinaryDataProperties: null); } } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CloudHsmClusterCollection.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CloudHsmClusterCollection.cs index 1a0867c1024d..d76ed2c86f1c 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CloudHsmClusterCollection.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CloudHsmClusterCollection.cs @@ -8,12 +8,13 @@ using System; using System.Collections; using System.Collections.Generic; -using System.Globalization; +using System.Diagnostics; using System.Threading; using System.Threading.Tasks; -using Autorest.CSharp.Core; +using Azure; using Azure.Core; using Azure.Core.Pipeline; +using Azure.ResourceManager; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.HardwareSecurityModules @@ -25,51 +26,53 @@ namespace Azure.ResourceManager.HardwareSecurityModules /// public partial class CloudHsmClusterCollection : ArmCollection, IEnumerable, IAsyncEnumerable { - private readonly ClientDiagnostics _cloudHsmClusterClientDiagnostics; - private readonly CloudHsmClustersRestOperations _cloudHsmClusterRestClient; + private readonly ClientDiagnostics _cloudHsmClustersClientDiagnostics; + private readonly CloudHsmClusters _cloudHsmClustersRestClient; + private readonly ClientDiagnostics _cloudHsmClusterPrivateLinkResourcesClientDiagnostics; + private readonly CloudHsmClusterPrivateLinkResources _cloudHsmClusterPrivateLinkResourcesRestClient; - /// Initializes a new instance of the class for mocking. + /// Initializes a new instance of CloudHsmClusterCollection for mocking. protected CloudHsmClusterCollection() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of class. /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. + /// The identifier of the resource that is the target of operations. internal CloudHsmClusterCollection(ArmClient client, ResourceIdentifier id) : base(client, id) { - _cloudHsmClusterClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HardwareSecurityModules", CloudHsmClusterResource.ResourceType.Namespace, Diagnostics); TryGetApiVersion(CloudHsmClusterResource.ResourceType, out string cloudHsmClusterApiVersion); - _cloudHsmClusterRestClient = new CloudHsmClustersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, cloudHsmClusterApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif + _cloudHsmClustersClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HardwareSecurityModules", CloudHsmClusterResource.ResourceType.Namespace, Diagnostics); + _cloudHsmClustersRestClient = new CloudHsmClusters(_cloudHsmClustersClientDiagnostics, Pipeline, Endpoint, cloudHsmClusterApiVersion ?? "2025-03-31"); + _cloudHsmClusterPrivateLinkResourcesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HardwareSecurityModules", CloudHsmClusterResource.ResourceType.Namespace, Diagnostics); + _cloudHsmClusterPrivateLinkResourcesRestClient = new CloudHsmClusterPrivateLinkResources(_cloudHsmClusterPrivateLinkResourcesClientDiagnostics, Pipeline, Endpoint, cloudHsmClusterApiVersion ?? "2025-03-31"); + ValidateResourceId(id); } + /// + [Conditional("DEBUG")] internal static void ValidateResourceId(ResourceIdentifier id) { if (id.ResourceType != ResourceGroupResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); + { + throw new ArgumentException(string.Format("Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), id); + } } /// /// Create or Update a Cloud HSM Cluster in the specified subscription. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName} - /// - /// - /// Operation Id - /// CloudHsmCluster_CreateOrUpdate + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}. /// /// - /// Default Api Version - /// 2025-03-31 + /// Operation Id. + /// CloudHsmClusters_CreateOrUpdate. /// /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-31. /// /// /// @@ -77,21 +80,34 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length. /// Parameters to create Cloud HSM Cluster. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// or is null. + /// is an empty string, and was expected to be non-empty. public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string cloudHsmClusterName, CloudHsmClusterData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(cloudHsmClusterName, nameof(cloudHsmClusterName)); Argument.AssertNotNull(data, nameof(data)); - using var scope = _cloudHsmClusterClientDiagnostics.CreateScope("CloudHsmClusterCollection.CreateOrUpdate"); + using DiagnosticScope scope = _cloudHsmClustersClientDiagnostics.CreateScope("CloudHsmClusterCollection.CreateOrUpdate"); scope.Start(); try { - var response = await _cloudHsmClusterRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, cloudHsmClusterName, data, cancellationToken).ConfigureAwait(false); - var operation = new HardwareSecurityModulesArmOperation(new CloudHsmClusterOperationSource(Client), _cloudHsmClusterClientDiagnostics, Pipeline, _cloudHsmClusterRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, cloudHsmClusterName, data).Request, response, OperationFinalStateVia.OriginalUri); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _cloudHsmClustersRestClient.CreateCreateOrUpdateRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, cloudHsmClusterName, CloudHsmClusterData.ToRequestContent(data), context); + Response response = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + HardwareSecurityModulesArmOperation operation = new HardwareSecurityModulesArmOperation( + new CloudHsmClusterOperationSource(Client), + _cloudHsmClustersClientDiagnostics, + Pipeline, + message.Request, + response, + OperationFinalStateVia.OriginalUri); if (waitUntil == WaitUntil.Completed) + { await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + } return operation; } catch (Exception e) @@ -105,20 +121,16 @@ public virtual async Task> CreateOrUpdateA /// Create or Update a Cloud HSM Cluster in the specified subscription. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}. /// /// - /// Operation Id - /// CloudHsmCluster_CreateOrUpdate + /// Operation Id. + /// CloudHsmClusters_CreateOrUpdate. /// /// - /// Default Api Version - /// 2025-03-31 - /// - /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-31. /// /// /// @@ -126,21 +138,34 @@ public virtual async Task> CreateOrUpdateA /// The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length. /// Parameters to create Cloud HSM Cluster. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// or is null. + /// is an empty string, and was expected to be non-empty. public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string cloudHsmClusterName, CloudHsmClusterData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(cloudHsmClusterName, nameof(cloudHsmClusterName)); Argument.AssertNotNull(data, nameof(data)); - using var scope = _cloudHsmClusterClientDiagnostics.CreateScope("CloudHsmClusterCollection.CreateOrUpdate"); + using DiagnosticScope scope = _cloudHsmClustersClientDiagnostics.CreateScope("CloudHsmClusterCollection.CreateOrUpdate"); scope.Start(); try { - var response = _cloudHsmClusterRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, cloudHsmClusterName, data, cancellationToken); - var operation = new HardwareSecurityModulesArmOperation(new CloudHsmClusterOperationSource(Client), _cloudHsmClusterClientDiagnostics, Pipeline, _cloudHsmClusterRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, cloudHsmClusterName, data).Request, response, OperationFinalStateVia.OriginalUri); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _cloudHsmClustersRestClient.CreateCreateOrUpdateRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, cloudHsmClusterName, CloudHsmClusterData.ToRequestContent(data), context); + Response response = Pipeline.ProcessMessage(message, context); + HardwareSecurityModulesArmOperation operation = new HardwareSecurityModulesArmOperation( + new CloudHsmClusterOperationSource(Client), + _cloudHsmClustersClientDiagnostics, + Pipeline, + message.Request, + response, + OperationFinalStateVia.OriginalUri); if (waitUntil == WaitUntil.Completed) + { operation.WaitForCompletion(cancellationToken); + } return operation; } catch (Exception e) @@ -154,38 +179,42 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wa /// Gets the specified Cloud HSM Cluster /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName} - /// - /// - /// Operation Id - /// CloudHsmCluster_Get + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}. /// /// - /// Default Api Version - /// 2025-03-31 + /// Operation Id. + /// CloudHsmClusters_Get. /// /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-31. /// /// /// /// The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. public virtual async Task> GetAsync(string cloudHsmClusterName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(cloudHsmClusterName, nameof(cloudHsmClusterName)); - using var scope = _cloudHsmClusterClientDiagnostics.CreateScope("CloudHsmClusterCollection.Get"); + using DiagnosticScope scope = _cloudHsmClustersClientDiagnostics.CreateScope("CloudHsmClusterCollection.Get"); scope.Start(); try { - var response = await _cloudHsmClusterRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, cloudHsmClusterName, cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _cloudHsmClustersRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, cloudHsmClusterName, context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(CloudHsmClusterData.FromResponse(result), result); if (response.Value == null) + { throw new RequestFailedException(response.GetRawResponse()); + } return Response.FromValue(new CloudHsmClusterResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -199,38 +228,42 @@ public virtual async Task> GetAsync(string clo /// Gets the specified Cloud HSM Cluster /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName} - /// - /// - /// Operation Id - /// CloudHsmCluster_Get + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}. /// /// - /// Default Api Version - /// 2025-03-31 + /// Operation Id. + /// CloudHsmClusters_Get. /// /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-31. /// /// /// /// The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. public virtual Response Get(string cloudHsmClusterName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(cloudHsmClusterName, nameof(cloudHsmClusterName)); - using var scope = _cloudHsmClusterClientDiagnostics.CreateScope("CloudHsmClusterCollection.Get"); + using DiagnosticScope scope = _cloudHsmClustersClientDiagnostics.CreateScope("CloudHsmClusterCollection.Get"); scope.Start(); try { - var response = _cloudHsmClusterRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, cloudHsmClusterName, cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _cloudHsmClustersRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, cloudHsmClusterName, context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(CloudHsmClusterData.FromResponse(result), result); if (response.Value == null) + { throw new RequestFailedException(response.GetRawResponse()); + } return Response.FromValue(new CloudHsmClusterResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -244,98 +277,108 @@ public virtual Response Get(string cloudHsmClusterName, /// The List operation gets information about the Cloud HSM Clusters associated with the subscription and within the specified resource group. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters. /// /// - /// Operation Id - /// CloudHsmCluster_ListByResourceGroup + /// Operation Id. + /// CloudHsmClusters_ListByResourceGroup. /// /// - /// Default Api Version - /// 2025-03-31 - /// - /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-31. /// /// /// /// The page-continuation token to use with a paged version of this API. /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(string skiptoken = null, CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(string skiptoken = default, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _cloudHsmClusterRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, skiptoken); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _cloudHsmClusterRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, skiptoken); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new CloudHsmClusterResource(Client, CloudHsmClusterData.DeserializeCloudHsmClusterData(e)), _cloudHsmClusterClientDiagnostics, Pipeline, "CloudHsmClusterCollection.GetAll", "value", "nextLink", cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + return new AsyncPageableWrapper(new CloudHsmClustersGetByResourceGroupAsyncCollectionResultOfT(_cloudHsmClustersRestClient, Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, skiptoken, context), data => new CloudHsmClusterResource(Client, data)); } /// /// The List operation gets information about the Cloud HSM Clusters associated with the subscription and within the specified resource group. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters - /// - /// - /// Operation Id - /// CloudHsmCluster_ListByResourceGroup + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters. /// /// - /// Default Api Version - /// 2025-03-31 + /// Operation Id. + /// CloudHsmClusters_ListByResourceGroup. /// /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-31. /// /// /// /// The page-continuation token to use with a paged version of this API. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(string skiptoken = null, CancellationToken cancellationToken = default) + public virtual Pageable GetAll(string skiptoken = default, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _cloudHsmClusterRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, skiptoken); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _cloudHsmClusterRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, skiptoken); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new CloudHsmClusterResource(Client, CloudHsmClusterData.DeserializeCloudHsmClusterData(e)), _cloudHsmClusterClientDiagnostics, Pipeline, "CloudHsmClusterCollection.GetAll", "value", "nextLink", cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + return new PageableWrapper(new CloudHsmClustersGetByResourceGroupCollectionResultOfT(_cloudHsmClustersRestClient, Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, skiptoken, context), data => new CloudHsmClusterResource(Client, data)); } /// - /// Checks to see if the resource exists in azure. + /// Gets the specified Cloud HSM Cluster /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}. /// /// - /// Operation Id - /// CloudHsmCluster_Get + /// Operation Id. + /// CloudHsmClusters_Get. /// /// - /// Default Api Version - /// 2025-03-31 - /// - /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-31. /// /// /// /// The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. public virtual async Task> ExistsAsync(string cloudHsmClusterName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(cloudHsmClusterName, nameof(cloudHsmClusterName)); - using var scope = _cloudHsmClusterClientDiagnostics.CreateScope("CloudHsmClusterCollection.Exists"); + using DiagnosticScope scope = _cloudHsmClustersClientDiagnostics.CreateScope("CloudHsmClusterCollection.Exists"); scope.Start(); try { - var response = await _cloudHsmClusterRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, cloudHsmClusterName, cancellationToken: cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _cloudHsmClustersRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, cloudHsmClusterName, context); + await Pipeline.SendAsync(message, context.CancellationToken).ConfigureAwait(false); + Response result = message.Response; + Response response = default; + switch (result.Status) + { + case 200: + response = Response.FromValue(CloudHsmClusterData.FromResponse(result), result); + break; + case 404: + response = Response.FromValue((CloudHsmClusterData)null, result); + break; + default: + throw new RequestFailedException(result); + } return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -346,39 +389,53 @@ public virtual async Task> ExistsAsync(string cloudHsmClusterName } /// - /// Checks to see if the resource exists in azure. + /// Gets the specified Cloud HSM Cluster /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName} - /// - /// - /// Operation Id - /// CloudHsmCluster_Get + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}. /// /// - /// Default Api Version - /// 2025-03-31 + /// Operation Id. + /// CloudHsmClusters_Get. /// /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-31. /// /// /// /// The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. public virtual Response Exists(string cloudHsmClusterName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(cloudHsmClusterName, nameof(cloudHsmClusterName)); - using var scope = _cloudHsmClusterClientDiagnostics.CreateScope("CloudHsmClusterCollection.Exists"); + using DiagnosticScope scope = _cloudHsmClustersClientDiagnostics.CreateScope("CloudHsmClusterCollection.Exists"); scope.Start(); try { - var response = _cloudHsmClusterRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, cloudHsmClusterName, cancellationToken: cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _cloudHsmClustersRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, cloudHsmClusterName, context); + Pipeline.Send(message, context.CancellationToken); + Response result = message.Response; + Response response = default; + switch (result.Status) + { + case 200: + response = Response.FromValue(CloudHsmClusterData.FromResponse(result), result); + break; + case 404: + response = Response.FromValue((CloudHsmClusterData)null, result); + break; + default: + throw new RequestFailedException(result); + } return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -389,41 +446,57 @@ public virtual Response Exists(string cloudHsmClusterName, CancellationTok } /// - /// Tries to get details for this resource from the service. + /// Gets the specified Cloud HSM Cluster /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName} - /// - /// - /// Operation Id - /// CloudHsmCluster_Get + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}. /// /// - /// Default Api Version - /// 2025-03-31 + /// Operation Id. + /// CloudHsmClusters_Get. /// /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-31. /// /// /// /// The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. public virtual async Task> GetIfExistsAsync(string cloudHsmClusterName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(cloudHsmClusterName, nameof(cloudHsmClusterName)); - using var scope = _cloudHsmClusterClientDiagnostics.CreateScope("CloudHsmClusterCollection.GetIfExists"); + using DiagnosticScope scope = _cloudHsmClustersClientDiagnostics.CreateScope("CloudHsmClusterCollection.GetIfExists"); scope.Start(); try { - var response = await _cloudHsmClusterRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, cloudHsmClusterName, cancellationToken: cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _cloudHsmClustersRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, cloudHsmClusterName, context); + await Pipeline.SendAsync(message, context.CancellationToken).ConfigureAwait(false); + Response result = message.Response; + Response response = default; + switch (result.Status) + { + case 200: + response = Response.FromValue(CloudHsmClusterData.FromResponse(result), result); + break; + case 404: + response = Response.FromValue((CloudHsmClusterData)null, result); + break; + default: + throw new RequestFailedException(result); + } if (response.Value == null) + { return new NoValueResponse(response.GetRawResponse()); + } return Response.FromValue(new CloudHsmClusterResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -434,41 +507,57 @@ public virtual async Task> GetIfExists } /// - /// Tries to get details for this resource from the service. + /// Gets the specified Cloud HSM Cluster /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}. /// /// - /// Operation Id - /// CloudHsmCluster_Get + /// Operation Id. + /// CloudHsmClusters_Get. /// /// - /// Default Api Version - /// 2025-03-31 - /// - /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-31. /// /// /// /// The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. public virtual NullableResponse GetIfExists(string cloudHsmClusterName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(cloudHsmClusterName, nameof(cloudHsmClusterName)); - using var scope = _cloudHsmClusterClientDiagnostics.CreateScope("CloudHsmClusterCollection.GetIfExists"); + using DiagnosticScope scope = _cloudHsmClustersClientDiagnostics.CreateScope("CloudHsmClusterCollection.GetIfExists"); scope.Start(); try { - var response = _cloudHsmClusterRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, cloudHsmClusterName, cancellationToken: cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _cloudHsmClustersRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, cloudHsmClusterName, context); + Pipeline.Send(message, context.CancellationToken); + Response result = message.Response; + Response response = default; + switch (result.Status) + { + case 200: + response = Response.FromValue(CloudHsmClusterData.FromResponse(result), result); + break; + case 404: + response = Response.FromValue((CloudHsmClusterData)null, result); + break; + default: + throw new RequestFailedException(result); + } if (response.Value == null) + { return new NoValueResponse(response.GetRawResponse()); + } return Response.FromValue(new CloudHsmClusterResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -488,6 +577,7 @@ IEnumerator IEnumerable.GetEnumerator() return GetAll().GetEnumerator(); } + /// The cancellation token to use. IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) { return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CloudHsmClusterData.Serialization.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CloudHsmClusterData.Serialization.cs index 587619f3f24e..c5e76d90af13 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CloudHsmClusterData.Serialization.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CloudHsmClusterData.Serialization.cs @@ -10,16 +10,23 @@ using System.Collections.Generic; using System.Text; using System.Text.Json; +using Azure; using Azure.Core; using Azure.ResourceManager.HardwareSecurityModules.Models; using Azure.ResourceManager.Models; namespace Azure.ResourceManager.HardwareSecurityModules { - public partial class CloudHsmClusterData : IUtf8JsonSerializable, IJsonModel + /// Resource information with extended details. + public partial class CloudHsmClusterData : TrackedResourceData, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal CloudHsmClusterData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -31,12 +38,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(CloudHsmClusterData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Properties)) { @@ -46,7 +52,7 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri if (Optional.IsDefined(Identity)) { writer.WritePropertyName("identity"u8); - ((IJsonModel)Identity).Write(writer, ModelSerializationExtensions.WireV3Options); + ((IJsonModel)Identity).Write(writer, options); } if (Optional.IsDefined(Sku)) { @@ -55,132 +61,153 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - CloudHsmClusterData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + CloudHsmClusterData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (CloudHsmClusterData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ResourceData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(CloudHsmClusterData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeCloudHsmClusterData(document.RootElement, options); } - internal static CloudHsmClusterData DeserializeCloudHsmClusterData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static CloudHsmClusterData DeserializeCloudHsmClusterData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - CloudHsmClusterProperties properties = default; - ManagedServiceIdentity identity = default; - CloudHsmClusterSku sku = default; - IDictionary tags = default; - AzureLocation location = default; ResourceIdentifier id = default; string name = default; - ResourceType type = default; + ResourceType resourceType = default; SystemData systemData = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + IDictionary tags = default; + AzureLocation location = default; + CloudHsmClusterProperties properties = default; + ManagedServiceIdentity identity = default; + CloudHsmClusterSku sku = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("properties"u8)) + if (prop.NameEquals("id"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - properties = CloudHsmClusterProperties.DeserializeCloudHsmClusterProperties(property.Value, options); + id = new ResourceIdentifier(prop.Value.GetString()); + continue; + } + if (prop.NameEquals("name"u8)) + { + name = prop.Value.GetString(); continue; } - if (property.NameEquals("identity"u8)) + if (prop.NameEquals("type"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - identity = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), ModelSerializationExtensions.WireV3Options, AzureResourceManagerHardwareSecurityModulesContext.Default); + resourceType = new ResourceType(prop.Value.GetString()); continue; } - if (property.NameEquals("sku"u8)) + if (prop.NameEquals("systemData"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - sku = CloudHsmClusterSku.DeserializeCloudHsmClusterSku(property.Value, options); + systemData = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(prop.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerHardwareSecurityModulesContext.Default); continue; } - if (property.NameEquals("tags"u8)) + if (prop.NameEquals("tags"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + foreach (var prop0 in prop.Value.EnumerateObject()) { - dictionary.Add(property0.Name, property0.Value.GetString()); + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } } tags = dictionary; continue; } - if (property.NameEquals("location"u8)) + if (prop.NameEquals("location"u8)) { - location = new AzureLocation(property.Value.GetString()); + location = new AzureLocation(prop.Value.GetString()); continue; } - if (property.NameEquals("id"u8)) + if (prop.NameEquals("properties"u8)) { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = CloudHsmClusterProperties.DeserializeCloudHsmClusterProperties(prop.Value, options); continue; } - if (property.NameEquals("type"u8)) + if (prop.NameEquals("identity"u8)) { - type = new ResourceType(property.Value.GetString()); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + identity = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(prop.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerHardwareSecurityModulesContext.Default); continue; } - if (property.NameEquals("systemData"u8)) + if (prop.NameEquals("sku"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - systemData = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerHardwareSecurityModulesContext.Default); + sku = CloudHsmClusterSku.DeserializeCloudHsmClusterSku(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new CloudHsmClusterData( id, name, - type, + resourceType, systemData, + additionalBinaryDataProperties, tags ?? new ChangeTrackingDictionary(), location, properties, identity, - sku, - serializedAdditionalRawData); + sku); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -190,15 +217,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions } } - CloudHsmClusterData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + CloudHsmClusterData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (CloudHsmClusterData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ResourceData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeCloudHsmClusterData(document.RootElement, options); } default: @@ -206,6 +238,26 @@ CloudHsmClusterData IPersistableModel.Create(BinaryData dat } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to serialize into . + internal static RequestContent ToRequestContent(CloudHsmClusterData cloudHsmClusterData) + { + if (cloudHsmClusterData == null) + { + return null; + } + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(cloudHsmClusterData, ModelSerializationExtensions.WireOptions); + return content; + } + + /// The to deserialize the from. + internal static CloudHsmClusterData FromResponse(Response response) + { + using JsonDocument document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCloudHsmClusterData(document.RootElement, ModelSerializationExtensions.WireOptions); + } } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CloudHsmClusterData.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CloudHsmClusterData.cs index 3e71a6b75384..39101060ce87 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CloudHsmClusterData.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CloudHsmClusterData.cs @@ -13,78 +13,43 @@ namespace Azure.ResourceManager.HardwareSecurityModules { - /// - /// A class representing the CloudHsmCluster data model. - /// Resource information with extended details. - /// + /// Resource information with extended details. public partial class CloudHsmClusterData : TrackedResourceData { - /// - /// 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; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . - /// The location. + /// The geo-location where the resource lives. public CloudHsmClusterData(AzureLocation location) : base(location) { } /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + /// The name of the resource. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// Keeps track of any properties unknown to the library. + /// Resource tags. + /// The geo-location where the resource lives. /// Properties of the Cloud HSM Cluster. /// Managed service identity (system assigned and/or user assigned identities). /// SKU details. - /// Keeps track of any properties unknown to the library. - internal CloudHsmClusterData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CloudHsmClusterProperties properties, ManagedServiceIdentity identity, CloudHsmClusterSku sku, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal CloudHsmClusterData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary additionalBinaryDataProperties, IDictionary tags, AzureLocation location, CloudHsmClusterProperties properties, ManagedServiceIdentity identity, CloudHsmClusterSku sku) : base(id, name, resourceType, systemData, tags, location) { + _additionalBinaryDataProperties = additionalBinaryDataProperties; Properties = properties; Identity = identity; Sku = sku; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal CloudHsmClusterData() - { } /// Properties of the Cloud HSM Cluster. public CloudHsmClusterProperties Properties { get; set; } + /// Managed service identity (system assigned and/or user assigned identities). public ManagedServiceIdentity Identity { get; set; } + /// SKU details. public CloudHsmClusterSku Sku { get; set; } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CloudHsmClusterPrivateEndpointConnectionCollection.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CloudHsmClusterPrivateEndpointConnectionCollection.cs index 82209e71b392..d45f67d079e4 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CloudHsmClusterPrivateEndpointConnectionCollection.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CloudHsmClusterPrivateEndpointConnectionCollection.cs @@ -8,12 +8,13 @@ using System; using System.Collections; using System.Collections.Generic; -using System.Globalization; +using System.Diagnostics; using System.Threading; using System.Threading.Tasks; -using Autorest.CSharp.Core; +using Azure; using Azure.Core; using Azure.Core.Pipeline; +using Azure.ResourceManager; namespace Azure.ResourceManager.HardwareSecurityModules { @@ -24,51 +25,49 @@ namespace Azure.ResourceManager.HardwareSecurityModules /// public partial class CloudHsmClusterPrivateEndpointConnectionCollection : ArmCollection, IEnumerable, IAsyncEnumerable { - private readonly ClientDiagnostics _cloudHsmClusterPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics; - private readonly PrivateEndpointConnectionsRestOperations _cloudHsmClusterPrivateEndpointConnectionPrivateEndpointConnectionsRestClient; + private readonly ClientDiagnostics _privateEndpointConnectionsClientDiagnostics; + private readonly PrivateEndpointConnections _privateEndpointConnectionsRestClient; - /// Initializes a new instance of the class for mocking. + /// Initializes a new instance of CloudHsmClusterPrivateEndpointConnectionCollection for mocking. protected CloudHsmClusterPrivateEndpointConnectionCollection() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of class. /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. + /// The identifier of the resource that is the target of operations. internal CloudHsmClusterPrivateEndpointConnectionCollection(ArmClient client, ResourceIdentifier id) : base(client, id) { - _cloudHsmClusterPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HardwareSecurityModules", CloudHsmClusterPrivateEndpointConnectionResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(CloudHsmClusterPrivateEndpointConnectionResource.ResourceType, out string cloudHsmClusterPrivateEndpointConnectionPrivateEndpointConnectionsApiVersion); - _cloudHsmClusterPrivateEndpointConnectionPrivateEndpointConnectionsRestClient = new PrivateEndpointConnectionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, cloudHsmClusterPrivateEndpointConnectionPrivateEndpointConnectionsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif + TryGetApiVersion(CloudHsmClusterPrivateEndpointConnectionResource.ResourceType, out string cloudHsmClusterPrivateEndpointConnectionApiVersion); + _privateEndpointConnectionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HardwareSecurityModules", CloudHsmClusterPrivateEndpointConnectionResource.ResourceType.Namespace, Diagnostics); + _privateEndpointConnectionsRestClient = new PrivateEndpointConnections(_privateEndpointConnectionsClientDiagnostics, Pipeline, Endpoint, cloudHsmClusterPrivateEndpointConnectionApiVersion ?? "2025-03-31"); + ValidateResourceId(id); } + /// + [Conditional("DEBUG")] internal static void ValidateResourceId(ResourceIdentifier id) { if (id.ResourceType != CloudHsmClusterResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, CloudHsmClusterResource.ResourceType), nameof(id)); + { + throw new ArgumentException(string.Format("Invalid resource type {0} expected {1}", id.ResourceType, CloudHsmClusterResource.ResourceType), id); + } } /// /// Creates or updates the private endpoint connection for the Cloud Hsm Cluster. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections/{peConnectionName} - /// - /// - /// Operation Id - /// PrivateEndpointConnection_Create + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections/{peConnectionName}. /// /// - /// Default Api Version - /// 2025-03-31 + /// Operation Id. + /// PrivateEndpointConnections_Create. /// /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-31. /// /// /// @@ -76,23 +75,31 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// Name of the private endpoint connection associated with the Cloud HSM Cluster. /// Parameters of the PrivateEndpointConnection. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// or is null. + /// is an empty string, and was expected to be non-empty. public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string peConnectionName, CloudHsmClusterPrivateEndpointConnectionData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(peConnectionName, nameof(peConnectionName)); Argument.AssertNotNull(data, nameof(data)); - using var scope = _cloudHsmClusterPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("CloudHsmClusterPrivateEndpointConnectionCollection.CreateOrUpdate"); + using DiagnosticScope scope = _privateEndpointConnectionsClientDiagnostics.CreateScope("CloudHsmClusterPrivateEndpointConnectionCollection.CreateOrUpdate"); scope.Start(); try { - var response = await _cloudHsmClusterPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, peConnectionName, data, cancellationToken).ConfigureAwait(false); - var uri = _cloudHsmClusterPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, peConnectionName, data); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new HardwareSecurityModulesArmOperation(Response.FromValue(new CloudHsmClusterPrivateEndpointConnectionResource(Client, response), response.GetRawResponse()), rehydrationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _privateEndpointConnectionsRestClient.CreateCreateRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, peConnectionName, CloudHsmClusterPrivateEndpointConnectionData.ToRequestContent(data), context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(CloudHsmClusterPrivateEndpointConnectionData.FromResponse(result), result); + RequestUriBuilder uri = message.Request.Uri; + RehydrationToken rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + HardwareSecurityModulesArmOperation operation = new HardwareSecurityModulesArmOperation(Response.FromValue(new CloudHsmClusterPrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()), rehydrationToken); if (waitUntil == WaitUntil.Completed) + { await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + } return operation; } catch (Exception e) @@ -106,20 +113,16 @@ public virtual async Task /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections/{peConnectionName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections/{peConnectionName}. /// /// - /// Operation Id - /// PrivateEndpointConnection_Create + /// Operation Id. + /// PrivateEndpointConnections_Create. /// /// - /// Default Api Version - /// 2025-03-31 - /// - /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-31. /// /// /// @@ -127,23 +130,31 @@ public virtual async Task Name of the private endpoint connection associated with the Cloud HSM Cluster. /// Parameters of the PrivateEndpointConnection. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// or is null. + /// is an empty string, and was expected to be non-empty. public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string peConnectionName, CloudHsmClusterPrivateEndpointConnectionData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(peConnectionName, nameof(peConnectionName)); Argument.AssertNotNull(data, nameof(data)); - using var scope = _cloudHsmClusterPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("CloudHsmClusterPrivateEndpointConnectionCollection.CreateOrUpdate"); + using DiagnosticScope scope = _privateEndpointConnectionsClientDiagnostics.CreateScope("CloudHsmClusterPrivateEndpointConnectionCollection.CreateOrUpdate"); scope.Start(); try { - var response = _cloudHsmClusterPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, peConnectionName, data, cancellationToken); - var uri = _cloudHsmClusterPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, peConnectionName, data); - var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); - var operation = new HardwareSecurityModulesArmOperation(Response.FromValue(new CloudHsmClusterPrivateEndpointConnectionResource(Client, response), response.GetRawResponse()), rehydrationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _privateEndpointConnectionsRestClient.CreateCreateRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, peConnectionName, CloudHsmClusterPrivateEndpointConnectionData.ToRequestContent(data), context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(CloudHsmClusterPrivateEndpointConnectionData.FromResponse(result), result); + RequestUriBuilder uri = message.Request.Uri; + RehydrationToken rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + HardwareSecurityModulesArmOperation operation = new HardwareSecurityModulesArmOperation(Response.FromValue(new CloudHsmClusterPrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()), rehydrationToken); if (waitUntil == WaitUntil.Completed) + { operation.WaitForCompletion(cancellationToken); + } return operation; } catch (Exception e) @@ -157,38 +168,42 @@ public virtual ArmOperation Cr /// Gets the private endpoint connection for the Cloud Hsm Cluster. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections/{peConnectionName} - /// - /// - /// Operation Id - /// PrivateEndpointConnection_Get + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections/{peConnectionName}. /// /// - /// Default Api Version - /// 2025-03-31 + /// Operation Id. + /// PrivateEndpointConnections_Get. /// /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-31. /// /// /// /// Name of the private endpoint connection associated with the Cloud HSM Cluster. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. public virtual async Task> GetAsync(string peConnectionName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(peConnectionName, nameof(peConnectionName)); - using var scope = _cloudHsmClusterPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("CloudHsmClusterPrivateEndpointConnectionCollection.Get"); + using DiagnosticScope scope = _privateEndpointConnectionsClientDiagnostics.CreateScope("CloudHsmClusterPrivateEndpointConnectionCollection.Get"); scope.Start(); try { - var response = await _cloudHsmClusterPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, peConnectionName, cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _privateEndpointConnectionsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, peConnectionName, context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(CloudHsmClusterPrivateEndpointConnectionData.FromResponse(result), result); if (response.Value == null) + { throw new RequestFailedException(response.GetRawResponse()); + } return Response.FromValue(new CloudHsmClusterPrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -202,38 +217,42 @@ public virtual async Task /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections/{peConnectionName} - /// - /// - /// Operation Id - /// PrivateEndpointConnection_Get + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections/{peConnectionName}. /// /// - /// Default Api Version - /// 2025-03-31 + /// Operation Id. + /// PrivateEndpointConnections_Get. /// /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-31. /// /// /// /// Name of the private endpoint connection associated with the Cloud HSM Cluster. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. public virtual Response Get(string peConnectionName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(peConnectionName, nameof(peConnectionName)); - using var scope = _cloudHsmClusterPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("CloudHsmClusterPrivateEndpointConnectionCollection.Get"); + using DiagnosticScope scope = _privateEndpointConnectionsClientDiagnostics.CreateScope("CloudHsmClusterPrivateEndpointConnectionCollection.Get"); scope.Start(); try { - var response = _cloudHsmClusterPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, peConnectionName, cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _privateEndpointConnectionsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, peConnectionName, context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(CloudHsmClusterPrivateEndpointConnectionData.FromResponse(result), result); if (response.Value == null) + { throw new RequestFailedException(response.GetRawResponse()); + } return Response.FromValue(new CloudHsmClusterPrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -247,50 +266,44 @@ public virtual Response Get(st /// The List operation gets information about the private endpoint connections associated with the Cloud HSM Cluster /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections. /// /// - /// Operation Id - /// PrivateEndpointConnection_ListByCloudHsmCluster + /// Operation Id. + /// PrivateEndpointConnections_ListByCloudHsmCluster. /// /// - /// Default Api Version - /// 2025-03-31 - /// - /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-31. /// /// /// /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. + /// A collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _cloudHsmClusterPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateListByCloudHsmClusterRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _cloudHsmClusterPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateListByCloudHsmClusterNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new CloudHsmClusterPrivateEndpointConnectionResource(Client, CloudHsmClusterPrivateEndpointConnectionData.DeserializeCloudHsmClusterPrivateEndpointConnectionData(e)), _cloudHsmClusterPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics, Pipeline, "CloudHsmClusterPrivateEndpointConnectionCollection.GetAll", "value", "nextLink", cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + return new AsyncPageableWrapper(new PrivateEndpointConnectionsGetByCloudHsmClusterAsyncCollectionResultOfT(_privateEndpointConnectionsRestClient, Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context), data => new CloudHsmClusterPrivateEndpointConnectionResource(Client, data)); } /// /// The List operation gets information about the private endpoint connections associated with the Cloud HSM Cluster /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections - /// - /// - /// Operation Id - /// PrivateEndpointConnection_ListByCloudHsmCluster + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections. /// /// - /// Default Api Version - /// 2025-03-31 + /// Operation Id. + /// PrivateEndpointConnections_ListByCloudHsmCluster. /// /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-31. /// /// /// @@ -298,45 +311,61 @@ public virtual AsyncPageable G /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetAll(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _cloudHsmClusterPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateListByCloudHsmClusterRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _cloudHsmClusterPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateListByCloudHsmClusterNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new CloudHsmClusterPrivateEndpointConnectionResource(Client, CloudHsmClusterPrivateEndpointConnectionData.DeserializeCloudHsmClusterPrivateEndpointConnectionData(e)), _cloudHsmClusterPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics, Pipeline, "CloudHsmClusterPrivateEndpointConnectionCollection.GetAll", "value", "nextLink", cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + return new PageableWrapper(new PrivateEndpointConnectionsGetByCloudHsmClusterCollectionResultOfT(_privateEndpointConnectionsRestClient, Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context), data => new CloudHsmClusterPrivateEndpointConnectionResource(Client, data)); } /// - /// Checks to see if the resource exists in azure. + /// Gets the private endpoint connection for the Cloud Hsm Cluster. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections/{peConnectionName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections/{peConnectionName}. /// /// - /// Operation Id - /// PrivateEndpointConnection_Get + /// Operation Id. + /// PrivateEndpointConnections_Get. /// /// - /// Default Api Version - /// 2025-03-31 - /// - /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-31. /// /// /// /// Name of the private endpoint connection associated with the Cloud HSM Cluster. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. public virtual async Task> ExistsAsync(string peConnectionName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(peConnectionName, nameof(peConnectionName)); - using var scope = _cloudHsmClusterPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("CloudHsmClusterPrivateEndpointConnectionCollection.Exists"); + using DiagnosticScope scope = _privateEndpointConnectionsClientDiagnostics.CreateScope("CloudHsmClusterPrivateEndpointConnectionCollection.Exists"); scope.Start(); try { - var response = await _cloudHsmClusterPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, peConnectionName, cancellationToken: cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _privateEndpointConnectionsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, peConnectionName, context); + await Pipeline.SendAsync(message, context.CancellationToken).ConfigureAwait(false); + Response result = message.Response; + Response response = default; + switch (result.Status) + { + case 200: + response = Response.FromValue(CloudHsmClusterPrivateEndpointConnectionData.FromResponse(result), result); + break; + case 404: + response = Response.FromValue((CloudHsmClusterPrivateEndpointConnectionData)null, result); + break; + default: + throw new RequestFailedException(result); + } return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -347,39 +376,53 @@ public virtual async Task> ExistsAsync(string peConnectionName, C } /// - /// Checks to see if the resource exists in azure. + /// Gets the private endpoint connection for the Cloud Hsm Cluster. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections/{peConnectionName} - /// - /// - /// Operation Id - /// PrivateEndpointConnection_Get + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections/{peConnectionName}. /// /// - /// Default Api Version - /// 2025-03-31 + /// Operation Id. + /// PrivateEndpointConnections_Get. /// /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-31. /// /// /// /// Name of the private endpoint connection associated with the Cloud HSM Cluster. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. public virtual Response Exists(string peConnectionName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(peConnectionName, nameof(peConnectionName)); - using var scope = _cloudHsmClusterPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("CloudHsmClusterPrivateEndpointConnectionCollection.Exists"); + using DiagnosticScope scope = _privateEndpointConnectionsClientDiagnostics.CreateScope("CloudHsmClusterPrivateEndpointConnectionCollection.Exists"); scope.Start(); try { - var response = _cloudHsmClusterPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, peConnectionName, cancellationToken: cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _privateEndpointConnectionsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, peConnectionName, context); + Pipeline.Send(message, context.CancellationToken); + Response result = message.Response; + Response response = default; + switch (result.Status) + { + case 200: + response = Response.FromValue(CloudHsmClusterPrivateEndpointConnectionData.FromResponse(result), result); + break; + case 404: + response = Response.FromValue((CloudHsmClusterPrivateEndpointConnectionData)null, result); + break; + default: + throw new RequestFailedException(result); + } return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -390,41 +433,57 @@ public virtual Response Exists(string peConnectionName, CancellationToken } /// - /// Tries to get details for this resource from the service. + /// Gets the private endpoint connection for the Cloud Hsm Cluster. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections/{peConnectionName} - /// - /// - /// Operation Id - /// PrivateEndpointConnection_Get + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections/{peConnectionName}. /// /// - /// Default Api Version - /// 2025-03-31 + /// Operation Id. + /// PrivateEndpointConnections_Get. /// /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-31. /// /// /// /// Name of the private endpoint connection associated with the Cloud HSM Cluster. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. public virtual async Task> GetIfExistsAsync(string peConnectionName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(peConnectionName, nameof(peConnectionName)); - using var scope = _cloudHsmClusterPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("CloudHsmClusterPrivateEndpointConnectionCollection.GetIfExists"); + using DiagnosticScope scope = _privateEndpointConnectionsClientDiagnostics.CreateScope("CloudHsmClusterPrivateEndpointConnectionCollection.GetIfExists"); scope.Start(); try { - var response = await _cloudHsmClusterPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, peConnectionName, cancellationToken: cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _privateEndpointConnectionsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, peConnectionName, context); + await Pipeline.SendAsync(message, context.CancellationToken).ConfigureAwait(false); + Response result = message.Response; + Response response = default; + switch (result.Status) + { + case 200: + response = Response.FromValue(CloudHsmClusterPrivateEndpointConnectionData.FromResponse(result), result); + break; + case 404: + response = Response.FromValue((CloudHsmClusterPrivateEndpointConnectionData)null, result); + break; + default: + throw new RequestFailedException(result); + } if (response.Value == null) + { return new NoValueResponse(response.GetRawResponse()); + } return Response.FromValue(new CloudHsmClusterPrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -435,41 +494,57 @@ public virtual async Task - /// Tries to get details for this resource from the service. + /// Gets the private endpoint connection for the Cloud Hsm Cluster. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections/{peConnectionName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections/{peConnectionName}. /// /// - /// Operation Id - /// PrivateEndpointConnection_Get + /// Operation Id. + /// PrivateEndpointConnections_Get. /// /// - /// Default Api Version - /// 2025-03-31 - /// - /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-31. /// /// /// /// Name of the private endpoint connection associated with the Cloud HSM Cluster. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. public virtual NullableResponse GetIfExists(string peConnectionName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(peConnectionName, nameof(peConnectionName)); - using var scope = _cloudHsmClusterPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("CloudHsmClusterPrivateEndpointConnectionCollection.GetIfExists"); + using DiagnosticScope scope = _privateEndpointConnectionsClientDiagnostics.CreateScope("CloudHsmClusterPrivateEndpointConnectionCollection.GetIfExists"); scope.Start(); try { - var response = _cloudHsmClusterPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, peConnectionName, cancellationToken: cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _privateEndpointConnectionsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, peConnectionName, context); + Pipeline.Send(message, context.CancellationToken); + Response result = message.Response; + Response response = default; + switch (result.Status) + { + case 200: + response = Response.FromValue(CloudHsmClusterPrivateEndpointConnectionData.FromResponse(result), result); + break; + case 404: + response = Response.FromValue((CloudHsmClusterPrivateEndpointConnectionData)null, result); + break; + default: + throw new RequestFailedException(result); + } if (response.Value == null) + { return new NoValueResponse(response.GetRawResponse()); + } return Response.FromValue(new CloudHsmClusterPrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -489,6 +564,7 @@ IEnumerator IEnumerable.GetEnumerator() return GetAll().GetEnumerator(); } + /// The cancellation token to use. IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) { return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CloudHsmClusterPrivateEndpointConnectionData.Serialization.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CloudHsmClusterPrivateEndpointConnectionData.Serialization.cs index c0577949c73f..d3e927875243 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CloudHsmClusterPrivateEndpointConnectionData.Serialization.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CloudHsmClusterPrivateEndpointConnectionData.Serialization.cs @@ -10,16 +10,18 @@ using System.Collections.Generic; using System.Text; using System.Text.Json; +using Azure; using Azure.Core; using Azure.ResourceManager.HardwareSecurityModules.Models; using Azure.ResourceManager.Models; namespace Azure.ResourceManager.HardwareSecurityModules { - public partial class CloudHsmClusterPrivateEndpointConnectionData : IUtf8JsonSerializable, IJsonModel + /// The private endpoint connection resource. + public partial class CloudHsmClusterPrivateEndpointConnectionData : ResourceData, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -31,12 +33,11 @@ void IJsonModel.Write(Utf8JsonWrit /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(CloudHsmClusterPrivateEndpointConnectionData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Properties)) { @@ -50,98 +51,112 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - CloudHsmClusterPrivateEndpointConnectionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + CloudHsmClusterPrivateEndpointConnectionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (CloudHsmClusterPrivateEndpointConnectionData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ResourceData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(CloudHsmClusterPrivateEndpointConnectionData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeCloudHsmClusterPrivateEndpointConnectionData(document.RootElement, options); } - internal static CloudHsmClusterPrivateEndpointConnectionData DeserializeCloudHsmClusterPrivateEndpointConnectionData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static CloudHsmClusterPrivateEndpointConnectionData DeserializeCloudHsmClusterPrivateEndpointConnectionData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - CloudHsmClusterPrivateEndpointConnectionProperties properties = default; - ETag? etag = default; ResourceIdentifier id = default; string name = default; - ResourceType type = default; + ResourceType resourceType = default; SystemData systemData = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + CloudHsmClusterPrivateEndpointConnectionProperties properties = default; + ETag? eTag = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("properties"u8)) + if (prop.NameEquals("id"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - properties = CloudHsmClusterPrivateEndpointConnectionProperties.DeserializeCloudHsmClusterPrivateEndpointConnectionProperties(property.Value, options); + id = new ResourceIdentifier(prop.Value.GetString()); continue; } - if (property.NameEquals("etag"u8)) + if (prop.NameEquals("name"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - etag = new ETag(property.Value.GetString()); + name = prop.Value.GetString(); continue; } - if (property.NameEquals("id"u8)) + if (prop.NameEquals("type"u8)) { - id = new ResourceIdentifier(property.Value.GetString()); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resourceType = new ResourceType(prop.Value.GetString()); continue; } - if (property.NameEquals("name"u8)) + if (prop.NameEquals("systemData"u8)) { - name = property.Value.GetString(); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(prop.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerHardwareSecurityModulesContext.Default); continue; } - if (property.NameEquals("type"u8)) + if (prop.NameEquals("properties"u8)) { - type = new ResourceType(property.Value.GetString()); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = CloudHsmClusterPrivateEndpointConnectionProperties.DeserializeCloudHsmClusterPrivateEndpointConnectionProperties(prop.Value, options); continue; } - if (property.NameEquals("systemData"u8)) + if (prop.NameEquals("etag"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - systemData = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerHardwareSecurityModulesContext.Default); + eTag = new ETag(prop.Value.GetString()); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new CloudHsmClusterPrivateEndpointConnectionData( id, name, - type, + resourceType, systemData, + additionalBinaryDataProperties, properties, - etag, - serializedAdditionalRawData); + eTag); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -151,15 +166,20 @@ BinaryData IPersistableModel.Write } } - CloudHsmClusterPrivateEndpointConnectionData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + CloudHsmClusterPrivateEndpointConnectionData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (CloudHsmClusterPrivateEndpointConnectionData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ResourceData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeCloudHsmClusterPrivateEndpointConnectionData(document.RootElement, options); } default: @@ -167,6 +187,26 @@ CloudHsmClusterPrivateEndpointConnectionData IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to serialize into . + internal static RequestContent ToRequestContent(CloudHsmClusterPrivateEndpointConnectionData cloudHsmClusterPrivateEndpointConnectionData) + { + if (cloudHsmClusterPrivateEndpointConnectionData == null) + { + return null; + } + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(cloudHsmClusterPrivateEndpointConnectionData, ModelSerializationExtensions.WireOptions); + return content; + } + + /// The to deserialize the from. + internal static CloudHsmClusterPrivateEndpointConnectionData FromResponse(Response response) + { + using JsonDocument document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCloudHsmClusterPrivateEndpointConnectionData(document.RootElement, ModelSerializationExtensions.WireOptions); + } } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CloudHsmClusterPrivateEndpointConnectionData.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CloudHsmClusterPrivateEndpointConnectionData.cs index ff0f9fbe31d8..48e4fc71ca4a 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CloudHsmClusterPrivateEndpointConnectionData.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CloudHsmClusterPrivateEndpointConnectionData.cs @@ -7,49 +7,18 @@ using System; using System.Collections.Generic; +using Azure; using Azure.Core; using Azure.ResourceManager.HardwareSecurityModules.Models; using Azure.ResourceManager.Models; namespace Azure.ResourceManager.HardwareSecurityModules { - /// - /// A class representing the CloudHsmClusterPrivateEndpointConnection data model. - /// The private endpoint connection resource. - /// + /// The private endpoint connection resource. public partial class CloudHsmClusterPrivateEndpointConnectionData : ResourceData { - /// - /// 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; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . public CloudHsmClusterPrivateEndpointConnectionData() @@ -57,22 +26,23 @@ public CloudHsmClusterPrivateEndpointConnectionData() } /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + /// The name of the resource. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// Keeps track of any properties unknown to the library. /// Resource properties. - /// Modified whenever there is a change in the state of private endpoint connection. - /// Keeps track of any properties unknown to the library. - internal CloudHsmClusterPrivateEndpointConnectionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, CloudHsmClusterPrivateEndpointConnectionProperties properties, ETag? etag, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + /// Modified whenever there is a change in the state of private endpoint connection. + internal CloudHsmClusterPrivateEndpointConnectionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary additionalBinaryDataProperties, CloudHsmClusterPrivateEndpointConnectionProperties properties, ETag? eTag) : base(id, name, resourceType, systemData) { + _additionalBinaryDataProperties = additionalBinaryDataProperties; Properties = properties; - ETag = etag; - _serializedAdditionalRawData = serializedAdditionalRawData; + ETag = eTag; } /// Resource properties. public CloudHsmClusterPrivateEndpointConnectionProperties Properties { get; set; } + /// Modified whenever there is a change in the state of private endpoint connection. public ETag? ETag { get; set; } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CloudHsmClusterPrivateEndpointConnectionResource.Serialization.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CloudHsmClusterPrivateEndpointConnectionResource.Serialization.cs index 3aea22129e88..244fe1c55cd8 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CloudHsmClusterPrivateEndpointConnectionResource.Serialization.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CloudHsmClusterPrivateEndpointConnectionResource.Serialization.cs @@ -11,19 +11,29 @@ namespace Azure.ResourceManager.HardwareSecurityModules { + /// public partial class CloudHsmClusterPrivateEndpointConnectionResource : IJsonModel { - private static CloudHsmClusterPrivateEndpointConnectionData s_dataDeserializationInstance; - private static CloudHsmClusterPrivateEndpointConnectionData DataDeserializationInstance => s_dataDeserializationInstance ??= new(); + private static IJsonModel s_dataDeserializationInstance; + private static IJsonModel DataDeserializationInstance => s_dataDeserializationInstance ??= new CloudHsmClusterPrivateEndpointConnectionData(); + + /// The writer to serialize the model to. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - CloudHsmClusterPrivateEndpointConnectionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)DataDeserializationInstance).Create(ref reader, options); + /// The reader for deserializing the model. + /// The client options for reading and writing models. + CloudHsmClusterPrivateEndpointConnectionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => DataDeserializationInstance.Create(ref reader, options); + /// The client options for reading and writing models. BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerHardwareSecurityModulesContext.Default); + /// The binary data to be processed. + /// The client options for reading and writing models. CloudHsmClusterPrivateEndpointConnectionData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerHardwareSecurityModulesContext.Default); - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)DataDeserializationInstance).GetFormatFromOptions(options); + /// The client options for reading and writing models. + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => DataDeserializationInstance.GetFormatFromOptions(options); } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CloudHsmClusterPrivateEndpointConnectionResource.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CloudHsmClusterPrivateEndpointConnectionResource.cs index 99d8f76d9ff7..df6e65d28e92 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CloudHsmClusterPrivateEndpointConnectionResource.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CloudHsmClusterPrivateEndpointConnectionResource.cs @@ -6,46 +6,35 @@ #nullable disable using System; -using System.Globalization; +using System.Diagnostics; using System.Threading; using System.Threading.Tasks; +using Azure; using Azure.Core; using Azure.Core.Pipeline; +using Azure.ResourceManager; namespace Azure.ResourceManager.HardwareSecurityModules { /// - /// A Class representing a CloudHsmClusterPrivateEndpointConnection along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetCloudHsmClusterPrivateEndpointConnectionResource method. - /// Otherwise you can get one from its parent resource using the GetCloudHsmClusterPrivateEndpointConnection method. + /// A class representing a CloudHsmClusterPrivateEndpointConnection along with the instance operations that can be performed on it. + /// If you have a you can construct a from an instance of using the GetResource method. + /// Otherwise you can get one from its parent resource using the GetCloudHsmClusterPrivateEndpointConnections method. /// public partial class CloudHsmClusterPrivateEndpointConnectionResource : ArmResource { - /// Generate the resource identifier of a instance. - /// The subscriptionId. - /// The resourceGroupName. - /// The cloudHsmClusterName. - /// The peConnectionName. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string cloudHsmClusterName, string peConnectionName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections/{peConnectionName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _cloudHsmClusterPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics; - private readonly PrivateEndpointConnectionsRestOperations _cloudHsmClusterPrivateEndpointConnectionPrivateEndpointConnectionsRestClient; + private readonly ClientDiagnostics _privateEndpointConnectionsClientDiagnostics; + private readonly PrivateEndpointConnections _privateEndpointConnectionsRestClient; private readonly CloudHsmClusterPrivateEndpointConnectionData _data; - /// Gets the resource type for the operations. public static readonly ResourceType ResourceType = "Microsoft.HardwareSecurityModules/cloudHsmClusters/privateEndpointConnections"; - /// Initializes a new instance of the class for mocking. + /// Initializes a new instance of CloudHsmClusterPrivateEndpointConnectionResource for mocking. protected CloudHsmClusterPrivateEndpointConnectionResource() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of class. /// The client parameters to use in these operations. /// The resource that is the target of operations. internal CloudHsmClusterPrivateEndpointConnectionResource(ArmClient client, CloudHsmClusterPrivateEndpointConnectionData data) : this(client, data.Id) @@ -54,71 +43,93 @@ internal CloudHsmClusterPrivateEndpointConnectionResource(ArmClient client, Clou _data = data; } - /// Initializes a new instance of the class. + /// Initializes a new instance of class. /// The client parameters to use in these operations. /// The identifier of the resource that is the target of operations. internal CloudHsmClusterPrivateEndpointConnectionResource(ArmClient client, ResourceIdentifier id) : base(client, id) { - _cloudHsmClusterPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HardwareSecurityModules", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string cloudHsmClusterPrivateEndpointConnectionPrivateEndpointConnectionsApiVersion); - _cloudHsmClusterPrivateEndpointConnectionPrivateEndpointConnectionsRestClient = new PrivateEndpointConnectionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, cloudHsmClusterPrivateEndpointConnectionPrivateEndpointConnectionsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif + TryGetApiVersion(ResourceType, out string cloudHsmClusterPrivateEndpointConnectionApiVersion); + _privateEndpointConnectionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HardwareSecurityModules", ResourceType.Namespace, Diagnostics); + _privateEndpointConnectionsRestClient = new PrivateEndpointConnections(_privateEndpointConnectionsClientDiagnostics, Pipeline, Endpoint, cloudHsmClusterPrivateEndpointConnectionApiVersion ?? "2025-03-31"); + ValidateResourceId(id); } /// Gets whether or not the current instance has data. public virtual bool HasData { get; } /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. public virtual CloudHsmClusterPrivateEndpointConnectionData Data { get { if (!HasData) + { throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + } return _data; } } + /// Generate the resource identifier for this resource. + /// The subscriptionId. + /// The resourceGroupName. + /// The cloudHsmClusterName. + /// The peConnectionName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string cloudHsmClusterName, string peConnectionName) + { + string resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections/{peConnectionName}"; + return new ResourceIdentifier(resourceId); + } + + /// + [Conditional("DEBUG")] internal static void ValidateResourceId(ResourceIdentifier id) { if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + { + throw new ArgumentException(string.Format("Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), id); + } } /// /// Gets the private endpoint connection for the Cloud Hsm Cluster. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections/{peConnectionName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections/{peConnectionName}. /// /// - /// Operation Id - /// PrivateEndpointConnection_Get + /// Operation Id. + /// PrivateEndpointConnections_Get. /// /// - /// Default Api Version - /// 2025-03-31 + /// Default Api Version. + /// 2025-03-31. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// /// The cancellation token to use. public virtual async Task> GetAsync(CancellationToken cancellationToken = default) { - using var scope = _cloudHsmClusterPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("CloudHsmClusterPrivateEndpointConnectionResource.Get"); + using DiagnosticScope scope = _privateEndpointConnectionsClientDiagnostics.CreateScope("CloudHsmClusterPrivateEndpointConnectionResource.Get"); scope.Start(); try { - var response = await _cloudHsmClusterPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _privateEndpointConnectionsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(CloudHsmClusterPrivateEndpointConnectionData.FromResponse(result), result); if (response.Value == null) + { throw new RequestFailedException(response.GetRawResponse()); + } return Response.FromValue(new CloudHsmClusterPrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -132,33 +143,41 @@ public virtual async Task /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections/{peConnectionName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections/{peConnectionName}. /// /// - /// Operation Id - /// PrivateEndpointConnection_Get + /// Operation Id. + /// PrivateEndpointConnections_Get. /// /// - /// Default Api Version - /// 2025-03-31 + /// Default Api Version. + /// 2025-03-31. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// /// The cancellation token to use. public virtual Response Get(CancellationToken cancellationToken = default) { - using var scope = _cloudHsmClusterPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("CloudHsmClusterPrivateEndpointConnectionResource.Get"); + using DiagnosticScope scope = _privateEndpointConnectionsClientDiagnostics.CreateScope("CloudHsmClusterPrivateEndpointConnectionResource.Get"); scope.Start(); try { - var response = _cloudHsmClusterPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _privateEndpointConnectionsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(CloudHsmClusterPrivateEndpointConnectionData.FromResponse(result), result); if (response.Value == null) + { throw new RequestFailedException(response.GetRawResponse()); + } return Response.FromValue(new CloudHsmClusterPrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -172,20 +191,20 @@ public virtual Response Get(Ca /// Deletes the private endpoint connection for the Cloud Hsm Cluster. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections/{peConnectionName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections/{peConnectionName}. /// /// - /// Operation Id - /// PrivateEndpointConnection_Delete + /// Operation Id. + /// PrivateEndpointConnections_Delete. /// /// - /// Default Api Version - /// 2025-03-31 + /// Default Api Version. + /// 2025-03-31. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// @@ -193,14 +212,21 @@ public virtual Response Get(Ca /// The cancellation token to use. public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _cloudHsmClusterPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("CloudHsmClusterPrivateEndpointConnectionResource.Delete"); + using DiagnosticScope scope = _privateEndpointConnectionsClientDiagnostics.CreateScope("CloudHsmClusterPrivateEndpointConnectionResource.Delete"); scope.Start(); try { - var response = await _cloudHsmClusterPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new HardwareSecurityModulesArmOperation(_cloudHsmClusterPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics, Pipeline, _cloudHsmClusterPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _privateEndpointConnectionsRestClient.CreateDeleteRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, context); + Response response = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + HardwareSecurityModulesArmOperation operation = new HardwareSecurityModulesArmOperation(_privateEndpointConnectionsClientDiagnostics, Pipeline, message.Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) + { await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + } return operation; } catch (Exception e) @@ -214,20 +240,20 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// Deletes the private endpoint connection for the Cloud Hsm Cluster. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections/{peConnectionName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections/{peConnectionName}. /// /// - /// Operation Id - /// PrivateEndpointConnection_Delete + /// Operation Id. + /// PrivateEndpointConnections_Delete. /// /// - /// Default Api Version - /// 2025-03-31 + /// Default Api Version. + /// 2025-03-31. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// @@ -235,14 +261,21 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// The cancellation token to use. public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _cloudHsmClusterPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("CloudHsmClusterPrivateEndpointConnectionResource.Delete"); + using DiagnosticScope scope = _privateEndpointConnectionsClientDiagnostics.CreateScope("CloudHsmClusterPrivateEndpointConnectionResource.Delete"); scope.Start(); try { - var response = _cloudHsmClusterPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new HardwareSecurityModulesArmOperation(_cloudHsmClusterPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics, Pipeline, _cloudHsmClusterPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _privateEndpointConnectionsRestClient.CreateDeleteRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, context); + Response response = Pipeline.ProcessMessage(message, context); + HardwareSecurityModulesArmOperation operation = new HardwareSecurityModulesArmOperation(_privateEndpointConnectionsClientDiagnostics, Pipeline, message.Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) + { operation.WaitForCompletionResponse(cancellationToken); + } return operation; } catch (Exception e) @@ -256,20 +289,20 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// Creates or updates the private endpoint connection for the Cloud Hsm Cluster. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections/{peConnectionName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections/{peConnectionName}. /// /// - /// Operation Id - /// PrivateEndpointConnection_Create + /// Operation Id. + /// PrivateEndpointConnections_Create. /// /// - /// Default Api Version - /// 2025-03-31 + /// Default Api Version. + /// 2025-03-31. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// @@ -281,16 +314,24 @@ public virtual async Task(Response.FromValue(new CloudHsmClusterPrivateEndpointConnectionResource(Client, response), response.GetRawResponse()), rehydrationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _privateEndpointConnectionsRestClient.CreateCreateRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, CloudHsmClusterPrivateEndpointConnectionData.ToRequestContent(data), context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(CloudHsmClusterPrivateEndpointConnectionData.FromResponse(result), result); + RequestUriBuilder uri = message.Request.Uri; + RehydrationToken rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + HardwareSecurityModulesArmOperation operation = new HardwareSecurityModulesArmOperation(Response.FromValue(new CloudHsmClusterPrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()), rehydrationToken); if (waitUntil == WaitUntil.Completed) + { await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + } return operation; } catch (Exception e) @@ -304,20 +345,20 @@ public virtual async Task /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections/{peConnectionName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections/{peConnectionName}. /// /// - /// Operation Id - /// PrivateEndpointConnection_Create + /// Operation Id. + /// PrivateEndpointConnections_Create. /// /// - /// Default Api Version - /// 2025-03-31 + /// Default Api Version. + /// 2025-03-31. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// @@ -329,16 +370,24 @@ public virtual ArmOperation Up { Argument.AssertNotNull(data, nameof(data)); - using var scope = _cloudHsmClusterPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("CloudHsmClusterPrivateEndpointConnectionResource.Update"); + using DiagnosticScope scope = _privateEndpointConnectionsClientDiagnostics.CreateScope("CloudHsmClusterPrivateEndpointConnectionResource.Update"); scope.Start(); try { - var response = _cloudHsmClusterPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); - var uri = _cloudHsmClusterPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateCreateRequestUri(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 HardwareSecurityModulesArmOperation(Response.FromValue(new CloudHsmClusterPrivateEndpointConnectionResource(Client, response), response.GetRawResponse()), rehydrationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _privateEndpointConnectionsRestClient.CreateCreateRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Parent.Name, Id.Name, CloudHsmClusterPrivateEndpointConnectionData.ToRequestContent(data), context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(CloudHsmClusterPrivateEndpointConnectionData.FromResponse(result), result); + RequestUriBuilder uri = message.Request.Uri; + RehydrationToken rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + HardwareSecurityModulesArmOperation operation = new HardwareSecurityModulesArmOperation(Response.FromValue(new CloudHsmClusterPrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()), rehydrationToken); if (waitUntil == WaitUntil.Completed) + { operation.WaitForCompletion(cancellationToken); + } return operation; } catch (Exception e) diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CloudHsmClusterResource.Serialization.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CloudHsmClusterResource.Serialization.cs index 70202bfb69c6..65d5e821850c 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CloudHsmClusterResource.Serialization.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CloudHsmClusterResource.Serialization.cs @@ -11,19 +11,29 @@ namespace Azure.ResourceManager.HardwareSecurityModules { + /// public partial class CloudHsmClusterResource : IJsonModel { - private static CloudHsmClusterData s_dataDeserializationInstance; - private static CloudHsmClusterData DataDeserializationInstance => s_dataDeserializationInstance ??= new(); + private static IJsonModel s_dataDeserializationInstance; + private static IJsonModel DataDeserializationInstance => s_dataDeserializationInstance ??= new CloudHsmClusterData(); + + /// The writer to serialize the model to. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - CloudHsmClusterData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)DataDeserializationInstance).Create(ref reader, options); + /// The reader for deserializing the model. + /// The client options for reading and writing models. + CloudHsmClusterData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => DataDeserializationInstance.Create(ref reader, options); + /// The client options for reading and writing models. BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerHardwareSecurityModulesContext.Default); + /// The binary data to be processed. + /// The client options for reading and writing models. CloudHsmClusterData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerHardwareSecurityModulesContext.Default); - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)DataDeserializationInstance).GetFormatFromOptions(options); + /// The client options for reading and writing models. + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => DataDeserializationInstance.GetFormatFromOptions(options); } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CloudHsmClusterResource.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CloudHsmClusterResource.cs index 6b4096e442e9..86deec9624cb 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CloudHsmClusterResource.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CloudHsmClusterResource.cs @@ -7,54 +7,39 @@ using System; using System.Collections.Generic; -using System.Globalization; +using System.Diagnostics; using System.Threading; using System.Threading.Tasks; -using Autorest.CSharp.Core; +using Azure; using Azure.Core; using Azure.Core.Pipeline; +using Azure.ResourceManager; using Azure.ResourceManager.HardwareSecurityModules.Models; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.HardwareSecurityModules { /// - /// A Class representing a CloudHsmCluster along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetCloudHsmClusterResource method. - /// Otherwise you can get one from its parent resource using the GetCloudHsmCluster method. + /// A class representing a CloudHsmCluster along with the instance operations that can be performed on it. + /// If you have a you can construct a from an instance of using the GetResource method. + /// Otherwise you can get one from its parent resource using the GetCloudHsmClusters method. /// public partial class CloudHsmClusterResource : ArmResource { - /// Generate the resource identifier of a instance. - /// The subscriptionId. - /// The resourceGroupName. - /// The cloudHsmClusterName. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string cloudHsmClusterName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _cloudHsmClusterClientDiagnostics; - private readonly CloudHsmClustersRestOperations _cloudHsmClusterRestClient; + private readonly ClientDiagnostics _cloudHsmClustersClientDiagnostics; + private readonly CloudHsmClusters _cloudHsmClustersRestClient; private readonly ClientDiagnostics _cloudHsmClusterPrivateLinkResourcesClientDiagnostics; - private readonly CloudHsmClusterPrivateLinkResourcesRestOperations _cloudHsmClusterPrivateLinkResourcesRestClient; - private readonly ClientDiagnostics _cloudHsmClusterBackupStatusClientDiagnostics; - private readonly CloudHsmClusterBackupStatusRestOperations _cloudHsmClusterBackupStatusRestClient; - private readonly ClientDiagnostics _cloudHsmClusterRestoreStatusClientDiagnostics; - private readonly CloudHsmClusterRestoreStatusRestOperations _cloudHsmClusterRestoreStatusRestClient; + private readonly CloudHsmClusterPrivateLinkResources _cloudHsmClusterPrivateLinkResourcesRestClient; private readonly CloudHsmClusterData _data; - /// Gets the resource type for the operations. public static readonly ResourceType ResourceType = "Microsoft.HardwareSecurityModules/cloudHsmClusters"; - /// Initializes a new instance of the class for mocking. + /// Initializes a new instance of CloudHsmClusterResource for mocking. protected CloudHsmClusterResource() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of class. /// The client parameters to use in these operations. /// The resource that is the target of operations. internal CloudHsmClusterResource(ArmClient client, CloudHsmClusterData data) : this(client, data.Id) @@ -63,146 +48,94 @@ internal CloudHsmClusterResource(ArmClient client, CloudHsmClusterData data) : t _data = data; } - /// Initializes a new instance of the class. + /// Initializes a new instance of class. /// The client parameters to use in these operations. /// The identifier of the resource that is the target of operations. internal CloudHsmClusterResource(ArmClient client, ResourceIdentifier id) : base(client, id) { - _cloudHsmClusterClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HardwareSecurityModules", ResourceType.Namespace, Diagnostics); TryGetApiVersion(ResourceType, out string cloudHsmClusterApiVersion); - _cloudHsmClusterRestClient = new CloudHsmClustersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, cloudHsmClusterApiVersion); - _cloudHsmClusterPrivateLinkResourcesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HardwareSecurityModules", ProviderConstants.DefaultProviderNamespace, Diagnostics); - _cloudHsmClusterPrivateLinkResourcesRestClient = new CloudHsmClusterPrivateLinkResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - _cloudHsmClusterBackupStatusClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HardwareSecurityModules", ProviderConstants.DefaultProviderNamespace, Diagnostics); - _cloudHsmClusterBackupStatusRestClient = new CloudHsmClusterBackupStatusRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - _cloudHsmClusterRestoreStatusClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HardwareSecurityModules", ProviderConstants.DefaultProviderNamespace, Diagnostics); - _cloudHsmClusterRestoreStatusRestClient = new CloudHsmClusterRestoreStatusRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); -#if DEBUG - ValidateResourceId(Id); -#endif + _cloudHsmClustersClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HardwareSecurityModules", ResourceType.Namespace, Diagnostics); + _cloudHsmClustersRestClient = new CloudHsmClusters(_cloudHsmClustersClientDiagnostics, Pipeline, Endpoint, cloudHsmClusterApiVersion ?? "2025-03-31"); + _cloudHsmClusterPrivateLinkResourcesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HardwareSecurityModules", ResourceType.Namespace, Diagnostics); + _cloudHsmClusterPrivateLinkResourcesRestClient = new CloudHsmClusterPrivateLinkResources(_cloudHsmClusterPrivateLinkResourcesClientDiagnostics, Pipeline, Endpoint, cloudHsmClusterApiVersion ?? "2025-03-31"); + ValidateResourceId(id); } /// Gets whether or not the current instance has data. public virtual bool HasData { get; } /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. public virtual CloudHsmClusterData Data { get { if (!HasData) + { throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + } return _data; } } - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// Gets a collection of CloudHsmClusterPrivateEndpointConnectionResources in the CloudHsmCluster. - /// An object representing collection of CloudHsmClusterPrivateEndpointConnectionResources and their operations over a CloudHsmClusterPrivateEndpointConnectionResource. - public virtual CloudHsmClusterPrivateEndpointConnectionCollection GetCloudHsmClusterPrivateEndpointConnections() - { - return GetCachedClient(client => new CloudHsmClusterPrivateEndpointConnectionCollection(client, Id)); - } - - /// - /// Gets the private endpoint connection for the Cloud Hsm Cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections/{peConnectionName} - /// - /// - /// Operation Id - /// PrivateEndpointConnection_Get - /// - /// - /// Default Api Version - /// 2025-03-31 - /// - /// - /// Resource - /// - /// - /// - /// - /// Name of the private endpoint connection associated with the Cloud HSM Cluster. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetCloudHsmClusterPrivateEndpointConnectionAsync(string peConnectionName, CancellationToken cancellationToken = default) + /// Generate the resource identifier for this resource. + /// The subscriptionId. + /// The resourceGroupName. + /// The cloudHsmClusterName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string cloudHsmClusterName) { - return await GetCloudHsmClusterPrivateEndpointConnections().GetAsync(peConnectionName, cancellationToken).ConfigureAwait(false); + string resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}"; + return new ResourceIdentifier(resourceId); } - /// - /// Gets the private endpoint connection for the Cloud Hsm Cluster. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections/{peConnectionName} - /// - /// - /// Operation Id - /// PrivateEndpointConnection_Get - /// - /// - /// Default Api Version - /// 2025-03-31 - /// - /// - /// Resource - /// - /// - /// - /// - /// Name of the private endpoint connection associated with the Cloud HSM Cluster. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetCloudHsmClusterPrivateEndpointConnection(string peConnectionName, CancellationToken cancellationToken = default) + /// + [Conditional("DEBUG")] + internal static void ValidateResourceId(ResourceIdentifier id) { - return GetCloudHsmClusterPrivateEndpointConnections().Get(peConnectionName, cancellationToken); + if (id.ResourceType != ResourceType) + { + throw new ArgumentException(string.Format("Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), id); + } } /// /// Gets the specified Cloud HSM Cluster /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}. /// /// - /// Operation Id - /// CloudHsmCluster_Get + /// Operation Id. + /// CloudHsmClusters_Get. /// /// - /// Default Api Version - /// 2025-03-31 + /// Default Api Version. + /// 2025-03-31. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// /// The cancellation token to use. public virtual async Task> GetAsync(CancellationToken cancellationToken = default) { - using var scope = _cloudHsmClusterClientDiagnostics.CreateScope("CloudHsmClusterResource.Get"); + using DiagnosticScope scope = _cloudHsmClustersClientDiagnostics.CreateScope("CloudHsmClusterResource.Get"); scope.Start(); try { - var response = await _cloudHsmClusterRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _cloudHsmClustersRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(CloudHsmClusterData.FromResponse(result), result); if (response.Value == null) + { throw new RequestFailedException(response.GetRawResponse()); + } return Response.FromValue(new CloudHsmClusterResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -216,33 +149,41 @@ public virtual async Task> GetAsync(Cancellati /// Gets the specified Cloud HSM Cluster /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}. /// /// - /// Operation Id - /// CloudHsmCluster_Get + /// Operation Id. + /// CloudHsmClusters_Get. /// /// - /// Default Api Version - /// 2025-03-31 + /// Default Api Version. + /// 2025-03-31. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// /// The cancellation token to use. public virtual Response Get(CancellationToken cancellationToken = default) { - using var scope = _cloudHsmClusterClientDiagnostics.CreateScope("CloudHsmClusterResource.Get"); + using DiagnosticScope scope = _cloudHsmClustersClientDiagnostics.CreateScope("CloudHsmClusterResource.Get"); scope.Start(); try { - var response = _cloudHsmClusterRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _cloudHsmClustersRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(CloudHsmClusterData.FromResponse(result), result); if (response.Value == null) + { throw new RequestFailedException(response.GetRawResponse()); + } return Response.FromValue(new CloudHsmClusterResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -253,38 +194,55 @@ public virtual Response Get(CancellationToken cancellat } /// - /// Deletes the specified Cloud HSM Cluster + /// Update a Cloud HSM Cluster in the specified subscription. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}. /// /// - /// Operation Id - /// CloudHsmCluster_Delete + /// Operation Id. + /// CloudHsmClusters_Update. /// /// - /// Default Api Version - /// 2025-03-31 + /// Default Api Version. + /// 2025-03-31. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// /// 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. + /// Parameters to create Cloud HSM Cluster. /// The cancellation token to use. - public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, CloudHsmClusterPatch patch, CancellationToken cancellationToken = default) { - using var scope = _cloudHsmClusterClientDiagnostics.CreateScope("CloudHsmClusterResource.Delete"); + Argument.AssertNotNull(patch, nameof(patch)); + + using DiagnosticScope scope = _cloudHsmClustersClientDiagnostics.CreateScope("CloudHsmClusterResource.Update"); scope.Start(); try { - var response = await _cloudHsmClusterRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new HardwareSecurityModulesArmOperation(_cloudHsmClusterClientDiagnostics, Pipeline, _cloudHsmClusterRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _cloudHsmClustersRestClient.CreateUpdateRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, CloudHsmClusterPatch.ToRequestContent(patch), context); + Response response = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + HardwareSecurityModulesArmOperation operation = new HardwareSecurityModulesArmOperation( + new CloudHsmClusterOperationSource(Client), + _cloudHsmClustersClientDiagnostics, + Pipeline, + message.Request, + response, + OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + { + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + } return operation; } catch (Exception e) @@ -295,38 +253,55 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell } /// - /// Deletes the specified Cloud HSM Cluster + /// Update a Cloud HSM Cluster in the specified subscription. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}. /// /// - /// Operation Id - /// CloudHsmCluster_Delete + /// Operation Id. + /// CloudHsmClusters_Update. /// /// - /// Default Api Version - /// 2025-03-31 + /// Default Api Version. + /// 2025-03-31. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// /// 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. + /// Parameters to create Cloud HSM Cluster. /// The cancellation token to use. - public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, CloudHsmClusterPatch patch, CancellationToken cancellationToken = default) { - using var scope = _cloudHsmClusterClientDiagnostics.CreateScope("CloudHsmClusterResource.Delete"); + Argument.AssertNotNull(patch, nameof(patch)); + + using DiagnosticScope scope = _cloudHsmClustersClientDiagnostics.CreateScope("CloudHsmClusterResource.Update"); scope.Start(); try { - var response = _cloudHsmClusterRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - var operation = new HardwareSecurityModulesArmOperation(_cloudHsmClusterClientDiagnostics, Pipeline, _cloudHsmClusterRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _cloudHsmClustersRestClient.CreateUpdateRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, CloudHsmClusterPatch.ToRequestContent(patch), context); + Response response = Pipeline.ProcessMessage(message, context); + HardwareSecurityModulesArmOperation operation = new HardwareSecurityModulesArmOperation( + new CloudHsmClusterOperationSource(Client), + _cloudHsmClustersClientDiagnostics, + Pipeline, + message.Request, + response, + OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); + { + operation.WaitForCompletion(cancellationToken); + } return operation; } catch (Exception e) @@ -337,42 +312,45 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel } /// - /// Update a Cloud HSM Cluster in the specified subscription. + /// Deletes the specified Cloud HSM Cluster /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}. /// /// - /// Operation Id - /// CloudHsmCluster_Update + /// Operation Id. + /// CloudHsmClusters_Delete. /// /// - /// Default Api Version - /// 2025-03-31 + /// Default Api Version. + /// 2025-03-31. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// /// 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. - /// Parameters to create Cloud HSM Cluster. /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, CloudHsmClusterPatch patch, CancellationToken cancellationToken = default) + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(patch, nameof(patch)); - - using var scope = _cloudHsmClusterClientDiagnostics.CreateScope("CloudHsmClusterResource.Update"); + using DiagnosticScope scope = _cloudHsmClustersClientDiagnostics.CreateScope("CloudHsmClusterResource.Delete"); scope.Start(); try { - var response = await _cloudHsmClusterRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); - var operation = new HardwareSecurityModulesArmOperation(new CloudHsmClusterOperationSource(Client), _cloudHsmClusterClientDiagnostics, Pipeline, _cloudHsmClusterRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _cloudHsmClustersRestClient.CreateDeleteRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response response = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + HardwareSecurityModulesArmOperation operation = new HardwareSecurityModulesArmOperation(_cloudHsmClustersClientDiagnostics, Pipeline, message.Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + { + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + } return operation; } catch (Exception e) @@ -383,42 +361,45 @@ public virtual async Task> UpdateAsync(Wai } /// - /// Update a Cloud HSM Cluster in the specified subscription. + /// Deletes the specified Cloud HSM Cluster /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}. /// /// - /// Operation Id - /// CloudHsmCluster_Update + /// Operation Id. + /// CloudHsmClusters_Delete. /// /// - /// Default Api Version - /// 2025-03-31 + /// Default Api Version. + /// 2025-03-31. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// /// 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. - /// Parameters to create Cloud HSM Cluster. /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, CloudHsmClusterPatch patch, CancellationToken cancellationToken = default) + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(patch, nameof(patch)); - - using var scope = _cloudHsmClusterClientDiagnostics.CreateScope("CloudHsmClusterResource.Update"); + using DiagnosticScope scope = _cloudHsmClustersClientDiagnostics.CreateScope("CloudHsmClusterResource.Delete"); scope.Start(); try { - var response = _cloudHsmClusterRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); - var operation = new HardwareSecurityModulesArmOperation(new CloudHsmClusterOperationSource(Client), _cloudHsmClusterClientDiagnostics, Pipeline, _cloudHsmClusterRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _cloudHsmClustersRestClient.CreateDeleteRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response response = Pipeline.ProcessMessage(message, context); + HardwareSecurityModulesArmOperation operation = new HardwareSecurityModulesArmOperation(_cloudHsmClustersClientDiagnostics, Pipeline, message.Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); + { + operation.WaitForCompletionResponse(cancellationToken); + } return operation; } catch (Exception e) @@ -432,36 +413,49 @@ public virtual ArmOperation Update(WaitUntil waitUntil, /// Pre Backup operation to validate whether the customer can perform a backup on the Cloud HSM Cluster resource in the specified subscription. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/validateBackupProperties + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/validateBackupProperties. /// /// - /// Operation Id - /// CloudHsmClusters_ValidateBackupProperties + /// Operation Id. + /// CloudHsmClusters_ValidateBackupProperties. /// /// - /// Default Api Version - /// 2025-03-31 + /// Default Api Version. + /// 2025-03-31. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// /// 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. - /// Backup Operation Required properties. + /// Backup Operation Required properties. /// The cancellation token to use. - public virtual async Task> ValidateBackupPropertiesAsync(WaitUntil waitUntil, CloudHsmClusterBackupContent content = null, CancellationToken cancellationToken = default) + public virtual async Task> ValidateBackupPropertiesAsync(WaitUntil waitUntil, CloudHsmClusterBackupContent backupRequestProperties = default, CancellationToken cancellationToken = default) { - using var scope = _cloudHsmClusterClientDiagnostics.CreateScope("CloudHsmClusterResource.ValidateBackupProperties"); + using DiagnosticScope scope = _cloudHsmClustersClientDiagnostics.CreateScope("CloudHsmClusterResource.ValidateBackupProperties"); scope.Start(); try { - var response = await _cloudHsmClusterRestClient.ValidateBackupPropertiesAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); - var operation = new HardwareSecurityModulesArmOperation(new CloudHsmClusterBackupResultOperationSource(), _cloudHsmClusterClientDiagnostics, Pipeline, _cloudHsmClusterRestClient.CreateValidateBackupPropertiesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.AzureAsyncOperation); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _cloudHsmClustersRestClient.CreateValidateBackupPropertiesRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, CloudHsmClusterBackupContent.ToRequestContent(backupRequestProperties), context); + Response response = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + HardwareSecurityModulesArmOperation operation = new HardwareSecurityModulesArmOperation( + new CloudHsmClusterBackupResultOperationSource(), + _cloudHsmClustersClientDiagnostics, + Pipeline, + message.Request, + response, + OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) + { await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + } return operation; } catch (Exception e) @@ -475,36 +469,49 @@ public virtual async Task> ValidateBac /// Pre Backup operation to validate whether the customer can perform a backup on the Cloud HSM Cluster resource in the specified subscription. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/validateBackupProperties + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/validateBackupProperties. /// /// - /// Operation Id - /// CloudHsmClusters_ValidateBackupProperties + /// Operation Id. + /// CloudHsmClusters_ValidateBackupProperties. /// /// - /// Default Api Version - /// 2025-03-31 + /// Default Api Version. + /// 2025-03-31. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// /// 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. - /// Backup Operation Required properties. + /// Backup Operation Required properties. /// The cancellation token to use. - public virtual ArmOperation ValidateBackupProperties(WaitUntil waitUntil, CloudHsmClusterBackupContent content = null, CancellationToken cancellationToken = default) + public virtual ArmOperation ValidateBackupProperties(WaitUntil waitUntil, CloudHsmClusterBackupContent backupRequestProperties = default, CancellationToken cancellationToken = default) { - using var scope = _cloudHsmClusterClientDiagnostics.CreateScope("CloudHsmClusterResource.ValidateBackupProperties"); + using DiagnosticScope scope = _cloudHsmClustersClientDiagnostics.CreateScope("CloudHsmClusterResource.ValidateBackupProperties"); scope.Start(); try { - var response = _cloudHsmClusterRestClient.ValidateBackupProperties(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); - var operation = new HardwareSecurityModulesArmOperation(new CloudHsmClusterBackupResultOperationSource(), _cloudHsmClusterClientDiagnostics, Pipeline, _cloudHsmClusterRestClient.CreateValidateBackupPropertiesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.AzureAsyncOperation); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _cloudHsmClustersRestClient.CreateValidateBackupPropertiesRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, CloudHsmClusterBackupContent.ToRequestContent(backupRequestProperties), context); + Response response = Pipeline.ProcessMessage(message, context); + HardwareSecurityModulesArmOperation operation = new HardwareSecurityModulesArmOperation( + new CloudHsmClusterBackupResultOperationSource(), + _cloudHsmClustersClientDiagnostics, + Pipeline, + message.Request, + response, + OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) + { operation.WaitForCompletion(cancellationToken); + } return operation; } catch (Exception e) @@ -518,36 +525,49 @@ public virtual ArmOperation ValidateBackupPropertie /// Create a backup of the Cloud HSM Cluster in the specified subscription /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/backup + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/backup. /// /// - /// Operation Id - /// CloudHsmClusters_Backup + /// Operation Id. + /// CloudHsmClusters_Backup. /// /// - /// Default Api Version - /// 2025-03-31 + /// Default Api Version. + /// 2025-03-31. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// /// 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. - /// Azure storage Resource Uri. + /// Azure storage Resource Uri. /// The cancellation token to use. - public virtual async Task> BackupAsync(WaitUntil waitUntil, CloudHsmClusterBackupContent content = null, CancellationToken cancellationToken = default) + public virtual async Task> BackupAsync(WaitUntil waitUntil, CloudHsmClusterBackupContent backupRequestProperties = default, CancellationToken cancellationToken = default) { - using var scope = _cloudHsmClusterClientDiagnostics.CreateScope("CloudHsmClusterResource.Backup"); + using DiagnosticScope scope = _cloudHsmClustersClientDiagnostics.CreateScope("CloudHsmClusterResource.Backup"); scope.Start(); try { - var response = await _cloudHsmClusterRestClient.BackupAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); - var operation = new HardwareSecurityModulesArmOperation(new CloudHsmClusterBackupResultOperationSource(), _cloudHsmClusterClientDiagnostics, Pipeline, _cloudHsmClusterRestClient.CreateBackupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.AzureAsyncOperation); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _cloudHsmClustersRestClient.CreateBackupRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, CloudHsmClusterBackupContent.ToRequestContent(backupRequestProperties), context); + Response response = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + HardwareSecurityModulesArmOperation operation = new HardwareSecurityModulesArmOperation( + new CloudHsmClusterBackupResultOperationSource(), + _cloudHsmClustersClientDiagnostics, + Pipeline, + message.Request, + response, + OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) + { await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + } return operation; } catch (Exception e) @@ -561,36 +581,49 @@ public virtual async Task> BackupAsync /// Create a backup of the Cloud HSM Cluster in the specified subscription /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/backup + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/backup. /// /// - /// Operation Id - /// CloudHsmClusters_Backup + /// Operation Id. + /// CloudHsmClusters_Backup. /// /// - /// Default Api Version - /// 2025-03-31 + /// Default Api Version. + /// 2025-03-31. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// /// 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. - /// Azure storage Resource Uri. + /// Azure storage Resource Uri. /// The cancellation token to use. - public virtual ArmOperation Backup(WaitUntil waitUntil, CloudHsmClusterBackupContent content = null, CancellationToken cancellationToken = default) + public virtual ArmOperation Backup(WaitUntil waitUntil, CloudHsmClusterBackupContent backupRequestProperties = default, CancellationToken cancellationToken = default) { - using var scope = _cloudHsmClusterClientDiagnostics.CreateScope("CloudHsmClusterResource.Backup"); + using DiagnosticScope scope = _cloudHsmClustersClientDiagnostics.CreateScope("CloudHsmClusterResource.Backup"); scope.Start(); try { - var response = _cloudHsmClusterRestClient.Backup(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); - var operation = new HardwareSecurityModulesArmOperation(new CloudHsmClusterBackupResultOperationSource(), _cloudHsmClusterClientDiagnostics, Pipeline, _cloudHsmClusterRestClient.CreateBackupRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.AzureAsyncOperation); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _cloudHsmClustersRestClient.CreateBackupRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, CloudHsmClusterBackupContent.ToRequestContent(backupRequestProperties), context); + Response response = Pipeline.ProcessMessage(message, context); + HardwareSecurityModulesArmOperation operation = new HardwareSecurityModulesArmOperation( + new CloudHsmClusterBackupResultOperationSource(), + _cloudHsmClustersClientDiagnostics, + Pipeline, + message.Request, + response, + OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) + { operation.WaitForCompletion(cancellationToken); + } return operation; } catch (Exception e) @@ -604,36 +637,49 @@ public virtual ArmOperation Backup(WaitUntil waitUn /// Queued validating pre restore operation /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/validateRestoreProperties + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/validateRestoreProperties. /// /// - /// Operation Id - /// CloudHsmClusters_ValidateRestoreProperties + /// Operation Id. + /// CloudHsmClusters_ValidateRestoreProperties. /// /// - /// Default Api Version - /// 2025-03-31 + /// Default Api Version. + /// 2025-03-31. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// /// 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. - /// Optional Parameters to validate prior performing a restore operation. + /// Optional Parameters to validate prior performing a restore operation. /// The cancellation token to use. - public virtual async Task> ValidateRestorePropertiesAsync(WaitUntil waitUntil, CloudHsmClusterRestoreContent content = null, CancellationToken cancellationToken = default) + public virtual async Task> ValidateRestorePropertiesAsync(WaitUntil waitUntil, CloudHsmClusterRestoreContent restoreRequestProperties = default, CancellationToken cancellationToken = default) { - using var scope = _cloudHsmClusterClientDiagnostics.CreateScope("CloudHsmClusterResource.ValidateRestoreProperties"); + using DiagnosticScope scope = _cloudHsmClustersClientDiagnostics.CreateScope("CloudHsmClusterResource.ValidateRestoreProperties"); scope.Start(); try { - var response = await _cloudHsmClusterRestClient.ValidateRestorePropertiesAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); - var operation = new HardwareSecurityModulesArmOperation(new CloudHsmClusterRestoreResultOperationSource(), _cloudHsmClusterClientDiagnostics, Pipeline, _cloudHsmClusterRestClient.CreateValidateRestorePropertiesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.AzureAsyncOperation); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _cloudHsmClustersRestClient.CreateValidateRestorePropertiesRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, CloudHsmClusterRestoreContent.ToRequestContent(restoreRequestProperties), context); + Response response = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + HardwareSecurityModulesArmOperation operation = new HardwareSecurityModulesArmOperation( + new CloudHsmClusterRestoreResultOperationSource(), + _cloudHsmClustersClientDiagnostics, + Pipeline, + message.Request, + response, + OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) + { await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + } return operation; } catch (Exception e) @@ -647,36 +693,49 @@ public virtual async Task> ValidateRe /// Queued validating pre restore operation /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/validateRestoreProperties + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/validateRestoreProperties. /// /// - /// Operation Id - /// CloudHsmClusters_ValidateRestoreProperties + /// Operation Id. + /// CloudHsmClusters_ValidateRestoreProperties. /// /// - /// Default Api Version - /// 2025-03-31 + /// Default Api Version. + /// 2025-03-31. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// /// 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. - /// Optional Parameters to validate prior performing a restore operation. + /// Optional Parameters to validate prior performing a restore operation. /// The cancellation token to use. - public virtual ArmOperation ValidateRestoreProperties(WaitUntil waitUntil, CloudHsmClusterRestoreContent content = null, CancellationToken cancellationToken = default) + public virtual ArmOperation ValidateRestoreProperties(WaitUntil waitUntil, CloudHsmClusterRestoreContent restoreRequestProperties = default, CancellationToken cancellationToken = default) { - using var scope = _cloudHsmClusterClientDiagnostics.CreateScope("CloudHsmClusterResource.ValidateRestoreProperties"); + using DiagnosticScope scope = _cloudHsmClustersClientDiagnostics.CreateScope("CloudHsmClusterResource.ValidateRestoreProperties"); scope.Start(); try { - var response = _cloudHsmClusterRestClient.ValidateRestoreProperties(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); - var operation = new HardwareSecurityModulesArmOperation(new CloudHsmClusterRestoreResultOperationSource(), _cloudHsmClusterClientDiagnostics, Pipeline, _cloudHsmClusterRestClient.CreateValidateRestorePropertiesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.AzureAsyncOperation); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _cloudHsmClustersRestClient.CreateValidateRestorePropertiesRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, CloudHsmClusterRestoreContent.ToRequestContent(restoreRequestProperties), context); + Response response = Pipeline.ProcessMessage(message, context); + HardwareSecurityModulesArmOperation operation = new HardwareSecurityModulesArmOperation( + new CloudHsmClusterRestoreResultOperationSource(), + _cloudHsmClustersClientDiagnostics, + Pipeline, + message.Request, + response, + OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) + { operation.WaitForCompletion(cancellationToken); + } return operation; } catch (Exception e) @@ -690,20 +749,20 @@ public virtual ArmOperation ValidateRestorePropert /// Restores all key materials of a specified Cloud HSM Cluster /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/restore + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/restore. /// /// - /// Operation Id - /// CloudHsmClusters_Restore + /// Operation Id. + /// CloudHsmClusters_Restore. /// /// - /// Default Api Version - /// 2025-03-31 + /// Default Api Version. + /// 2025-03-31. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// @@ -715,14 +774,27 @@ public virtual async Task> RestoreAsy { Argument.AssertNotNull(content, nameof(content)); - using var scope = _cloudHsmClusterClientDiagnostics.CreateScope("CloudHsmClusterResource.Restore"); + using DiagnosticScope scope = _cloudHsmClustersClientDiagnostics.CreateScope("CloudHsmClusterResource.Restore"); scope.Start(); try { - var response = await _cloudHsmClusterRestClient.RestoreAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); - var operation = new HardwareSecurityModulesArmOperation(new CloudHsmClusterRestoreResultOperationSource(), _cloudHsmClusterClientDiagnostics, Pipeline, _cloudHsmClusterRestClient.CreateRestoreRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.AzureAsyncOperation); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _cloudHsmClustersRestClient.CreateRestoreRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, CloudHsmClusterRestoreContent.ToRequestContent(content), context); + Response response = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + HardwareSecurityModulesArmOperation operation = new HardwareSecurityModulesArmOperation( + new CloudHsmClusterRestoreResultOperationSource(), + _cloudHsmClustersClientDiagnostics, + Pipeline, + message.Request, + response, + OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) + { await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + } return operation; } catch (Exception e) @@ -736,20 +808,20 @@ public virtual async Task> RestoreAsy /// Restores all key materials of a specified Cloud HSM Cluster /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/restore + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/restore. /// /// - /// Operation Id - /// CloudHsmClusters_Restore + /// Operation Id. + /// CloudHsmClusters_Restore. /// /// - /// Default Api Version - /// 2025-03-31 + /// Default Api Version. + /// 2025-03-31. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// @@ -761,14 +833,27 @@ public virtual ArmOperation Restore(WaitUntil wait { Argument.AssertNotNull(content, nameof(content)); - using var scope = _cloudHsmClusterClientDiagnostics.CreateScope("CloudHsmClusterResource.Restore"); + using DiagnosticScope scope = _cloudHsmClustersClientDiagnostics.CreateScope("CloudHsmClusterResource.Restore"); scope.Start(); try { - var response = _cloudHsmClusterRestClient.Restore(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); - var operation = new HardwareSecurityModulesArmOperation(new CloudHsmClusterRestoreResultOperationSource(), _cloudHsmClusterClientDiagnostics, Pipeline, _cloudHsmClusterRestClient.CreateRestoreRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.AzureAsyncOperation); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _cloudHsmClustersRestClient.CreateRestoreRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, CloudHsmClusterRestoreContent.ToRequestContent(content), context); + Response response = Pipeline.ProcessMessage(message, context); + HardwareSecurityModulesArmOperation operation = new HardwareSecurityModulesArmOperation( + new CloudHsmClusterRestoreResultOperationSource(), + _cloudHsmClustersClientDiagnostics, + Pipeline, + message.Request, + response, + OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) + { operation.WaitForCompletion(cancellationToken); + } return operation; } catch (Exception e) @@ -782,231 +867,67 @@ public virtual ArmOperation Restore(WaitUntil wait /// Gets the private link resources supported for the Cloud Hsm Cluster. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateLinkResources + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateLinkResources. /// /// - /// Operation Id - /// CloudHsmClusters_ListByCloudHsmCluster + /// Operation Id. + /// CloudHsmClusters_ListByCloudHsmCluster. /// /// - /// Default Api Version - /// 2025-03-31 + /// Default Api Version. + /// 2025-03-31. /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetCloudHsmClusterPrivateLinkResourcesAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _cloudHsmClusterPrivateLinkResourcesRestClient.CreateListByCloudHsmClusterRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _cloudHsmClusterPrivateLinkResourcesRestClient.CreateListByCloudHsmClusterNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => CloudHsmClusterPrivateLinkData.DeserializeCloudHsmClusterPrivateLinkData(e), _cloudHsmClusterPrivateLinkResourcesClientDiagnostics, Pipeline, "CloudHsmClusterResource.GetCloudHsmClusterPrivateLinkResources", "value", "nextLink", cancellationToken); - } - - /// - /// Gets the private link resources supported for the Cloud Hsm Cluster. - /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateLinkResources - /// - /// - /// Operation Id - /// CloudHsmClusters_ListByCloudHsmCluster - /// - /// - /// Default Api Version - /// 2025-03-31 + /// Resource. + /// . /// /// /// /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetCloudHsmClusterPrivateLinkResources(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _cloudHsmClusterPrivateLinkResourcesRestClient.CreateListByCloudHsmClusterRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _cloudHsmClusterPrivateLinkResourcesRestClient.CreateListByCloudHsmClusterNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => CloudHsmClusterPrivateLinkData.DeserializeCloudHsmClusterPrivateLinkData(e), _cloudHsmClusterPrivateLinkResourcesClientDiagnostics, Pipeline, "CloudHsmClusterResource.GetCloudHsmClusterPrivateLinkResources", "value", "nextLink", cancellationToken); - } - - /// - /// Gets the backup operation status of the specified Cloud HSM Cluster - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/backupOperationStatus/{jobId} - /// - /// - /// Operation Id - /// CloudHsmClusters_GetCloudHsmClusterBackupStatus - /// - /// - /// Default Api Version - /// 2025-03-31 - /// - /// - /// - /// Identifier for the backup operation. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetCloudHsmClusterBackupStatusAsync(string jobId, CancellationToken cancellationToken = default) + public virtual AsyncPageable GetByCloudHsmClusterAsync(CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = _cloudHsmClusterBackupStatusClientDiagnostics.CreateScope("CloudHsmClusterResource.GetCloudHsmClusterBackupStatus"); - scope.Start(); - try + RequestContext context = new RequestContext { - var response = await _cloudHsmClusterBackupStatusRestClient.GetCloudHsmClusterBackupStatusAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobId, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } + CancellationToken = cancellationToken + }; + return new CloudHsmClusterPrivateLinkResourcesGetByCloudHsmClusterAsyncCollectionResultOfT(_cloudHsmClusterPrivateLinkResourcesRestClient, Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); } /// - /// Gets the backup operation status of the specified Cloud HSM Cluster + /// Gets the private link resources supported for the Cloud Hsm Cluster. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/backupOperationStatus/{jobId} - /// - /// - /// Operation Id - /// CloudHsmClusters_GetCloudHsmClusterBackupStatus - /// - /// - /// Default Api Version - /// 2025-03-31 + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateLinkResources. /// - /// - /// - /// Identifier for the backup operation. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response GetCloudHsmClusterBackupStatus(string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = _cloudHsmClusterBackupStatusClientDiagnostics.CreateScope("CloudHsmClusterResource.GetCloudHsmClusterBackupStatus"); - scope.Start(); - try - { - var response = _cloudHsmClusterBackupStatusRestClient.GetCloudHsmClusterBackupStatus(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobId, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the restore operation status of the specified Cloud HSM Cluster - /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/restoreOperationStatus/{jobId} + /// Operation Id. + /// CloudHsmClusters_ListByCloudHsmCluster. /// /// - /// Operation Id - /// CloudHsmClusters_GetCloudHsmClusterRestoreStatus + /// Default Api Version. + /// 2025-03-31. /// /// - /// Default Api Version - /// 2025-03-31 + /// Resource. + /// . /// /// /// - /// Identifier for the restore operation. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetCloudHsmClusterRestoreStatusAsync(string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = _cloudHsmClusterRestoreStatusClientDiagnostics.CreateScope("CloudHsmClusterResource.GetCloudHsmClusterRestoreStatus"); - scope.Start(); - try - { - var response = await _cloudHsmClusterRestoreStatusRestClient.GetCloudHsmClusterRestoreStatusAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobId, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the restore operation status of the specified Cloud HSM Cluster - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/restoreOperationStatus/{jobId} - /// - /// - /// Operation Id - /// CloudHsmClusters_GetCloudHsmClusterRestoreStatus - /// - /// - /// Default Api Version - /// 2025-03-31 - /// - /// - /// - /// Identifier for the restore operation. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response GetCloudHsmClusterRestoreStatus(string jobId, CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetByCloudHsmCluster(CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var scope = _cloudHsmClusterRestoreStatusClientDiagnostics.CreateScope("CloudHsmClusterResource.GetCloudHsmClusterRestoreStatus"); - scope.Start(); - try - { - var response = _cloudHsmClusterRestoreStatusRestClient.GetCloudHsmClusterRestoreStatus(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobId, cancellationToken); - return response; - } - catch (Exception e) + RequestContext context = new RequestContext { - scope.Failed(e); - throw; - } + CancellationToken = cancellationToken + }; + return new CloudHsmClusterPrivateLinkResourcesGetByCloudHsmClusterCollectionResultOfT(_cloudHsmClusterPrivateLinkResourcesRestClient, Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); } - /// - /// Add a tag to the current resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName} - /// - /// - /// Operation Id - /// CloudHsmCluster_Get - /// - /// - /// Default Api Version - /// 2025-03-31 - /// - /// - /// Resource - /// - /// - /// - /// + /// Add a tag to the current resource. /// The key for the tag. /// The value for the tag. /// The cancellation token to use. @@ -1016,28 +937,34 @@ public virtual async Task> AddTagAsync(string Argument.AssertNotNull(key, nameof(key)); Argument.AssertNotNull(value, nameof(value)); - using var scope = _cloudHsmClusterClientDiagnostics.CreateScope("CloudHsmClusterResource.AddTag"); + using DiagnosticScope scope = _cloudHsmClustersClientDiagnostics.CreateScope("CloudHsmClusterResource.AddTag"); scope.Start(); try { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + if (await CanUseTagResourceAsync(cancellationToken).ConfigureAwait(false)) { - var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + Response 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 _cloudHsmClusterRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new CloudHsmClusterResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _cloudHsmClustersRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(CloudHsmClusterData.FromResponse(result), result); + return Response.FromValue(new CloudHsmClusterResource(Client, response.Value), response.GetRawResponse()); } else { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new CloudHsmClusterPatch(); - foreach (var tag in current.Tags) + CloudHsmClusterData current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + CloudHsmClusterPatch patch = new CloudHsmClusterPatch(); + foreach (KeyValuePair tag in current.Tags) { patch.Tags.Add(tag); } patch.Tags[key] = value; - var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + ArmOperation result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(result.Value, result.GetRawResponse()); } } @@ -1048,27 +975,7 @@ public virtual async Task> AddTagAsync(string } } - /// - /// Add a tag to the current resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName} - /// - /// - /// Operation Id - /// CloudHsmCluster_Get - /// - /// - /// Default Api Version - /// 2025-03-31 - /// - /// - /// Resource - /// - /// - /// - /// + /// Add a tag to the current resource. /// The key for the tag. /// The value for the tag. /// The cancellation token to use. @@ -1078,28 +985,34 @@ public virtual Response AddTag(string key, string value Argument.AssertNotNull(key, nameof(key)); Argument.AssertNotNull(value, nameof(value)); - using var scope = _cloudHsmClusterClientDiagnostics.CreateScope("CloudHsmClusterResource.AddTag"); + using DiagnosticScope scope = _cloudHsmClustersClientDiagnostics.CreateScope("CloudHsmClusterResource.AddTag"); scope.Start(); try { - if (CanUseTagResource(cancellationToken: cancellationToken)) + if (CanUseTagResource(cancellationToken)) { - var originalTags = GetTagResource().Get(cancellationToken); + Response originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues[key] = value; - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _cloudHsmClusterRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return Response.FromValue(new CloudHsmClusterResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _cloudHsmClustersRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(CloudHsmClusterData.FromResponse(result), result); + return Response.FromValue(new CloudHsmClusterResource(Client, response.Value), response.GetRawResponse()); } else { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new CloudHsmClusterPatch(); - foreach (var tag in current.Tags) + CloudHsmClusterData current = Get(cancellationToken: cancellationToken).Value.Data; + CloudHsmClusterPatch patch = new CloudHsmClusterPatch(); + foreach (KeyValuePair tag in current.Tags) { patch.Tags.Add(tag); } patch.Tags[key] = value; - var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + ArmOperation result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); return Response.FromValue(result.Value, result.GetRawResponse()); } } @@ -1110,53 +1023,39 @@ public virtual Response AddTag(string key, string value } } - /// - /// Replace the tags on the resource with the given set. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName} - /// - /// - /// Operation Id - /// CloudHsmCluster_Get - /// - /// - /// Default Api Version - /// 2025-03-31 - /// - /// - /// Resource - /// - /// - /// - /// - /// The set of tags to use as replacement. + /// Replace the tags on the resource with the given set. + /// The tags to set on the resource. /// The cancellation token to use. /// is null. public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) { Argument.AssertNotNull(tags, nameof(tags)); - using var scope = _cloudHsmClusterClientDiagnostics.CreateScope("CloudHsmClusterResource.SetTags"); + using DiagnosticScope scope = _cloudHsmClustersClientDiagnostics.CreateScope("CloudHsmClusterResource.SetTags"); scope.Start(); try { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + if (await CanUseTagResourceAsync(cancellationToken).ConfigureAwait(false)) { - await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken).ConfigureAwait(false); + Response 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 _cloudHsmClusterRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new CloudHsmClusterResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _cloudHsmClustersRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(CloudHsmClusterData.FromResponse(result), result); + return Response.FromValue(new CloudHsmClusterResource(Client, response.Value), response.GetRawResponse()); } else { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new CloudHsmClusterPatch(); + CloudHsmClusterData current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + CloudHsmClusterPatch patch = new CloudHsmClusterPatch(); patch.Tags.ReplaceWith(tags); - var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + ArmOperation result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(result.Value, result.GetRawResponse()); } } @@ -1167,53 +1066,39 @@ public virtual async Task> SetTagsAsync(IDicti } } - /// - /// Replace the tags on the resource with the given set. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName} - /// - /// - /// Operation Id - /// CloudHsmCluster_Get - /// - /// - /// Default Api Version - /// 2025-03-31 - /// - /// - /// Resource - /// - /// - /// - /// - /// The set of tags to use as replacement. + /// Replace the tags on the resource with the given set. + /// The tags to set on the resource. /// The cancellation token to use. /// is null. public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) { Argument.AssertNotNull(tags, nameof(tags)); - using var scope = _cloudHsmClusterClientDiagnostics.CreateScope("CloudHsmClusterResource.SetTags"); + using DiagnosticScope scope = _cloudHsmClustersClientDiagnostics.CreateScope("CloudHsmClusterResource.SetTags"); scope.Start(); try { - if (CanUseTagResource(cancellationToken: cancellationToken)) + if (CanUseTagResource(cancellationToken)) { - GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); - var originalTags = GetTagResource().Get(cancellationToken); + GetTagResource().Delete(WaitUntil.Completed, cancellationToken); + Response originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues.ReplaceWith(tags); - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _cloudHsmClusterRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return Response.FromValue(new CloudHsmClusterResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _cloudHsmClustersRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(CloudHsmClusterData.FromResponse(result), result); + return Response.FromValue(new CloudHsmClusterResource(Client, response.Value), response.GetRawResponse()); } else { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new CloudHsmClusterPatch(); + CloudHsmClusterData current = Get(cancellationToken: cancellationToken).Value.Data; + CloudHsmClusterPatch patch = new CloudHsmClusterPatch(); patch.Tags.ReplaceWith(tags); - var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + ArmOperation result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); return Response.FromValue(result.Value, result.GetRawResponse()); } } @@ -1224,27 +1109,7 @@ public virtual Response SetTags(IDictionary - /// Removes a tag by key from the resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName} - /// - /// - /// Operation Id - /// CloudHsmCluster_Get - /// - /// - /// Default Api Version - /// 2025-03-31 - /// - /// - /// Resource - /// - /// - /// - /// + /// Removes a tag by key from the resource. /// The key for the tag. /// The cancellation token to use. /// is null. @@ -1252,28 +1117,34 @@ public virtual async Task> RemoveTagAsync(stri { Argument.AssertNotNull(key, nameof(key)); - using var scope = _cloudHsmClusterClientDiagnostics.CreateScope("CloudHsmClusterResource.RemoveTag"); + using DiagnosticScope scope = _cloudHsmClustersClientDiagnostics.CreateScope("CloudHsmClusterResource.RemoveTag"); scope.Start(); try { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + if (await CanUseTagResourceAsync(cancellationToken).ConfigureAwait(false)) { - var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + Response 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 _cloudHsmClusterRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new CloudHsmClusterResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _cloudHsmClustersRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(CloudHsmClusterData.FromResponse(result), result); + return Response.FromValue(new CloudHsmClusterResource(Client, response.Value), response.GetRawResponse()); } else { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new CloudHsmClusterPatch(); - foreach (var tag in current.Tags) + CloudHsmClusterData current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + CloudHsmClusterPatch patch = new CloudHsmClusterPatch(); + foreach (KeyValuePair tag in current.Tags) { patch.Tags.Add(tag); } patch.Tags.Remove(key); - var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + ArmOperation result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(result.Value, result.GetRawResponse()); } } @@ -1284,27 +1155,7 @@ public virtual async Task> RemoveTagAsync(stri } } - /// - /// Removes a tag by key from the resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName} - /// - /// - /// Operation Id - /// CloudHsmCluster_Get - /// - /// - /// Default Api Version - /// 2025-03-31 - /// - /// - /// Resource - /// - /// - /// - /// + /// Removes a tag by key from the resource. /// The key for the tag. /// The cancellation token to use. /// is null. @@ -1312,28 +1163,34 @@ public virtual Response RemoveTag(string key, Cancellat { Argument.AssertNotNull(key, nameof(key)); - using var scope = _cloudHsmClusterClientDiagnostics.CreateScope("CloudHsmClusterResource.RemoveTag"); + using DiagnosticScope scope = _cloudHsmClustersClientDiagnostics.CreateScope("CloudHsmClusterResource.RemoveTag"); scope.Start(); try { - if (CanUseTagResource(cancellationToken: cancellationToken)) + if (CanUseTagResource(cancellationToken)) { - var originalTags = GetTagResource().Get(cancellationToken); + Response originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues.Remove(key); - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _cloudHsmClusterRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return Response.FromValue(new CloudHsmClusterResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _cloudHsmClustersRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(CloudHsmClusterData.FromResponse(result), result); + return Response.FromValue(new CloudHsmClusterResource(Client, response.Value), response.GetRawResponse()); } else { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new CloudHsmClusterPatch(); - foreach (var tag in current.Tags) + CloudHsmClusterData current = Get(cancellationToken: cancellationToken).Value.Data; + CloudHsmClusterPatch patch = new CloudHsmClusterPatch(); + foreach (KeyValuePair tag in current.Tags) { patch.Tags.Add(tag); } patch.Tags.Remove(key); - var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + ArmOperation result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); return Response.FromValue(result.Value, result.GetRawResponse()); } } @@ -1343,5 +1200,38 @@ public virtual Response RemoveTag(string key, Cancellat throw; } } + + /// Gets a collection of CloudHsmClusterPrivateEndpointConnections in the . + /// An object representing collection of CloudHsmClusterPrivateEndpointConnections and their operations over a CloudHsmClusterPrivateEndpointConnectionResource. + public virtual CloudHsmClusterPrivateEndpointConnectionCollection GetCloudHsmClusterPrivateEndpointConnections() + { + return GetCachedClient(client => new CloudHsmClusterPrivateEndpointConnectionCollection(client, Id)); + } + + /// Gets the private endpoint connection for the Cloud Hsm Cluster. + /// Name of the private endpoint connection associated with the Cloud HSM Cluster. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetCloudHsmClusterPrivateEndpointConnectionAsync(string peConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(peConnectionName, nameof(peConnectionName)); + + return await GetCloudHsmClusterPrivateEndpointConnections().GetAsync(peConnectionName, cancellationToken).ConfigureAwait(false); + } + + /// Gets the private endpoint connection for the Cloud Hsm Cluster. + /// Name of the private endpoint connection associated with the Cloud HSM Cluster. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetCloudHsmClusterPrivateEndpointConnection(string peConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(peConnectionName, nameof(peConnectionName)); + + return GetCloudHsmClusterPrivateEndpointConnections().Get(peConnectionName, cancellationToken); + } } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CollectionResults/CloudHsmClusterPrivateLinkResourcesGetByCloudHsmClusterAsyncCollectionResultOfT.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CollectionResults/CloudHsmClusterPrivateLinkResourcesGetByCloudHsmClusterAsyncCollectionResultOfT.cs new file mode 100644 index 000000000000..e9d8620bf143 --- /dev/null +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CollectionResults/CloudHsmClusterPrivateLinkResourcesGetByCloudHsmClusterAsyncCollectionResultOfT.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.HardwareSecurityModules.Models; + +namespace Azure.ResourceManager.HardwareSecurityModules +{ + internal partial class CloudHsmClusterPrivateLinkResourcesGetByCloudHsmClusterAsyncCollectionResultOfT : AsyncPageable + { + private readonly CloudHsmClusterPrivateLinkResources _client; + private readonly Guid _subscriptionId; + private readonly string _resourceGroupName; + private readonly string _cloudHsmClusterName; + private readonly RequestContext _context; + + /// Initializes a new instance of CloudHsmClusterPrivateLinkResourcesGetByCloudHsmClusterAsyncCollectionResultOfT, which is used to iterate over the pages of a collection. + /// The CloudHsmClusterPrivateLinkResources client used to send requests. + /// 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 Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + public CloudHsmClusterPrivateLinkResourcesGetByCloudHsmClusterAsyncCollectionResultOfT(CloudHsmClusterPrivateLinkResources client, Guid subscriptionId, string resourceGroupName, string cloudHsmClusterName, RequestContext context) : base(context?.CancellationToken ?? default) + { + _client = client; + _subscriptionId = subscriptionId; + _resourceGroupName = resourceGroupName; + _cloudHsmClusterName = cloudHsmClusterName; + _context = context; + } + + /// Gets the pages of CloudHsmClusterPrivateLinkResourcesGetByCloudHsmClusterAsyncCollectionResultOfT as an enumerable collection. + /// A continuation token indicating where to resume paging. + /// The number of items per page. + /// The pages of CloudHsmClusterPrivateLinkResourcesGetByCloudHsmClusterAsyncCollectionResultOfT as an enumerable collection. + public override async IAsyncEnumerable> AsPages(string continuationToken, int? pageSizeHint) + { + Uri nextPage = continuationToken != null ? new Uri(continuationToken) : null; + while (true) + { + Response response = await GetNextResponseAsync(pageSizeHint, nextPage).ConfigureAwait(false); + if (response is null) + { + yield break; + } + HardwareSecurityModulesPrivateLinkResourceListResult result = HardwareSecurityModulesPrivateLinkResourceListResult.FromResponse(response); + yield return Page.FromValues((IReadOnlyList)result.Value, nextPage?.AbsoluteUri, response); + nextPage = result.NextLink; + if (nextPage == null) + { + yield break; + } + } + } + + /// Get next page. + /// The number of items per page. + /// The next link to use for the next page of results. + private async ValueTask GetNextResponseAsync(int? pageSizeHint, Uri nextLink) + { + HttpMessage message = nextLink != null ? _client.CreateNextGetByCloudHsmClusterRequest(nextLink, _subscriptionId, _resourceGroupName, _cloudHsmClusterName, _context) : _client.CreateGetByCloudHsmClusterRequest(_subscriptionId, _resourceGroupName, _cloudHsmClusterName, _context); + using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("CloudHsmClusterResource.GetByCloudHsmCluster"); + scope.Start(); + try + { + return await _client.Pipeline.ProcessMessageAsync(message, _context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CollectionResults/CloudHsmClusterPrivateLinkResourcesGetByCloudHsmClusterCollectionResultOfT.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CollectionResults/CloudHsmClusterPrivateLinkResourcesGetByCloudHsmClusterCollectionResultOfT.cs new file mode 100644 index 000000000000..7fad736c4310 --- /dev/null +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CollectionResults/CloudHsmClusterPrivateLinkResourcesGetByCloudHsmClusterCollectionResultOfT.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.HardwareSecurityModules.Models; + +namespace Azure.ResourceManager.HardwareSecurityModules +{ + internal partial class CloudHsmClusterPrivateLinkResourcesGetByCloudHsmClusterCollectionResultOfT : Pageable + { + private readonly CloudHsmClusterPrivateLinkResources _client; + private readonly Guid _subscriptionId; + private readonly string _resourceGroupName; + private readonly string _cloudHsmClusterName; + private readonly RequestContext _context; + + /// Initializes a new instance of CloudHsmClusterPrivateLinkResourcesGetByCloudHsmClusterCollectionResultOfT, which is used to iterate over the pages of a collection. + /// The CloudHsmClusterPrivateLinkResources client used to send requests. + /// 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 Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + public CloudHsmClusterPrivateLinkResourcesGetByCloudHsmClusterCollectionResultOfT(CloudHsmClusterPrivateLinkResources client, Guid subscriptionId, string resourceGroupName, string cloudHsmClusterName, RequestContext context) : base(context?.CancellationToken ?? default) + { + _client = client; + _subscriptionId = subscriptionId; + _resourceGroupName = resourceGroupName; + _cloudHsmClusterName = cloudHsmClusterName; + _context = context; + } + + /// Gets the pages of CloudHsmClusterPrivateLinkResourcesGetByCloudHsmClusterCollectionResultOfT as an enumerable collection. + /// A continuation token indicating where to resume paging. + /// The number of items per page. + /// The pages of CloudHsmClusterPrivateLinkResourcesGetByCloudHsmClusterCollectionResultOfT as an enumerable collection. + public override IEnumerable> AsPages(string continuationToken, int? pageSizeHint) + { + Uri nextPage = continuationToken != null ? new Uri(continuationToken) : null; + while (true) + { + Response response = GetNextResponse(pageSizeHint, nextPage); + if (response is null) + { + yield break; + } + HardwareSecurityModulesPrivateLinkResourceListResult result = HardwareSecurityModulesPrivateLinkResourceListResult.FromResponse(response); + yield return Page.FromValues((IReadOnlyList)result.Value, nextPage?.AbsoluteUri, response); + nextPage = result.NextLink; + if (nextPage == null) + { + yield break; + } + } + } + + /// Get next page. + /// The number of items per page. + /// The next link to use for the next page of results. + private Response GetNextResponse(int? pageSizeHint, Uri nextLink) + { + HttpMessage message = nextLink != null ? _client.CreateNextGetByCloudHsmClusterRequest(nextLink, _subscriptionId, _resourceGroupName, _cloudHsmClusterName, _context) : _client.CreateGetByCloudHsmClusterRequest(_subscriptionId, _resourceGroupName, _cloudHsmClusterName, _context); + using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("CloudHsmClusterResource.GetByCloudHsmCluster"); + scope.Start(); + try + { + return _client.Pipeline.ProcessMessage(message, _context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CollectionResults/CloudHsmClustersGetByResourceGroupAsyncCollectionResultOfT.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CollectionResults/CloudHsmClustersGetByResourceGroupAsyncCollectionResultOfT.cs new file mode 100644 index 000000000000..61efa53ad574 --- /dev/null +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CollectionResults/CloudHsmClustersGetByResourceGroupAsyncCollectionResultOfT.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.HardwareSecurityModules.Models; + +namespace Azure.ResourceManager.HardwareSecurityModules +{ + internal partial class CloudHsmClustersGetByResourceGroupAsyncCollectionResultOfT : AsyncPageable + { + private readonly CloudHsmClusters _client; + private readonly Guid _subscriptionId; + private readonly string _resourceGroupName; + private readonly string _skiptoken; + private readonly RequestContext _context; + + /// Initializes a new instance of CloudHsmClustersGetByResourceGroupAsyncCollectionResultOfT, which is used to iterate over the pages of a collection. + /// The CloudHsmClusters client used to send requests. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The page-continuation token to use with a paged version of this API. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + public CloudHsmClustersGetByResourceGroupAsyncCollectionResultOfT(CloudHsmClusters client, Guid subscriptionId, string resourceGroupName, string skiptoken, RequestContext context) : base(context?.CancellationToken ?? default) + { + _client = client; + _subscriptionId = subscriptionId; + _resourceGroupName = resourceGroupName; + _skiptoken = skiptoken; + _context = context; + } + + /// Gets the pages of CloudHsmClustersGetByResourceGroupAsyncCollectionResultOfT as an enumerable collection. + /// A continuation token indicating where to resume paging. + /// The number of items per page. + /// The pages of CloudHsmClustersGetByResourceGroupAsyncCollectionResultOfT as an enumerable collection. + public override async IAsyncEnumerable> AsPages(string continuationToken, int? pageSizeHint) + { + Uri nextPage = continuationToken != null ? new Uri(continuationToken) : null; + while (true) + { + Response response = await GetNextResponseAsync(pageSizeHint, nextPage).ConfigureAwait(false); + if (response is null) + { + yield break; + } + CloudHsmClusterListResult result = CloudHsmClusterListResult.FromResponse(response); + yield return Page.FromValues((IReadOnlyList)result.Value, nextPage?.AbsoluteUri, response); + nextPage = result.NextLink; + if (nextPage == null) + { + yield break; + } + } + } + + /// Get next page. + /// The number of items per page. + /// The next link to use for the next page of results. + private async ValueTask GetNextResponseAsync(int? pageSizeHint, Uri nextLink) + { + HttpMessage message = nextLink != null ? _client.CreateNextGetByResourceGroupRequest(nextLink, _subscriptionId, _resourceGroupName, _skiptoken, _context) : _client.CreateGetByResourceGroupRequest(_subscriptionId, _resourceGroupName, _skiptoken, _context); + using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("CloudHsmClusterCollection.GetAll"); + scope.Start(); + try + { + return await _client.Pipeline.ProcessMessageAsync(message, _context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CollectionResults/CloudHsmClustersGetByResourceGroupCollectionResultOfT.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CollectionResults/CloudHsmClustersGetByResourceGroupCollectionResultOfT.cs new file mode 100644 index 000000000000..a2966853b87a --- /dev/null +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CollectionResults/CloudHsmClustersGetByResourceGroupCollectionResultOfT.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.HardwareSecurityModules.Models; + +namespace Azure.ResourceManager.HardwareSecurityModules +{ + internal partial class CloudHsmClustersGetByResourceGroupCollectionResultOfT : Pageable + { + private readonly CloudHsmClusters _client; + private readonly Guid _subscriptionId; + private readonly string _resourceGroupName; + private readonly string _skiptoken; + private readonly RequestContext _context; + + /// Initializes a new instance of CloudHsmClustersGetByResourceGroupCollectionResultOfT, which is used to iterate over the pages of a collection. + /// The CloudHsmClusters client used to send requests. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The page-continuation token to use with a paged version of this API. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + public CloudHsmClustersGetByResourceGroupCollectionResultOfT(CloudHsmClusters client, Guid subscriptionId, string resourceGroupName, string skiptoken, RequestContext context) : base(context?.CancellationToken ?? default) + { + _client = client; + _subscriptionId = subscriptionId; + _resourceGroupName = resourceGroupName; + _skiptoken = skiptoken; + _context = context; + } + + /// Gets the pages of CloudHsmClustersGetByResourceGroupCollectionResultOfT as an enumerable collection. + /// A continuation token indicating where to resume paging. + /// The number of items per page. + /// The pages of CloudHsmClustersGetByResourceGroupCollectionResultOfT as an enumerable collection. + public override IEnumerable> AsPages(string continuationToken, int? pageSizeHint) + { + Uri nextPage = continuationToken != null ? new Uri(continuationToken) : null; + while (true) + { + Response response = GetNextResponse(pageSizeHint, nextPage); + if (response is null) + { + yield break; + } + CloudHsmClusterListResult result = CloudHsmClusterListResult.FromResponse(response); + yield return Page.FromValues((IReadOnlyList)result.Value, nextPage?.AbsoluteUri, response); + nextPage = result.NextLink; + if (nextPage == null) + { + yield break; + } + } + } + + /// Get next page. + /// The number of items per page. + /// The next link to use for the next page of results. + private Response GetNextResponse(int? pageSizeHint, Uri nextLink) + { + HttpMessage message = nextLink != null ? _client.CreateNextGetByResourceGroupRequest(nextLink, _subscriptionId, _resourceGroupName, _skiptoken, _context) : _client.CreateGetByResourceGroupRequest(_subscriptionId, _resourceGroupName, _skiptoken, _context); + using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("CloudHsmClusterCollection.GetAll"); + scope.Start(); + try + { + return _client.Pipeline.ProcessMessage(message, _context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CollectionResults/CloudHsmClustersGetBySubscriptionAsyncCollectionResultOfT.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CollectionResults/CloudHsmClustersGetBySubscriptionAsyncCollectionResultOfT.cs new file mode 100644 index 000000000000..a90856a419b5 --- /dev/null +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CollectionResults/CloudHsmClustersGetBySubscriptionAsyncCollectionResultOfT.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.HardwareSecurityModules.Models; + +namespace Azure.ResourceManager.HardwareSecurityModules +{ + internal partial class CloudHsmClustersGetBySubscriptionAsyncCollectionResultOfT : AsyncPageable + { + private readonly CloudHsmClusters _client; + private readonly Guid _subscriptionId; + private readonly string _skiptoken; + private readonly RequestContext _context; + + /// Initializes a new instance of CloudHsmClustersGetBySubscriptionAsyncCollectionResultOfT, which is used to iterate over the pages of a collection. + /// The CloudHsmClusters client used to send requests. + /// The ID of the target subscription. The value must be an UUID. + /// The page-continuation token to use with a paged version of this API. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + public CloudHsmClustersGetBySubscriptionAsyncCollectionResultOfT(CloudHsmClusters client, Guid subscriptionId, string skiptoken, RequestContext context) : base(context?.CancellationToken ?? default) + { + _client = client; + _subscriptionId = subscriptionId; + _skiptoken = skiptoken; + _context = context; + } + + /// Gets the pages of CloudHsmClustersGetBySubscriptionAsyncCollectionResultOfT as an enumerable collection. + /// A continuation token indicating where to resume paging. + /// The number of items per page. + /// The pages of CloudHsmClustersGetBySubscriptionAsyncCollectionResultOfT as an enumerable collection. + public override async IAsyncEnumerable> AsPages(string continuationToken, int? pageSizeHint) + { + Uri nextPage = continuationToken != null ? new Uri(continuationToken) : null; + while (true) + { + Response response = await GetNextResponseAsync(pageSizeHint, nextPage).ConfigureAwait(false); + if (response is null) + { + yield break; + } + CloudHsmClusterListResult result = CloudHsmClusterListResult.FromResponse(response); + yield return Page.FromValues((IReadOnlyList)result.Value, nextPage?.AbsoluteUri, response); + nextPage = result.NextLink; + if (nextPage == null) + { + yield break; + } + } + } + + /// Get next page. + /// The number of items per page. + /// The next link to use for the next page of results. + private async ValueTask GetNextResponseAsync(int? pageSizeHint, Uri nextLink) + { + HttpMessage message = nextLink != null ? _client.CreateNextGetBySubscriptionRequest(nextLink, _subscriptionId, _skiptoken, _context) : _client.CreateGetBySubscriptionRequest(_subscriptionId, _skiptoken, _context); + using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("MockableHardwareSecurityModulesSubscriptionResource.GetCloudHsmClusters"); + scope.Start(); + try + { + return await _client.Pipeline.ProcessMessageAsync(message, _context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CollectionResults/CloudHsmClustersGetBySubscriptionCollectionResultOfT.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CollectionResults/CloudHsmClustersGetBySubscriptionCollectionResultOfT.cs new file mode 100644 index 000000000000..2035a43ffefc --- /dev/null +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CollectionResults/CloudHsmClustersGetBySubscriptionCollectionResultOfT.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.HardwareSecurityModules.Models; + +namespace Azure.ResourceManager.HardwareSecurityModules +{ + internal partial class CloudHsmClustersGetBySubscriptionCollectionResultOfT : Pageable + { + private readonly CloudHsmClusters _client; + private readonly Guid _subscriptionId; + private readonly string _skiptoken; + private readonly RequestContext _context; + + /// Initializes a new instance of CloudHsmClustersGetBySubscriptionCollectionResultOfT, which is used to iterate over the pages of a collection. + /// The CloudHsmClusters client used to send requests. + /// The ID of the target subscription. The value must be an UUID. + /// The page-continuation token to use with a paged version of this API. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + public CloudHsmClustersGetBySubscriptionCollectionResultOfT(CloudHsmClusters client, Guid subscriptionId, string skiptoken, RequestContext context) : base(context?.CancellationToken ?? default) + { + _client = client; + _subscriptionId = subscriptionId; + _skiptoken = skiptoken; + _context = context; + } + + /// Gets the pages of CloudHsmClustersGetBySubscriptionCollectionResultOfT as an enumerable collection. + /// A continuation token indicating where to resume paging. + /// The number of items per page. + /// The pages of CloudHsmClustersGetBySubscriptionCollectionResultOfT as an enumerable collection. + public override IEnumerable> AsPages(string continuationToken, int? pageSizeHint) + { + Uri nextPage = continuationToken != null ? new Uri(continuationToken) : null; + while (true) + { + Response response = GetNextResponse(pageSizeHint, nextPage); + if (response is null) + { + yield break; + } + CloudHsmClusterListResult result = CloudHsmClusterListResult.FromResponse(response); + yield return Page.FromValues((IReadOnlyList)result.Value, nextPage?.AbsoluteUri, response); + nextPage = result.NextLink; + if (nextPage == null) + { + yield break; + } + } + } + + /// Get next page. + /// The number of items per page. + /// The next link to use for the next page of results. + private Response GetNextResponse(int? pageSizeHint, Uri nextLink) + { + HttpMessage message = nextLink != null ? _client.CreateNextGetBySubscriptionRequest(nextLink, _subscriptionId, _skiptoken, _context) : _client.CreateGetBySubscriptionRequest(_subscriptionId, _skiptoken, _context); + using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("MockableHardwareSecurityModulesSubscriptionResource.GetCloudHsmClusters"); + scope.Start(); + try + { + return _client.Pipeline.ProcessMessage(message, _context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CollectionResults/DedicatedHsmsGetByResourceGroupAsyncCollectionResultOfT.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CollectionResults/DedicatedHsmsGetByResourceGroupAsyncCollectionResultOfT.cs new file mode 100644 index 000000000000..f45441417ac9 --- /dev/null +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CollectionResults/DedicatedHsmsGetByResourceGroupAsyncCollectionResultOfT.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.HardwareSecurityModules.Models; + +namespace Azure.ResourceManager.HardwareSecurityModules +{ + internal partial class DedicatedHsmsGetByResourceGroupAsyncCollectionResultOfT : AsyncPageable + { + private readonly DedicatedHsms _client; + private readonly Guid _subscriptionId; + private readonly string _resourceGroupName; + private readonly int? _top; + private readonly RequestContext _context; + + /// Initializes a new instance of DedicatedHsmsGetByResourceGroupAsyncCollectionResultOfT, which is used to iterate over the pages of a collection. + /// The DedicatedHsms client used to send requests. + /// 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 request options, which can override default behaviors of the client pipeline on a per-call basis. + public DedicatedHsmsGetByResourceGroupAsyncCollectionResultOfT(DedicatedHsms client, Guid subscriptionId, string resourceGroupName, int? top, RequestContext context) : base(context?.CancellationToken ?? default) + { + _client = client; + _subscriptionId = subscriptionId; + _resourceGroupName = resourceGroupName; + _top = top; + _context = context; + } + + /// Gets the pages of DedicatedHsmsGetByResourceGroupAsyncCollectionResultOfT as an enumerable collection. + /// A continuation token indicating where to resume paging. + /// The number of items per page. + /// The pages of DedicatedHsmsGetByResourceGroupAsyncCollectionResultOfT as an enumerable collection. + public override async IAsyncEnumerable> AsPages(string continuationToken, int? pageSizeHint) + { + Uri nextPage = continuationToken != null ? new Uri(continuationToken) : null; + while (true) + { + Response response = await GetNextResponseAsync(pageSizeHint, nextPage).ConfigureAwait(false); + if (response is null) + { + yield break; + } + DedicatedHsmListResult result = DedicatedHsmListResult.FromResponse(response); + yield return Page.FromValues((IReadOnlyList)result.Value, nextPage?.AbsoluteUri, response); + nextPage = result.NextLink; + if (nextPage == null) + { + yield break; + } + } + } + + /// Get next page. + /// The number of items per page. + /// The next link to use for the next page of results. + private async ValueTask GetNextResponseAsync(int? pageSizeHint, Uri nextLink) + { + HttpMessage message = nextLink != null ? _client.CreateNextGetByResourceGroupRequest(nextLink, _subscriptionId, _resourceGroupName, _top, _context) : _client.CreateGetByResourceGroupRequest(_subscriptionId, _resourceGroupName, _top, _context); + using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("DedicatedHsmCollection.GetAll"); + scope.Start(); + try + { + return await _client.Pipeline.ProcessMessageAsync(message, _context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CollectionResults/DedicatedHsmsGetByResourceGroupCollectionResultOfT.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CollectionResults/DedicatedHsmsGetByResourceGroupCollectionResultOfT.cs new file mode 100644 index 000000000000..c9108459a8b6 --- /dev/null +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CollectionResults/DedicatedHsmsGetByResourceGroupCollectionResultOfT.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.HardwareSecurityModules.Models; + +namespace Azure.ResourceManager.HardwareSecurityModules +{ + internal partial class DedicatedHsmsGetByResourceGroupCollectionResultOfT : Pageable + { + private readonly DedicatedHsms _client; + private readonly Guid _subscriptionId; + private readonly string _resourceGroupName; + private readonly int? _top; + private readonly RequestContext _context; + + /// Initializes a new instance of DedicatedHsmsGetByResourceGroupCollectionResultOfT, which is used to iterate over the pages of a collection. + /// The DedicatedHsms client used to send requests. + /// 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 request options, which can override default behaviors of the client pipeline on a per-call basis. + public DedicatedHsmsGetByResourceGroupCollectionResultOfT(DedicatedHsms client, Guid subscriptionId, string resourceGroupName, int? top, RequestContext context) : base(context?.CancellationToken ?? default) + { + _client = client; + _subscriptionId = subscriptionId; + _resourceGroupName = resourceGroupName; + _top = top; + _context = context; + } + + /// Gets the pages of DedicatedHsmsGetByResourceGroupCollectionResultOfT as an enumerable collection. + /// A continuation token indicating where to resume paging. + /// The number of items per page. + /// The pages of DedicatedHsmsGetByResourceGroupCollectionResultOfT as an enumerable collection. + public override IEnumerable> AsPages(string continuationToken, int? pageSizeHint) + { + Uri nextPage = continuationToken != null ? new Uri(continuationToken) : null; + while (true) + { + Response response = GetNextResponse(pageSizeHint, nextPage); + if (response is null) + { + yield break; + } + DedicatedHsmListResult result = DedicatedHsmListResult.FromResponse(response); + yield return Page.FromValues((IReadOnlyList)result.Value, nextPage?.AbsoluteUri, response); + nextPage = result.NextLink; + if (nextPage == null) + { + yield break; + } + } + } + + /// Get next page. + /// The number of items per page. + /// The next link to use for the next page of results. + private Response GetNextResponse(int? pageSizeHint, Uri nextLink) + { + HttpMessage message = nextLink != null ? _client.CreateNextGetByResourceGroupRequest(nextLink, _subscriptionId, _resourceGroupName, _top, _context) : _client.CreateGetByResourceGroupRequest(_subscriptionId, _resourceGroupName, _top, _context); + using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("DedicatedHsmCollection.GetAll"); + scope.Start(); + try + { + return _client.Pipeline.ProcessMessage(message, _context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CollectionResults/DedicatedHsmsGetBySubscriptionAsyncCollectionResultOfT.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CollectionResults/DedicatedHsmsGetBySubscriptionAsyncCollectionResultOfT.cs new file mode 100644 index 000000000000..f78658f6d8a9 --- /dev/null +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CollectionResults/DedicatedHsmsGetBySubscriptionAsyncCollectionResultOfT.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.HardwareSecurityModules.Models; + +namespace Azure.ResourceManager.HardwareSecurityModules +{ + internal partial class DedicatedHsmsGetBySubscriptionAsyncCollectionResultOfT : AsyncPageable + { + private readonly DedicatedHsms _client; + private readonly Guid _subscriptionId; + private readonly int? _top; + private readonly RequestContext _context; + + /// Initializes a new instance of DedicatedHsmsGetBySubscriptionAsyncCollectionResultOfT, which is used to iterate over the pages of a collection. + /// The DedicatedHsms client used to send requests. + /// The ID of the target subscription. The value must be an UUID. + /// Maximum number of results to return. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + public DedicatedHsmsGetBySubscriptionAsyncCollectionResultOfT(DedicatedHsms client, Guid subscriptionId, int? top, RequestContext context) : base(context?.CancellationToken ?? default) + { + _client = client; + _subscriptionId = subscriptionId; + _top = top; + _context = context; + } + + /// Gets the pages of DedicatedHsmsGetBySubscriptionAsyncCollectionResultOfT as an enumerable collection. + /// A continuation token indicating where to resume paging. + /// The number of items per page. + /// The pages of DedicatedHsmsGetBySubscriptionAsyncCollectionResultOfT as an enumerable collection. + public override async IAsyncEnumerable> AsPages(string continuationToken, int? pageSizeHint) + { + Uri nextPage = continuationToken != null ? new Uri(continuationToken) : null; + while (true) + { + Response response = await GetNextResponseAsync(pageSizeHint, nextPage).ConfigureAwait(false); + if (response is null) + { + yield break; + } + DedicatedHsmListResult result = DedicatedHsmListResult.FromResponse(response); + yield return Page.FromValues((IReadOnlyList)result.Value, nextPage?.AbsoluteUri, response); + nextPage = result.NextLink; + if (nextPage == null) + { + yield break; + } + } + } + + /// Get next page. + /// The number of items per page. + /// The next link to use for the next page of results. + private async ValueTask GetNextResponseAsync(int? pageSizeHint, Uri nextLink) + { + HttpMessage message = nextLink != null ? _client.CreateNextGetBySubscriptionRequest(nextLink, _subscriptionId, _top, _context) : _client.CreateGetBySubscriptionRequest(_subscriptionId, _top, _context); + using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("MockableHardwareSecurityModulesSubscriptionResource.GetDedicatedHsms"); + scope.Start(); + try + { + return await _client.Pipeline.ProcessMessageAsync(message, _context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CollectionResults/DedicatedHsmsGetBySubscriptionCollectionResultOfT.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CollectionResults/DedicatedHsmsGetBySubscriptionCollectionResultOfT.cs new file mode 100644 index 000000000000..6bce95cfa3bd --- /dev/null +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CollectionResults/DedicatedHsmsGetBySubscriptionCollectionResultOfT.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.HardwareSecurityModules.Models; + +namespace Azure.ResourceManager.HardwareSecurityModules +{ + internal partial class DedicatedHsmsGetBySubscriptionCollectionResultOfT : Pageable + { + private readonly DedicatedHsms _client; + private readonly Guid _subscriptionId; + private readonly int? _top; + private readonly RequestContext _context; + + /// Initializes a new instance of DedicatedHsmsGetBySubscriptionCollectionResultOfT, which is used to iterate over the pages of a collection. + /// The DedicatedHsms client used to send requests. + /// The ID of the target subscription. The value must be an UUID. + /// Maximum number of results to return. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + public DedicatedHsmsGetBySubscriptionCollectionResultOfT(DedicatedHsms client, Guid subscriptionId, int? top, RequestContext context) : base(context?.CancellationToken ?? default) + { + _client = client; + _subscriptionId = subscriptionId; + _top = top; + _context = context; + } + + /// Gets the pages of DedicatedHsmsGetBySubscriptionCollectionResultOfT as an enumerable collection. + /// A continuation token indicating where to resume paging. + /// The number of items per page. + /// The pages of DedicatedHsmsGetBySubscriptionCollectionResultOfT as an enumerable collection. + public override IEnumerable> AsPages(string continuationToken, int? pageSizeHint) + { + Uri nextPage = continuationToken != null ? new Uri(continuationToken) : null; + while (true) + { + Response response = GetNextResponse(pageSizeHint, nextPage); + if (response is null) + { + yield break; + } + DedicatedHsmListResult result = DedicatedHsmListResult.FromResponse(response); + yield return Page.FromValues((IReadOnlyList)result.Value, nextPage?.AbsoluteUri, response); + nextPage = result.NextLink; + if (nextPage == null) + { + yield break; + } + } + } + + /// Get next page. + /// The number of items per page. + /// The next link to use for the next page of results. + private Response GetNextResponse(int? pageSizeHint, Uri nextLink) + { + HttpMessage message = nextLink != null ? _client.CreateNextGetBySubscriptionRequest(nextLink, _subscriptionId, _top, _context) : _client.CreateGetBySubscriptionRequest(_subscriptionId, _top, _context); + using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("MockableHardwareSecurityModulesSubscriptionResource.GetDedicatedHsms"); + scope.Start(); + try + { + return _client.Pipeline.ProcessMessage(message, _context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CollectionResults/DedicatedHsmsGetOutboundNetworkDependenciesEndpointsAsyncCollectionResultOfT.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CollectionResults/DedicatedHsmsGetOutboundNetworkDependenciesEndpointsAsyncCollectionResultOfT.cs new file mode 100644 index 000000000000..b30d2643eea8 --- /dev/null +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CollectionResults/DedicatedHsmsGetOutboundNetworkDependenciesEndpointsAsyncCollectionResultOfT.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.HardwareSecurityModules.Models; + +namespace Azure.ResourceManager.HardwareSecurityModules +{ + internal partial class DedicatedHsmsGetOutboundNetworkDependenciesEndpointsAsyncCollectionResultOfT : AsyncPageable + { + private readonly DedicatedHsms _client; + private readonly Guid _subscriptionId; + private readonly string _resourceGroupName; + private readonly string _name; + private readonly RequestContext _context; + + /// Initializes a new instance of DedicatedHsmsGetOutboundNetworkDependenciesEndpointsAsyncCollectionResultOfT, which is used to iterate over the pages of a collection. + /// The DedicatedHsms client used to send requests. + /// 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 dedicated Hsm. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + public DedicatedHsmsGetOutboundNetworkDependenciesEndpointsAsyncCollectionResultOfT(DedicatedHsms client, Guid subscriptionId, string resourceGroupName, string name, RequestContext context) : base(context?.CancellationToken ?? default) + { + _client = client; + _subscriptionId = subscriptionId; + _resourceGroupName = resourceGroupName; + _name = name; + _context = context; + } + + /// Gets the pages of DedicatedHsmsGetOutboundNetworkDependenciesEndpointsAsyncCollectionResultOfT as an enumerable collection. + /// A continuation token indicating where to resume paging. + /// The number of items per page. + /// The pages of DedicatedHsmsGetOutboundNetworkDependenciesEndpointsAsyncCollectionResultOfT as an enumerable collection. + public override async IAsyncEnumerable> AsPages(string continuationToken, int? pageSizeHint) + { + Uri nextPage = continuationToken != null ? new Uri(continuationToken) : null; + while (true) + { + Response response = await GetNextResponseAsync(pageSizeHint, nextPage).ConfigureAwait(false); + if (response is null) + { + yield break; + } + DedicatedHsmEgressEndpointListResult result = DedicatedHsmEgressEndpointListResult.FromResponse(response); + yield return Page.FromValues((IReadOnlyList)result.Value, nextPage?.AbsoluteUri, response); + nextPage = result.NextLink; + if (nextPage == null) + { + yield break; + } + } + } + + /// Get next page. + /// The number of items per page. + /// The next link to use for the next page of results. + private async ValueTask GetNextResponseAsync(int? pageSizeHint, Uri nextLink) + { + HttpMessage message = nextLink != null ? _client.CreateNextGetOutboundNetworkDependenciesEndpointsRequest(nextLink, _subscriptionId, _resourceGroupName, _name, _context) : _client.CreateGetOutboundNetworkDependenciesEndpointsRequest(_subscriptionId, _resourceGroupName, _name, _context); + using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("DedicatedHsmResource.GetOutboundNetworkDependenciesEndpoints"); + scope.Start(); + try + { + return await _client.Pipeline.ProcessMessageAsync(message, _context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CollectionResults/DedicatedHsmsGetOutboundNetworkDependenciesEndpointsCollectionResultOfT.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CollectionResults/DedicatedHsmsGetOutboundNetworkDependenciesEndpointsCollectionResultOfT.cs new file mode 100644 index 000000000000..4aa2ba551393 --- /dev/null +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CollectionResults/DedicatedHsmsGetOutboundNetworkDependenciesEndpointsCollectionResultOfT.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.HardwareSecurityModules.Models; + +namespace Azure.ResourceManager.HardwareSecurityModules +{ + internal partial class DedicatedHsmsGetOutboundNetworkDependenciesEndpointsCollectionResultOfT : Pageable + { + private readonly DedicatedHsms _client; + private readonly Guid _subscriptionId; + private readonly string _resourceGroupName; + private readonly string _name; + private readonly RequestContext _context; + + /// Initializes a new instance of DedicatedHsmsGetOutboundNetworkDependenciesEndpointsCollectionResultOfT, which is used to iterate over the pages of a collection. + /// The DedicatedHsms client used to send requests. + /// 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 dedicated Hsm. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + public DedicatedHsmsGetOutboundNetworkDependenciesEndpointsCollectionResultOfT(DedicatedHsms client, Guid subscriptionId, string resourceGroupName, string name, RequestContext context) : base(context?.CancellationToken ?? default) + { + _client = client; + _subscriptionId = subscriptionId; + _resourceGroupName = resourceGroupName; + _name = name; + _context = context; + } + + /// Gets the pages of DedicatedHsmsGetOutboundNetworkDependenciesEndpointsCollectionResultOfT as an enumerable collection. + /// A continuation token indicating where to resume paging. + /// The number of items per page. + /// The pages of DedicatedHsmsGetOutboundNetworkDependenciesEndpointsCollectionResultOfT as an enumerable collection. + public override IEnumerable> AsPages(string continuationToken, int? pageSizeHint) + { + Uri nextPage = continuationToken != null ? new Uri(continuationToken) : null; + while (true) + { + Response response = GetNextResponse(pageSizeHint, nextPage); + if (response is null) + { + yield break; + } + DedicatedHsmEgressEndpointListResult result = DedicatedHsmEgressEndpointListResult.FromResponse(response); + yield return Page.FromValues((IReadOnlyList)result.Value, nextPage?.AbsoluteUri, response); + nextPage = result.NextLink; + if (nextPage == null) + { + yield break; + } + } + } + + /// Get next page. + /// The number of items per page. + /// The next link to use for the next page of results. + private Response GetNextResponse(int? pageSizeHint, Uri nextLink) + { + HttpMessage message = nextLink != null ? _client.CreateNextGetOutboundNetworkDependenciesEndpointsRequest(nextLink, _subscriptionId, _resourceGroupName, _name, _context) : _client.CreateGetOutboundNetworkDependenciesEndpointsRequest(_subscriptionId, _resourceGroupName, _name, _context); + using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("DedicatedHsmResource.GetOutboundNetworkDependenciesEndpoints"); + scope.Start(); + try + { + return _client.Pipeline.ProcessMessage(message, _context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CollectionResults/PrivateEndpointConnectionsGetByCloudHsmClusterAsyncCollectionResultOfT.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CollectionResults/PrivateEndpointConnectionsGetByCloudHsmClusterAsyncCollectionResultOfT.cs new file mode 100644 index 000000000000..db1fe8e3e771 --- /dev/null +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CollectionResults/PrivateEndpointConnectionsGetByCloudHsmClusterAsyncCollectionResultOfT.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.HardwareSecurityModules.Models; + +namespace Azure.ResourceManager.HardwareSecurityModules +{ + internal partial class PrivateEndpointConnectionsGetByCloudHsmClusterAsyncCollectionResultOfT : AsyncPageable + { + private readonly PrivateEndpointConnections _client; + private readonly Guid _subscriptionId; + private readonly string _resourceGroupName; + private readonly string _cloudHsmClusterName; + private readonly RequestContext _context; + + /// Initializes a new instance of PrivateEndpointConnectionsGetByCloudHsmClusterAsyncCollectionResultOfT, which is used to iterate over the pages of a collection. + /// The PrivateEndpointConnections client used to send requests. + /// 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 Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + public PrivateEndpointConnectionsGetByCloudHsmClusterAsyncCollectionResultOfT(PrivateEndpointConnections client, Guid subscriptionId, string resourceGroupName, string cloudHsmClusterName, RequestContext context) : base(context?.CancellationToken ?? default) + { + _client = client; + _subscriptionId = subscriptionId; + _resourceGroupName = resourceGroupName; + _cloudHsmClusterName = cloudHsmClusterName; + _context = context; + } + + /// Gets the pages of PrivateEndpointConnectionsGetByCloudHsmClusterAsyncCollectionResultOfT as an enumerable collection. + /// A continuation token indicating where to resume paging. + /// The number of items per page. + /// The pages of PrivateEndpointConnectionsGetByCloudHsmClusterAsyncCollectionResultOfT as an enumerable collection. + public override async IAsyncEnumerable> AsPages(string continuationToken, int? pageSizeHint) + { + Uri nextPage = continuationToken != null ? new Uri(continuationToken) : null; + while (true) + { + Response response = await GetNextResponseAsync(pageSizeHint, nextPage).ConfigureAwait(false); + if (response is null) + { + yield break; + } + HardwareSecurityModulesPrivateEndpointConnectionListResult result = HardwareSecurityModulesPrivateEndpointConnectionListResult.FromResponse(response); + yield return Page.FromValues((IReadOnlyList)result.Value, nextPage?.AbsoluteUri, response); + nextPage = result.NextLink; + if (nextPage == null) + { + yield break; + } + } + } + + /// Get next page. + /// The number of items per page. + /// The next link to use for the next page of results. + private async ValueTask GetNextResponseAsync(int? pageSizeHint, Uri nextLink) + { + HttpMessage message = nextLink != null ? _client.CreateNextGetByCloudHsmClusterRequest(nextLink, _subscriptionId, _resourceGroupName, _cloudHsmClusterName, _context) : _client.CreateGetByCloudHsmClusterRequest(_subscriptionId, _resourceGroupName, _cloudHsmClusterName, _context); + using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("CloudHsmClusterPrivateEndpointConnectionCollection.GetAll"); + scope.Start(); + try + { + return await _client.Pipeline.ProcessMessageAsync(message, _context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CollectionResults/PrivateEndpointConnectionsGetByCloudHsmClusterCollectionResultOfT.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CollectionResults/PrivateEndpointConnectionsGetByCloudHsmClusterCollectionResultOfT.cs new file mode 100644 index 000000000000..eee7a2622fcc --- /dev/null +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/CollectionResults/PrivateEndpointConnectionsGetByCloudHsmClusterCollectionResultOfT.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.HardwareSecurityModules.Models; + +namespace Azure.ResourceManager.HardwareSecurityModules +{ + internal partial class PrivateEndpointConnectionsGetByCloudHsmClusterCollectionResultOfT : Pageable + { + private readonly PrivateEndpointConnections _client; + private readonly Guid _subscriptionId; + private readonly string _resourceGroupName; + private readonly string _cloudHsmClusterName; + private readonly RequestContext _context; + + /// Initializes a new instance of PrivateEndpointConnectionsGetByCloudHsmClusterCollectionResultOfT, which is used to iterate over the pages of a collection. + /// The PrivateEndpointConnections client used to send requests. + /// 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 Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length. + /// The request options, which can override default behaviors of the client pipeline on a per-call basis. + public PrivateEndpointConnectionsGetByCloudHsmClusterCollectionResultOfT(PrivateEndpointConnections client, Guid subscriptionId, string resourceGroupName, string cloudHsmClusterName, RequestContext context) : base(context?.CancellationToken ?? default) + { + _client = client; + _subscriptionId = subscriptionId; + _resourceGroupName = resourceGroupName; + _cloudHsmClusterName = cloudHsmClusterName; + _context = context; + } + + /// Gets the pages of PrivateEndpointConnectionsGetByCloudHsmClusterCollectionResultOfT as an enumerable collection. + /// A continuation token indicating where to resume paging. + /// The number of items per page. + /// The pages of PrivateEndpointConnectionsGetByCloudHsmClusterCollectionResultOfT as an enumerable collection. + public override IEnumerable> AsPages(string continuationToken, int? pageSizeHint) + { + Uri nextPage = continuationToken != null ? new Uri(continuationToken) : null; + while (true) + { + Response response = GetNextResponse(pageSizeHint, nextPage); + if (response is null) + { + yield break; + } + HardwareSecurityModulesPrivateEndpointConnectionListResult result = HardwareSecurityModulesPrivateEndpointConnectionListResult.FromResponse(response); + yield return Page.FromValues((IReadOnlyList)result.Value, nextPage?.AbsoluteUri, response); + nextPage = result.NextLink; + if (nextPage == null) + { + yield break; + } + } + } + + /// Get next page. + /// The number of items per page. + /// The next link to use for the next page of results. + private Response GetNextResponse(int? pageSizeHint, Uri nextLink) + { + HttpMessage message = nextLink != null ? _client.CreateNextGetByCloudHsmClusterRequest(nextLink, _subscriptionId, _resourceGroupName, _cloudHsmClusterName, _context) : _client.CreateGetByCloudHsmClusterRequest(_subscriptionId, _resourceGroupName, _cloudHsmClusterName, _context); + using DiagnosticScope scope = _client.ClientDiagnostics.CreateScope("CloudHsmClusterPrivateEndpointConnectionCollection.GetAll"); + scope.Start(); + try + { + return _client.Pipeline.ProcessMessage(message, _context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/DedicatedHsmCollection.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/DedicatedHsmCollection.cs index 1bc1fcfc546a..d923eb46f411 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/DedicatedHsmCollection.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/DedicatedHsmCollection.cs @@ -8,12 +8,13 @@ using System; using System.Collections; using System.Collections.Generic; -using System.Globalization; +using System.Diagnostics; using System.Threading; using System.Threading.Tasks; -using Autorest.CSharp.Core; +using Azure; using Azure.Core; using Azure.Core.Pipeline; +using Azure.ResourceManager; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.HardwareSecurityModules @@ -25,51 +26,49 @@ namespace Azure.ResourceManager.HardwareSecurityModules /// public partial class DedicatedHsmCollection : ArmCollection, IEnumerable, IAsyncEnumerable { - private readonly ClientDiagnostics _dedicatedHsmClientDiagnostics; - private readonly DedicatedHsmsRestOperations _dedicatedHsmRestClient; + private readonly ClientDiagnostics _dedicatedHsmsClientDiagnostics; + private readonly DedicatedHsms _dedicatedHsmsRestClient; - /// Initializes a new instance of the class for mocking. + /// Initializes a new instance of DedicatedHsmCollection for mocking. protected DedicatedHsmCollection() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of class. /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. + /// The identifier of the resource that is the target of operations. internal DedicatedHsmCollection(ArmClient client, ResourceIdentifier id) : base(client, id) { - _dedicatedHsmClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HardwareSecurityModules", DedicatedHsmResource.ResourceType.Namespace, Diagnostics); TryGetApiVersion(DedicatedHsmResource.ResourceType, out string dedicatedHsmApiVersion); - _dedicatedHsmRestClient = new DedicatedHsmsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dedicatedHsmApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif + _dedicatedHsmsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HardwareSecurityModules", DedicatedHsmResource.ResourceType.Namespace, Diagnostics); + _dedicatedHsmsRestClient = new DedicatedHsms(_dedicatedHsmsClientDiagnostics, Pipeline, Endpoint, dedicatedHsmApiVersion ?? "2025-03-31"); + ValidateResourceId(id); } + /// + [Conditional("DEBUG")] internal static void ValidateResourceId(ResourceIdentifier id) { if (id.ResourceType != ResourceGroupResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); + { + throw new ArgumentException(string.Format("Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), id); + } } /// /// Create or Update a dedicated HSM in the specified subscription. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name} - /// - /// - /// Operation Id - /// DedicatedHsm_CreateOrUpdate + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}. /// /// - /// Default Api Version - /// 2025-03-31 + /// Operation Id. + /// DedicatedHsms_CreateOrUpdate. /// /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-31. /// /// /// @@ -77,21 +76,34 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// Name of the dedicated Hsm. /// Parameters to create or update the dedicated hsm. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// or is null. + /// is an empty string, and was expected to be non-empty. public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string name, DedicatedHsmData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(name, nameof(name)); Argument.AssertNotNull(data, nameof(data)); - using var scope = _dedicatedHsmClientDiagnostics.CreateScope("DedicatedHsmCollection.CreateOrUpdate"); + using DiagnosticScope scope = _dedicatedHsmsClientDiagnostics.CreateScope("DedicatedHsmCollection.CreateOrUpdate"); scope.Start(); try { - var response = await _dedicatedHsmRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, name, data, cancellationToken).ConfigureAwait(false); - var operation = new HardwareSecurityModulesArmOperation(new DedicatedHsmOperationSource(Client), _dedicatedHsmClientDiagnostics, Pipeline, _dedicatedHsmRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _dedicatedHsmsRestClient.CreateCreateOrUpdateRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, name, DedicatedHsmData.ToRequestContent(data), context); + Response response = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + HardwareSecurityModulesArmOperation operation = new HardwareSecurityModulesArmOperation( + new DedicatedHsmOperationSource(Client), + _dedicatedHsmsClientDiagnostics, + Pipeline, + message.Request, + response, + OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) + { await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + } return operation; } catch (Exception e) @@ -105,20 +117,16 @@ public virtual async Task> CreateOrUpdateAsyn /// Create or Update a dedicated HSM in the specified subscription. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}. /// /// - /// Operation Id - /// DedicatedHsm_CreateOrUpdate + /// Operation Id. + /// DedicatedHsms_CreateOrUpdate. /// /// - /// Default Api Version - /// 2025-03-31 - /// - /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-31. /// /// /// @@ -126,21 +134,34 @@ public virtual async Task> CreateOrUpdateAsyn /// Name of the dedicated Hsm. /// Parameters to create or update the dedicated hsm. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// or is null. + /// is an empty string, and was expected to be non-empty. public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string name, DedicatedHsmData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(name, nameof(name)); Argument.AssertNotNull(data, nameof(data)); - using var scope = _dedicatedHsmClientDiagnostics.CreateScope("DedicatedHsmCollection.CreateOrUpdate"); + using DiagnosticScope scope = _dedicatedHsmsClientDiagnostics.CreateScope("DedicatedHsmCollection.CreateOrUpdate"); scope.Start(); try { - var response = _dedicatedHsmRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, name, data, cancellationToken); - var operation = new HardwareSecurityModulesArmOperation(new DedicatedHsmOperationSource(Client), _dedicatedHsmClientDiagnostics, Pipeline, _dedicatedHsmRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _dedicatedHsmsRestClient.CreateCreateOrUpdateRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, name, DedicatedHsmData.ToRequestContent(data), context); + Response response = Pipeline.ProcessMessage(message, context); + HardwareSecurityModulesArmOperation operation = new HardwareSecurityModulesArmOperation( + new DedicatedHsmOperationSource(Client), + _dedicatedHsmsClientDiagnostics, + Pipeline, + message.Request, + response, + OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) + { operation.WaitForCompletion(cancellationToken); + } return operation; } catch (Exception e) @@ -154,38 +175,42 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitU /// Gets the specified Azure dedicated HSM. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name} - /// - /// - /// Operation Id - /// DedicatedHsm_Get + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}. /// /// - /// Default Api Version - /// 2025-03-31 + /// Operation Id. + /// DedicatedHsms_Get. /// /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-31. /// /// /// /// Name of the dedicated Hsm. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. public virtual async Task> GetAsync(string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var scope = _dedicatedHsmClientDiagnostics.CreateScope("DedicatedHsmCollection.Get"); + using DiagnosticScope scope = _dedicatedHsmsClientDiagnostics.CreateScope("DedicatedHsmCollection.Get"); scope.Start(); try { - var response = await _dedicatedHsmRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, name, cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _dedicatedHsmsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, name, context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(DedicatedHsmData.FromResponse(result), result); if (response.Value == null) + { throw new RequestFailedException(response.GetRawResponse()); + } return Response.FromValue(new DedicatedHsmResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -199,38 +224,42 @@ public virtual async Task> GetAsync(string name, /// Gets the specified Azure dedicated HSM. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name} - /// - /// - /// Operation Id - /// DedicatedHsm_Get + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}. /// /// - /// Default Api Version - /// 2025-03-31 + /// Operation Id. + /// DedicatedHsms_Get. /// /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-31. /// /// /// /// Name of the dedicated Hsm. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. public virtual Response Get(string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var scope = _dedicatedHsmClientDiagnostics.CreateScope("DedicatedHsmCollection.Get"); + using DiagnosticScope scope = _dedicatedHsmsClientDiagnostics.CreateScope("DedicatedHsmCollection.Get"); scope.Start(); try { - var response = _dedicatedHsmRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, name, cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _dedicatedHsmsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, name, context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(DedicatedHsmData.FromResponse(result), result); if (response.Value == null) + { throw new RequestFailedException(response.GetRawResponse()); + } return Response.FromValue(new DedicatedHsmResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -244,98 +273,108 @@ public virtual Response Get(string name, CancellationToken /// The List operation gets information about the dedicated HSMs associated with the subscription and within the specified resource group. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs. /// /// - /// Operation Id - /// DedicatedHsm_ListByResourceGroup + /// Operation Id. + /// DedicatedHsms_ListByResourceGroup. /// /// - /// Default Api Version - /// 2025-03-31 - /// - /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-31. /// /// /// /// 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 GetAllAsync(int? top = null, CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(int? top = default, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _dedicatedHsmRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, top); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dedicatedHsmRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, top); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DedicatedHsmResource(Client, DedicatedHsmData.DeserializeDedicatedHsmData(e)), _dedicatedHsmClientDiagnostics, Pipeline, "DedicatedHsmCollection.GetAll", "value", "nextLink", cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + return new AsyncPageableWrapper(new DedicatedHsmsGetByResourceGroupAsyncCollectionResultOfT(_dedicatedHsmsRestClient, Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, top, context), data => new DedicatedHsmResource(Client, data)); } /// /// The List operation gets information about the dedicated HSMs associated with the subscription and within the specified resource group. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs - /// - /// - /// Operation Id - /// DedicatedHsm_ListByResourceGroup + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs. /// /// - /// Default Api Version - /// 2025-03-31 + /// Operation Id. + /// DedicatedHsms_ListByResourceGroup. /// /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-31. /// /// /// /// 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 GetAll(int? top = null, CancellationToken cancellationToken = default) + public virtual Pageable GetAll(int? top = default, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _dedicatedHsmRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, top); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dedicatedHsmRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, top); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DedicatedHsmResource(Client, DedicatedHsmData.DeserializeDedicatedHsmData(e)), _dedicatedHsmClientDiagnostics, Pipeline, "DedicatedHsmCollection.GetAll", "value", "nextLink", cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + return new PageableWrapper(new DedicatedHsmsGetByResourceGroupCollectionResultOfT(_dedicatedHsmsRestClient, Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, top, context), data => new DedicatedHsmResource(Client, data)); } /// - /// Checks to see if the resource exists in azure. + /// Gets the specified Azure dedicated HSM. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}. /// /// - /// Operation Id - /// DedicatedHsm_Get + /// Operation Id. + /// DedicatedHsms_Get. /// /// - /// Default Api Version - /// 2025-03-31 - /// - /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-31. /// /// /// /// Name of the dedicated Hsm. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. public virtual async Task> ExistsAsync(string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var scope = _dedicatedHsmClientDiagnostics.CreateScope("DedicatedHsmCollection.Exists"); + using DiagnosticScope scope = _dedicatedHsmsClientDiagnostics.CreateScope("DedicatedHsmCollection.Exists"); scope.Start(); try { - var response = await _dedicatedHsmRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, name, cancellationToken: cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _dedicatedHsmsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, name, context); + await Pipeline.SendAsync(message, context.CancellationToken).ConfigureAwait(false); + Response result = message.Response; + Response response = default; + switch (result.Status) + { + case 200: + response = Response.FromValue(DedicatedHsmData.FromResponse(result), result); + break; + case 404: + response = Response.FromValue((DedicatedHsmData)null, result); + break; + default: + throw new RequestFailedException(result); + } return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -346,39 +385,53 @@ public virtual async Task> ExistsAsync(string name, CancellationT } /// - /// Checks to see if the resource exists in azure. + /// Gets the specified Azure dedicated HSM. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name} - /// - /// - /// Operation Id - /// DedicatedHsm_Get + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}. /// /// - /// Default Api Version - /// 2025-03-31 + /// Operation Id. + /// DedicatedHsms_Get. /// /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-31. /// /// /// /// Name of the dedicated Hsm. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. public virtual Response Exists(string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var scope = _dedicatedHsmClientDiagnostics.CreateScope("DedicatedHsmCollection.Exists"); + using DiagnosticScope scope = _dedicatedHsmsClientDiagnostics.CreateScope("DedicatedHsmCollection.Exists"); scope.Start(); try { - var response = _dedicatedHsmRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, name, cancellationToken: cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _dedicatedHsmsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, name, context); + Pipeline.Send(message, context.CancellationToken); + Response result = message.Response; + Response response = default; + switch (result.Status) + { + case 200: + response = Response.FromValue(DedicatedHsmData.FromResponse(result), result); + break; + case 404: + response = Response.FromValue((DedicatedHsmData)null, result); + break; + default: + throw new RequestFailedException(result); + } return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -389,41 +442,57 @@ public virtual Response Exists(string name, CancellationToken cancellation } /// - /// Tries to get details for this resource from the service. + /// Gets the specified Azure dedicated HSM. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name} - /// - /// - /// Operation Id - /// DedicatedHsm_Get + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}. /// /// - /// Default Api Version - /// 2025-03-31 + /// Operation Id. + /// DedicatedHsms_Get. /// /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-31. /// /// /// /// Name of the dedicated Hsm. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. public virtual async Task> GetIfExistsAsync(string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var scope = _dedicatedHsmClientDiagnostics.CreateScope("DedicatedHsmCollection.GetIfExists"); + using DiagnosticScope scope = _dedicatedHsmsClientDiagnostics.CreateScope("DedicatedHsmCollection.GetIfExists"); scope.Start(); try { - var response = await _dedicatedHsmRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, name, cancellationToken: cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _dedicatedHsmsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, name, context); + await Pipeline.SendAsync(message, context.CancellationToken).ConfigureAwait(false); + Response result = message.Response; + Response response = default; + switch (result.Status) + { + case 200: + response = Response.FromValue(DedicatedHsmData.FromResponse(result), result); + break; + case 404: + response = Response.FromValue((DedicatedHsmData)null, result); + break; + default: + throw new RequestFailedException(result); + } if (response.Value == null) + { return new NoValueResponse(response.GetRawResponse()); + } return Response.FromValue(new DedicatedHsmResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -434,41 +503,57 @@ public virtual async Task> GetIfExistsAsy } /// - /// Tries to get details for this resource from the service. + /// Gets the specified Azure dedicated HSM. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}. /// /// - /// Operation Id - /// DedicatedHsm_Get + /// Operation Id. + /// DedicatedHsms_Get. /// /// - /// Default Api Version - /// 2025-03-31 - /// - /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-31. /// /// /// /// Name of the dedicated Hsm. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. /// is null. + /// is an empty string, and was expected to be non-empty. public virtual NullableResponse GetIfExists(string name, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(name, nameof(name)); - using var scope = _dedicatedHsmClientDiagnostics.CreateScope("DedicatedHsmCollection.GetIfExists"); + using DiagnosticScope scope = _dedicatedHsmsClientDiagnostics.CreateScope("DedicatedHsmCollection.GetIfExists"); scope.Start(); try { - var response = _dedicatedHsmRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, name, cancellationToken: cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _dedicatedHsmsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, name, context); + Pipeline.Send(message, context.CancellationToken); + Response result = message.Response; + Response response = default; + switch (result.Status) + { + case 200: + response = Response.FromValue(DedicatedHsmData.FromResponse(result), result); + break; + case 404: + response = Response.FromValue((DedicatedHsmData)null, result); + break; + default: + throw new RequestFailedException(result); + } if (response.Value == null) + { return new NoValueResponse(response.GetRawResponse()); + } return Response.FromValue(new DedicatedHsmResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -488,6 +573,7 @@ IEnumerator IEnumerable.GetEnumerator() return GetAll().GetEnumerator(); } + /// The cancellation token to use. IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) { return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/DedicatedHsmData.Serialization.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/DedicatedHsmData.Serialization.cs index 9ad80ed092ee..cfeb58847c1d 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/DedicatedHsmData.Serialization.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/DedicatedHsmData.Serialization.cs @@ -10,16 +10,23 @@ using System.Collections.Generic; using System.Text; using System.Text.Json; +using Azure; using Azure.Core; using Azure.ResourceManager.HardwareSecurityModules.Models; using Azure.ResourceManager.Models; namespace Azure.ResourceManager.HardwareSecurityModules { - public partial class DedicatedHsmData : IUtf8JsonSerializable, IJsonModel + /// Resource information with extended details. + public partial class DedicatedHsmData : TrackedResourceData, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal DedicatedHsmData() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -31,12 +38,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(DedicatedHsmData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); writer.WritePropertyName("properties"u8); writer.WriteObjectValue(Properties, options); @@ -46,137 +52,170 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri { writer.WritePropertyName("zones"u8); writer.WriteStartArray(); - foreach (var item in Zones) + foreach (string item in Zones) { + if (item == null) + { + writer.WriteNullValue(); + continue; + } writer.WriteStringValue(item); } writer.WriteEndArray(); } } - DedicatedHsmData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + DedicatedHsmData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (DedicatedHsmData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ResourceData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(DedicatedHsmData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeDedicatedHsmData(document.RootElement, options); } - internal static DedicatedHsmData DeserializeDedicatedHsmData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static DedicatedHsmData DeserializeDedicatedHsmData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - DedicatedHsmProperties properties = default; - DedicatedHsmSku sku = default; - IList zones = default; - IDictionary tags = default; - AzureLocation location = default; ResourceIdentifier id = default; string name = default; - ResourceType type = default; + ResourceType resourceType = default; SystemData systemData = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + IDictionary tags = default; + AzureLocation location = default; + DedicatedHsmProperties properties = default; + DedicatedHsmSku sku = default; + IList zones = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("properties"u8)) + if (prop.NameEquals("id"u8)) { - properties = DedicatedHsmProperties.DeserializeDedicatedHsmProperties(property.Value, options); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + id = new ResourceIdentifier(prop.Value.GetString()); continue; } - if (property.NameEquals("sku"u8)) + if (prop.NameEquals("name"u8)) { - sku = DedicatedHsmSku.DeserializeDedicatedHsmSku(property.Value, options); + name = prop.Value.GetString(); continue; } - if (property.NameEquals("zones"u8)) + if (prop.NameEquals("type"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + resourceType = new ResourceType(prop.Value.GetString()); + continue; + } + if (prop.NameEquals("systemData"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) { - array.Add(item.GetString()); + continue; } - zones = array; + systemData = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(prop.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerHardwareSecurityModulesContext.Default); continue; } - if (property.NameEquals("tags"u8)) + if (prop.NameEquals("tags"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + foreach (var prop0 in prop.Value.EnumerateObject()) { - dictionary.Add(property0.Name, property0.Value.GetString()); + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } } tags = dictionary; continue; } - if (property.NameEquals("location"u8)) + if (prop.NameEquals("location"u8)) { - location = new AzureLocation(property.Value.GetString()); + location = new AzureLocation(prop.Value.GetString()); continue; } - if (property.NameEquals("id"u8)) + if (prop.NameEquals("properties"u8)) { - id = new ResourceIdentifier(property.Value.GetString()); + properties = DedicatedHsmProperties.DeserializeDedicatedHsmProperties(prop.Value, options); continue; } - if (property.NameEquals("name"u8)) + if (prop.NameEquals("sku"u8)) { - name = property.Value.GetString(); + sku = DedicatedHsmSku.DeserializeDedicatedHsmSku(prop.Value, options); continue; } - if (property.NameEquals("type"u8)) + if (prop.NameEquals("zones"u8)) { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - systemData = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerHardwareSecurityModulesContext.Default); + List array = new List(); + foreach (var item in prop.Value.EnumerateArray()) + { + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(item.GetString()); + } + } + zones = array; continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new DedicatedHsmData( id, name, - type, + resourceType, systemData, + additionalBinaryDataProperties, tags ?? new ChangeTrackingDictionary(), location, properties, sku, - zones ?? new ChangeTrackingList(), - serializedAdditionalRawData); + zones ?? new ChangeTrackingList()); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -186,15 +225,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions op } } - DedicatedHsmData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + DedicatedHsmData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (DedicatedHsmData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ResourceData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeDedicatedHsmData(document.RootElement, options); } default: @@ -202,6 +246,26 @@ DedicatedHsmData IPersistableModel.Create(BinaryData data, Mod } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to serialize into . + internal static RequestContent ToRequestContent(DedicatedHsmData dedicatedHsmData) + { + if (dedicatedHsmData == null) + { + return null; + } + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(dedicatedHsmData, ModelSerializationExtensions.WireOptions); + return content; + } + + /// The to deserialize the from. + internal static DedicatedHsmData FromResponse(Response response) + { + using JsonDocument document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDedicatedHsmData(document.RootElement, ModelSerializationExtensions.WireOptions); + } } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/DedicatedHsmData.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/DedicatedHsmData.cs index d26f53670564..ee71ccca9989 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/DedicatedHsmData.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/DedicatedHsmData.cs @@ -13,46 +13,14 @@ namespace Azure.ResourceManager.HardwareSecurityModules { - /// - /// A class representing the DedicatedHsm data model. - /// Resource information with extended details. - /// + /// Resource information with extended details. public partial class DedicatedHsmData : TrackedResourceData { - /// - /// 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; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . - /// The location. + /// The geo-location where the resource lives. /// Properties of the dedicated HSM. /// SKU details. /// or is null. @@ -67,46 +35,48 @@ public DedicatedHsmData(AzureLocation location, DedicatedHsmProperties propertie } /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + /// The name of the resource. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// Keeps track of any properties unknown to the library. + /// Resource tags. + /// The geo-location where the resource lives. /// Properties of the dedicated HSM. /// SKU details. /// The availability zones. - /// Keeps track of any properties unknown to the library. - internal DedicatedHsmData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, DedicatedHsmProperties properties, DedicatedHsmSku sku, IList zones, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal DedicatedHsmData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary additionalBinaryDataProperties, IDictionary tags, AzureLocation location, DedicatedHsmProperties properties, DedicatedHsmSku sku, IList zones) : base(id, name, resourceType, systemData, tags, location) { + _additionalBinaryDataProperties = additionalBinaryDataProperties; Properties = properties; Sku = sku; Zones = zones; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal DedicatedHsmData() - { } /// Properties of the dedicated HSM. public DedicatedHsmProperties Properties { get; set; } + /// SKU details. internal DedicatedHsmSku Sku { get; set; } + + /// The availability zones. + public IList Zones { get; } + /// SKU of the dedicated HSM. public DedicatedHsmSkuName? SkuName { - get => Sku is null ? default : Sku.Name; + get + { + return Sku is null ? default : Sku.Name; + } set { if (Sku is null) + { Sku = new DedicatedHsmSku(); + } Sku.Name = value; } } - - /// The availability zones. - public IList Zones { get; } } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/DedicatedHsmResource.Serialization.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/DedicatedHsmResource.Serialization.cs index 22a2ffd677dd..d83598a06b24 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/DedicatedHsmResource.Serialization.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/DedicatedHsmResource.Serialization.cs @@ -11,19 +11,29 @@ namespace Azure.ResourceManager.HardwareSecurityModules { + /// public partial class DedicatedHsmResource : IJsonModel { - private static DedicatedHsmData s_dataDeserializationInstance; - private static DedicatedHsmData DataDeserializationInstance => s_dataDeserializationInstance ??= new(); + private static IJsonModel s_dataDeserializationInstance; + private static IJsonModel DataDeserializationInstance => s_dataDeserializationInstance ??= new DedicatedHsmData(); + + /// The writer to serialize the model to. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - DedicatedHsmData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)DataDeserializationInstance).Create(ref reader, options); + /// The reader for deserializing the model. + /// The client options for reading and writing models. + DedicatedHsmData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => DataDeserializationInstance.Create(ref reader, options); + /// The client options for reading and writing models. BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options, AzureResourceManagerHardwareSecurityModulesContext.Default); + /// The binary data to be processed. + /// The client options for reading and writing models. DedicatedHsmData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options, AzureResourceManagerHardwareSecurityModulesContext.Default); - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)DataDeserializationInstance).GetFormatFromOptions(options); + /// The client options for reading and writing models. + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => DataDeserializationInstance.GetFormatFromOptions(options); } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/DedicatedHsmResource.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/DedicatedHsmResource.cs index f35463273813..28a816bc1040 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/DedicatedHsmResource.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/DedicatedHsmResource.cs @@ -7,48 +7,37 @@ using System; using System.Collections.Generic; -using System.Globalization; +using System.Diagnostics; using System.Threading; using System.Threading.Tasks; -using Autorest.CSharp.Core; +using Azure; using Azure.Core; using Azure.Core.Pipeline; +using Azure.ResourceManager; using Azure.ResourceManager.HardwareSecurityModules.Models; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.HardwareSecurityModules { /// - /// A Class representing a DedicatedHsm along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetDedicatedHsmResource method. - /// Otherwise you can get one from its parent resource using the GetDedicatedHsm method. + /// A class representing a DedicatedHsm along with the instance operations that can be performed on it. + /// If you have a you can construct a from an instance of using the GetResource method. + /// Otherwise you can get one from its parent resource using the GetDedicatedHsms method. /// public partial class DedicatedHsmResource : ArmResource { - /// Generate the resource identifier of a instance. - /// The subscriptionId. - /// The resourceGroupName. - /// The name. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string name) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _dedicatedHsmClientDiagnostics; - private readonly DedicatedHsmsRestOperations _dedicatedHsmRestClient; + private readonly ClientDiagnostics _dedicatedHsmsClientDiagnostics; + private readonly DedicatedHsms _dedicatedHsmsRestClient; private readonly DedicatedHsmData _data; - /// Gets the resource type for the operations. public static readonly ResourceType ResourceType = "Microsoft.HardwareSecurityModules/dedicatedHSMs"; - /// Initializes a new instance of the class for mocking. + /// Initializes a new instance of DedicatedHsmResource for mocking. protected DedicatedHsmResource() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of class. /// The client parameters to use in these operations. /// The resource that is the target of operations. internal DedicatedHsmResource(ArmClient client, DedicatedHsmData data) : this(client, data.Id) @@ -57,71 +46,92 @@ internal DedicatedHsmResource(ArmClient client, DedicatedHsmData data) : this(cl _data = data; } - /// Initializes a new instance of the class. + /// Initializes a new instance of class. /// The client parameters to use in these operations. /// The identifier of the resource that is the target of operations. internal DedicatedHsmResource(ArmClient client, ResourceIdentifier id) : base(client, id) { - _dedicatedHsmClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HardwareSecurityModules", ResourceType.Namespace, Diagnostics); TryGetApiVersion(ResourceType, out string dedicatedHsmApiVersion); - _dedicatedHsmRestClient = new DedicatedHsmsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dedicatedHsmApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif + _dedicatedHsmsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HardwareSecurityModules", ResourceType.Namespace, Diagnostics); + _dedicatedHsmsRestClient = new DedicatedHsms(_dedicatedHsmsClientDiagnostics, Pipeline, Endpoint, dedicatedHsmApiVersion ?? "2025-03-31"); + ValidateResourceId(id); } /// Gets whether or not the current instance has data. public virtual bool HasData { get; } /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. public virtual DedicatedHsmData Data { get { if (!HasData) + { throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + } return _data; } } + /// Generate the resource identifier for this resource. + /// The subscriptionId. + /// The resourceGroupName. + /// The name. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string name) + { + string resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}"; + return new ResourceIdentifier(resourceId); + } + + /// + [Conditional("DEBUG")] internal static void ValidateResourceId(ResourceIdentifier id) { if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + { + throw new ArgumentException(string.Format("Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), id); + } } /// /// Gets the specified Azure dedicated HSM. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}. /// /// - /// Operation Id - /// DedicatedHsm_Get + /// Operation Id. + /// DedicatedHsms_Get. /// /// - /// Default Api Version - /// 2025-03-31 + /// Default Api Version. + /// 2025-03-31. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// /// The cancellation token to use. public virtual async Task> GetAsync(CancellationToken cancellationToken = default) { - using var scope = _dedicatedHsmClientDiagnostics.CreateScope("DedicatedHsmResource.Get"); + using DiagnosticScope scope = _dedicatedHsmsClientDiagnostics.CreateScope("DedicatedHsmResource.Get"); scope.Start(); try { - var response = await _dedicatedHsmRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _dedicatedHsmsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(DedicatedHsmData.FromResponse(result), result); if (response.Value == null) + { throw new RequestFailedException(response.GetRawResponse()); + } return Response.FromValue(new DedicatedHsmResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -135,33 +145,41 @@ public virtual async Task> GetAsync(CancellationT /// Gets the specified Azure dedicated HSM. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}. /// /// - /// Operation Id - /// DedicatedHsm_Get + /// Operation Id. + /// DedicatedHsms_Get. /// /// - /// Default Api Version - /// 2025-03-31 + /// Default Api Version. + /// 2025-03-31. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// /// The cancellation token to use. public virtual Response Get(CancellationToken cancellationToken = default) { - using var scope = _dedicatedHsmClientDiagnostics.CreateScope("DedicatedHsmResource.Get"); + using DiagnosticScope scope = _dedicatedHsmsClientDiagnostics.CreateScope("DedicatedHsmResource.Get"); scope.Start(); try { - var response = _dedicatedHsmRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _dedicatedHsmsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(DedicatedHsmData.FromResponse(result), result); if (response.Value == null) + { throw new RequestFailedException(response.GetRawResponse()); + } return Response.FromValue(new DedicatedHsmResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) @@ -172,38 +190,55 @@ public virtual Response Get(CancellationToken cancellation } /// - /// Deletes the specified Azure Dedicated HSM. + /// Update a dedicated HSM in the specified subscription. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}. /// /// - /// Operation Id - /// DedicatedHsm_Delete + /// Operation Id. + /// DedicatedHsms_Update. /// /// - /// Default Api Version - /// 2025-03-31 + /// Default Api Version. + /// 2025-03-31. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// /// 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. + /// Parameters to patch the dedicated HSM. /// The cancellation token to use. - public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, DedicatedHsmPatch dedicatedHsmPatch, CancellationToken cancellationToken = default) { - using var scope = _dedicatedHsmClientDiagnostics.CreateScope("DedicatedHsmResource.Delete"); + Argument.AssertNotNull(dedicatedHsmPatch, nameof(dedicatedHsmPatch)); + + using DiagnosticScope scope = _dedicatedHsmsClientDiagnostics.CreateScope("DedicatedHsmResource.Update"); scope.Start(); try { - var response = await _dedicatedHsmRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new HardwareSecurityModulesArmOperation(_dedicatedHsmClientDiagnostics, Pipeline, _dedicatedHsmRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _dedicatedHsmsRestClient.CreateUpdateRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, DedicatedHsmPatch.ToRequestContent(dedicatedHsmPatch), context); + Response response = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + HardwareSecurityModulesArmOperation operation = new HardwareSecurityModulesArmOperation( + new DedicatedHsmOperationSource(Client), + _dedicatedHsmsClientDiagnostics, + Pipeline, + message.Request, + response, + OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + { + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + } return operation; } catch (Exception e) @@ -214,38 +249,55 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell } /// - /// Deletes the specified Azure Dedicated HSM. + /// Update a dedicated HSM in the specified subscription. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}. /// /// - /// Operation Id - /// DedicatedHsm_Delete + /// Operation Id. + /// DedicatedHsms_Update. /// /// - /// Default Api Version - /// 2025-03-31 + /// Default Api Version. + /// 2025-03-31. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// /// 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. + /// Parameters to patch the dedicated HSM. /// The cancellation token to use. - public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, DedicatedHsmPatch dedicatedHsmPatch, CancellationToken cancellationToken = default) { - using var scope = _dedicatedHsmClientDiagnostics.CreateScope("DedicatedHsmResource.Delete"); + Argument.AssertNotNull(dedicatedHsmPatch, nameof(dedicatedHsmPatch)); + + using DiagnosticScope scope = _dedicatedHsmsClientDiagnostics.CreateScope("DedicatedHsmResource.Update"); scope.Start(); try { - var response = _dedicatedHsmRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - var operation = new HardwareSecurityModulesArmOperation(_dedicatedHsmClientDiagnostics, Pipeline, _dedicatedHsmRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _dedicatedHsmsRestClient.CreateUpdateRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, DedicatedHsmPatch.ToRequestContent(dedicatedHsmPatch), context); + Response response = Pipeline.ProcessMessage(message, context); + HardwareSecurityModulesArmOperation operation = new HardwareSecurityModulesArmOperation( + new DedicatedHsmOperationSource(Client), + _dedicatedHsmsClientDiagnostics, + Pipeline, + message.Request, + response, + OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); + { + operation.WaitForCompletion(cancellationToken); + } return operation; } catch (Exception e) @@ -256,42 +308,45 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel } /// - /// Update a dedicated HSM in the specified subscription. + /// Deletes the specified Azure Dedicated HSM. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}. /// /// - /// Operation Id - /// DedicatedHsm_Update + /// Operation Id. + /// DedicatedHsms_Delete. /// /// - /// Default Api Version - /// 2025-03-31 + /// Default Api Version. + /// 2025-03-31. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// /// 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. - /// Parameters to patch the dedicated HSM. /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, DedicatedHsmPatch patch, CancellationToken cancellationToken = default) + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(patch, nameof(patch)); - - using var scope = _dedicatedHsmClientDiagnostics.CreateScope("DedicatedHsmResource.Update"); + using DiagnosticScope scope = _dedicatedHsmsClientDiagnostics.CreateScope("DedicatedHsmResource.Delete"); scope.Start(); try { - var response = await _dedicatedHsmRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); - var operation = new HardwareSecurityModulesArmOperation(new DedicatedHsmOperationSource(Client), _dedicatedHsmClientDiagnostics, Pipeline, _dedicatedHsmRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _dedicatedHsmsRestClient.CreateDeleteRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response response = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + HardwareSecurityModulesArmOperation operation = new HardwareSecurityModulesArmOperation(_dedicatedHsmsClientDiagnostics, Pipeline, message.Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + { + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + } return operation; } catch (Exception e) @@ -302,42 +357,45 @@ public virtual async Task> UpdateAsync(WaitUn } /// - /// Update a dedicated HSM in the specified subscription. + /// Deletes the specified Azure Dedicated HSM. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}. /// /// - /// Operation Id - /// DedicatedHsm_Update + /// Operation Id. + /// DedicatedHsms_Delete. /// /// - /// Default Api Version - /// 2025-03-31 + /// Default Api Version. + /// 2025-03-31. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// /// 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. - /// Parameters to patch the dedicated HSM. /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, DedicatedHsmPatch patch, CancellationToken cancellationToken = default) + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(patch, nameof(patch)); - - using var scope = _dedicatedHsmClientDiagnostics.CreateScope("DedicatedHsmResource.Update"); + using DiagnosticScope scope = _dedicatedHsmsClientDiagnostics.CreateScope("DedicatedHsmResource.Delete"); scope.Start(); try { - var response = _dedicatedHsmRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); - var operation = new HardwareSecurityModulesArmOperation(new DedicatedHsmOperationSource(Client), _dedicatedHsmClientDiagnostics, Pipeline, _dedicatedHsmRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _dedicatedHsmsRestClient.CreateDeleteRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response response = Pipeline.ProcessMessage(message, context); + HardwareSecurityModulesArmOperation operation = new HardwareSecurityModulesArmOperation(_dedicatedHsmsClientDiagnostics, Pipeline, message.Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); + { + operation.WaitForCompletionResponse(cancellationToken); + } return operation; } catch (Exception e) @@ -351,50 +409,52 @@ public virtual ArmOperation Update(WaitUntil waitUntil, De /// Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified dedicated hsm resource. The operation returns properties of each egress endpoint. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}/outboundNetworkDependenciesEndpoints + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}/outboundNetworkDependenciesEndpoints. /// /// - /// Operation Id - /// DedicatedHsms_ListOutboundNetworkDependenciesEndpoints + /// Operation Id. + /// DedicatedHsms_ListOutboundNetworkDependenciesEndpoints. /// /// - /// Default Api Version - /// 2025-03-31 + /// Default Api Version. + /// 2025-03-31. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. + /// A collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetOutboundNetworkDependenciesEndpointsAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _dedicatedHsmRestClient.CreateListOutboundNetworkDependenciesEndpointsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dedicatedHsmRestClient.CreateListOutboundNetworkDependenciesEndpointsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => DedicatedHsmEgressEndpoint.DeserializeDedicatedHsmEgressEndpoint(e), _dedicatedHsmClientDiagnostics, Pipeline, "DedicatedHsmResource.GetOutboundNetworkDependenciesEndpoints", "value", "nextLink", cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + return new DedicatedHsmsGetOutboundNetworkDependenciesEndpointsAsyncCollectionResultOfT(_dedicatedHsmsRestClient, Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); } /// /// Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified dedicated hsm resource. The operation returns properties of each egress endpoint. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}/outboundNetworkDependenciesEndpoints + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}/outboundNetworkDependenciesEndpoints. /// /// - /// Operation Id - /// DedicatedHsms_ListOutboundNetworkDependenciesEndpoints + /// Operation Id. + /// DedicatedHsms_ListOutboundNetworkDependenciesEndpoints. /// /// - /// Default Api Version - /// 2025-03-31 + /// Default Api Version. + /// 2025-03-31. /// /// - /// Resource - /// + /// Resource. + /// . /// /// /// @@ -402,32 +462,14 @@ public virtual AsyncPageable GetOutboundNetworkDepen /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetOutboundNetworkDependenciesEndpoints(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _dedicatedHsmRestClient.CreateListOutboundNetworkDependenciesEndpointsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dedicatedHsmRestClient.CreateListOutboundNetworkDependenciesEndpointsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => DedicatedHsmEgressEndpoint.DeserializeDedicatedHsmEgressEndpoint(e), _dedicatedHsmClientDiagnostics, Pipeline, "DedicatedHsmResource.GetOutboundNetworkDependenciesEndpoints", "value", "nextLink", cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + return new DedicatedHsmsGetOutboundNetworkDependenciesEndpointsCollectionResultOfT(_dedicatedHsmsRestClient, Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); } - /// - /// Add a tag to the current resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name} - /// - /// - /// Operation Id - /// DedicatedHsm_Get - /// - /// - /// Default Api Version - /// 2025-03-31 - /// - /// - /// Resource - /// - /// - /// - /// + /// Add a tag to the current resource. /// The key for the tag. /// The value for the tag. /// The cancellation token to use. @@ -437,28 +479,34 @@ public virtual async Task> AddTagAsync(string key Argument.AssertNotNull(key, nameof(key)); Argument.AssertNotNull(value, nameof(value)); - using var scope = _dedicatedHsmClientDiagnostics.CreateScope("DedicatedHsmResource.AddTag"); + using DiagnosticScope scope = _dedicatedHsmsClientDiagnostics.CreateScope("DedicatedHsmResource.AddTag"); scope.Start(); try { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + if (await CanUseTagResourceAsync(cancellationToken).ConfigureAwait(false)) { - var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + Response 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 _dedicatedHsmRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new DedicatedHsmResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _dedicatedHsmsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(DedicatedHsmData.FromResponse(result), result); + return Response.FromValue(new DedicatedHsmResource(Client, response.Value), response.GetRawResponse()); } else { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new DedicatedHsmPatch(); - foreach (var tag in current.Tags) + DedicatedHsmData current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + DedicatedHsmPatch patch = new DedicatedHsmPatch(); + foreach (KeyValuePair tag in current.Tags) { patch.Tags.Add(tag); } patch.Tags[key] = value; - var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + ArmOperation result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(result.Value, result.GetRawResponse()); } } @@ -469,27 +517,7 @@ public virtual async Task> AddTagAsync(string key } } - /// - /// Add a tag to the current resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name} - /// - /// - /// Operation Id - /// DedicatedHsm_Get - /// - /// - /// Default Api Version - /// 2025-03-31 - /// - /// - /// Resource - /// - /// - /// - /// + /// Add a tag to the current resource. /// The key for the tag. /// The value for the tag. /// The cancellation token to use. @@ -499,28 +527,34 @@ public virtual Response AddTag(string key, string value, C Argument.AssertNotNull(key, nameof(key)); Argument.AssertNotNull(value, nameof(value)); - using var scope = _dedicatedHsmClientDiagnostics.CreateScope("DedicatedHsmResource.AddTag"); + using DiagnosticScope scope = _dedicatedHsmsClientDiagnostics.CreateScope("DedicatedHsmResource.AddTag"); scope.Start(); try { - if (CanUseTagResource(cancellationToken: cancellationToken)) + if (CanUseTagResource(cancellationToken)) { - var originalTags = GetTagResource().Get(cancellationToken); + Response originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues[key] = value; - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _dedicatedHsmRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return Response.FromValue(new DedicatedHsmResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _dedicatedHsmsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(DedicatedHsmData.FromResponse(result), result); + return Response.FromValue(new DedicatedHsmResource(Client, response.Value), response.GetRawResponse()); } else { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new DedicatedHsmPatch(); - foreach (var tag in current.Tags) + DedicatedHsmData current = Get(cancellationToken: cancellationToken).Value.Data; + DedicatedHsmPatch patch = new DedicatedHsmPatch(); + foreach (KeyValuePair tag in current.Tags) { patch.Tags.Add(tag); } patch.Tags[key] = value; - var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + ArmOperation result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); return Response.FromValue(result.Value, result.GetRawResponse()); } } @@ -531,53 +565,39 @@ public virtual Response AddTag(string key, string value, C } } - /// - /// Replace the tags on the resource with the given set. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name} - /// - /// - /// Operation Id - /// DedicatedHsm_Get - /// - /// - /// Default Api Version - /// 2025-03-31 - /// - /// - /// Resource - /// - /// - /// - /// - /// The set of tags to use as replacement. + /// Replace the tags on the resource with the given set. + /// The tags to set on the resource. /// The cancellation token to use. /// is null. public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) { Argument.AssertNotNull(tags, nameof(tags)); - using var scope = _dedicatedHsmClientDiagnostics.CreateScope("DedicatedHsmResource.SetTags"); + using DiagnosticScope scope = _dedicatedHsmsClientDiagnostics.CreateScope("DedicatedHsmResource.SetTags"); scope.Start(); try { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + if (await CanUseTagResourceAsync(cancellationToken).ConfigureAwait(false)) { - await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken).ConfigureAwait(false); + Response 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 _dedicatedHsmRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new DedicatedHsmResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _dedicatedHsmsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(DedicatedHsmData.FromResponse(result), result); + return Response.FromValue(new DedicatedHsmResource(Client, response.Value), response.GetRawResponse()); } else { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new DedicatedHsmPatch(); + DedicatedHsmData current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + DedicatedHsmPatch patch = new DedicatedHsmPatch(); patch.Tags.ReplaceWith(tags); - var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + ArmOperation result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(result.Value, result.GetRawResponse()); } } @@ -588,53 +608,39 @@ public virtual async Task> SetTagsAsync(IDictiona } } - /// - /// Replace the tags on the resource with the given set. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name} - /// - /// - /// Operation Id - /// DedicatedHsm_Get - /// - /// - /// Default Api Version - /// 2025-03-31 - /// - /// - /// Resource - /// - /// - /// - /// - /// The set of tags to use as replacement. + /// Replace the tags on the resource with the given set. + /// The tags to set on the resource. /// The cancellation token to use. /// is null. public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) { Argument.AssertNotNull(tags, nameof(tags)); - using var scope = _dedicatedHsmClientDiagnostics.CreateScope("DedicatedHsmResource.SetTags"); + using DiagnosticScope scope = _dedicatedHsmsClientDiagnostics.CreateScope("DedicatedHsmResource.SetTags"); scope.Start(); try { - if (CanUseTagResource(cancellationToken: cancellationToken)) + if (CanUseTagResource(cancellationToken)) { - GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); - var originalTags = GetTagResource().Get(cancellationToken); + GetTagResource().Delete(WaitUntil.Completed, cancellationToken); + Response originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues.ReplaceWith(tags); - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _dedicatedHsmRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return Response.FromValue(new DedicatedHsmResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _dedicatedHsmsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(DedicatedHsmData.FromResponse(result), result); + return Response.FromValue(new DedicatedHsmResource(Client, response.Value), response.GetRawResponse()); } else { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new DedicatedHsmPatch(); + DedicatedHsmData current = Get(cancellationToken: cancellationToken).Value.Data; + DedicatedHsmPatch patch = new DedicatedHsmPatch(); patch.Tags.ReplaceWith(tags); - var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + ArmOperation result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); return Response.FromValue(result.Value, result.GetRawResponse()); } } @@ -645,27 +651,7 @@ public virtual Response SetTags(IDictionary - /// Removes a tag by key from the resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name} - /// - /// - /// Operation Id - /// DedicatedHsm_Get - /// - /// - /// Default Api Version - /// 2025-03-31 - /// - /// - /// Resource - /// - /// - /// - /// + /// Removes a tag by key from the resource. /// The key for the tag. /// The cancellation token to use. /// is null. @@ -673,28 +659,34 @@ public virtual async Task> RemoveTagAsync(string { Argument.AssertNotNull(key, nameof(key)); - using var scope = _dedicatedHsmClientDiagnostics.CreateScope("DedicatedHsmResource.RemoveTag"); + using DiagnosticScope scope = _dedicatedHsmsClientDiagnostics.CreateScope("DedicatedHsmResource.RemoveTag"); scope.Start(); try { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + if (await CanUseTagResourceAsync(cancellationToken).ConfigureAwait(false)) { - var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + Response 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 _dedicatedHsmRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new DedicatedHsmResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken).ConfigureAwait(false); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _dedicatedHsmsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(DedicatedHsmData.FromResponse(result), result); + return Response.FromValue(new DedicatedHsmResource(Client, response.Value), response.GetRawResponse()); } else { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new DedicatedHsmPatch(); - foreach (var tag in current.Tags) + DedicatedHsmData current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + DedicatedHsmPatch patch = new DedicatedHsmPatch(); + foreach (KeyValuePair tag in current.Tags) { patch.Tags.Add(tag); } patch.Tags.Remove(key); - var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + ArmOperation result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(result.Value, result.GetRawResponse()); } } @@ -705,27 +697,7 @@ public virtual async Task> RemoveTagAsync(string } } - /// - /// Removes a tag by key from the resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name} - /// - /// - /// Operation Id - /// DedicatedHsm_Get - /// - /// - /// Default Api Version - /// 2025-03-31 - /// - /// - /// Resource - /// - /// - /// - /// + /// Removes a tag by key from the resource. /// The key for the tag. /// The cancellation token to use. /// is null. @@ -733,28 +705,34 @@ public virtual Response RemoveTag(string key, Cancellation { Argument.AssertNotNull(key, nameof(key)); - using var scope = _dedicatedHsmClientDiagnostics.CreateScope("DedicatedHsmResource.RemoveTag"); + using DiagnosticScope scope = _dedicatedHsmsClientDiagnostics.CreateScope("DedicatedHsmResource.RemoveTag"); scope.Start(); try { - if (CanUseTagResource(cancellationToken: cancellationToken)) + if (CanUseTagResource(cancellationToken)) { - var originalTags = GetTagResource().Get(cancellationToken); + Response originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues.Remove(key); - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _dedicatedHsmRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return Response.FromValue(new DedicatedHsmResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = _dedicatedHsmsRestClient.CreateGetRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, Id.Name, context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(DedicatedHsmData.FromResponse(result), result); + return Response.FromValue(new DedicatedHsmResource(Client, response.Value), response.GetRawResponse()); } else { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new DedicatedHsmPatch(); - foreach (var tag in current.Tags) + DedicatedHsmData current = Get(cancellationToken: cancellationToken).Value.Data; + DedicatedHsmPatch patch = new DedicatedHsmPatch(); + foreach (KeyValuePair tag in current.Tags) { patch.Tags.Add(tag); } patch.Tags.Remove(key); - var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + ArmOperation result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); return Response.FromValue(result.Value, result.GetRawResponse()); } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Extensions/HardwareSecurityModulesExtensions.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Extensions/HardwareSecurityModulesExtensions.cs index 3ecdcf08dd84..599967b37931 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Extensions/HardwareSecurityModulesExtensions.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Extensions/HardwareSecurityModulesExtensions.cs @@ -8,8 +8,11 @@ using System; using System.Threading; using System.Threading.Tasks; +using Azure; using Azure.Core; +using Azure.ResourceManager; using Azure.ResourceManager.HardwareSecurityModules.Mocking; +using Azure.ResourceManager.HardwareSecurityModules.Models; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.HardwareSecurityModules @@ -17,30 +20,32 @@ namespace Azure.ResourceManager.HardwareSecurityModules /// A class to add extension methods to Azure.ResourceManager.HardwareSecurityModules. public static partial class HardwareSecurityModulesExtensions { + /// private static MockableHardwareSecurityModulesArmClient GetMockableHardwareSecurityModulesArmClient(ArmClient client) { - return client.GetCachedClient(client0 => new MockableHardwareSecurityModulesArmClient(client0)); + return client.GetCachedClient(client0 => new MockableHardwareSecurityModulesArmClient(client0, ResourceIdentifier.Root)); } - private static MockableHardwareSecurityModulesResourceGroupResource GetMockableHardwareSecurityModulesResourceGroupResource(ArmResource resource) + /// + private static MockableHardwareSecurityModulesResourceGroupResource GetMockableHardwareSecurityModulesResourceGroupResource(ResourceGroupResource resourceGroupResource) { - return resource.GetCachedClient(client => new MockableHardwareSecurityModulesResourceGroupResource(client, resource.Id)); + return resourceGroupResource.GetCachedClient(client => new MockableHardwareSecurityModulesResourceGroupResource(client, resourceGroupResource.Id)); } - private static MockableHardwareSecurityModulesSubscriptionResource GetMockableHardwareSecurityModulesSubscriptionResource(ArmResource resource) + /// + private static MockableHardwareSecurityModulesSubscriptionResource GetMockableHardwareSecurityModulesSubscriptionResource(SubscriptionResource subscriptionResource) { - return resource.GetCachedClient(client => new MockableHardwareSecurityModulesSubscriptionResource(client, resource.Id)); + return subscriptionResource.GetCachedClient(client => new MockableHardwareSecurityModulesSubscriptionResource(client, subscriptionResource.Id)); } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// - /// Mocking - /// To mock this method, please mock instead. + /// Mocking. + /// To mock this method, please mock instead. /// /// - /// The instance the method will execute against. + /// The the method will execute against. /// The resource ID of the resource to get. /// is null. /// Returns a object. @@ -52,14 +57,13 @@ public static CloudHsmClusterResource GetCloudHsmClusterResource(this ArmClient } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// - /// Mocking - /// To mock this method, please mock instead. + /// Mocking. + /// To mock this method, please mock instead. /// /// - /// The instance the method will execute against. + /// The the method will execute against. /// The resource ID of the resource to get. /// is null. /// Returns a object. @@ -71,14 +75,13 @@ public static CloudHsmClusterPrivateEndpointConnectionResource GetCloudHsmCluste } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// - /// Mocking - /// To mock this method, please mock instead. + /// Mocking. + /// To mock this method, please mock instead. /// /// - /// The instance the method will execute against. + /// The the method will execute against. /// The resource ID of the resource to get. /// is null. /// Returns a object. @@ -90,15 +93,15 @@ public static DedicatedHsmResource GetDedicatedHsmResource(this ArmClient client } /// - /// Gets a collection of CloudHsmClusterResources in the ResourceGroupResource. + /// Gets a collection of CloudHsmClusters in the /// - /// Mocking - /// To mock this method, please mock instead. + /// Mocking. + /// To mock this method, please mock instead. /// /// - /// The instance the method will execute against. + /// The the method will execute against. /// is null. - /// An object representing collection of CloudHsmClusterResources and their operations over a CloudHsmClusterResource. + /// An object representing collection of CloudHsmClusters and their operations over a CloudHsmClusterResource. public static CloudHsmClusterCollection GetCloudHsmClusters(this ResourceGroupResource resourceGroupResource) { Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); @@ -108,34 +111,15 @@ public static CloudHsmClusterCollection GetCloudHsmClusters(this ResourceGroupRe /// /// Gets the specified Cloud HSM Cluster - /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName} - /// - /// - /// Operation Id - /// CloudHsmCluster_Get - /// - /// - /// Default Api Version - /// 2025-03-31 - /// - /// - /// Resource - /// - /// - /// - /// - /// Mocking - /// To mock this method, please mock instead. + /// Mocking. + /// To mock this method, please mock instead. /// /// - /// The instance the method will execute against. + /// The the method will execute against. /// The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. + /// is null. [ForwardsClientCalls] public static async Task> GetCloudHsmClusterAsync(this ResourceGroupResource resourceGroupResource, string cloudHsmClusterName, CancellationToken cancellationToken = default) { @@ -146,34 +130,15 @@ public static async Task> GetCloudHsmClusterAs /// /// Gets the specified Cloud HSM Cluster - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName} - /// - /// - /// Operation Id - /// CloudHsmCluster_Get - /// /// - /// Default Api Version - /// 2025-03-31 - /// - /// - /// Resource - /// - /// - /// - /// - /// Mocking - /// To mock this method, please mock instead. + /// Mocking. + /// To mock this method, please mock instead. /// /// - /// The instance the method will execute against. + /// The the method will execute against. /// The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. + /// is null. [ForwardsClientCalls] public static Response GetCloudHsmCluster(this ResourceGroupResource resourceGroupResource, string cloudHsmClusterName, CancellationToken cancellationToken = default) { @@ -183,15 +148,15 @@ public static Response GetCloudHsmCluster(this Resource } /// - /// Gets a collection of DedicatedHsmResources in the ResourceGroupResource. + /// Gets a collection of DedicatedHsms in the /// - /// Mocking - /// To mock this method, please mock instead. + /// Mocking. + /// To mock this method, please mock instead. /// /// - /// The instance the method will execute against. + /// The the method will execute against. /// is null. - /// An object representing collection of DedicatedHsmResources and their operations over a DedicatedHsmResource. + /// An object representing collection of DedicatedHsms and their operations over a DedicatedHsmResource. public static DedicatedHsmCollection GetDedicatedHsms(this ResourceGroupResource resourceGroupResource) { Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); @@ -201,34 +166,15 @@ public static DedicatedHsmCollection GetDedicatedHsms(this ResourceGroupResource /// /// Gets the specified Azure dedicated HSM. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name} - /// - /// - /// Operation Id - /// DedicatedHsm_Get - /// - /// - /// Default Api Version - /// 2025-03-31 - /// - /// - /// Resource - /// - /// - /// /// - /// Mocking - /// To mock this method, please mock instead. + /// Mocking. + /// To mock this method, please mock instead. /// /// - /// The instance the method will execute against. + /// The the method will execute against. /// Name of the dedicated Hsm. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. + /// is null. [ForwardsClientCalls] public static async Task> GetDedicatedHsmAsync(this ResourceGroupResource resourceGroupResource, string name, CancellationToken cancellationToken = default) { @@ -239,34 +185,15 @@ public static async Task> GetDedicatedHsmAsync(th /// /// Gets the specified Azure dedicated HSM. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name} - /// /// - /// Operation Id - /// DedicatedHsm_Get - /// - /// - /// Default Api Version - /// 2025-03-31 - /// - /// - /// Resource - /// - /// - /// - /// - /// Mocking - /// To mock this method, please mock instead. + /// Mocking. + /// To mock this method, please mock instead. /// /// - /// The instance the method will execute against. + /// The the method will execute against. /// Name of the dedicated Hsm. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. + /// is null. [ForwardsClientCalls] public static Response GetDedicatedHsm(this ResourceGroupResource resourceGroupResource, string name, CancellationToken cancellationToken = default) { @@ -276,36 +203,94 @@ public static Response GetDedicatedHsm(this ResourceGroupR } /// - /// The List operation gets information about the Cloud HSM Clusters associated with the subscription. - /// + /// Gets the backup operation status of the specified Cloud HSM Cluster /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters + /// Mocking. + /// To mock this method, please mock instead. /// + /// + /// The the method will execute against. + /// + /// Identifier for the backup operation. + /// The cancellation token to use. + /// is null. + public static async Task> GetCloudHsmClusterBackupStatusAsync(this ResourceGroupResource resourceGroupResource, string cloudHsmClusterName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableHardwareSecurityModulesResourceGroupResource(resourceGroupResource).GetCloudHsmClusterBackupStatusAsync(cloudHsmClusterName, jobId, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the backup operation status of the specified Cloud HSM Cluster /// - /// Operation Id - /// CloudHsmCluster_ListBySubscription + /// Mocking. + /// To mock this method, please mock instead. /// + /// + /// The the method will execute against. + /// + /// Identifier for the backup operation. + /// The cancellation token to use. + /// is null. + public static Response GetCloudHsmClusterBackupStatus(this ResourceGroupResource resourceGroupResource, string cloudHsmClusterName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableHardwareSecurityModulesResourceGroupResource(resourceGroupResource).GetCloudHsmClusterBackupStatus(cloudHsmClusterName, jobId, cancellationToken); + } + + /// + /// Gets the restore operation status of the specified Cloud HSM Cluster /// - /// Default Api Version - /// 2025-03-31 + /// Mocking. + /// To mock this method, please mock instead. /// + /// + /// The the method will execute against. + /// Name of the Cloud HSM Cluster. + /// Identifier for the restore operation. + /// The cancellation token to use. + /// is null. + public static async Task> GetCloudHsmClusterRestoreStatusAsync(this ResourceGroupResource resourceGroupResource, string cloudHsmClusterName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableHardwareSecurityModulesResourceGroupResource(resourceGroupResource).GetCloudHsmClusterRestoreStatusAsync(cloudHsmClusterName, jobId, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the restore operation status of the specified Cloud HSM Cluster /// - /// Resource - /// + /// Mocking. + /// To mock this method, please mock instead. /// - /// + /// + /// The the method will execute against. + /// Name of the Cloud HSM Cluster. + /// Identifier for the restore operation. + /// The cancellation token to use. + /// is null. + public static Response GetCloudHsmClusterRestoreStatus(this ResourceGroupResource resourceGroupResource, string cloudHsmClusterName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableHardwareSecurityModulesResourceGroupResource(resourceGroupResource).GetCloudHsmClusterRestoreStatus(cloudHsmClusterName, jobId, cancellationToken); + } + + /// + /// The List operation gets information about the Cloud HSM Clusters associated with the subscription. /// - /// Mocking - /// To mock this method, please mock instead. + /// Mocking. + /// To mock this method, please mock instead. /// /// - /// The instance the method will execute against. + /// The the method will execute against. /// The page-continuation token to use with a paged version of this API. /// The cancellation token to use. /// is null. - /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetCloudHsmClustersAsync(this SubscriptionResource subscriptionResource, string skiptoken = null, CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetCloudHsmClustersAsync(this SubscriptionResource subscriptionResource, string skiptoken = default, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); @@ -314,35 +299,17 @@ public static AsyncPageable GetCloudHsmClustersAsync(th /// /// The List operation gets information about the Cloud HSM Clusters associated with the subscription. - /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters - /// - /// - /// Operation Id - /// CloudHsmCluster_ListBySubscription - /// - /// - /// Default Api Version - /// 2025-03-31 - /// - /// - /// Resource - /// - /// - /// - /// - /// Mocking - /// To mock this method, please mock instead. + /// Mocking. + /// To mock this method, please mock instead. /// /// - /// The instance the method will execute against. + /// The the method will execute against. /// The page-continuation token to use with a paged version of this API. /// The cancellation token to use. /// is null. /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetCloudHsmClusters(this SubscriptionResource subscriptionResource, string skiptoken = null, CancellationToken cancellationToken = default) + public static Pageable GetCloudHsmClusters(this SubscriptionResource subscriptionResource, string skiptoken = default, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); @@ -351,35 +318,17 @@ public static Pageable GetCloudHsmClusters(this Subscri /// /// The List operation gets information about the dedicated HSMs associated with the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs - /// /// - /// Operation Id - /// DedicatedHsm_ListBySubscription - /// - /// - /// Default Api Version - /// 2025-03-31 - /// - /// - /// Resource - /// - /// - /// - /// - /// Mocking - /// To mock this method, please mock instead. + /// Mocking. + /// To mock this method, please mock instead. /// /// - /// The instance the method will execute against. + /// The 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 GetDedicatedHsmsAsync(this SubscriptionResource subscriptionResource, int? top = null, CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetDedicatedHsmsAsync(this SubscriptionResource subscriptionResource, int? top = default, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); @@ -388,35 +337,17 @@ public static AsyncPageable GetDedicatedHsmsAsync(this Sub /// /// The List operation gets information about the dedicated HSMs associated with the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs - /// - /// - /// Operation Id - /// DedicatedHsm_ListBySubscription - /// - /// - /// Default Api Version - /// 2025-03-31 - /// - /// - /// Resource - /// - /// - /// /// - /// Mocking - /// To mock this method, please mock instead. + /// Mocking. + /// To mock this method, please mock instead. /// /// - /// The instance the method will execute against. + /// The 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 GetDedicatedHsms(this SubscriptionResource subscriptionResource, int? top = null, CancellationToken cancellationToken = default) + public static Pageable GetDedicatedHsms(this SubscriptionResource subscriptionResource, int? top = default, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Extensions/MockableHardwareSecurityModulesArmClient.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Extensions/MockableHardwareSecurityModulesArmClient.cs index c29e547c5524..aa63ed4e49b7 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Extensions/MockableHardwareSecurityModulesArmClient.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Extensions/MockableHardwareSecurityModulesArmClient.cs @@ -6,38 +6,27 @@ #nullable disable using Azure.Core; +using Azure.ResourceManager; +using Azure.ResourceManager.HardwareSecurityModules; namespace Azure.ResourceManager.HardwareSecurityModules.Mocking { - /// A class to add extension methods to ArmClient. + /// A class to add extension methods to . public partial class MockableHardwareSecurityModulesArmClient : ArmResource { - /// Initializes a new instance of the class for mocking. + /// Initializes a new instance of MockableHardwareSecurityModulesArmClient for mocking. protected MockableHardwareSecurityModulesArmClient() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of class. /// The client parameters to use in these operations. /// The identifier of the resource that is the target of operations. internal MockableHardwareSecurityModulesArmClient(ArmClient client, ResourceIdentifier id) : base(client, id) { } - internal MockableHardwareSecurityModulesArmClient(ArmClient client) : this(client, ResourceIdentifier.Root) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// The resource ID of the resource to get. /// Returns a object. public virtual CloudHsmClusterResource GetCloudHsmClusterResource(ResourceIdentifier id) @@ -46,10 +35,7 @@ public virtual CloudHsmClusterResource GetCloudHsmClusterResource(ResourceIdenti return new CloudHsmClusterResource(Client, id); } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// The resource ID of the resource to get. /// Returns a object. public virtual CloudHsmClusterPrivateEndpointConnectionResource GetCloudHsmClusterPrivateEndpointConnectionResource(ResourceIdentifier id) @@ -58,10 +44,7 @@ public virtual CloudHsmClusterPrivateEndpointConnectionResource GetCloudHsmClust return new CloudHsmClusterPrivateEndpointConnectionResource(Client, id); } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// The resource ID of the resource to get. /// Returns a object. public virtual DedicatedHsmResource GetDedicatedHsmResource(ResourceIdentifier id) diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Extensions/MockableHardwareSecurityModulesResourceGroupResource.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Extensions/MockableHardwareSecurityModulesResourceGroupResource.cs index f7e581b16ac6..2a186a998ae1 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Extensions/MockableHardwareSecurityModulesResourceGroupResource.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Extensions/MockableHardwareSecurityModulesResourceGroupResource.cs @@ -8,33 +8,46 @@ using System; using System.Threading; using System.Threading.Tasks; +using Azure; using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.HardwareSecurityModules; +using Azure.ResourceManager.HardwareSecurityModules.Models; +using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.HardwareSecurityModules.Mocking { - /// A class to add extension methods to ResourceGroupResource. + /// A class to add extension methods to . public partial class MockableHardwareSecurityModulesResourceGroupResource : ArmResource { - /// Initializes a new instance of the class for mocking. + private ClientDiagnostics _cloudHsmClusterBackupStatusClientDiagnostics; + private CloudHsmClusterBackupStatus _cloudHsmClusterBackupStatusRestClient; + private ClientDiagnostics _cloudHsmClusterRestoreStatusClientDiagnostics; + private CloudHsmClusterRestoreStatus _cloudHsmClusterRestoreStatusRestClient; + + /// Initializes a new instance of MockableHardwareSecurityModulesResourceGroupResource for mocking. protected MockableHardwareSecurityModulesResourceGroupResource() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of class. /// The client parameters to use in these operations. /// The identifier of the resource that is the target of operations. internal MockableHardwareSecurityModulesResourceGroupResource(ArmClient client, ResourceIdentifier id) : base(client, id) { } - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } + private ClientDiagnostics CloudHsmClusterBackupStatusClientDiagnostics => _cloudHsmClusterBackupStatusClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.HardwareSecurityModules.Mocking", ProviderConstants.DefaultProviderNamespace, Diagnostics); + + private CloudHsmClusterBackupStatus CloudHsmClusterBackupStatusRestClient => _cloudHsmClusterBackupStatusRestClient ??= new CloudHsmClusterBackupStatus(CloudHsmClusterBackupStatusClientDiagnostics, Pipeline, Endpoint, "2025-03-31"); + + private ClientDiagnostics CloudHsmClusterRestoreStatusClientDiagnostics => _cloudHsmClusterRestoreStatusClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.HardwareSecurityModules.Mocking", ProviderConstants.DefaultProviderNamespace, Diagnostics); - /// Gets a collection of CloudHsmClusterResources in the ResourceGroupResource. - /// An object representing collection of CloudHsmClusterResources and their operations over a CloudHsmClusterResource. + private CloudHsmClusterRestoreStatus CloudHsmClusterRestoreStatusRestClient => _cloudHsmClusterRestoreStatusRestClient ??= new CloudHsmClusterRestoreStatus(CloudHsmClusterRestoreStatusClientDiagnostics, Pipeline, Endpoint, "2025-03-31"); + + /// Gets a collection of CloudHsmClusters in the . + /// An object representing collection of CloudHsmClusters and their operations over a CloudHsmClusterResource. public virtual CloudHsmClusterCollection GetCloudHsmClusters() { return GetCachedClient(client => new CloudHsmClusterCollection(client, Id)); @@ -44,20 +57,16 @@ public virtual CloudHsmClusterCollection GetCloudHsmClusters() /// Gets the specified Cloud HSM Cluster /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName} - /// - /// - /// Operation Id - /// CloudHsmCluster_Get + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}. /// /// - /// Default Api Version - /// 2025-03-31 + /// Operation Id. + /// CloudHsmClusters_Get. /// /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-31. /// /// /// @@ -68,6 +77,8 @@ public virtual CloudHsmClusterCollection GetCloudHsmClusters() [ForwardsClientCalls] public virtual async Task> GetCloudHsmClusterAsync(string cloudHsmClusterName, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(cloudHsmClusterName, nameof(cloudHsmClusterName)); + return await GetCloudHsmClusters().GetAsync(cloudHsmClusterName, cancellationToken).ConfigureAwait(false); } @@ -75,20 +86,16 @@ public virtual async Task> GetCloudHsmClusterA /// Gets the specified Cloud HSM Cluster /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName} - /// - /// - /// Operation Id - /// CloudHsmCluster_Get + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}. /// /// - /// Default Api Version - /// 2025-03-31 + /// Operation Id. + /// CloudHsmClusters_Get. /// /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-31. /// /// /// @@ -99,11 +106,13 @@ public virtual async Task> GetCloudHsmClusterA [ForwardsClientCalls] public virtual Response GetCloudHsmCluster(string cloudHsmClusterName, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(cloudHsmClusterName, nameof(cloudHsmClusterName)); + return GetCloudHsmClusters().Get(cloudHsmClusterName, cancellationToken); } - /// Gets a collection of DedicatedHsmResources in the ResourceGroupResource. - /// An object representing collection of DedicatedHsmResources and their operations over a DedicatedHsmResource. + /// Gets a collection of DedicatedHsms in the . + /// An object representing collection of DedicatedHsms and their operations over a DedicatedHsmResource. public virtual DedicatedHsmCollection GetDedicatedHsms() { return GetCachedClient(client => new DedicatedHsmCollection(client, Id)); @@ -113,20 +122,16 @@ public virtual DedicatedHsmCollection GetDedicatedHsms() /// Gets the specified Azure dedicated HSM. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}. /// /// - /// Operation Id - /// DedicatedHsm_Get + /// Operation Id. + /// DedicatedHsms_Get. /// /// - /// Default Api Version - /// 2025-03-31 - /// - /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-31. /// /// /// @@ -137,6 +142,8 @@ public virtual DedicatedHsmCollection GetDedicatedHsms() [ForwardsClientCalls] public virtual async Task> GetDedicatedHsmAsync(string name, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + return await GetDedicatedHsms().GetAsync(name, cancellationToken).ConfigureAwait(false); } @@ -144,20 +151,16 @@ public virtual async Task> GetDedicatedHsmAsync(s /// Gets the specified Azure dedicated HSM. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name} + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}. /// /// - /// Operation Id - /// DedicatedHsm_Get + /// Operation Id. + /// DedicatedHsms_Get. /// /// - /// Default Api Version - /// 2025-03-31 - /// - /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-31. /// /// /// @@ -168,7 +171,213 @@ public virtual async Task> GetDedicatedHsmAsync(s [ForwardsClientCalls] public virtual Response GetDedicatedHsm(string name, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(name, nameof(name)); + return GetDedicatedHsms().Get(name, cancellationToken); } + + /// + /// Gets the backup operation status of the specified Cloud HSM Cluster + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/backupOperationStatus/{jobId}. + /// + /// + /// Operation Id. + /// CloudHsmClusters_CloudHsmClusterBackupStatusGet. + /// + /// + /// Default Api Version. + /// 2025-03-31. + /// + /// + /// + /// + /// Identifier for the backup operation. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual async Task> GetCloudHsmClusterBackupStatusAsync(string cloudHsmClusterName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(cloudHsmClusterName, nameof(cloudHsmClusterName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using DiagnosticScope scope = CloudHsmClusterBackupStatusClientDiagnostics.CreateScope("MockableHardwareSecurityModulesResourceGroupResource.GetCloudHsmClusterBackupStatus"); + scope.Start(); + try + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = CloudHsmClusterBackupStatusRestClient.CreateGetCloudHsmClusterBackupStatusRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, cloudHsmClusterName, jobId, context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(CloudHsmClusterBackupResult.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the backup operation status of the specified Cloud HSM Cluster + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/backupOperationStatus/{jobId}. + /// + /// + /// Operation Id. + /// CloudHsmClusters_CloudHsmClusterBackupStatusGet. + /// + /// + /// Default Api Version. + /// 2025-03-31. + /// + /// + /// + /// + /// Identifier for the backup operation. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual Response GetCloudHsmClusterBackupStatus(string cloudHsmClusterName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(cloudHsmClusterName, nameof(cloudHsmClusterName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using DiagnosticScope scope = CloudHsmClusterBackupStatusClientDiagnostics.CreateScope("MockableHardwareSecurityModulesResourceGroupResource.GetCloudHsmClusterBackupStatus"); + scope.Start(); + try + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = CloudHsmClusterBackupStatusRestClient.CreateGetCloudHsmClusterBackupStatusRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, cloudHsmClusterName, jobId, context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(CloudHsmClusterBackupResult.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the restore operation status of the specified Cloud HSM Cluster + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/restoreOperationStatus/{jobId}. + /// + /// + /// Operation Id. + /// CloudHsmClusters_CloudHsmClusterRestoreStatusGet. + /// + /// + /// Default Api Version. + /// 2025-03-31. + /// + /// + /// + /// Name of the Cloud HSM Cluster. + /// Identifier for the restore operation. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual async Task> GetCloudHsmClusterRestoreStatusAsync(string cloudHsmClusterName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(cloudHsmClusterName, nameof(cloudHsmClusterName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using DiagnosticScope scope = CloudHsmClusterRestoreStatusClientDiagnostics.CreateScope("MockableHardwareSecurityModulesResourceGroupResource.GetCloudHsmClusterRestoreStatus"); + scope.Start(); + try + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = CloudHsmClusterRestoreStatusRestClient.CreateGetCloudHsmClusterRestoreStatusRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, cloudHsmClusterName, jobId, context); + Response result = await Pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + Response response = Response.FromValue(CloudHsmClusterRestoreResult.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the restore operation status of the specified Cloud HSM Cluster + /// + /// + /// Request Path. + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/restoreOperationStatus/{jobId}. + /// + /// + /// Operation Id. + /// CloudHsmClusters_CloudHsmClusterRestoreStatusGet. + /// + /// + /// Default Api Version. + /// 2025-03-31. + /// + /// + /// + /// Name of the Cloud HSM Cluster. + /// Identifier for the restore operation. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public virtual Response GetCloudHsmClusterRestoreStatus(string cloudHsmClusterName, string jobId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(cloudHsmClusterName, nameof(cloudHsmClusterName)); + Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); + + using DiagnosticScope scope = CloudHsmClusterRestoreStatusClientDiagnostics.CreateScope("MockableHardwareSecurityModulesResourceGroupResource.GetCloudHsmClusterRestoreStatus"); + scope.Start(); + try + { + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + HttpMessage message = CloudHsmClusterRestoreStatusRestClient.CreateGetCloudHsmClusterRestoreStatusRequest(Guid.Parse(Id.SubscriptionId), Id.ResourceGroupName, cloudHsmClusterName, jobId, context); + Response result = Pipeline.ProcessMessage(message, context); + Response response = Response.FromValue(CloudHsmClusterRestoreResult.FromResponse(result), result); + if (response.Value == null) + { + throw new RequestFailedException(response.GetRawResponse()); + } + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Extensions/MockableHardwareSecurityModulesSubscriptionResource.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Extensions/MockableHardwareSecurityModulesSubscriptionResource.cs index 82632486e0a5..e7d658f3f71a 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Extensions/MockableHardwareSecurityModulesSubscriptionResource.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Extensions/MockableHardwareSecurityModulesSubscriptionResource.cs @@ -5,166 +5,159 @@ #nullable disable +using System; using System.Threading; -using Autorest.CSharp.Core; +using Azure; using Azure.Core; using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.HardwareSecurityModules; +using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.HardwareSecurityModules.Mocking { - /// A class to add extension methods to SubscriptionResource. + /// A class to add extension methods to . public partial class MockableHardwareSecurityModulesSubscriptionResource : ArmResource { - private ClientDiagnostics _cloudHsmClusterClientDiagnostics; - private CloudHsmClustersRestOperations _cloudHsmClusterRestClient; - private ClientDiagnostics _dedicatedHsmClientDiagnostics; - private DedicatedHsmsRestOperations _dedicatedHsmRestClient; + private ClientDiagnostics _cloudHsmClustersClientDiagnostics; + private CloudHsmClusters _cloudHsmClustersRestClient; + private ClientDiagnostics _dedicatedHsmsClientDiagnostics; + private DedicatedHsms _dedicatedHsmsRestClient; - /// Initializes a new instance of the class for mocking. + /// Initializes a new instance of MockableHardwareSecurityModulesSubscriptionResource for mocking. protected MockableHardwareSecurityModulesSubscriptionResource() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of class. /// The client parameters to use in these operations. /// The identifier of the resource that is the target of operations. internal MockableHardwareSecurityModulesSubscriptionResource(ArmClient client, ResourceIdentifier id) : base(client, id) { } - private ClientDiagnostics CloudHsmClusterClientDiagnostics => _cloudHsmClusterClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.HardwareSecurityModules", CloudHsmClusterResource.ResourceType.Namespace, Diagnostics); - private CloudHsmClustersRestOperations CloudHsmClusterRestClient => _cloudHsmClusterRestClient ??= new CloudHsmClustersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(CloudHsmClusterResource.ResourceType)); - private ClientDiagnostics DedicatedHsmClientDiagnostics => _dedicatedHsmClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.HardwareSecurityModules", DedicatedHsmResource.ResourceType.Namespace, Diagnostics); - private DedicatedHsmsRestOperations DedicatedHsmRestClient => _dedicatedHsmRestClient ??= new DedicatedHsmsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(DedicatedHsmResource.ResourceType)); + private ClientDiagnostics CloudHsmClustersClientDiagnostics => _cloudHsmClustersClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.HardwareSecurityModules.Mocking", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } + private CloudHsmClusters CloudHsmClustersRestClient => _cloudHsmClustersRestClient ??= new CloudHsmClusters(CloudHsmClustersClientDiagnostics, Pipeline, Endpoint, "2025-03-31"); + + private ClientDiagnostics DedicatedHsmsClientDiagnostics => _dedicatedHsmsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.HardwareSecurityModules.Mocking", ProviderConstants.DefaultProviderNamespace, Diagnostics); + + private DedicatedHsms DedicatedHsmsRestClient => _dedicatedHsmsRestClient ??= new DedicatedHsms(DedicatedHsmsClientDiagnostics, Pipeline, Endpoint, "2025-03-31"); /// /// The List operation gets information about the Cloud HSM Clusters associated with the subscription. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters + /// Request Path. + /// /subscriptions/{subscriptionId}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters. /// /// - /// Operation Id - /// CloudHsmCluster_ListBySubscription + /// Operation Id. + /// CloudHsmClusters_ListBySubscription. /// /// - /// Default Api Version - /// 2025-03-31 - /// - /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-31. /// /// /// /// The page-continuation token to use with a paged version of this API. /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetCloudHsmClustersAsync(string skiptoken = null, CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetCloudHsmClustersAsync(string skiptoken = default, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => CloudHsmClusterRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, skiptoken); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CloudHsmClusterRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, skiptoken); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new CloudHsmClusterResource(Client, CloudHsmClusterData.DeserializeCloudHsmClusterData(e)), CloudHsmClusterClientDiagnostics, Pipeline, "MockableHardwareSecurityModulesSubscriptionResource.GetCloudHsmClusters", "value", "nextLink", cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + return new AsyncPageableWrapper(new CloudHsmClustersGetBySubscriptionAsyncCollectionResultOfT(CloudHsmClustersRestClient, Guid.Parse(Id.SubscriptionId), skiptoken, context), data => new CloudHsmClusterResource(Client, data)); } /// /// The List operation gets information about the Cloud HSM Clusters associated with the subscription. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters + /// Request Path. + /// /subscriptions/{subscriptionId}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters. /// /// - /// Operation Id - /// CloudHsmCluster_ListBySubscription + /// Operation Id. + /// CloudHsmClusters_ListBySubscription. /// /// - /// Default Api Version - /// 2025-03-31 - /// - /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-31. /// /// /// /// The page-continuation token to use with a paged version of this API. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetCloudHsmClusters(string skiptoken = null, CancellationToken cancellationToken = default) + public virtual Pageable GetCloudHsmClusters(string skiptoken = default, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => CloudHsmClusterRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, skiptoken); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CloudHsmClusterRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, skiptoken); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new CloudHsmClusterResource(Client, CloudHsmClusterData.DeserializeCloudHsmClusterData(e)), CloudHsmClusterClientDiagnostics, Pipeline, "MockableHardwareSecurityModulesSubscriptionResource.GetCloudHsmClusters", "value", "nextLink", cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + return new PageableWrapper(new CloudHsmClustersGetBySubscriptionCollectionResultOfT(CloudHsmClustersRestClient, Guid.Parse(Id.SubscriptionId), skiptoken, context), data => new CloudHsmClusterResource(Client, data)); } /// /// The List operation gets information about the dedicated HSMs associated with the subscription. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs - /// - /// - /// Operation Id - /// DedicatedHsm_ListBySubscription + /// Request Path. + /// /subscriptions/{subscriptionId}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs. /// /// - /// Default Api Version - /// 2025-03-31 + /// Operation Id. + /// DedicatedHsms_ListBySubscription. /// /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-31. /// /// /// /// 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 GetDedicatedHsmsAsync(int? top = null, CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetDedicatedHsmsAsync(int? top = default, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => DedicatedHsmRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, top); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DedicatedHsmRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, top); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DedicatedHsmResource(Client, DedicatedHsmData.DeserializeDedicatedHsmData(e)), DedicatedHsmClientDiagnostics, Pipeline, "MockableHardwareSecurityModulesSubscriptionResource.GetDedicatedHsms", "value", "nextLink", cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + return new AsyncPageableWrapper(new DedicatedHsmsGetBySubscriptionAsyncCollectionResultOfT(DedicatedHsmsRestClient, Guid.Parse(Id.SubscriptionId), top, context), data => new DedicatedHsmResource(Client, data)); } /// /// The List operation gets information about the dedicated HSMs associated with the subscription. /// /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs - /// - /// - /// Operation Id - /// DedicatedHsm_ListBySubscription + /// Request Path. + /// /subscriptions/{subscriptionId}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs. /// /// - /// Default Api Version - /// 2025-03-31 + /// Operation Id. + /// DedicatedHsms_ListBySubscription. /// /// - /// Resource - /// + /// Default Api Version. + /// 2025-03-31. /// /// /// /// 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 GetDedicatedHsms(int? top = null, CancellationToken cancellationToken = default) + public virtual Pageable GetDedicatedHsms(int? top = default, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => DedicatedHsmRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, top); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DedicatedHsmRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, top); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DedicatedHsmResource(Client, DedicatedHsmData.DeserializeDedicatedHsmData(e)), DedicatedHsmClientDiagnostics, Pipeline, "MockableHardwareSecurityModulesSubscriptionResource.GetDedicatedHsms", "value", "nextLink", cancellationToken); + RequestContext context = new RequestContext + { + CancellationToken = cancellationToken + }; + return new PageableWrapper(new DedicatedHsmsGetBySubscriptionCollectionResultOfT(DedicatedHsmsRestClient, Guid.Parse(Id.SubscriptionId), top, context), data => new DedicatedHsmResource(Client, data)); } } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Internal/Argument.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Internal/Argument.cs index 7530c4643e96..98e16300d5ae 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Internal/Argument.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Internal/Argument.cs @@ -11,8 +11,10 @@ namespace Azure.ResourceManager.HardwareSecurityModules { - internal static class Argument + internal static partial class Argument { + /// The value. + /// The name. public static void AssertNotNull(T value, string name) { if (value is null) @@ -21,8 +23,10 @@ public static void AssertNotNull(T value, string name) } } + /// The value. + /// The name. public static void AssertNotNull(T? value, string name) - where T : struct + where T : struct { if (!value.HasValue) { @@ -30,6 +34,8 @@ public static void AssertNotNull(T? value, string name) } } + /// The value. + /// The name. public static void AssertNotNullOrEmpty(IEnumerable value, string name) { if (value is null) @@ -51,6 +57,8 @@ public static void AssertNotNullOrEmpty(IEnumerable value, string name) } } + /// The value. + /// The name. public static void AssertNotNullOrEmpty(string value, string name) { if (value is null) @@ -62,68 +70,5 @@ public static void AssertNotNullOrEmpty(string value, string name) throw new ArgumentException("Value cannot be an empty string.", name); } } - - public static void AssertNotNullOrWhiteSpace(string value, string name) - { - if (value is null) - { - throw new ArgumentNullException(name); - } - if (string.IsNullOrWhiteSpace(value)) - { - throw new ArgumentException("Value cannot be empty or contain only white-space characters.", name); - } - } - - public static void AssertNotDefault(ref T value, string name) - where T : struct, IEquatable - { - if (value.Equals(default)) - { - throw new ArgumentException("Value cannot be empty.", name); - } - } - - public static void AssertInRange(T value, T minimum, T maximum, string name) - where T : notnull, IComparable - { - if (minimum.CompareTo(value) > 0) - { - throw new ArgumentOutOfRangeException(name, "Value is less than the minimum allowed."); - } - if (maximum.CompareTo(value) < 0) - { - throw new ArgumentOutOfRangeException(name, "Value is greater than the maximum allowed."); - } - } - - public static void AssertEnumDefined(Type enumType, object value, string name) - { - if (!Enum.IsDefined(enumType, value)) - { - throw new ArgumentException($"Value not defined for {enumType.FullName}.", name); - } - } - - public static T CheckNotNull(T value, string name) - where T : class - { - AssertNotNull(value, name); - return value; - } - - public static string CheckNotNullOrEmpty(string value, string name) - { - AssertNotNullOrEmpty(value, name); - return value; - } - - public static void AssertNull(T value, string name, string message = null) - { - if (value != null) - { - throw new ArgumentException(message ?? "Value must be null.", name); - } - } } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Internal/AsyncPageableWrapper.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Internal/AsyncPageableWrapper.cs new file mode 100644 index 000000000000..f5777df4107c --- /dev/null +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Internal/AsyncPageableWrapper.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Azure; + +namespace Azure.ResourceManager.HardwareSecurityModules +{ + internal partial class AsyncPageableWrapper : AsyncPageable + { + /// The source async pageable value of type AsyncPageable<T>. + private AsyncPageable _source; + /// The converter function from T to U. + private Func _converter; + + /// Initializes a new instance of the AsyncPageableWrapper class. + /// The source async pageable value of type AsyncPageable<T>. + /// The converter function from T to U. + public AsyncPageableWrapper(AsyncPageable source, Func converter) + { + _source = source; + _converter = converter; + } + + /// Converts the pages from AsyncPageable to Page. + /// A continuation token from a previous response. + /// An optional hint to specify the desired size of each page. + /// An enumerable of pages containing converted items of type U. + public override async IAsyncEnumerable> AsPages(string continuationToken, int? pageSizeHint) + { + await foreach (Page page in _source.AsPages(continuationToken, pageSizeHint).ConfigureAwait(false)) + { + List convertedItems = new List(); + foreach (T item in page.Values) + { + convertedItems.Add(_converter.Invoke(item)); + } + yield return Page.FromValues(convertedItems, page.ContinuationToken, page.GetRawResponse()); + } + } + } +} diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Internal/ChangeTrackingDictionary.cs index fb8701658bd1..3b48fd0a0cb5 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Internal/ChangeTrackingDictionary.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Internal/ChangeTrackingDictionary.cs @@ -11,7 +11,8 @@ namespace Azure.ResourceManager.HardwareSecurityModules { - internal class ChangeTrackingDictionary : IDictionary, IReadOnlyDictionary where TKey : notnull + internal partial class ChangeTrackingDictionary : IDictionary, IReadOnlyDictionary + where TKey : notnull { private IDictionary _innerDictionary; @@ -19,6 +20,7 @@ public ChangeTrackingDictionary() { } + /// The inner dictionary. public ChangeTrackingDictionary(IDictionary dictionary) { if (dictionary == null) @@ -28,6 +30,7 @@ public ChangeTrackingDictionary(IDictionary dictionary) _innerDictionary = new Dictionary(dictionary); } + /// The inner dictionary. public ChangeTrackingDictionary(IReadOnlyDictionary dictionary) { if (dictionary == null) @@ -41,16 +44,22 @@ public ChangeTrackingDictionary(IReadOnlyDictionary dictionary) } } + /// Gets the IsUndefined. public bool IsUndefined => _innerDictionary == null; + /// Gets the Count. public int Count => IsUndefined ? 0 : EnsureDictionary().Count; + /// Gets the IsReadOnly. public bool IsReadOnly => IsUndefined ? false : EnsureDictionary().IsReadOnly; + /// Gets the Keys. public ICollection Keys => IsUndefined ? Array.Empty() : EnsureDictionary().Keys; + /// Gets the Values. public ICollection Values => IsUndefined ? Array.Empty() : EnsureDictionary().Values; + /// Gets or sets the value associated with the specified key. public TValue this[TKey key] { get @@ -67,8 +76,10 @@ public TValue this[TKey key] } } + /// Gets the Keys. IEnumerable IReadOnlyDictionary.Keys => Keys; + /// Gets the Values. IEnumerable IReadOnlyDictionary.Values => Values; public IEnumerator> GetEnumerator() @@ -89,6 +100,7 @@ IEnumerator IEnumerable.GetEnumerator() return GetEnumerator(); } + /// The item to add. public void Add(KeyValuePair item) { EnsureDictionary().Add(item); @@ -99,6 +111,7 @@ public void Clear() EnsureDictionary().Clear(); } + /// The item to search for. public bool Contains(KeyValuePair item) { if (IsUndefined) @@ -108,6 +121,8 @@ public bool Contains(KeyValuePair item) return EnsureDictionary().Contains(item); } + /// The array to copy. + /// The index. public void CopyTo(KeyValuePair[] array, int index) { if (IsUndefined) @@ -117,6 +132,7 @@ public void CopyTo(KeyValuePair[] array, int index) EnsureDictionary().CopyTo(array, index); } + /// The item to remove. public bool Remove(KeyValuePair item) { if (IsUndefined) @@ -126,11 +142,14 @@ public bool Remove(KeyValuePair item) return EnsureDictionary().Remove(item); } + /// The key. + /// The value to add. public void Add(TKey key, TValue value) { EnsureDictionary().Add(key, value); } + /// The key to search for. public bool ContainsKey(TKey key) { if (IsUndefined) @@ -140,6 +159,7 @@ public bool ContainsKey(TKey key) return EnsureDictionary().ContainsKey(key); } + /// The key. public bool Remove(TKey key) { if (IsUndefined) @@ -149,6 +169,8 @@ public bool Remove(TKey key) return EnsureDictionary().Remove(key); } + /// The key to search for. + /// The value. public bool TryGetValue(TKey key, out TValue value) { if (IsUndefined) diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Internal/ChangeTrackingList.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Internal/ChangeTrackingList.cs index 5a387e42ec41..1279f213816d 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Internal/ChangeTrackingList.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Internal/ChangeTrackingList.cs @@ -12,7 +12,7 @@ namespace Azure.ResourceManager.HardwareSecurityModules { - internal class ChangeTrackingList : IList, IReadOnlyList + internal partial class ChangeTrackingList : IList, IReadOnlyList { private IList _innerList; @@ -20,6 +20,7 @@ public ChangeTrackingList() { } + /// The inner list. public ChangeTrackingList(IList innerList) { if (innerList != null) @@ -28,6 +29,7 @@ public ChangeTrackingList(IList innerList) } } + /// The inner list. public ChangeTrackingList(IReadOnlyList innerList) { if (innerList != null) @@ -36,12 +38,16 @@ public ChangeTrackingList(IReadOnlyList innerList) } } + /// Gets the IsUndefined. public bool IsUndefined => _innerList == null; + /// Gets the Count. public int Count => IsUndefined ? 0 : EnsureList().Count; + /// Gets the IsReadOnly. public bool IsReadOnly => IsUndefined ? false : EnsureList().IsReadOnly; + /// Gets or sets the value associated with the specified key. public T this[int index] { get @@ -85,6 +91,7 @@ IEnumerator IEnumerable.GetEnumerator() return GetEnumerator(); } + /// The item to add. public void Add(T item) { EnsureList().Add(item); @@ -95,6 +102,7 @@ public void Clear() EnsureList().Clear(); } + /// The item. public bool Contains(T item) { if (IsUndefined) @@ -104,6 +112,8 @@ public bool Contains(T item) return EnsureList().Contains(item); } + /// The array to copy to. + /// The array index. public void CopyTo(T[] array, int arrayIndex) { if (IsUndefined) @@ -113,6 +123,7 @@ public void CopyTo(T[] array, int arrayIndex) EnsureList().CopyTo(array, arrayIndex); } + /// The item. public bool Remove(T item) { if (IsUndefined) @@ -122,6 +133,7 @@ public bool Remove(T item) return EnsureList().Remove(item); } + /// The item. public int IndexOf(T item) { if (IsUndefined) @@ -131,11 +143,14 @@ public int IndexOf(T item) return EnsureList().IndexOf(item); } + /// The inner list. + /// The item. public void Insert(int index, T item) { EnsureList().Insert(index, item); } + /// The inner list. public void RemoveAt(int index) { if (IsUndefined) diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Internal/ClientPipelineExtensions.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Internal/ClientPipelineExtensions.cs new file mode 100644 index 000000000000..a314f1e3167b --- /dev/null +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Internal/ClientPipelineExtensions.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.HardwareSecurityModules +{ + internal static partial class ClientPipelineExtensions + { + public static async ValueTask ProcessMessageAsync(this HttpPipeline pipeline, HttpMessage message, RequestContext context) + { + (CancellationToken userCancellationToken, ErrorOptions statusOption) = context.Parse(); + await pipeline.SendAsync(message, userCancellationToken).ConfigureAwait(false); + + if (message.Response.IsError && (context?.ErrorOptions & ErrorOptions.NoThrow) != ErrorOptions.NoThrow) + { + throw new RequestFailedException(message.Response); + } + + return message.Response; + } + + public static Response ProcessMessage(this HttpPipeline pipeline, HttpMessage message, RequestContext context) + { + (CancellationToken userCancellationToken, ErrorOptions statusOption) = context.Parse(); + pipeline.Send(message, userCancellationToken); + + if (message.Response.IsError && (context?.ErrorOptions & ErrorOptions.NoThrow) != ErrorOptions.NoThrow) + { + throw new RequestFailedException(message.Response); + } + + return message.Response; + } + + public static async ValueTask> ProcessHeadAsBoolMessageAsync(this HttpPipeline pipeline, HttpMessage message, RequestContext context) + { + Response response = await pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + switch (response.Status) + { + case >= 200 and < 300: + return Response.FromValue(true, response); + case >= 400 and < 500: + return Response.FromValue(false, response); + default: + return new ErrorResult(response, new RequestFailedException(response)); + } + } + + public static Response ProcessHeadAsBoolMessage(this HttpPipeline pipeline, HttpMessage message, RequestContext context) + { + Response response = pipeline.ProcessMessage(message, context); + switch (response.Status) + { + case >= 200 and < 300: + return Response.FromValue(true, response); + case >= 400 and < 500: + return Response.FromValue(false, response); + default: + return new ErrorResult(response, new RequestFailedException(response)); + } + } + } +} diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Internal/CodeGenMemberAttribute.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Internal/CodeGenMemberAttribute.cs new file mode 100644 index 000000000000..f7cf399463b8 --- /dev/null +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Internal/CodeGenMemberAttribute.cs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.ResourceManager.HardwareSecurityModules +{ + [AttributeUsage((AttributeTargets.Property | AttributeTargets.Field))] + internal partial class CodeGenMemberAttribute : CodeGenTypeAttribute + { + /// The original name of the member. + public CodeGenMemberAttribute(string originalName) : base(originalName) + { + } + } +} diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Internal/CodeGenSerializationAttribute.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Internal/CodeGenSerializationAttribute.cs new file mode 100644 index 000000000000..8fbfdfadf966 --- /dev/null +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Internal/CodeGenSerializationAttribute.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.ResourceManager.HardwareSecurityModules +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Struct), AllowMultiple = true, Inherited = true)] + internal partial class CodeGenSerializationAttribute : Attribute + { + /// The property name which these hooks apply to. + public CodeGenSerializationAttribute(string propertyName) + { + PropertyName = propertyName; + } + + /// The property name which these hooks apply to. + /// The serialization name of the property. + public CodeGenSerializationAttribute(string propertyName, string serializationName) + { + PropertyName = propertyName; + SerializationName = serializationName; + } + + /// Gets or sets the property name which these hooks should apply to. + public string PropertyName { get; } + + /// Gets or sets the serialization name of the property. + public string SerializationName { get; set; } + + /// + /// Gets or sets the method name to use when serializing the property value (property name excluded). + /// The signature of the serialization hook method must be or compatible with when invoking: private void SerializeHook(Utf8JsonWriter writer); + /// + public string SerializationValueHook { get; set; } + + /// + /// Gets or sets the method name to use when deserializing the property value from the JSON. + /// private static void DeserializationHook(JsonProperty property, ref TypeOfTheProperty propertyValue); // if the property is required + /// private static void DeserializationHook(JsonProperty property, ref Optional<TypeOfTheProperty> propertyValue); // if the property is optional + /// + public string DeserializationValueHook { get; set; } + } +} diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Internal/CodeGenSuppressAttribute.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Internal/CodeGenSuppressAttribute.cs new file mode 100644 index 000000000000..1fe6597f0867 --- /dev/null +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Internal/CodeGenSuppressAttribute.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.ResourceManager.HardwareSecurityModules +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Struct), AllowMultiple = true)] + internal partial class CodeGenSuppressAttribute : Attribute + { + /// The member to suppress. + /// The types of the parameters of the member. + public CodeGenSuppressAttribute(string member, params Type[] parameters) + { + Member = member; + Parameters = parameters; + } + + /// Gets the Member. + public string Member { get; } + + /// Gets the Parameters. + public Type[] Parameters { get; } + } +} diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Internal/CodeGenTypeAttribute.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Internal/CodeGenTypeAttribute.cs new file mode 100644 index 000000000000..45cc22100f48 --- /dev/null +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Internal/CodeGenTypeAttribute.cs @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.ResourceManager.HardwareSecurityModules +{ + [AttributeUsage((AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Struct))] + internal partial class CodeGenTypeAttribute : Attribute + { + /// The original name of the type. + public CodeGenTypeAttribute(string originalName) + { + OriginalName = originalName; + } + + /// Gets the OriginalName. + public string OriginalName { get; } + } +} diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Internal/ErrorResult.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Internal/ErrorResult.cs new file mode 100644 index 000000000000..1c579975d12a --- /dev/null +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Internal/ErrorResult.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure; + +namespace Azure.ResourceManager.HardwareSecurityModules +{ + internal partial class ErrorResult : Response + { + private readonly Response _response; + private readonly RequestFailedException _exception; + + public ErrorResult(Response response, RequestFailedException exception) + { + _response = response; + _exception = exception; + } + + /// Gets the Value. + public override T Value => throw _exception; + + /// + public override Response GetRawResponse() + { + return _response; + } + } +} diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Internal/ModelSerializationExtensions.cs index d8d4da1e8121..809e1cc46a1f 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Internal/ModelSerializationExtensions.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Internal/ModelSerializationExtensions.cs @@ -11,18 +11,16 @@ using System.Diagnostics; using System.Globalization; using System.Text.Json; -using System.Xml; -using Azure.Core; namespace Azure.ResourceManager.HardwareSecurityModules { - internal static class ModelSerializationExtensions + internal static partial class ModelSerializationExtensions { - internal static readonly JsonDocumentOptions JsonDocumentOptions = new JsonDocumentOptions { MaxDepth = 256 }; internal static readonly ModelReaderWriterOptions WireOptions = new ModelReaderWriterOptions("W"); - internal static readonly ModelReaderWriterOptions WireV3Options = new ModelReaderWriterOptions("W|v3"); - internal static readonly ModelReaderWriterOptions JsonV3Options = new ModelReaderWriterOptions("J|v3"); - internal static readonly BinaryData SentinelValue = BinaryData.FromBytes("\"__EMPTY__\""u8.ToArray()); + internal static readonly JsonDocumentOptions JsonDocumentOptions = new JsonDocumentOptions + { + MaxDepth = 256 + }; public static object GetObject(this JsonElement element) { @@ -48,14 +46,14 @@ public static object GetObject(this JsonElement element) case JsonValueKind.Null: return null; case JsonValueKind.Object: - var dictionary = new Dictionary(); + Dictionary dictionary = new Dictionary(); foreach (var jsonProperty in element.EnumerateObject()) { dictionary.Add(jsonProperty.Name, jsonProperty.Value.GetObject()); } return dictionary; case JsonValueKind.Array: - var list = new List(); + List list = new List(); foreach (var item in element.EnumerateArray()) { list.Add(item.GetObject()); @@ -93,7 +91,7 @@ public static char GetChar(this JsonElement element) { if (element.ValueKind == JsonValueKind.String) { - var text = element.GetString(); + string text = element.GetString(); if (text == null || text.Length != 1) { throw new NotSupportedException($"Cannot convert \"{text}\" to a char"); @@ -107,14 +105,14 @@ public static char GetChar(this JsonElement element) } [Conditional("DEBUG")] - public static void ThrowNonNullablePropertyIsNull(this JsonProperty property) + public static void ThrowNonNullablePropertyIsNull(this JsonProperty @property) { - throw new JsonException($"A property '{property.Name}' defined as non-nullable but received as null from the service. This exception only happens in DEBUG builds of the library and would be ignored in the release build"); + throw new JsonException($"A property '{@property.Name}' defined as non-nullable but received as null from the service. This exception only happens in DEBUG builds of the library and would be ignored in the release build"); } public static string GetRequiredString(this JsonElement element) { - var value = element.GetString(); + string value = element.GetString(); if (value == null) { throw new InvalidOperationException($"The requested operation requires an element of type 'String', but the target element has type '{element.ValueKind}'."); @@ -181,9 +179,6 @@ public static void WriteObjectValue(this Utf8JsonWriter writer, T value, Mode case IJsonModel jsonModel: jsonModel.Write(writer, options ?? WireOptions); break; - case IUtf8JsonSerializable serializable: - serializable.Write(writer); - break; case byte[] bytes: writer.WriteBase64StringValue(bytes); break; @@ -259,151 +254,5 @@ public static void WriteObjectValue(this Utf8JsonWriter writer, object value, Mo { writer.WriteObjectValue(value, options); } - - internal static bool IsSentinelValue(BinaryData value) - { - ReadOnlySpan sentinelSpan = SentinelValue.ToMemory().Span; - ReadOnlySpan valueSpan = value.ToMemory().Span; - return sentinelSpan.SequenceEqual(valueSpan); - } - - internal static class TypeFormatters - { - private const string RoundtripZFormat = "yyyy-MM-ddTHH:mm:ss.fffffffZ"; - public const string DefaultNumberFormat = "G"; - - public static string ToString(bool value) => value ? "true" : "false"; - - public static string ToString(DateTime value, string format) => value.Kind switch - { - DateTimeKind.Utc => ToString((DateTimeOffset)value, format), - _ => throw new NotSupportedException($"DateTime {value} has a Kind of {value.Kind}. Azure SDK requires it to be UTC. You can call DateTime.SpecifyKind to change Kind property value to DateTimeKind.Utc.") - }; - - public static string ToString(DateTimeOffset value, string format) => format switch - { - "D" => value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), - "U" => value.ToUnixTimeSeconds().ToString(CultureInfo.InvariantCulture), - "O" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), - "o" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), - "R" => value.ToString("r", CultureInfo.InvariantCulture), - _ => value.ToString(format, CultureInfo.InvariantCulture) - }; - - public static string ToString(TimeSpan value, string format) => format switch - { - "P" => XmlConvert.ToString(value), - _ => value.ToString(format, CultureInfo.InvariantCulture) - }; - - public static string ToString(byte[] value, string format) => format switch - { - "U" => ToBase64UrlString(value), - "D" => Convert.ToBase64String(value), - _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) - }; - - public static string ToBase64UrlString(byte[] value) - { - int numWholeOrPartialInputBlocks = checked(value.Length + 2) / 3; - int size = checked(numWholeOrPartialInputBlocks * 4); - char[] output = new char[size]; - - int numBase64Chars = Convert.ToBase64CharArray(value, 0, value.Length, output, 0); - - int i = 0; - for (; i < numBase64Chars; i++) - { - char ch = output[i]; - if (ch == '+') - { - output[i] = '-'; - } - else - { - if (ch == '/') - { - output[i] = '_'; - } - else - { - if (ch == '=') - { - break; - } - } - } - } - - return new string(output, 0, i); - } - - public static byte[] FromBase64UrlString(string value) - { - int paddingCharsToAdd = (value.Length % 4) switch - { - 0 => 0, - 2 => 2, - 3 => 1, - _ => throw new InvalidOperationException("Malformed input") - }; - char[] output = new char[(value.Length + paddingCharsToAdd)]; - int i = 0; - for (; i < value.Length; i++) - { - char ch = value[i]; - if (ch == '-') - { - output[i] = '+'; - } - else - { - if (ch == '_') - { - output[i] = '/'; - } - else - { - output[i] = ch; - } - } - } - - for (; i < output.Length; i++) - { - output[i] = '='; - } - - return Convert.FromBase64CharArray(output, 0, output.Length); - } - - public static DateTimeOffset ParseDateTimeOffset(string value, string format) => format switch - { - "U" => DateTimeOffset.FromUnixTimeSeconds(long.Parse(value, CultureInfo.InvariantCulture)), - _ => DateTimeOffset.Parse(value, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal) - }; - - public static TimeSpan ParseTimeSpan(string value, string format) => format switch - { - "P" => XmlConvert.ToTimeSpan(value), - _ => TimeSpan.ParseExact(value, format, CultureInfo.InvariantCulture) - }; - - public static string ConvertToString(object value, string format = null) => value switch - { - null => "null", - string s => s, - bool b => ToString(b), - int or float or double or long or decimal => ((IFormattable)value).ToString(DefaultNumberFormat, CultureInfo.InvariantCulture), - byte[] b0 when format != null => ToString(b0, format), - IEnumerable s0 => string.Join(",", s0), - DateTimeOffset dateTime when format != null => ToString(dateTime, format), - TimeSpan timeSpan when format != null => ToString(timeSpan, format), - TimeSpan timeSpan0 => XmlConvert.ToString(timeSpan0), - Guid guid => guid.ToString(), - BinaryData binaryData => ConvertToString(binaryData.ToArray(), format), - _ => value.ToString() - }; - } } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Internal/Optional.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Internal/Optional.cs index 3065e994c1e5..94c0f22f9702 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Internal/Optional.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Internal/Optional.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.HardwareSecurityModules { - internal static class Optional + internal static partial class Optional { public static bool IsCollectionDefined(IEnumerable collection) { @@ -28,7 +28,7 @@ public static bool IsCollectionDefined(IReadOnlyDictionary(T? value) - where T : struct + where T : struct { return value.HasValue; } @@ -38,14 +38,14 @@ public static bool IsDefined(object value) return value != null; } - public static bool IsDefined(JsonElement value) + public static bool IsDefined(string value) { - return value.ValueKind != JsonValueKind.Undefined; + return value != null; } - public static bool IsDefined(string value) + public static bool IsDefined(JsonElement value) { - return value != null; + return value.ValueKind != JsonValueKind.Undefined; } } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Internal/PageableWrapper.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Internal/PageableWrapper.cs new file mode 100644 index 000000000000..3d3576bddd3a --- /dev/null +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Internal/PageableWrapper.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure; + +namespace Azure.ResourceManager.HardwareSecurityModules +{ + internal partial class PageableWrapper : Pageable + { + /// The source pageable value of type Pageable<T>. + private Pageable _source; + /// The converter function from T to U. + private Func _converter; + + /// Initializes a new instance of the PageableWrapper class. + /// The source pageable value of type Pageable<T>. + /// The converter function from T to U. + public PageableWrapper(Pageable source, Func converter) + { + _source = source; + _converter = converter; + } + + /// Converts the pages from Pageable to Page. + /// A continuation token from a previous response. + /// An optional hint to specify the desired size of each page. + /// An enumerable of pages containing converted items of type U. + public override IEnumerable> AsPages(string continuationToken, int? pageSizeHint) + { + foreach (Page page in _source.AsPages(continuationToken, pageSizeHint)) + { + List convertedItems = new List(); + foreach (T item in page.Values) + { + convertedItems.Add(_converter.Invoke(item)); + } + yield return Page.FromValues(convertedItems, page.ContinuationToken, page.GetRawResponse()); + } + } + } +} diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Internal/RawRequestUriBuilderExtensions.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Internal/RawRequestUriBuilderExtensions.cs new file mode 100644 index 000000000000..79f2e96ad90c --- /dev/null +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Internal/RawRequestUriBuilderExtensions.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Linq; +using Azure.Core; + +namespace Azure.ResourceManager.HardwareSecurityModules +{ + internal static partial class RawRequestUriBuilderExtensions + { + public static void AppendQueryDelimited(this RawRequestUriBuilder builder, string name, IEnumerable value, string delimiter, SerializationFormat format = SerializationFormat.Default, bool escape = true) + { + delimiter ??= ","; + IEnumerable stringValues = value.Select(v => TypeFormatters.ConvertToString(v, format)); + builder.AppendQuery(name, string.Join(delimiter, stringValues), escape); + } + } +} diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Internal/RequestContextExtensions.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Internal/RequestContextExtensions.cs new file mode 100644 index 000000000000..948a6d279daf --- /dev/null +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Internal/RequestContextExtensions.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using Azure; + +namespace Azure.ResourceManager.HardwareSecurityModules +{ + internal static partial class RequestContextExtensions + { + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + public static ValueTuple Parse(this RequestContext context) + { + if (context == null) + { + return (CancellationToken.None, ErrorOptions.Default); + } + return (context.CancellationToken, context.ErrorOptions); + } + } +} diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Internal/SerializationFormat.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Internal/SerializationFormat.cs new file mode 100644 index 000000000000..dbb699297704 --- /dev/null +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Internal/SerializationFormat.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.HardwareSecurityModules +{ + internal enum SerializationFormat + { + /// The default serialization format. + Default = 0, + /// The RFC1123 date time format. + DateTime_RFC1123 = 1, + /// The RFC3339 date time format. + DateTime_RFC3339 = 2, + /// The RFC7231 date time format. + DateTime_RFC7231 = 3, + /// The ISO8601 date time format. + DateTime_ISO8601 = 4, + /// The Unix date time format. + DateTime_Unix = 5, + /// The ISO8601 date format. + Date_ISO8601 = 6, + /// The ISO8601 duration format. + Duration_ISO8601 = 7, + /// The constant duration format. + Duration_Constant = 8, + /// The seconds duration format. + Duration_Seconds = 9, + /// The seconds duration format with float precision. + Duration_Seconds_Float = 10, + /// The seconds duration format with double precision. + Duration_Seconds_Double = 11, + /// The milliseconds duration format. + Duration_Milliseconds = 12, + /// The milliseconds duration format with float precision. + Duration_Milliseconds_Float = 13, + /// The milliseconds duration format with double precision. + Duration_Milliseconds_Double = 14, + /// The ISO8601 time format. + Time_ISO8601 = 15, + /// The Base64Url bytes format. + Bytes_Base64Url = 16, + /// The Base64 bytes format. + Bytes_Base64 = 17 + } +} diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Internal/TypeFormatters.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Internal/TypeFormatters.cs new file mode 100644 index 000000000000..45cdea62e56f --- /dev/null +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Internal/TypeFormatters.cs @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Xml; + +namespace Azure.ResourceManager.HardwareSecurityModules +{ + internal static partial class TypeFormatters + { + private const string RoundtripZFormat = "yyyy-MM-ddTHH:mm:ss.fffffffZ"; + public const string DefaultNumberFormat = "G"; + + public static string ToString(bool value) => value ? "true" : "false"; + + public static string ToString(DateTime value, string format) => value.Kind switch + { + DateTimeKind.Utc => ToString((DateTimeOffset)value, format), + _ => throw new NotSupportedException($"DateTime {value} has a Kind of {value.Kind}. Generated clients require it to be UTC. You can call DateTime.SpecifyKind to change Kind property value to DateTimeKind.Utc.") + }; + + public static string ToString(DateTimeOffset value, string format) => format switch + { + "D" => value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), + "U" => value.ToUnixTimeSeconds().ToString(CultureInfo.InvariantCulture), + "O" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "o" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "R" => value.ToString("r", CultureInfo.InvariantCulture), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(TimeSpan value, string format) => format switch + { + "P" => XmlConvert.ToString(value), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(byte[] value, string format) => format switch + { + "U" => ToBase64UrlString(value), + "D" => Convert.ToBase64String(value), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + + public static string ToBase64UrlString(byte[] value) + { + int numWholeOrPartialInputBlocks = checked (value.Length + 2) / 3; + int size = checked (numWholeOrPartialInputBlocks * 4); + char[] output = new char[size]; + + int numBase64Chars = Convert.ToBase64CharArray(value, 0, value.Length, output, 0); + + int i = 0; + for (; i < numBase64Chars; i++) + { + char ch = output[i]; + if (ch == '+') + { + output[i] = '-'; + } + else + { + if (ch == '/') + { + output[i] = '_'; + } + else + { + if (ch == '=') + { + break; + } + } + } + } + + return new string(output, 0, i); + } + + public static byte[] FromBase64UrlString(string value) + { + int paddingCharsToAdd = (value.Length % 4) switch + { + 0 => 0, + 2 => 2, + 3 => 1, + _ => throw new InvalidOperationException("Malformed input") + }; + char[] output = new char[(value.Length + paddingCharsToAdd)]; + int i = 0; + for (; i < value.Length; i++) + { + char ch = value[i]; + if (ch == '-') + { + output[i] = '+'; + } + else + { + if (ch == '_') + { + output[i] = '/'; + } + else + { + output[i] = ch; + } + } + } + + for (; i < output.Length; i++) + { + output[i] = '='; + } + + return Convert.FromBase64CharArray(output, 0, output.Length); + } + + public static DateTimeOffset ParseDateTimeOffset(string value, string format) => format switch + { + "U" => DateTimeOffset.FromUnixTimeSeconds(long.Parse(value, CultureInfo.InvariantCulture)), + _ => DateTimeOffset.Parse(value, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal) + }; + + public static TimeSpan ParseTimeSpan(string value, string format) => format switch + { + "P" => XmlConvert.ToTimeSpan(value), + _ => TimeSpan.ParseExact(value, format, CultureInfo.InvariantCulture) + }; + + public static string ToFormatSpecifier(SerializationFormat format) => format switch + { + SerializationFormat.DateTime_RFC1123 => "R", + SerializationFormat.DateTime_RFC3339 => "O", + SerializationFormat.DateTime_RFC7231 => "R", + SerializationFormat.DateTime_ISO8601 => "O", + SerializationFormat.Date_ISO8601 => "D", + SerializationFormat.DateTime_Unix => "U", + SerializationFormat.Bytes_Base64Url => "U", + SerializationFormat.Bytes_Base64 => "D", + SerializationFormat.Duration_ISO8601 => "P", + SerializationFormat.Duration_Constant => "c", + SerializationFormat.Duration_Seconds => "%s", + SerializationFormat.Duration_Seconds_Float => "s\\.FFF", + SerializationFormat.Duration_Seconds_Double => "s\\.FFFFFF", + SerializationFormat.Time_ISO8601 => "T", + _ => null + }; + + public static string ConvertToString(object value, SerializationFormat format = SerializationFormat.Default) + { + string formatSpecifier = ToFormatSpecifier(format); + + return value switch + { + null => "null", + string s => s, + bool b => ToString(b), + int or float or double or long or decimal => ((IFormattable)value).ToString(DefaultNumberFormat, CultureInfo.InvariantCulture), + byte[] b0 when formatSpecifier != null => ToString(b0, formatSpecifier), + IEnumerable s0 => string.Join(",", s0), + DateTimeOffset dateTime when formatSpecifier != null => ToString(dateTime, formatSpecifier), + TimeSpan timeSpan when format == SerializationFormat.Duration_Seconds => Convert.ToInt32(timeSpan.TotalSeconds).ToString(CultureInfo.InvariantCulture), + TimeSpan timeSpan0 when format == SerializationFormat.Duration_Seconds_Float || format == SerializationFormat.Duration_Seconds_Double => timeSpan0.TotalSeconds.ToString(CultureInfo.InvariantCulture), + TimeSpan timeSpan1 when format == SerializationFormat.Duration_Milliseconds => Convert.ToInt32(timeSpan1.TotalMilliseconds).ToString(CultureInfo.InvariantCulture), + TimeSpan timeSpan2 when format == SerializationFormat.Duration_Milliseconds_Float || format == SerializationFormat.Duration_Milliseconds_Double => timeSpan2.TotalMilliseconds.ToString(CultureInfo.InvariantCulture), + TimeSpan timeSpan3 when formatSpecifier != null => ToString(timeSpan3, formatSpecifier), + TimeSpan timeSpan4 => XmlConvert.ToString(timeSpan4), + Guid guid => guid.ToString(), + BinaryData binaryData => ConvertToString(binaryData.ToArray(), format), + _ => value.ToString() + }; + } + } +} diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Internal/Utf8JsonRequestContent.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Internal/Utf8JsonRequestContent.cs index 654e639e976a..257ac150e3e1 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Internal/Utf8JsonRequestContent.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Internal/Utf8JsonRequestContent.cs @@ -13,7 +13,7 @@ namespace Azure.ResourceManager.HardwareSecurityModules { - internal class Utf8JsonRequestContent : RequestContent + internal partial class Utf8JsonRequestContent : RequestContent { private readonly MemoryStream _stream; private readonly RequestContent _content; @@ -25,20 +25,26 @@ public Utf8JsonRequestContent() JsonWriter = new Utf8JsonWriter(_stream); } + /// Gets the JsonWriter. public Utf8JsonWriter JsonWriter { get; } + /// The stream containing the data to be written. + /// The cancellation token to use. public override async Task WriteToAsync(Stream stream, CancellationToken cancellationToken = default) { await JsonWriter.FlushAsync().ConfigureAwait(false); await _content.WriteToAsync(stream, cancellationToken).ConfigureAwait(false); } + /// The stream containing the data to be written. + /// The cancellation token to use. public override void WriteTo(Stream stream, CancellationToken cancellationToken = default) { JsonWriter.Flush(); _content.WriteTo(stream, cancellationToken); } + /// public override bool TryComputeLength(out long length) { length = JsonWriter.BytesCommitted + JsonWriter.BytesPending; diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/LongRunningOperation/CloudHsmClusterBackupResultOperationSource.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/LongRunningOperation/CloudHsmClusterBackupResultOperationSource.cs index a6048deb8c9f..084de8cadd1e 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/LongRunningOperation/CloudHsmClusterBackupResultOperationSource.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/LongRunningOperation/CloudHsmClusterBackupResultOperationSource.cs @@ -8,23 +8,38 @@ using System.Text.Json; using System.Threading; using System.Threading.Tasks; +using Azure; using Azure.Core; using Azure.ResourceManager.HardwareSecurityModules.Models; namespace Azure.ResourceManager.HardwareSecurityModules { - internal class CloudHsmClusterBackupResultOperationSource : IOperationSource + /// + internal partial class CloudHsmClusterBackupResultOperationSource : IOperationSource { + /// + internal CloudHsmClusterBackupResultOperationSource() + { + } + + /// The response from the service. + /// The cancellation token to use. + /// CloudHsmClusterBackupResult IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) { - using var document = JsonDocument.Parse(response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - return CloudHsmClusterBackupResult.DeserializeCloudHsmClusterBackupResult(document.RootElement); + using JsonDocument document = JsonDocument.Parse(response.ContentStream); + CloudHsmClusterBackupResult result = CloudHsmClusterBackupResult.DeserializeCloudHsmClusterBackupResult(document.RootElement, ModelSerializationExtensions.WireOptions); + return result; } + /// The response from the service. + /// The cancellation token to use. + /// async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) { - using var document = await JsonDocument.ParseAsync(response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - return CloudHsmClusterBackupResult.DeserializeCloudHsmClusterBackupResult(document.RootElement); + using JsonDocument document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + CloudHsmClusterBackupResult result = CloudHsmClusterBackupResult.DeserializeCloudHsmClusterBackupResult(document.RootElement, ModelSerializationExtensions.WireOptions); + return result; } } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/LongRunningOperation/CloudHsmClusterOperationSource.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/LongRunningOperation/CloudHsmClusterOperationSource.cs index 0f57cf7533b0..2796f25ce45d 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/LongRunningOperation/CloudHsmClusterOperationSource.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/LongRunningOperation/CloudHsmClusterOperationSource.cs @@ -5,32 +5,45 @@ #nullable disable -using System.ClientModel.Primitives; +using System.Text.Json; using System.Threading; using System.Threading.Tasks; +using Azure; using Azure.Core; +using Azure.ResourceManager; namespace Azure.ResourceManager.HardwareSecurityModules { - internal class CloudHsmClusterOperationSource : IOperationSource + /// + internal partial class CloudHsmClusterOperationSource : IOperationSource { private readonly ArmClient _client; + /// + /// internal CloudHsmClusterOperationSource(ArmClient client) { _client = client; } + /// The response from the service. + /// The cancellation token to use. + /// CloudHsmClusterResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) { - var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerHardwareSecurityModulesContext.Default); + using JsonDocument document = JsonDocument.Parse(response.ContentStream); + CloudHsmClusterData data = CloudHsmClusterData.DeserializeCloudHsmClusterData(document.RootElement, ModelSerializationExtensions.WireOptions); return new CloudHsmClusterResource(_client, data); } + /// The response from the service. + /// The cancellation token to use. + /// async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) { - var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerHardwareSecurityModulesContext.Default); - return await Task.FromResult(new CloudHsmClusterResource(_client, data)).ConfigureAwait(false); + using JsonDocument document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + CloudHsmClusterData data = CloudHsmClusterData.DeserializeCloudHsmClusterData(document.RootElement, ModelSerializationExtensions.WireOptions); + return new CloudHsmClusterResource(_client, data); } } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/LongRunningOperation/CloudHsmClusterRestoreResultOperationSource.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/LongRunningOperation/CloudHsmClusterRestoreResultOperationSource.cs index 68e1134c15f0..1fe3ea8b8ff9 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/LongRunningOperation/CloudHsmClusterRestoreResultOperationSource.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/LongRunningOperation/CloudHsmClusterRestoreResultOperationSource.cs @@ -8,23 +8,38 @@ using System.Text.Json; using System.Threading; using System.Threading.Tasks; +using Azure; using Azure.Core; using Azure.ResourceManager.HardwareSecurityModules.Models; namespace Azure.ResourceManager.HardwareSecurityModules { - internal class CloudHsmClusterRestoreResultOperationSource : IOperationSource + /// + internal partial class CloudHsmClusterRestoreResultOperationSource : IOperationSource { + /// + internal CloudHsmClusterRestoreResultOperationSource() + { + } + + /// The response from the service. + /// The cancellation token to use. + /// CloudHsmClusterRestoreResult IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) { - using var document = JsonDocument.Parse(response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - return CloudHsmClusterRestoreResult.DeserializeCloudHsmClusterRestoreResult(document.RootElement); + using JsonDocument document = JsonDocument.Parse(response.ContentStream); + CloudHsmClusterRestoreResult result = CloudHsmClusterRestoreResult.DeserializeCloudHsmClusterRestoreResult(document.RootElement, ModelSerializationExtensions.WireOptions); + return result; } + /// The response from the service. + /// The cancellation token to use. + /// async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) { - using var document = await JsonDocument.ParseAsync(response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - return CloudHsmClusterRestoreResult.DeserializeCloudHsmClusterRestoreResult(document.RootElement); + using JsonDocument document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + CloudHsmClusterRestoreResult result = CloudHsmClusterRestoreResult.DeserializeCloudHsmClusterRestoreResult(document.RootElement, ModelSerializationExtensions.WireOptions); + return result; } } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/LongRunningOperation/DedicatedHsmOperationSource.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/LongRunningOperation/DedicatedHsmOperationSource.cs index 0bff2966d9ad..023e818ad38d 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/LongRunningOperation/DedicatedHsmOperationSource.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/LongRunningOperation/DedicatedHsmOperationSource.cs @@ -5,32 +5,45 @@ #nullable disable -using System.ClientModel.Primitives; +using System.Text.Json; using System.Threading; using System.Threading.Tasks; +using Azure; using Azure.Core; +using Azure.ResourceManager; namespace Azure.ResourceManager.HardwareSecurityModules { - internal class DedicatedHsmOperationSource : IOperationSource + /// + internal partial class DedicatedHsmOperationSource : IOperationSource { private readonly ArmClient _client; + /// + /// internal DedicatedHsmOperationSource(ArmClient client) { _client = client; } + /// The response from the service. + /// The cancellation token to use. + /// DedicatedHsmResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) { - var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerHardwareSecurityModulesContext.Default); + using JsonDocument document = JsonDocument.Parse(response.ContentStream); + DedicatedHsmData data = DedicatedHsmData.DeserializeDedicatedHsmData(document.RootElement, ModelSerializationExtensions.WireOptions); return new DedicatedHsmResource(_client, data); } + /// The response from the service. + /// The cancellation token to use. + /// async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) { - var data = ModelReaderWriter.Read(response.Content, ModelReaderWriterOptions.Json, AzureResourceManagerHardwareSecurityModulesContext.Default); - return await Task.FromResult(new DedicatedHsmResource(_client, data)).ConfigureAwait(false); + using JsonDocument document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + DedicatedHsmData data = DedicatedHsmData.DeserializeDedicatedHsmData(document.RootElement, ModelSerializationExtensions.WireOptions); + return new DedicatedHsmResource(_client, data); } } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/LongRunningOperation/HardwareSecurityModulesArmOperation.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/LongRunningOperation/HardwareSecurityModulesArmOperation.cs index fcb06559a40b..27332ee74822 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/LongRunningOperation/HardwareSecurityModulesArmOperation.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/LongRunningOperation/HardwareSecurityModulesArmOperation.cs @@ -6,18 +6,16 @@ #nullable disable using System; -using System.ClientModel.Primitives; -using System.Text.Json; using System.Threading; using System.Threading.Tasks; +using Azure; using Azure.Core; using Azure.Core.Pipeline; +using Azure.ResourceManager; namespace Azure.ResourceManager.HardwareSecurityModules { -#pragma warning disable SA1649 // File name should match first type name - internal class HardwareSecurityModulesArmOperation : ArmOperation -#pragma warning restore SA1649 // File name should match first type name + internal partial class HardwareSecurityModulesArmOperation : ArmOperation { private readonly OperationInternal _operation; private readonly RehydrationToken? _completeRehydrationToken; @@ -29,6 +27,9 @@ protected HardwareSecurityModulesArmOperation() { } + /// + /// The operation response. + /// The token to rehydrate the operation. internal HardwareSecurityModulesArmOperation(Response response, RehydrationToken? rehydrationToken = null) { _operation = OperationInternal.Succeeded(response); @@ -36,12 +37,20 @@ internal HardwareSecurityModulesArmOperation(Response response, RehydrationToken _operationId = GetOperationId(rehydrationToken); } + /// + /// The instance of . + /// The instance of . + /// The operation request. + /// The operation response. + /// The finalStateVia of the operation. + /// If should skip Api version override. + /// The Api version override value. internal HardwareSecurityModulesArmOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia, bool skipApiVersionOverride = false, string apiVersionOverrideValue = null) { - var nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); - if (nextLinkOperation is NextLinkOperationImplementation nextLinkOperationValue) + IOperation nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); + if (nextLinkOperation is NextLinkOperationImplementation nextLinkOperationImplementation) { - _nextLinkOperation = nextLinkOperationValue; + _nextLinkOperation = nextLinkOperationImplementation; _operationId = _nextLinkOperation.OperationId; } else @@ -49,48 +58,49 @@ internal HardwareSecurityModulesArmOperation(ClientDiagnostics clientDiagnostics _completeRehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(request.Method, request.Uri.ToUri(), response, finalStateVia); _operationId = GetOperationId(_completeRehydrationToken); } - _operation = new OperationInternal(nextLinkOperation, clientDiagnostics, response, "HardwareSecurityModulesArmOperation", fallbackStrategy: new SequentialDelayStrategy()); + _operation = new OperationInternal( + nextLinkOperation, + clientDiagnostics, + response, + "HardwareSecurityModulesArmOperation", + null, + new SequentialDelayStrategy()); } + /// Gets the Id. + public override string Id => _operationId ?? NextLinkOperationImplementation.NotSet; + + /// Gets the HasCompleted. + public override bool HasCompleted => _operation.HasCompleted; + + /// The token to rehydrate a long-running operation. private string GetOperationId(RehydrationToken? rehydrationToken) { - if (rehydrationToken is null) - { - return null; - } - var data = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json, AzureResourceManagerHardwareSecurityModulesContext.Default); - using var document = JsonDocument.Parse(data); - var lroDetails = document.RootElement; - return lroDetails.GetProperty("id").GetString(); + return rehydrationToken?.Id; } - /// - public override string Id => _operationId ?? NextLinkOperationImplementation.NotSet; - /// + /// public override RehydrationToken? GetRehydrationToken() => _nextLinkOperation?.GetRehydrationToken() ?? _completeRehydrationToken; - /// - public override bool HasCompleted => _operation.HasCompleted; - - /// + /// public override Response GetRawResponse() => _operation.RawResponse; - /// + /// public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); - /// + /// public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); - /// + /// public override Response WaitForCompletionResponse(CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponse(cancellationToken); - /// + /// public override Response WaitForCompletionResponse(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponse(pollingInterval, cancellationToken); - /// + /// public override ValueTask WaitForCompletionResponseAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponseAsync(cancellationToken); - /// + /// public override ValueTask WaitForCompletionResponseAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponseAsync(pollingInterval, cancellationToken); } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/LongRunningOperation/HardwareSecurityModulesArmOperationOfT.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/LongRunningOperation/HardwareSecurityModulesArmOperationOfT.cs index 04a1a10a2e3a..cbffc5ff4375 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/LongRunningOperation/HardwareSecurityModulesArmOperationOfT.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/LongRunningOperation/HardwareSecurityModulesArmOperationOfT.cs @@ -6,18 +6,16 @@ #nullable disable using System; -using System.ClientModel.Primitives; -using System.Text.Json; using System.Threading; using System.Threading.Tasks; +using Azure; using Azure.Core; using Azure.Core.Pipeline; +using Azure.ResourceManager; namespace Azure.ResourceManager.HardwareSecurityModules { -#pragma warning disable SA1649 // File name should match first type name - internal class HardwareSecurityModulesArmOperation : ArmOperation -#pragma warning restore SA1649 // File name should match first type name + internal partial class HardwareSecurityModulesArmOperation : ArmOperation { private readonly OperationInternal _operation; private readonly RehydrationToken? _completeRehydrationToken; @@ -29,6 +27,9 @@ protected HardwareSecurityModulesArmOperation() { } + /// + /// The operation response. + /// The token to rehydrate the operation. internal HardwareSecurityModulesArmOperation(Response response, RehydrationToken? rehydrationToken = null) { _operation = OperationInternal.Succeeded(response.GetRawResponse(), response.Value); @@ -36,12 +37,21 @@ internal HardwareSecurityModulesArmOperation(Response response, RehydrationTo _operationId = GetOperationId(rehydrationToken); } + /// + /// The instance of . + /// The instance of . + /// The instance of . + /// The operation request. + /// The operation response. + /// The finalStateVia of the operation. + /// If should skip Api version override. + /// The Api version override value. internal HardwareSecurityModulesArmOperation(IOperationSource source, ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia, bool skipApiVersionOverride = false, string apiVersionOverrideValue = null) { - var nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); - if (nextLinkOperation is NextLinkOperationImplementation nextLinkOperationValue) + IOperation nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); + if (nextLinkOperation is NextLinkOperationImplementation nextLinkOperationImplementation) { - _nextLinkOperation = nextLinkOperationValue; + _nextLinkOperation = nextLinkOperationImplementation; _operationId = _nextLinkOperation.OperationId; } else @@ -49,54 +59,55 @@ internal HardwareSecurityModulesArmOperation(IOperationSource source, ClientD _completeRehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(request.Method, request.Uri.ToUri(), response, finalStateVia); _operationId = GetOperationId(_completeRehydrationToken); } - _operation = new OperationInternal(NextLinkOperationImplementation.Create(source, nextLinkOperation), clientDiagnostics, response, "HardwareSecurityModulesArmOperation", fallbackStrategy: new SequentialDelayStrategy()); + _operation = new OperationInternal( + NextLinkOperationImplementation.Create(source, nextLinkOperation), + clientDiagnostics, + response, + "HardwareSecurityModulesArmOperation", + null, + new SequentialDelayStrategy()); } - private string GetOperationId(RehydrationToken? rehydrationToken) - { - if (rehydrationToken is null) - { - return null; - } - var data = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json, AzureResourceManagerHardwareSecurityModulesContext.Default); - using var document = JsonDocument.Parse(data); - var lroDetails = document.RootElement; - return lroDetails.GetProperty("id").GetString(); - } - /// + /// Gets the Id. public override string Id => _operationId ?? NextLinkOperationImplementation.NotSet; - /// - public override RehydrationToken? GetRehydrationToken() => _nextLinkOperation?.GetRehydrationToken() ?? _completeRehydrationToken; - - /// + /// Gets the Value. public override T Value => _operation.Value; - /// + /// Gets the HasValue. public override bool HasValue => _operation.HasValue; - /// + /// Gets the HasCompleted. public override bool HasCompleted => _operation.HasCompleted; - /// + /// The token to rehydrate a long-running operation. + private string GetOperationId(RehydrationToken? rehydrationToken) + { + return rehydrationToken?.Id; + } + + /// + public override RehydrationToken? GetRehydrationToken() => _nextLinkOperation?.GetRehydrationToken() ?? _completeRehydrationToken; + + /// public override Response GetRawResponse() => _operation.RawResponse; - /// + /// public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); - /// + /// public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); - /// + /// public override Response WaitForCompletion(CancellationToken cancellationToken = default) => _operation.WaitForCompletion(cancellationToken); - /// + /// public override Response WaitForCompletion(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletion(pollingInterval, cancellationToken); - /// + /// public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken); - /// + /// public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken); } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/ApiEntityReference.Serialization.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/ApiEntityReference.Serialization.cs index de9d730cd72c..34767397bd51 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/ApiEntityReference.Serialization.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/ApiEntityReference.Serialization.cs @@ -10,13 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using Azure.Core; +using Azure.ResourceManager.HardwareSecurityModules; namespace Azure.ResourceManager.HardwareSecurityModules.Models { - internal partial class ApiEntityReference : IUtf8JsonSerializable, IJsonModel + /// The API entity reference. + internal partial class ApiEntityReference : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,26 +30,25 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit /// 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; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiEntityReference)} does not support writing '{format}' format."); } - if (Optional.IsDefined(ResourceId)) { writer.WritePropertyName("resourceId"u8); writer.WriteStringValue(ResourceId); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -56,53 +57,59 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ApiEntityReference IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + ApiEntityReference IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ApiEntityReference JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(ApiEntityReference)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeApiEntityReference(document.RootElement, options); } - internal static ApiEntityReference DeserializeApiEntityReference(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static ApiEntityReference DeserializeApiEntityReference(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } ResourceIdentifier resourceId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("resourceId"u8)) + if (prop.NameEquals("resourceId"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - resourceId = new ResourceIdentifier(property.Value.GetString()); + resourceId = new ResourceIdentifier(prop.Value.GetString()); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new ApiEntityReference(resourceId, serializedAdditionalRawData); + return new ApiEntityReference(resourceId, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -112,15 +119,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions } } - ApiEntityReference IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + ApiEntityReference IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ApiEntityReference PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeApiEntityReference(document.RootElement, options); } default: @@ -128,6 +140,7 @@ ApiEntityReference IPersistableModel.Create(BinaryData data, } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/ApiEntityReference.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/ApiEntityReference.cs index f109f8b84a04..4adf3ca50ef0 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/ApiEntityReference.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/ApiEntityReference.cs @@ -14,37 +14,8 @@ namespace Azure.ResourceManager.HardwareSecurityModules.Models /// The API entity reference. internal partial class ApiEntityReference { - /// - /// 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; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . public ApiEntityReference() @@ -53,11 +24,11 @@ public ApiEntityReference() /// Initializes a new instance of . /// The Azure resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... - /// Keeps track of any properties unknown to the library. - internal ApiEntityReference(ResourceIdentifier resourceId, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal ApiEntityReference(ResourceIdentifier resourceId, IDictionary additionalBinaryDataProperties) { ResourceId = resourceId; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The Azure resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/AutoGeneratedDomainNameLabelScope.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/AutoGeneratedDomainNameLabelScope.cs index a356348e0e51..41a4c8ca5efa 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/AutoGeneratedDomainNameLabelScope.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/AutoGeneratedDomainNameLabelScope.cs @@ -7,6 +7,7 @@ using System; using System.ComponentModel; +using Azure.ResourceManager.HardwareSecurityModules; namespace Azure.ResourceManager.HardwareSecurityModules.Models { @@ -14,44 +15,63 @@ namespace Azure.ResourceManager.HardwareSecurityModules.Models public readonly partial struct AutoGeneratedDomainNameLabelScope : IEquatable { private readonly string _value; + private const string TenantReuseValue = "TenantReuse"; + private const string SubscriptionReuseValue = "SubscriptionReuse"; + private const string ResourceGroupReuseValue = "ResourceGroupReuse"; + private const string NoReuseValue = "NoReuse"; /// Initializes a new instance of . + /// The value. /// is null. public AutoGeneratedDomainNameLabelScope(string value) { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } + Argument.AssertNotNull(value, nameof(value)); - private const string TenantReuseValue = "TenantReuse"; - private const string SubscriptionReuseValue = "SubscriptionReuse"; - private const string ResourceGroupReuseValue = "ResourceGroupReuse"; - private const string NoReuseValue = "NoReuse"; + _value = value; + } - /// TenantReuse. + /// Gets the TenantReuse. public static AutoGeneratedDomainNameLabelScope TenantReuse { get; } = new AutoGeneratedDomainNameLabelScope(TenantReuseValue); - /// SubscriptionReuse. + + /// Gets the SubscriptionReuse. public static AutoGeneratedDomainNameLabelScope SubscriptionReuse { get; } = new AutoGeneratedDomainNameLabelScope(SubscriptionReuseValue); - /// ResourceGroupReuse. + + /// Gets the ResourceGroupReuse. public static AutoGeneratedDomainNameLabelScope ResourceGroupReuse { get; } = new AutoGeneratedDomainNameLabelScope(ResourceGroupReuseValue); - /// NoReuse. + + /// Gets the NoReuse. public static AutoGeneratedDomainNameLabelScope NoReuse { get; } = new AutoGeneratedDomainNameLabelScope(NoReuseValue); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(AutoGeneratedDomainNameLabelScope left, AutoGeneratedDomainNameLabelScope right) => left.Equals(right); + /// Determines if two values are not the same. + /// The left value to compare. + /// The right value to compare. public static bool operator !=(AutoGeneratedDomainNameLabelScope left, AutoGeneratedDomainNameLabelScope right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator AutoGeneratedDomainNameLabelScope(string value) => new AutoGeneratedDomainNameLabelScope(value); - /// + /// Converts a string to a . + /// The value. + public static implicit operator AutoGeneratedDomainNameLabelScope?(string value) => value == null ? null : new AutoGeneratedDomainNameLabelScope(value); + + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is AutoGeneratedDomainNameLabelScope other && Equals(other); - /// + + /// public bool Equals(AutoGeneratedDomainNameLabelScope other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// + + /// public override string ToString() => _value; } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/AzureResourceManagerHardwareSecurityModulesContext.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/AzureResourceManagerHardwareSecurityModulesContext.cs index 9ea28ad96062..eb3720222571 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/AzureResourceManagerHardwareSecurityModulesContext.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/AzureResourceManagerHardwareSecurityModulesContext.cs @@ -6,15 +6,15 @@ #nullable disable using System.ClientModel.Primitives; +using Azure; using Azure.ResourceManager.HardwareSecurityModules.Models; using Azure.ResourceManager.Models; -using Azure.ResourceManager.Resources.Models; namespace Azure.ResourceManager.HardwareSecurityModules { /// /// Context class which will be filled in by the System.ClientModel.SourceGeneration. - /// For more information see 'https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/System.ClientModel/src/docs/ModelReaderWriterContext.md' + /// For more information /// [ModelReaderWriterBuildable(typeof(ApiEntityReference))] [ModelReaderWriterBuildable(typeof(BackupRestoreBaseResultProperties))] @@ -52,8 +52,8 @@ namespace Azure.ResourceManager.HardwareSecurityModules [ModelReaderWriterBuildable(typeof(HardwareSecurityModulesPrivateEndpointConnectionListResult))] [ModelReaderWriterBuildable(typeof(HardwareSecurityModulesPrivateLinkResourceListResult))] [ModelReaderWriterBuildable(typeof(ManagedServiceIdentity))] + [ModelReaderWriterBuildable(typeof(PrivateEndpoint))] [ModelReaderWriterBuildable(typeof(ResponseError))] - [ModelReaderWriterBuildable(typeof(SubResource))] [ModelReaderWriterBuildable(typeof(SystemData))] [ModelReaderWriterBuildable(typeof(UserAssignedIdentity))] public partial class AzureResourceManagerHardwareSecurityModulesContext : ModelReaderWriterContext diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/BackupRestoreBaseResultProperties.Serialization.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/BackupRestoreBaseResultProperties.Serialization.cs index 773d7b3f92b6..306d1345e608 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/BackupRestoreBaseResultProperties.Serialization.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/BackupRestoreBaseResultProperties.Serialization.cs @@ -10,14 +10,16 @@ using System.Collections.Generic; using System.Text; using System.Text.Json; -using Azure.Core; +using Azure; +using Azure.ResourceManager.HardwareSecurityModules; namespace Azure.ResourceManager.HardwareSecurityModules.Models { - public partial class BackupRestoreBaseResultProperties : IUtf8JsonSerializable, IJsonModel + /// Backup and Restore operation common properties. + public partial class BackupRestoreBaseResultProperties : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -29,12 +31,11 @@ void IJsonModel.Write(Utf8JsonWriter 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; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(BackupRestoreBaseResultProperties)} does not support writing '{format}' format."); } - if (options.Format != "W" && Optional.IsDefined(Status)) { writer.WritePropertyName("status"u8); @@ -57,30 +58,23 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } if (options.Format != "W" && Optional.IsDefined(EndOn)) { - if (EndOn != null) - { - writer.WritePropertyName("endTime"u8); - writer.WriteStringValue(EndOn.Value, "O"); - } - else - { - writer.WriteNull("endTime"); - } + writer.WritePropertyName("endTime"u8); + writer.WriteStringValue(EndOn.Value, "O"); } if (Optional.IsDefined(JobId)) { writer.WritePropertyName("jobId"u8); writer.WriteStringValue(JobId); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -89,22 +83,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - BackupRestoreBaseResultProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + BackupRestoreBaseResultProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual BackupRestoreBaseResultProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(BackupRestoreBaseResultProperties)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeBackupRestoreBaseResultProperties(document.RootElement, options); } - internal static BackupRestoreBaseResultProperties DeserializeBackupRestoreBaseResultProperties(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static BackupRestoreBaseResultProperties DeserializeBackupRestoreBaseResultProperties(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -112,80 +111,81 @@ internal static BackupRestoreBaseResultProperties DeserializeBackupRestoreBaseRe BackupRestoreOperationStatus? status = default; string statusDetails = default; ResponseError error = default; - DateTimeOffset? startTime = default; - DateTimeOffset? endTime = default; + DateTimeOffset? startOn = default; + DateTimeOffset? endOn = default; string jobId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("status"u8)) + if (prop.NameEquals("status"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - status = new BackupRestoreOperationStatus(property.Value.GetString()); + status = new BackupRestoreOperationStatus(prop.Value.GetString()); continue; } - if (property.NameEquals("statusDetails"u8)) + if (prop.NameEquals("statusDetails"u8)) { - statusDetails = property.Value.GetString(); + statusDetails = prop.Value.GetString(); continue; } - if (property.NameEquals("error"u8)) + if (prop.NameEquals("error"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - error = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), options, AzureResourceManagerHardwareSecurityModulesContext.Default); + error = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(prop.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerHardwareSecurityModulesContext.Default); continue; } - if (property.NameEquals("startTime"u8)) + if (prop.NameEquals("startTime"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - startTime = property.Value.GetDateTimeOffset("O"); + startOn = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("endTime"u8)) + if (prop.NameEquals("endTime"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { - endTime = null; + endOn = null; continue; } - endTime = property.Value.GetDateTimeOffset("O"); + endOn = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("jobId"u8)) + if (prop.NameEquals("jobId"u8)) { - jobId = property.Value.GetString(); + jobId = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new BackupRestoreBaseResultProperties( status, statusDetails, error, - startTime, - endTime, + startOn, + endOn, jobId, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -195,15 +195,20 @@ BinaryData IPersistableModel.Write(ModelReade } } - BackupRestoreBaseResultProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + BackupRestoreBaseResultProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual BackupRestoreBaseResultProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeBackupRestoreBaseResultProperties(document.RootElement, options); } default: @@ -211,6 +216,7 @@ BackupRestoreBaseResultProperties IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/BackupRestoreBaseResultProperties.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/BackupRestoreBaseResultProperties.cs index 41a28ee48313..ab8b2872d21a 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/BackupRestoreBaseResultProperties.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/BackupRestoreBaseResultProperties.cs @@ -7,43 +7,15 @@ using System; using System.Collections.Generic; +using Azure; namespace Azure.ResourceManager.HardwareSecurityModules.Models { /// Backup and Restore operation common properties. public partial class BackupRestoreBaseResultProperties { - /// - /// 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 protected IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal BackupRestoreBaseResultProperties() @@ -57,8 +29,8 @@ internal BackupRestoreBaseResultProperties() /// The start time of the backup/restore operation in UTC. /// The end time of the backup/restore operation in UTC. /// Identifier for the backup/restore operation. - /// Keeps track of any properties unknown to the library. - internal BackupRestoreBaseResultProperties(BackupRestoreOperationStatus? status, string statusDetails, ResponseError error, DateTimeOffset? startOn, DateTimeOffset? endOn, string jobId, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal BackupRestoreBaseResultProperties(BackupRestoreOperationStatus? status, string statusDetails, ResponseError error, DateTimeOffset? startOn, DateTimeOffset? endOn, string jobId, IDictionary additionalBinaryDataProperties) { Status = status; StatusDetails = statusDetails; @@ -66,19 +38,24 @@ internal BackupRestoreBaseResultProperties(BackupRestoreOperationStatus? status, StartOn = startOn; EndOn = endOn; JobId = jobId; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Status of the backup/restore operation. public BackupRestoreOperationStatus? Status { get; } + /// The status details of backup/restore operation. public string StatusDetails { get; } + /// Error encountered, if any, during the backup/restore operation. public ResponseError Error { get; } + /// The start time of the backup/restore operation in UTC. public DateTimeOffset? StartOn { get; } + /// The end time of the backup/restore operation in UTC. public DateTimeOffset? EndOn { get; } + /// Identifier for the backup/restore operation. public string JobId { get; } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/BackupRestoreOperationStatus.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/BackupRestoreOperationStatus.cs index fc6b3edbd053..e4e207e66f65 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/BackupRestoreOperationStatus.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/BackupRestoreOperationStatus.cs @@ -7,6 +7,7 @@ using System; using System.ComponentModel; +using Azure.ResourceManager.HardwareSecurityModules; namespace Azure.ResourceManager.HardwareSecurityModules.Models { @@ -14,44 +15,63 @@ namespace Azure.ResourceManager.HardwareSecurityModules.Models public readonly partial struct BackupRestoreOperationStatus : IEquatable { private readonly string _value; + private const string InProgressValue = "InProgress"; + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string CancelledValue = "Cancelled"; /// Initializes a new instance of . + /// The value. /// is null. public BackupRestoreOperationStatus(string value) { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } + Argument.AssertNotNull(value, nameof(value)); - private const string InProgressValue = "InProgress"; - private const string SucceededValue = "Succeeded"; - private const string FailedValue = "Failed"; - private const string CancelledValue = "Cancelled"; + _value = value; + } - /// InProgress. + /// Gets the InProgress. public static BackupRestoreOperationStatus InProgress { get; } = new BackupRestoreOperationStatus(InProgressValue); - /// Succeeded. + + /// Gets the Succeeded. public static BackupRestoreOperationStatus Succeeded { get; } = new BackupRestoreOperationStatus(SucceededValue); - /// Failed. + + /// Gets the Failed. public static BackupRestoreOperationStatus Failed { get; } = new BackupRestoreOperationStatus(FailedValue); - /// Cancelled. + + /// Gets the Cancelled. public static BackupRestoreOperationStatus Cancelled { get; } = new BackupRestoreOperationStatus(CancelledValue); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(BackupRestoreOperationStatus left, BackupRestoreOperationStatus right) => left.Equals(right); + /// Determines if two values are not the same. + /// The left value to compare. + /// The right value to compare. public static bool operator !=(BackupRestoreOperationStatus left, BackupRestoreOperationStatus right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator BackupRestoreOperationStatus(string value) => new BackupRestoreOperationStatus(value); - /// + /// Converts a string to a . + /// The value. + public static implicit operator BackupRestoreOperationStatus?(string value) => value == null ? null : new BackupRestoreOperationStatus(value); + + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is BackupRestoreOperationStatus other && Equals(other); - /// + + /// public bool Equals(BackupRestoreOperationStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// + + /// public override string ToString() => _value; } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/BackupRestoreRequestBaseProperties.Serialization.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/BackupRestoreRequestBaseProperties.Serialization.cs index b518c1eadc6c..4e798711113f 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/BackupRestoreRequestBaseProperties.Serialization.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/BackupRestoreRequestBaseProperties.Serialization.cs @@ -9,14 +9,20 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.HardwareSecurityModules; namespace Azure.ResourceManager.HardwareSecurityModules.Models { - public partial class BackupRestoreRequestBaseProperties : IUtf8JsonSerializable, IJsonModel + /// Backup and Restore Common properties. + public partial class BackupRestoreRequestBaseProperties : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal BackupRestoreRequestBaseProperties() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +34,11 @@ void IJsonModel.Write(Utf8JsonWriter 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; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(BackupRestoreRequestBaseProperties)} does not support writing '{format}' format."); } - writer.WritePropertyName("azureStorageBlobContainerUri"u8); writer.WriteStringValue(AzureStorageBlobContainerUri.AbsoluteUri); if (Optional.IsDefined(Token)) @@ -41,15 +46,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("token"u8); writer.WriteStringValue(Token); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -58,55 +63,61 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - BackupRestoreRequestBaseProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + BackupRestoreRequestBaseProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual BackupRestoreRequestBaseProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(BackupRestoreRequestBaseProperties)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeBackupRestoreRequestBaseProperties(document.RootElement, options); } - internal static BackupRestoreRequestBaseProperties DeserializeBackupRestoreRequestBaseProperties(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static BackupRestoreRequestBaseProperties DeserializeBackupRestoreRequestBaseProperties(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } Uri azureStorageBlobContainerUri = default; string token = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("azureStorageBlobContainerUri"u8)) + if (prop.NameEquals("azureStorageBlobContainerUri"u8)) { - azureStorageBlobContainerUri = new Uri(property.Value.GetString()); + azureStorageBlobContainerUri = new Uri(prop.Value.GetString()); continue; } - if (property.NameEquals("token"u8)) + if (prop.NameEquals("token"u8)) { - token = property.Value.GetString(); + token = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new BackupRestoreRequestBaseProperties(azureStorageBlobContainerUri, token, serializedAdditionalRawData); + return new BackupRestoreRequestBaseProperties(azureStorageBlobContainerUri, token, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -116,15 +127,20 @@ BinaryData IPersistableModel.Write(ModelRead } } - BackupRestoreRequestBaseProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + BackupRestoreRequestBaseProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual BackupRestoreRequestBaseProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeBackupRestoreRequestBaseProperties(document.RootElement, options); } default: @@ -132,6 +148,7 @@ BackupRestoreRequestBaseProperties IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/BackupRestoreRequestBaseProperties.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/BackupRestoreRequestBaseProperties.cs index 21d90d89d36f..586ff724c875 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/BackupRestoreRequestBaseProperties.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/BackupRestoreRequestBaseProperties.cs @@ -7,43 +7,15 @@ using System; using System.Collections.Generic; +using Azure.ResourceManager.HardwareSecurityModules; namespace Azure.ResourceManager.HardwareSecurityModules.Models { /// Backup and Restore Common properties. public partial class BackupRestoreRequestBaseProperties { - /// - /// 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 protected IDictionary _serializedAdditionalRawData; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The Azure blob storage container Uri which contains the backup. @@ -58,21 +30,17 @@ public BackupRestoreRequestBaseProperties(Uri azureStorageBlobContainerUri) /// Initializes a new instance of . /// The Azure blob storage container Uri which contains the backup. /// The SAS token pointing to an Azure blob storage container. This property is reserved for Azure Backup Service. - /// Keeps track of any properties unknown to the library. - internal BackupRestoreRequestBaseProperties(Uri azureStorageBlobContainerUri, string token, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal BackupRestoreRequestBaseProperties(Uri azureStorageBlobContainerUri, string token, IDictionary additionalBinaryDataProperties) { AzureStorageBlobContainerUri = azureStorageBlobContainerUri; Token = token; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal BackupRestoreRequestBaseProperties() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The Azure blob storage container Uri which contains the backup. public Uri AzureStorageBlobContainerUri { get; } + /// The SAS token pointing to an Azure blob storage container. This property is reserved for Azure Backup Service. public string Token { get; set; } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterBackupContent.Serialization.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterBackupContent.Serialization.cs index cfefdb7c2b2c..4f2adf383d33 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterBackupContent.Serialization.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterBackupContent.Serialization.cs @@ -10,13 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using Azure.Core; +using Azure.ResourceManager.HardwareSecurityModules; namespace Azure.ResourceManager.HardwareSecurityModules.Models { - public partial class CloudHsmClusterBackupContent : IUtf8JsonSerializable, IJsonModel + /// Backup properties. + public partial class CloudHsmClusterBackupContent : BackupRestoreRequestBaseProperties, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal CloudHsmClusterBackupContent() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,64 +35,69 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(CloudHsmClusterBackupContent)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); } - CloudHsmClusterBackupContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + CloudHsmClusterBackupContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (CloudHsmClusterBackupContent)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override BackupRestoreRequestBaseProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(CloudHsmClusterBackupContent)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeCloudHsmClusterBackupContent(document.RootElement, options); } - internal static CloudHsmClusterBackupContent DeserializeCloudHsmClusterBackupContent(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static CloudHsmClusterBackupContent DeserializeCloudHsmClusterBackupContent(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } Uri azureStorageBlobContainerUri = default; string token = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("azureStorageBlobContainerUri"u8)) + if (prop.NameEquals("azureStorageBlobContainerUri"u8)) { - azureStorageBlobContainerUri = new Uri(property.Value.GetString()); + azureStorageBlobContainerUri = new Uri(prop.Value.GetString()); continue; } - if (property.NameEquals("token"u8)) + if (prop.NameEquals("token"u8)) { - token = property.Value.GetString(); + token = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new CloudHsmClusterBackupContent(azureStorageBlobContainerUri, token, serializedAdditionalRawData); + return new CloudHsmClusterBackupContent(azureStorageBlobContainerUri, token, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -95,15 +107,20 @@ BinaryData IPersistableModel.Write(ModelReaderWrit } } - CloudHsmClusterBackupContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + CloudHsmClusterBackupContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (CloudHsmClusterBackupContent)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override BackupRestoreRequestBaseProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeCloudHsmClusterBackupContent(document.RootElement, options); } default: @@ -111,6 +128,19 @@ CloudHsmClusterBackupContent IPersistableModel.Cre } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to serialize into . + internal static RequestContent ToRequestContent(CloudHsmClusterBackupContent cloudHsmClusterBackupContent) + { + if (cloudHsmClusterBackupContent == null) + { + return null; + } + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(cloudHsmClusterBackupContent, ModelSerializationExtensions.WireOptions); + return content; + } } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterBackupContent.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterBackupContent.cs index 7a4736613925..b122f965659c 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterBackupContent.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterBackupContent.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using Azure.ResourceManager.HardwareSecurityModules; namespace Azure.ResourceManager.HardwareSecurityModules.Models { @@ -19,18 +20,14 @@ public partial class CloudHsmClusterBackupContent : BackupRestoreRequestBaseProp public CloudHsmClusterBackupContent(Uri azureStorageBlobContainerUri) : base(azureStorageBlobContainerUri) { Argument.AssertNotNull(azureStorageBlobContainerUri, nameof(azureStorageBlobContainerUri)); + } /// Initializes a new instance of . /// The Azure blob storage container Uri which contains the backup. /// The SAS token pointing to an Azure blob storage container. This property is reserved for Azure Backup Service. - /// Keeps track of any properties unknown to the library. - internal CloudHsmClusterBackupContent(Uri azureStorageBlobContainerUri, string token, IDictionary serializedAdditionalRawData) : base(azureStorageBlobContainerUri, token, serializedAdditionalRawData) - { - } - - /// Initializes a new instance of for deserialization. - internal CloudHsmClusterBackupContent() + /// Keeps track of any properties unknown to the library. + internal CloudHsmClusterBackupContent(Uri azureStorageBlobContainerUri, string token, IDictionary additionalBinaryDataProperties) : base(azureStorageBlobContainerUri, token, additionalBinaryDataProperties) { } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterBackupResult.Serialization.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterBackupResult.Serialization.cs index 9b62387cb638..3889e4f7f677 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterBackupResult.Serialization.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterBackupResult.Serialization.cs @@ -9,14 +9,16 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure; +using Azure.ResourceManager.HardwareSecurityModules; namespace Azure.ResourceManager.HardwareSecurityModules.Models { - public partial class CloudHsmClusterBackupResult : IUtf8JsonSerializable, IJsonModel + /// Backup operation Result. + public partial class CloudHsmClusterBackupResult : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,26 +30,25 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR /// 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; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(CloudHsmClusterBackupResult)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Properties)) { writer.WritePropertyName("properties"u8); writer.WriteObjectValue(Properties, options); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -56,53 +57,59 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - CloudHsmClusterBackupResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + CloudHsmClusterBackupResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual CloudHsmClusterBackupResult JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(CloudHsmClusterBackupResult)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeCloudHsmClusterBackupResult(document.RootElement, options); } - internal static CloudHsmClusterBackupResult DeserializeCloudHsmClusterBackupResult(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static CloudHsmClusterBackupResult DeserializeCloudHsmClusterBackupResult(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } CloudHsmClusterBackupResultProperties properties = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("properties"u8)) + if (prop.NameEquals("properties"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - properties = CloudHsmClusterBackupResultProperties.DeserializeCloudHsmClusterBackupResultProperties(property.Value, options); + properties = CloudHsmClusterBackupResultProperties.DeserializeCloudHsmClusterBackupResultProperties(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new CloudHsmClusterBackupResult(properties, serializedAdditionalRawData); + return new CloudHsmClusterBackupResult(properties, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -112,15 +119,20 @@ BinaryData IPersistableModel.Write(ModelReaderWrite } } - CloudHsmClusterBackupResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + CloudHsmClusterBackupResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual CloudHsmClusterBackupResult PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeCloudHsmClusterBackupResult(document.RootElement, options); } default: @@ -128,6 +140,14 @@ CloudHsmClusterBackupResult IPersistableModel.Creat } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to deserialize the from. + internal static CloudHsmClusterBackupResult FromResponse(Response response) + { + using JsonDocument document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCloudHsmClusterBackupResult(document.RootElement, ModelSerializationExtensions.WireOptions); + } } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterBackupResult.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterBackupResult.cs index 61d3a34e65a0..5a0248071fc3 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterBackupResult.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterBackupResult.cs @@ -13,37 +13,8 @@ namespace Azure.ResourceManager.HardwareSecurityModules.Models /// Backup operation Result. public partial class CloudHsmClusterBackupResult { - /// - /// 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; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal CloudHsmClusterBackupResult() @@ -52,11 +23,11 @@ internal CloudHsmClusterBackupResult() /// Initializes a new instance of . /// Properties of the Cloud HSM Cluster. - /// Keeps track of any properties unknown to the library. - internal CloudHsmClusterBackupResult(CloudHsmClusterBackupResultProperties properties, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal CloudHsmClusterBackupResult(CloudHsmClusterBackupResultProperties properties, IDictionary additionalBinaryDataProperties) { Properties = properties; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Properties of the Cloud HSM Cluster. diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterBackupResultProperties.Serialization.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterBackupResultProperties.Serialization.cs index f79c121f89e8..e85f9369ac7d 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterBackupResultProperties.Serialization.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterBackupResultProperties.Serialization.cs @@ -10,14 +10,16 @@ using System.Collections.Generic; using System.Text; using System.Text.Json; -using Azure.Core; +using Azure; +using Azure.ResourceManager.HardwareSecurityModules; namespace Azure.ResourceManager.HardwareSecurityModules.Models { - public partial class CloudHsmClusterBackupResultProperties : IUtf8JsonSerializable, IJsonModel + /// Properties of the Cloud HSM Cluster. + public partial class CloudHsmClusterBackupResultProperties : BackupRestoreBaseResultProperties, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -29,12 +31,11 @@ void IJsonModel.Write(Utf8JsonWriter writ /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(CloudHsmClusterBackupResultProperties)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(AzureStorageBlobContainerUri)) { @@ -48,121 +49,127 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - CloudHsmClusterBackupResultProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + CloudHsmClusterBackupResultProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (CloudHsmClusterBackupResultProperties)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override BackupRestoreBaseResultProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(CloudHsmClusterBackupResultProperties)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeCloudHsmClusterBackupResultProperties(document.RootElement, options); } - internal static CloudHsmClusterBackupResultProperties DeserializeCloudHsmClusterBackupResultProperties(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static CloudHsmClusterBackupResultProperties DeserializeCloudHsmClusterBackupResultProperties(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - Uri azureStorageBlobContainerUri = default; - string backupId = default; BackupRestoreOperationStatus? status = default; string statusDetails = default; ResponseError error = default; - DateTimeOffset? startTime = default; - DateTimeOffset? endTime = default; + DateTimeOffset? startOn = default; + DateTimeOffset? endOn = default; string jobId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + Uri azureStorageBlobContainerUri = default; + string backupId = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("azureStorageBlobContainerUri"u8)) + if (prop.NameEquals("status"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - azureStorageBlobContainerUri = new Uri(property.Value.GetString()); + status = new BackupRestoreOperationStatus(prop.Value.GetString()); continue; } - if (property.NameEquals("backupId"u8)) + if (prop.NameEquals("statusDetails"u8)) { - backupId = property.Value.GetString(); + statusDetails = prop.Value.GetString(); continue; } - if (property.NameEquals("status"u8)) + if (prop.NameEquals("error"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - status = new BackupRestoreOperationStatus(property.Value.GetString()); + error = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(prop.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerHardwareSecurityModulesContext.Default); continue; } - if (property.NameEquals("statusDetails"u8)) + if (prop.NameEquals("startTime"u8)) { - statusDetails = property.Value.GetString(); - continue; - } - if (property.NameEquals("error"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - error = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), options, AzureResourceManagerHardwareSecurityModulesContext.Default); + startOn = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("startTime"u8)) + if (prop.NameEquals("endTime"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { + endOn = null; continue; } - startTime = property.Value.GetDateTimeOffset("O"); + endOn = prop.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("endTime"u8)) + if (prop.NameEquals("jobId"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + jobId = prop.Value.GetString(); + continue; + } + if (prop.NameEquals("azureStorageBlobContainerUri"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) { - endTime = null; continue; } - endTime = property.Value.GetDateTimeOffset("O"); + azureStorageBlobContainerUri = new Uri(prop.Value.GetString()); continue; } - if (property.NameEquals("jobId"u8)) + if (prop.NameEquals("backupId"u8)) { - jobId = property.Value.GetString(); + backupId = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new CloudHsmClusterBackupResultProperties( status, statusDetails, error, - startTime, - endTime, + startOn, + endOn, jobId, - serializedAdditionalRawData, + additionalBinaryDataProperties, azureStorageBlobContainerUri, backupId); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -172,15 +179,20 @@ BinaryData IPersistableModel.Write(ModelR } } - CloudHsmClusterBackupResultProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + CloudHsmClusterBackupResultProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (CloudHsmClusterBackupResultProperties)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override BackupRestoreBaseResultProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeCloudHsmClusterBackupResultProperties(document.RootElement, options); } default: @@ -188,6 +200,7 @@ CloudHsmClusterBackupResultProperties IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterBackupResultProperties.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterBackupResultProperties.cs index c952be46d688..f6f09b57aad0 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterBackupResultProperties.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterBackupResultProperties.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using Azure; namespace Azure.ResourceManager.HardwareSecurityModules.Models { @@ -25,10 +26,10 @@ internal CloudHsmClusterBackupResultProperties() /// The start time of the backup/restore operation in UTC. /// The end time of the backup/restore operation in UTC. /// Identifier for the backup/restore operation. - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// The Azure blob storage container Uri which contains the backup. /// The ID of the backup. - internal CloudHsmClusterBackupResultProperties(BackupRestoreOperationStatus? status, string statusDetails, ResponseError error, DateTimeOffset? startOn, DateTimeOffset? endOn, string jobId, IDictionary serializedAdditionalRawData, Uri azureStorageBlobContainerUri, string backupId) : base(status, statusDetails, error, startOn, endOn, jobId, serializedAdditionalRawData) + internal CloudHsmClusterBackupResultProperties(BackupRestoreOperationStatus? status, string statusDetails, ResponseError error, DateTimeOffset? startOn, DateTimeOffset? endOn, string jobId, IDictionary additionalBinaryDataProperties, Uri azureStorageBlobContainerUri, string backupId) : base(status, statusDetails, error, startOn, endOn, jobId, additionalBinaryDataProperties) { AzureStorageBlobContainerUri = azureStorageBlobContainerUri; BackupId = backupId; @@ -36,6 +37,7 @@ internal CloudHsmClusterBackupResultProperties(BackupRestoreOperationStatus? sta /// The Azure blob storage container Uri which contains the backup. public Uri AzureStorageBlobContainerUri { get; } + /// The ID of the backup. public string BackupId { get; } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterListResult.Serialization.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterListResult.Serialization.cs index f3ed868e8deb..61aefac05487 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterListResult.Serialization.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterListResult.Serialization.cs @@ -9,14 +9,21 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure; +using Azure.ResourceManager.HardwareSecurityModules; namespace Azure.ResourceManager.HardwareSecurityModules.Models { - internal partial class CloudHsmClusterListResult : IUtf8JsonSerializable, IJsonModel + /// The response of a CloudHsmCluster list operation. + internal partial class CloudHsmClusterListResult : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal CloudHsmClusterListResult() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,15 +35,14 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea /// 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; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(CloudHsmClusterListResult)} does not support writing '{format}' format."); } - writer.WritePropertyName("value"u8); writer.WriteStartArray(); - foreach (var item in Value) + foreach (CloudHsmClusterData item in Value) { writer.WriteObjectValue(item, options); } @@ -46,15 +52,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("nextLink"u8); writer.WriteStringValue(NextLink.AbsoluteUri); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -63,64 +69,70 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - CloudHsmClusterListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + CloudHsmClusterListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual CloudHsmClusterListResult JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(CloudHsmClusterListResult)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeCloudHsmClusterListResult(document.RootElement, options); } - internal static CloudHsmClusterListResult DeserializeCloudHsmClusterListResult(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static CloudHsmClusterListResult DeserializeCloudHsmClusterListResult(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - IReadOnlyList value = default; + IList value = default; Uri nextLink = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("value"u8)) + if (prop.NameEquals("value"u8)) { List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { array.Add(CloudHsmClusterData.DeserializeCloudHsmClusterData(item, options)); } value = array; continue; } - if (property.NameEquals("nextLink"u8)) + if (prop.NameEquals("nextLink"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - nextLink = new Uri(property.Value.GetString()); + nextLink = new Uri(prop.Value.GetString()); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new CloudHsmClusterListResult(value, nextLink, serializedAdditionalRawData); + return new CloudHsmClusterListResult(value, nextLink, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -130,15 +142,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterO } } - CloudHsmClusterListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + CloudHsmClusterListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual CloudHsmClusterListResult PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeCloudHsmClusterListResult(document.RootElement, options); } default: @@ -146,6 +163,14 @@ CloudHsmClusterListResult IPersistableModel.Create(Bi } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to deserialize the from. + internal static CloudHsmClusterListResult FromResponse(Response response) + { + using JsonDocument document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCloudHsmClusterListResult(document.RootElement, ModelSerializationExtensions.WireOptions); + } } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterListResult.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterListResult.cs index c55c9d5fa01b..aceae4dda6a1 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterListResult.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterListResult.cs @@ -8,72 +8,37 @@ using System; using System.Collections.Generic; using System.Linq; +using Azure.ResourceManager.HardwareSecurityModules; namespace Azure.ResourceManager.HardwareSecurityModules.Models { /// The response of a CloudHsmCluster list operation. internal partial class CloudHsmClusterListResult { - /// - /// 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; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The CloudHsmCluster items on this page. - /// is null. internal CloudHsmClusterListResult(IEnumerable value) { - Argument.AssertNotNull(value, nameof(value)); - Value = value.ToList(); } /// Initializes a new instance of . /// The CloudHsmCluster items on this page. /// The link to the next page of items. - /// Keeps track of any properties unknown to the library. - internal CloudHsmClusterListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal CloudHsmClusterListResult(IList value, Uri nextLink, IDictionary additionalBinaryDataProperties) { Value = value; NextLink = nextLink; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal CloudHsmClusterListResult() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The CloudHsmCluster items on this page. - public IReadOnlyList Value { get; } + public IList Value { get; } + /// The link to the next page of items. public Uri NextLink { get; } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterPatch.Serialization.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterPatch.Serialization.cs index e1cc94cd143e..6bcd7acfc496 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterPatch.Serialization.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterPatch.Serialization.cs @@ -11,14 +11,16 @@ using System.Text; using System.Text.Json; using Azure.Core; +using Azure.ResourceManager.HardwareSecurityModules; using Azure.ResourceManager.Models; namespace Azure.ResourceManager.HardwareSecurityModules.Models { - public partial class CloudHsmClusterPatch : IUtf8JsonSerializable, IJsonModel + /// Patchable properties of the Cloud HSM Cluster. + public partial class CloudHsmClusterPatch : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +32,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr /// 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; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(CloudHsmClusterPatch)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -43,6 +44,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit foreach (var item in Tags) { writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } writer.WriteStringValue(item.Value); } writer.WriteEndObject(); @@ -50,17 +56,17 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit if (Optional.IsDefined(Identity)) { writer.WritePropertyName("identity"u8); - ((IJsonModel)Identity).Write(writer, ModelSerializationExtensions.WireV3Options); + ((IJsonModel)Identity).Write(writer, options); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -69,68 +75,81 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - CloudHsmClusterPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + CloudHsmClusterPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual CloudHsmClusterPatch JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(CloudHsmClusterPatch)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeCloudHsmClusterPatch(document.RootElement, options); } - internal static CloudHsmClusterPatch DeserializeCloudHsmClusterPatch(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static CloudHsmClusterPatch DeserializeCloudHsmClusterPatch(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } IDictionary tags = default; ManagedServiceIdentity identity = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("tags"u8)) + if (prop.NameEquals("tags"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + foreach (var prop0 in prop.Value.EnumerateObject()) { - dictionary.Add(property0.Name, property0.Value.GetString()); + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } } tags = dictionary; continue; } - if (property.NameEquals("identity"u8)) + if (prop.NameEquals("identity"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - identity = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), ModelSerializationExtensions.WireV3Options, AzureResourceManagerHardwareSecurityModulesContext.Default); + identity = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(prop.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerHardwareSecurityModulesContext.Default); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new CloudHsmClusterPatch(tags ?? new ChangeTrackingDictionary(), identity, serializedAdditionalRawData); + return new CloudHsmClusterPatch(tags ?? new ChangeTrackingDictionary(), identity, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -140,15 +159,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOption } } - CloudHsmClusterPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + CloudHsmClusterPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual CloudHsmClusterPatch PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeCloudHsmClusterPatch(document.RootElement, options); } default: @@ -156,6 +180,19 @@ CloudHsmClusterPatch IPersistableModel.Create(BinaryData d } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to serialize into . + internal static RequestContent ToRequestContent(CloudHsmClusterPatch cloudHsmClusterPatch) + { + if (cloudHsmClusterPatch == null) + { + return null; + } + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(cloudHsmClusterPatch, ModelSerializationExtensions.WireOptions); + return content; + } } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterPatch.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterPatch.cs index 96e76af36c2a..ed8f84060438 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterPatch.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterPatch.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using Azure.ResourceManager.HardwareSecurityModules; using Azure.ResourceManager.Models; namespace Azure.ResourceManager.HardwareSecurityModules.Models @@ -14,37 +15,8 @@ namespace Azure.ResourceManager.HardwareSecurityModules.Models /// Patchable properties of the Cloud HSM Cluster. public partial class CloudHsmClusterPatch { - /// - /// 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; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . public CloudHsmClusterPatch() @@ -55,16 +27,17 @@ public CloudHsmClusterPatch() /// Initializes a new instance of . /// The Cloud HSM Cluster's tags. /// Managed service identity (system assigned and/or user assigned identities). - /// Keeps track of any properties unknown to the library. - internal CloudHsmClusterPatch(IDictionary tags, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal CloudHsmClusterPatch(IDictionary tags, ManagedServiceIdentity identity, IDictionary additionalBinaryDataProperties) { Tags = tags; Identity = identity; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The Cloud HSM Cluster's tags. public IDictionary Tags { get; } + /// Managed service identity (system assigned and/or user assigned identities). public ManagedServiceIdentity Identity { get; set; } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterPrivateEndpointConnectionProperties.Serialization.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterPrivateEndpointConnectionProperties.Serialization.cs index aea604557573..4d59efdedc1a 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterPrivateEndpointConnectionProperties.Serialization.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterPrivateEndpointConnectionProperties.Serialization.cs @@ -8,17 +8,21 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; -using System.Text; using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Resources.Models; +using Azure.ResourceManager.HardwareSecurityModules; namespace Azure.ResourceManager.HardwareSecurityModules.Models { - public partial class CloudHsmClusterPrivateEndpointConnectionProperties : IUtf8JsonSerializable, IJsonModel + /// Properties of the private endpoint connection. + public partial class CloudHsmClusterPrivateEndpointConnectionProperties : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal CloudHsmClusterPrivateEndpointConnectionProperties() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,16 +34,15 @@ void IJsonModel.Write(Utf8Js /// 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; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(CloudHsmClusterPrivateEndpointConnectionProperties)} does not support writing '{format}' format."); } - if (Optional.IsDefined(PrivateEndpoint)) { writer.WritePropertyName("privateEndpoint"u8); - ((IJsonModel)PrivateEndpoint).Write(writer, options); + writer.WriteObjectValue(PrivateEndpoint, options); } writer.WritePropertyName("privateLinkServiceConnectionState"u8); writer.WriteObjectValue(ConnectionState, options); @@ -52,21 +55,26 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit { writer.WritePropertyName("groupIds"u8); writer.WriteStartArray(); - foreach (var item in GroupIds) + foreach (string item in GroupIds) { + if (item == null) + { + writer.WriteNullValue(); + continue; + } writer.WriteStringValue(item); } writer.WriteEndArray(); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -75,84 +83,97 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - CloudHsmClusterPrivateEndpointConnectionProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + CloudHsmClusterPrivateEndpointConnectionProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual CloudHsmClusterPrivateEndpointConnectionProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(CloudHsmClusterPrivateEndpointConnectionProperties)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeCloudHsmClusterPrivateEndpointConnectionProperties(document.RootElement, options); } - internal static CloudHsmClusterPrivateEndpointConnectionProperties DeserializeCloudHsmClusterPrivateEndpointConnectionProperties(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static CloudHsmClusterPrivateEndpointConnectionProperties DeserializeCloudHsmClusterPrivateEndpointConnectionProperties(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - SubResource privateEndpoint = default; - CloudHsmClusterPrivateLinkServiceConnectionState privateLinkServiceConnectionState = default; + PrivateEndpoint privateEndpoint = default; + CloudHsmClusterPrivateLinkServiceConnectionState connectionState = default; CloudHsmClusterPrivateEndpointConnectionProvisioningState? provisioningState = default; IReadOnlyList groupIds = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("privateEndpoint"u8)) + if (prop.NameEquals("privateEndpoint"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - privateEndpoint = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), options, AzureResourceManagerHardwareSecurityModulesContext.Default); + privateEndpoint = PrivateEndpoint.DeserializePrivateEndpoint(prop.Value, options); continue; } - if (property.NameEquals("privateLinkServiceConnectionState"u8)) + if (prop.NameEquals("privateLinkServiceConnectionState"u8)) { - privateLinkServiceConnectionState = CloudHsmClusterPrivateLinkServiceConnectionState.DeserializeCloudHsmClusterPrivateLinkServiceConnectionState(property.Value, options); + connectionState = CloudHsmClusterPrivateLinkServiceConnectionState.DeserializeCloudHsmClusterPrivateLinkServiceConnectionState(prop.Value, options); continue; } - if (property.NameEquals("provisioningState"u8)) + if (prop.NameEquals("provisioningState"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - provisioningState = new CloudHsmClusterPrivateEndpointConnectionProvisioningState(property.Value.GetString()); + provisioningState = new CloudHsmClusterPrivateEndpointConnectionProvisioningState(prop.Value.GetString()); continue; } - if (property.NameEquals("groupIds"u8)) + if (prop.NameEquals("groupIds"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { - array.Add(item.GetString()); + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(item.GetString()); + } } groupIds = array; continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new CloudHsmClusterPrivateEndpointConnectionProperties(privateEndpoint, privateLinkServiceConnectionState, provisioningState, groupIds ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new CloudHsmClusterPrivateEndpointConnectionProperties(privateEndpoint, connectionState, provisioningState, groupIds ?? new ChangeTrackingList(), additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -162,15 +183,20 @@ BinaryData IPersistableModel } } - CloudHsmClusterPrivateEndpointConnectionProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + CloudHsmClusterPrivateEndpointConnectionProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual CloudHsmClusterPrivateEndpointConnectionProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeCloudHsmClusterPrivateEndpointConnectionProperties(document.RootElement, options); } default: @@ -178,6 +204,7 @@ CloudHsmClusterPrivateEndpointConnectionProperties IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterPrivateEndpointConnectionProperties.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterPrivateEndpointConnectionProperties.cs index 771f13dfcd5d..e240bec95ccc 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterPrivateEndpointConnectionProperties.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterPrivateEndpointConnectionProperties.cs @@ -8,44 +8,15 @@ using System; using System.Collections.Generic; using Azure.Core; -using Azure.ResourceManager.Resources.Models; +using Azure.ResourceManager.HardwareSecurityModules; namespace Azure.ResourceManager.HardwareSecurityModules.Models { /// Properties of the private endpoint connection. public partial class CloudHsmClusterPrivateEndpointConnectionProperties { - /// - /// 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; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// A collection of information about the state of the connection between service consumer and provider. @@ -63,34 +34,35 @@ public CloudHsmClusterPrivateEndpointConnectionProperties(CloudHsmClusterPrivate /// A collection of information about the state of the connection between service consumer and provider. /// The provisioning state of the private endpoint connection resource. /// The group ids for the private endpoint resource. - /// Keeps track of any properties unknown to the library. - internal CloudHsmClusterPrivateEndpointConnectionProperties(SubResource privateEndpoint, CloudHsmClusterPrivateLinkServiceConnectionState connectionState, CloudHsmClusterPrivateEndpointConnectionProvisioningState? provisioningState, IReadOnlyList groupIds, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal CloudHsmClusterPrivateEndpointConnectionProperties(PrivateEndpoint privateEndpoint, CloudHsmClusterPrivateLinkServiceConnectionState connectionState, CloudHsmClusterPrivateEndpointConnectionProvisioningState? provisioningState, IReadOnlyList groupIds, IDictionary additionalBinaryDataProperties) { PrivateEndpoint = privateEndpoint; ConnectionState = connectionState; ProvisioningState = provisioningState; GroupIds = groupIds; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal CloudHsmClusterPrivateEndpointConnectionProperties() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The private endpoint resource. - internal SubResource PrivateEndpoint { get; set; } - /// Gets Id. - public ResourceIdentifier PrivateEndpointId - { - get => PrivateEndpoint is null ? default : PrivateEndpoint.Id; - } + internal PrivateEndpoint PrivateEndpoint { get; set; } /// A collection of information about the state of the connection between service consumer and provider. public CloudHsmClusterPrivateLinkServiceConnectionState ConnectionState { get; set; } + /// The provisioning state of the private endpoint connection resource. public CloudHsmClusterPrivateEndpointConnectionProvisioningState? ProvisioningState { get; } + /// The group ids for the private endpoint resource. public IReadOnlyList GroupIds { get; } + + /// The resource identifier of the private endpoint. + public ResourceIdentifier PrivateEndpointId + { + get + { + return PrivateEndpoint is null ? default : PrivateEndpoint.Id; + } + } } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterPrivateEndpointConnectionProvisioningState.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterPrivateEndpointConnectionProvisioningState.cs index dc261578edce..d06bebcecc33 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterPrivateEndpointConnectionProvisioningState.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterPrivateEndpointConnectionProvisioningState.cs @@ -7,6 +7,7 @@ using System; using System.ComponentModel; +using Azure.ResourceManager.HardwareSecurityModules; namespace Azure.ResourceManager.HardwareSecurityModules.Models { @@ -14,14 +15,6 @@ namespace Azure.ResourceManager.HardwareSecurityModules.Models public readonly partial struct CloudHsmClusterPrivateEndpointConnectionProvisioningState : IEquatable { private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public CloudHsmClusterPrivateEndpointConnectionProvisioningState(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - private const string SucceededValue = "Succeeded"; private const string CreatingValue = "Creating"; private const string DeletingValue = "Deleting"; @@ -30,37 +23,67 @@ public CloudHsmClusterPrivateEndpointConnectionProvisioningState(string value) private const string InternalErrorValue = "InternalError"; private const string CanceledValue = "Canceled"; - /// Succeeded. + /// Initializes a new instance of . + /// The value. + /// is null. + public CloudHsmClusterPrivateEndpointConnectionProvisioningState(string value) + { + Argument.AssertNotNull(value, nameof(value)); + + _value = value; + } + + /// Gets the Succeeded. public static CloudHsmClusterPrivateEndpointConnectionProvisioningState Succeeded { get; } = new CloudHsmClusterPrivateEndpointConnectionProvisioningState(SucceededValue); - /// Creating. + + /// Gets the Creating. public static CloudHsmClusterPrivateEndpointConnectionProvisioningState Creating { get; } = new CloudHsmClusterPrivateEndpointConnectionProvisioningState(CreatingValue); - /// Deleting. + + /// Gets the Deleting. public static CloudHsmClusterPrivateEndpointConnectionProvisioningState Deleting { get; } = new CloudHsmClusterPrivateEndpointConnectionProvisioningState(DeletingValue); - /// Failed. + + /// Gets the Failed. public static CloudHsmClusterPrivateEndpointConnectionProvisioningState Failed { get; } = new CloudHsmClusterPrivateEndpointConnectionProvisioningState(FailedValue); - /// Updating. + + /// Gets the Updating. public static CloudHsmClusterPrivateEndpointConnectionProvisioningState Updating { get; } = new CloudHsmClusterPrivateEndpointConnectionProvisioningState(UpdatingValue); - /// InternalError. + + /// Gets the InternalError. public static CloudHsmClusterPrivateEndpointConnectionProvisioningState InternalError { get; } = new CloudHsmClusterPrivateEndpointConnectionProvisioningState(InternalErrorValue); - /// Canceled. + + /// Gets the Canceled. public static CloudHsmClusterPrivateEndpointConnectionProvisioningState Canceled { get; } = new CloudHsmClusterPrivateEndpointConnectionProvisioningState(CanceledValue); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(CloudHsmClusterPrivateEndpointConnectionProvisioningState left, CloudHsmClusterPrivateEndpointConnectionProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + /// The left value to compare. + /// The right value to compare. public static bool operator !=(CloudHsmClusterPrivateEndpointConnectionProvisioningState left, CloudHsmClusterPrivateEndpointConnectionProvisioningState right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator CloudHsmClusterPrivateEndpointConnectionProvisioningState(string value) => new CloudHsmClusterPrivateEndpointConnectionProvisioningState(value); - /// + /// Converts a string to a . + /// The value. + public static implicit operator CloudHsmClusterPrivateEndpointConnectionProvisioningState?(string value) => value == null ? null : new CloudHsmClusterPrivateEndpointConnectionProvisioningState(value); + + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is CloudHsmClusterPrivateEndpointConnectionProvisioningState other && Equals(other); - /// + + /// public bool Equals(CloudHsmClusterPrivateEndpointConnectionProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// + + /// public override string ToString() => _value; } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterPrivateEndpointServiceConnectionStatus.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterPrivateEndpointServiceConnectionStatus.cs index af5da2557d66..d9e4460085ad 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterPrivateEndpointServiceConnectionStatus.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterPrivateEndpointServiceConnectionStatus.cs @@ -7,6 +7,7 @@ using System; using System.ComponentModel; +using Azure.ResourceManager.HardwareSecurityModules; namespace Azure.ResourceManager.HardwareSecurityModules.Models { @@ -14,41 +15,62 @@ namespace Azure.ResourceManager.HardwareSecurityModules.Models public readonly partial struct CloudHsmClusterPrivateEndpointServiceConnectionStatus : IEquatable { private readonly string _value; + /// Connection waiting for approval or rejection. + private const string PendingValue = "Pending"; + /// Connection approved. + private const string ApprovedValue = "Approved"; + /// Connection Rejected. + private const string RejectedValue = "Rejected"; /// Initializes a new instance of . + /// The value. /// is null. public CloudHsmClusterPrivateEndpointServiceConnectionStatus(string value) { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } + Argument.AssertNotNull(value, nameof(value)); - private const string PendingValue = "Pending"; - private const string ApprovedValue = "Approved"; - private const string RejectedValue = "Rejected"; + _value = value; + } /// Connection waiting for approval or rejection. public static CloudHsmClusterPrivateEndpointServiceConnectionStatus Pending { get; } = new CloudHsmClusterPrivateEndpointServiceConnectionStatus(PendingValue); + /// Connection approved. public static CloudHsmClusterPrivateEndpointServiceConnectionStatus Approved { get; } = new CloudHsmClusterPrivateEndpointServiceConnectionStatus(ApprovedValue); + /// Connection Rejected. public static CloudHsmClusterPrivateEndpointServiceConnectionStatus Rejected { get; } = new CloudHsmClusterPrivateEndpointServiceConnectionStatus(RejectedValue); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(CloudHsmClusterPrivateEndpointServiceConnectionStatus left, CloudHsmClusterPrivateEndpointServiceConnectionStatus right) => left.Equals(right); + /// Determines if two values are not the same. + /// The left value to compare. + /// The right value to compare. public static bool operator !=(CloudHsmClusterPrivateEndpointServiceConnectionStatus left, CloudHsmClusterPrivateEndpointServiceConnectionStatus right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator CloudHsmClusterPrivateEndpointServiceConnectionStatus(string value) => new CloudHsmClusterPrivateEndpointServiceConnectionStatus(value); - /// + /// Converts a string to a . + /// The value. + public static implicit operator CloudHsmClusterPrivateEndpointServiceConnectionStatus?(string value) => value == null ? null : new CloudHsmClusterPrivateEndpointServiceConnectionStatus(value); + + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is CloudHsmClusterPrivateEndpointServiceConnectionStatus other && Equals(other); - /// + + /// public bool Equals(CloudHsmClusterPrivateEndpointServiceConnectionStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// + + /// public override string ToString() => _value; } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterPrivateLinkData.Serialization.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterPrivateLinkData.Serialization.cs index 26d76e126838..7e67d88269d0 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterPrivateLinkData.Serialization.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterPrivateLinkData.Serialization.cs @@ -11,14 +11,16 @@ using System.Text; using System.Text.Json; using Azure.Core; +using Azure.ResourceManager.HardwareSecurityModules; using Azure.ResourceManager.Models; namespace Azure.ResourceManager.HardwareSecurityModules.Models { - public partial class CloudHsmClusterPrivateLinkData : IUtf8JsonSerializable, IJsonModel + /// A private link resource. + public partial class CloudHsmClusterPrivateLinkData : ResourceData, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -30,12 +32,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(CloudHsmClusterPrivateLinkData)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Properties)) { @@ -44,87 +45,101 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } } - CloudHsmClusterPrivateLinkData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + CloudHsmClusterPrivateLinkData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (CloudHsmClusterPrivateLinkData)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual ResourceData JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(CloudHsmClusterPrivateLinkData)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeCloudHsmClusterPrivateLinkData(document.RootElement, options); } - internal static CloudHsmClusterPrivateLinkData DeserializeCloudHsmClusterPrivateLinkData(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static CloudHsmClusterPrivateLinkData DeserializeCloudHsmClusterPrivateLinkData(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - CloudHsmClusterPrivateLinkResourceProperties properties = default; ResourceIdentifier id = default; string name = default; - ResourceType type = default; + ResourceType resourceType = default; SystemData systemData = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + CloudHsmClusterPrivateLinkResourceProperties properties = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("properties"u8)) + if (prop.NameEquals("id"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - properties = CloudHsmClusterPrivateLinkResourceProperties.DeserializeCloudHsmClusterPrivateLinkResourceProperties(property.Value, options); + id = new ResourceIdentifier(prop.Value.GetString()); continue; } - if (property.NameEquals("id"u8)) + if (prop.NameEquals("name"u8)) { - id = new ResourceIdentifier(property.Value.GetString()); + name = prop.Value.GetString(); continue; } - if (property.NameEquals("name"u8)) + if (prop.NameEquals("type"u8)) { - name = property.Value.GetString(); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resourceType = new ResourceType(prop.Value.GetString()); continue; } - if (property.NameEquals("type"u8)) + if (prop.NameEquals("systemData"u8)) { - type = new ResourceType(property.Value.GetString()); + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(prop.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerHardwareSecurityModulesContext.Default); continue; } - if (property.NameEquals("systemData"u8)) + if (prop.NameEquals("properties"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - systemData = ModelReaderWriter.Read(new BinaryData(Encoding.UTF8.GetBytes(property.Value.GetRawText())), ModelSerializationExtensions.WireOptions, AzureResourceManagerHardwareSecurityModulesContext.Default); + properties = CloudHsmClusterPrivateLinkResourceProperties.DeserializeCloudHsmClusterPrivateLinkResourceProperties(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new CloudHsmClusterPrivateLinkData( id, name, - type, + resourceType, systemData, - properties, - serializedAdditionalRawData); + additionalBinaryDataProperties, + properties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -134,15 +149,20 @@ BinaryData IPersistableModel.Write(ModelReaderWr } } - CloudHsmClusterPrivateLinkData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + CloudHsmClusterPrivateLinkData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (CloudHsmClusterPrivateLinkData)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual ResourceData PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeCloudHsmClusterPrivateLinkData(document.RootElement, options); } default: @@ -150,6 +170,7 @@ CloudHsmClusterPrivateLinkData IPersistableModel } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterPrivateLinkData.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterPrivateLinkData.cs index 3f5abf45f8f1..c8fed097a06c 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterPrivateLinkData.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterPrivateLinkData.cs @@ -15,37 +15,8 @@ namespace Azure.ResourceManager.HardwareSecurityModules.Models /// A private link resource. public partial class CloudHsmClusterPrivateLinkData : ResourceData { - /// - /// 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; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . public CloudHsmClusterPrivateLinkData() @@ -53,16 +24,16 @@ public CloudHsmClusterPrivateLinkData() } /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + /// The name of the resource. + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// Keeps track of any properties unknown to the library. /// Resource properties. - /// Keeps track of any properties unknown to the library. - internal CloudHsmClusterPrivateLinkData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, CloudHsmClusterPrivateLinkResourceProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal CloudHsmClusterPrivateLinkData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary additionalBinaryDataProperties, CloudHsmClusterPrivateLinkResourceProperties properties) : base(id, name, resourceType, systemData) { + _additionalBinaryDataProperties = additionalBinaryDataProperties; Properties = properties; - _serializedAdditionalRawData = serializedAdditionalRawData; } /// Resource properties. diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterPrivateLinkResourceProperties.Serialization.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterPrivateLinkResourceProperties.Serialization.cs index 9fe3fe47bcab..b1fc6f36e7a3 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterPrivateLinkResourceProperties.Serialization.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterPrivateLinkResourceProperties.Serialization.cs @@ -9,14 +9,15 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.HardwareSecurityModules; namespace Azure.ResourceManager.HardwareSecurityModules.Models { - public partial class CloudHsmClusterPrivateLinkResourceProperties : IUtf8JsonSerializable, IJsonModel + /// Properties of a private link resource. + public partial class CloudHsmClusterPrivateLinkResourceProperties : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +29,11 @@ void IJsonModel.Write(Utf8JsonWrit /// 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; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(CloudHsmClusterPrivateLinkResourceProperties)} does not support writing '{format}' format."); } - if (options.Format != "W" && Optional.IsDefined(GroupId)) { writer.WritePropertyName("groupId"u8); @@ -43,8 +43,13 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit { writer.WritePropertyName("requiredMembers"u8); writer.WriteStartArray(); - foreach (var item in RequiredMembers) + foreach (string item in RequiredMembers) { + if (item == null) + { + writer.WriteNullValue(); + continue; + } writer.WriteStringValue(item); } writer.WriteEndArray(); @@ -53,21 +58,26 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit { writer.WritePropertyName("requiredZoneNames"u8); writer.WriteStartArray(); - foreach (var item in RequiredZoneNames) + foreach (string item in RequiredZoneNames) { + if (item == null) + { + writer.WriteNullValue(); + continue; + } writer.WriteStringValue(item); } writer.WriteEndArray(); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -76,22 +86,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - CloudHsmClusterPrivateLinkResourceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + CloudHsmClusterPrivateLinkResourceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual CloudHsmClusterPrivateLinkResourceProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(CloudHsmClusterPrivateLinkResourceProperties)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeCloudHsmClusterPrivateLinkResourceProperties(document.RootElement, options); } - internal static CloudHsmClusterPrivateLinkResourceProperties DeserializeCloudHsmClusterPrivateLinkResourceProperties(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static CloudHsmClusterPrivateLinkResourceProperties DeserializeCloudHsmClusterPrivateLinkResourceProperties(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -99,56 +114,71 @@ internal static CloudHsmClusterPrivateLinkResourceProperties DeserializeCloudHsm string groupId = default; IReadOnlyList requiredMembers = default; IList requiredZoneNames = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("groupId"u8)) + if (prop.NameEquals("groupId"u8)) { - groupId = property.Value.GetString(); + groupId = prop.Value.GetString(); continue; } - if (property.NameEquals("requiredMembers"u8)) + if (prop.NameEquals("requiredMembers"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { - array.Add(item.GetString()); + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(item.GetString()); + } } requiredMembers = array; continue; } - if (property.NameEquals("requiredZoneNames"u8)) + if (prop.NameEquals("requiredZoneNames"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { - array.Add(item.GetString()); + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(item.GetString()); + } } requiredZoneNames = array; continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new CloudHsmClusterPrivateLinkResourceProperties(groupId, requiredMembers ?? new ChangeTrackingList(), requiredZoneNames ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new CloudHsmClusterPrivateLinkResourceProperties(groupId, requiredMembers ?? new ChangeTrackingList(), requiredZoneNames ?? new ChangeTrackingList(), additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -158,15 +188,20 @@ BinaryData IPersistableModel.Write } } - CloudHsmClusterPrivateLinkResourceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + CloudHsmClusterPrivateLinkResourceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual CloudHsmClusterPrivateLinkResourceProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeCloudHsmClusterPrivateLinkResourceProperties(document.RootElement, options); } default: @@ -174,6 +209,7 @@ CloudHsmClusterPrivateLinkResourceProperties IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterPrivateLinkResourceProperties.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterPrivateLinkResourceProperties.cs index e4530ed5f43c..73094bc97a3f 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterPrivateLinkResourceProperties.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterPrivateLinkResourceProperties.cs @@ -7,43 +7,15 @@ using System; using System.Collections.Generic; +using Azure.ResourceManager.HardwareSecurityModules; namespace Azure.ResourceManager.HardwareSecurityModules.Models { /// Properties of a private link resource. public partial class CloudHsmClusterPrivateLinkResourceProperties { - /// - /// 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; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . public CloudHsmClusterPrivateLinkResourceProperties() @@ -56,19 +28,21 @@ public CloudHsmClusterPrivateLinkResourceProperties() /// The private link resource group id. /// The private link resource required member names. /// The private link resource private link DNS zone name. - /// Keeps track of any properties unknown to the library. - internal CloudHsmClusterPrivateLinkResourceProperties(string groupId, IReadOnlyList requiredMembers, IList requiredZoneNames, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal CloudHsmClusterPrivateLinkResourceProperties(string groupId, IReadOnlyList requiredMembers, IList requiredZoneNames, IDictionary additionalBinaryDataProperties) { GroupId = groupId; RequiredMembers = requiredMembers; RequiredZoneNames = requiredZoneNames; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The private link resource group id. public string GroupId { get; } + /// The private link resource required member names. public IReadOnlyList RequiredMembers { get; } + /// The private link resource private link DNS zone name. public IList RequiredZoneNames { get; } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterPrivateLinkServiceConnectionState.Serialization.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterPrivateLinkServiceConnectionState.Serialization.cs index ea3c3fdf8923..bf67dae98451 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterPrivateLinkServiceConnectionState.Serialization.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterPrivateLinkServiceConnectionState.Serialization.cs @@ -9,14 +9,15 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.HardwareSecurityModules; namespace Azure.ResourceManager.HardwareSecurityModules.Models { - public partial class CloudHsmClusterPrivateLinkServiceConnectionState : IUtf8JsonSerializable, IJsonModel + /// A collection of information about the state of the connection between service consumer and provider. + public partial class CloudHsmClusterPrivateLinkServiceConnectionState : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +29,11 @@ void IJsonModel.Write(Utf8Json /// 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; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(CloudHsmClusterPrivateLinkServiceConnectionState)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Status)) { writer.WritePropertyName("status"u8); @@ -49,15 +49,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("actionsRequired"u8); writer.WriteStringValue(ActionsRequired); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -66,22 +66,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - CloudHsmClusterPrivateLinkServiceConnectionState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + CloudHsmClusterPrivateLinkServiceConnectionState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual CloudHsmClusterPrivateLinkServiceConnectionState JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(CloudHsmClusterPrivateLinkServiceConnectionState)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeCloudHsmClusterPrivateLinkServiceConnectionState(document.RootElement, options); } - internal static CloudHsmClusterPrivateLinkServiceConnectionState DeserializeCloudHsmClusterPrivateLinkServiceConnectionState(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static CloudHsmClusterPrivateLinkServiceConnectionState DeserializeCloudHsmClusterPrivateLinkServiceConnectionState(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -89,42 +94,43 @@ internal static CloudHsmClusterPrivateLinkServiceConnectionState DeserializeClou CloudHsmClusterPrivateEndpointServiceConnectionStatus? status = default; string description = default; string actionsRequired = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("status"u8)) + if (prop.NameEquals("status"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - status = new CloudHsmClusterPrivateEndpointServiceConnectionStatus(property.Value.GetString()); + status = new CloudHsmClusterPrivateEndpointServiceConnectionStatus(prop.Value.GetString()); continue; } - if (property.NameEquals("description"u8)) + if (prop.NameEquals("description"u8)) { - description = property.Value.GetString(); + description = prop.Value.GetString(); continue; } - if (property.NameEquals("actionsRequired"u8)) + if (prop.NameEquals("actionsRequired"u8)) { - actionsRequired = property.Value.GetString(); + actionsRequired = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new CloudHsmClusterPrivateLinkServiceConnectionState(status, description, actionsRequired, serializedAdditionalRawData); + return new CloudHsmClusterPrivateLinkServiceConnectionState(status, description, actionsRequired, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -134,15 +140,20 @@ BinaryData IPersistableModel.W } } - CloudHsmClusterPrivateLinkServiceConnectionState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + CloudHsmClusterPrivateLinkServiceConnectionState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual CloudHsmClusterPrivateLinkServiceConnectionState PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeCloudHsmClusterPrivateLinkServiceConnectionState(document.RootElement, options); } default: @@ -150,6 +161,7 @@ CloudHsmClusterPrivateLinkServiceConnectionState IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterPrivateLinkServiceConnectionState.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterPrivateLinkServiceConnectionState.cs index 8cd406a445f3..5f0582b83ebe 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterPrivateLinkServiceConnectionState.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterPrivateLinkServiceConnectionState.cs @@ -13,37 +13,8 @@ namespace Azure.ResourceManager.HardwareSecurityModules.Models /// A collection of information about the state of the connection between service consumer and provider. public partial class CloudHsmClusterPrivateLinkServiceConnectionState { - /// - /// 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; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . public CloudHsmClusterPrivateLinkServiceConnectionState() @@ -54,19 +25,21 @@ public CloudHsmClusterPrivateLinkServiceConnectionState() /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. /// The reason for approval/rejection of the connection. /// A message indicating if changes on the service provider require any updates on the consumer. - /// Keeps track of any properties unknown to the library. - internal CloudHsmClusterPrivateLinkServiceConnectionState(CloudHsmClusterPrivateEndpointServiceConnectionStatus? status, string description, string actionsRequired, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal CloudHsmClusterPrivateLinkServiceConnectionState(CloudHsmClusterPrivateEndpointServiceConnectionStatus? status, string description, string actionsRequired, IDictionary additionalBinaryDataProperties) { Status = status; Description = description; ActionsRequired = actionsRequired; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. public CloudHsmClusterPrivateEndpointServiceConnectionStatus? Status { get; set; } + /// The reason for approval/rejection of the connection. public string Description { get; set; } + /// A message indicating if changes on the service provider require any updates on the consumer. public string ActionsRequired { get; set; } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterProperties.Serialization.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterProperties.Serialization.cs index a6187e04e733..aeee716fb196 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterProperties.Serialization.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterProperties.Serialization.cs @@ -9,14 +9,15 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.HardwareSecurityModules; namespace Azure.ResourceManager.HardwareSecurityModules.Models { - public partial class CloudHsmClusterProperties : IUtf8JsonSerializable, IJsonModel + /// Properties of a Cloud HSM Cluster. + public partial class CloudHsmClusterProperties : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +29,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea /// 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; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(CloudHsmClusterProperties)} does not support writing '{format}' format."); } - if (options.Format != "W" && Optional.IsDefined(ActivationState)) { writer.WritePropertyName("activationState"u8); @@ -48,7 +48,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit { writer.WritePropertyName("hsms"u8); writer.WriteStartArray(); - foreach (var item in Hsms) + foreach (CloudHsmProperties item in Hsms) { writer.WriteObjectValue(item, options); } @@ -58,7 +58,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit { writer.WritePropertyName("privateEndpointConnections"u8); writer.WriteStartArray(); - foreach (var item in PrivateEndpointConnections) + foreach (CloudHsmClusterPrivateEndpointConnectionData item in PrivateEndpointConnections) { writer.WriteObjectValue(item, options); } @@ -79,15 +79,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("statusMessage"u8); writer.WriteStringValue(StatusMessage); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -96,22 +96,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - CloudHsmClusterProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + CloudHsmClusterProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual CloudHsmClusterProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(CloudHsmClusterProperties)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeCloudHsmClusterProperties(document.RootElement, options); } - internal static CloudHsmClusterProperties DeserializeCloudHsmClusterProperties(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static CloudHsmClusterProperties DeserializeCloudHsmClusterProperties(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -123,85 +128,83 @@ internal static CloudHsmClusterProperties DeserializeCloudHsmClusterProperties(J CloudHsmClusterProvisioningState? provisioningState = default; CloudHsmClusterPublicNetworkAccess? publicNetworkAccess = default; string statusMessage = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("activationState"u8)) + if (prop.NameEquals("activationState"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - activationState = new SecurityDomainActivationState(property.Value.GetString()); + activationState = new SecurityDomainActivationState(prop.Value.GetString()); continue; } - if (property.NameEquals("autoGeneratedDomainNameLabelScope"u8)) + if (prop.NameEquals("autoGeneratedDomainNameLabelScope"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - autoGeneratedDomainNameLabelScope = new AutoGeneratedDomainNameLabelScope(property.Value.GetString()); + autoGeneratedDomainNameLabelScope = new AutoGeneratedDomainNameLabelScope(prop.Value.GetString()); continue; } - if (property.NameEquals("hsms"u8)) + if (prop.NameEquals("hsms"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { array.Add(CloudHsmProperties.DeserializeCloudHsmProperties(item, options)); } hsms = array; continue; } - if (property.NameEquals("privateEndpointConnections"u8)) + if (prop.NameEquals("privateEndpointConnections"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { array.Add(CloudHsmClusterPrivateEndpointConnectionData.DeserializeCloudHsmClusterPrivateEndpointConnectionData(item, options)); } privateEndpointConnections = array; continue; } - if (property.NameEquals("provisioningState"u8)) + if (prop.NameEquals("provisioningState"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - provisioningState = new CloudHsmClusterProvisioningState(property.Value.GetString()); + provisioningState = new CloudHsmClusterProvisioningState(prop.Value.GetString()); continue; } - if (property.NameEquals("publicNetworkAccess"u8)) + if (prop.NameEquals("publicNetworkAccess"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - publicNetworkAccess = new CloudHsmClusterPublicNetworkAccess(property.Value.GetString()); + publicNetworkAccess = new CloudHsmClusterPublicNetworkAccess(prop.Value.GetString()); continue; } - if (property.NameEquals("statusMessage"u8)) + if (prop.NameEquals("statusMessage"u8)) { - statusMessage = property.Value.GetString(); + statusMessage = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new CloudHsmClusterProperties( activationState, autoGeneratedDomainNameLabelScope, @@ -210,13 +213,16 @@ internal static CloudHsmClusterProperties DeserializeCloudHsmClusterProperties(J provisioningState, publicNetworkAccess, statusMessage, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -226,15 +232,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterO } } - CloudHsmClusterProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + CloudHsmClusterProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual CloudHsmClusterProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeCloudHsmClusterProperties(document.RootElement, options); } default: @@ -242,6 +253,7 @@ CloudHsmClusterProperties IPersistableModel.Create(Bi } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterProperties.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterProperties.cs index 4ca855534f4f..605da5607269 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterProperties.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterProperties.cs @@ -7,43 +7,15 @@ using System; using System.Collections.Generic; +using Azure.ResourceManager.HardwareSecurityModules; namespace Azure.ResourceManager.HardwareSecurityModules.Models { /// Properties of a Cloud HSM Cluster. public partial class CloudHsmClusterProperties { - /// - /// 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; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . public CloudHsmClusterProperties() @@ -60,8 +32,8 @@ public CloudHsmClusterProperties() /// The Cloud HSM Cluster's provisioningState. /// The Cloud HSM Cluster public network access. /// Cloud HSM Cluster status message. - /// Keeps track of any properties unknown to the library. - internal CloudHsmClusterProperties(SecurityDomainActivationState? activationState, AutoGeneratedDomainNameLabelScope? autoGeneratedDomainNameLabelScope, IReadOnlyList hsms, IReadOnlyList privateEndpointConnections, CloudHsmClusterProvisioningState? provisioningState, CloudHsmClusterPublicNetworkAccess? publicNetworkAccess, string statusMessage, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal CloudHsmClusterProperties(SecurityDomainActivationState? activationState, AutoGeneratedDomainNameLabelScope? autoGeneratedDomainNameLabelScope, IReadOnlyList hsms, IReadOnlyList privateEndpointConnections, CloudHsmClusterProvisioningState? provisioningState, CloudHsmClusterPublicNetworkAccess? publicNetworkAccess, string statusMessage, IDictionary additionalBinaryDataProperties) { ActivationState = activationState; AutoGeneratedDomainNameLabelScope = autoGeneratedDomainNameLabelScope; @@ -70,21 +42,27 @@ internal CloudHsmClusterProperties(SecurityDomainActivationState? activationStat ProvisioningState = provisioningState; PublicNetworkAccess = publicNetworkAccess; StatusMessage = statusMessage; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// State of security domain activation. public SecurityDomainActivationState? ActivationState { get; } + /// The Cloud HSM Cluster's auto-generated Domain Name Label Scope. public AutoGeneratedDomainNameLabelScope? AutoGeneratedDomainNameLabelScope { get; set; } + /// An array of Cloud HSM Cluster's HSMs. public IReadOnlyList Hsms { get; } + /// List of private endpoint connection resources. public IReadOnlyList PrivateEndpointConnections { get; } + /// The Cloud HSM Cluster's provisioningState. public CloudHsmClusterProvisioningState? ProvisioningState { get; } + /// The Cloud HSM Cluster public network access. public CloudHsmClusterPublicNetworkAccess? PublicNetworkAccess { get; set; } + /// Cloud HSM Cluster status message. public string StatusMessage { get; } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterProvisioningState.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterProvisioningState.cs index 5df078c539c7..182a21b25cda 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterProvisioningState.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterProvisioningState.cs @@ -7,6 +7,7 @@ using System; using System.ComponentModel; +using Azure.ResourceManager.HardwareSecurityModules; namespace Azure.ResourceManager.HardwareSecurityModules.Models { @@ -14,14 +15,6 @@ namespace Azure.ResourceManager.HardwareSecurityModules.Models public readonly partial struct CloudHsmClusterProvisioningState : IEquatable { private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public CloudHsmClusterProvisioningState(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - private const string ProvisioningValue = "Provisioning"; private const string SucceededValue = "Succeeded"; private const string UpdatingValue = "Updating"; @@ -29,35 +22,64 @@ public CloudHsmClusterProvisioningState(string value) private const string DeletingValue = "Deleting"; private const string CanceledValue = "Canceled"; - /// Provisioning. + /// Initializes a new instance of . + /// The value. + /// is null. + public CloudHsmClusterProvisioningState(string value) + { + Argument.AssertNotNull(value, nameof(value)); + + _value = value; + } + + /// Gets the Provisioning. public static CloudHsmClusterProvisioningState Provisioning { get; } = new CloudHsmClusterProvisioningState(ProvisioningValue); - /// Succeeded. + + /// Gets the Succeeded. public static CloudHsmClusterProvisioningState Succeeded { get; } = new CloudHsmClusterProvisioningState(SucceededValue); - /// Updating. + + /// Gets the Updating. public static CloudHsmClusterProvisioningState Updating { get; } = new CloudHsmClusterProvisioningState(UpdatingValue); - /// Failed. + + /// Gets the Failed. public static CloudHsmClusterProvisioningState Failed { get; } = new CloudHsmClusterProvisioningState(FailedValue); - /// Deleting. + + /// Gets the Deleting. public static CloudHsmClusterProvisioningState Deleting { get; } = new CloudHsmClusterProvisioningState(DeletingValue); - /// Canceled. + + /// Gets the Canceled. public static CloudHsmClusterProvisioningState Canceled { get; } = new CloudHsmClusterProvisioningState(CanceledValue); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(CloudHsmClusterProvisioningState left, CloudHsmClusterProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + /// The left value to compare. + /// The right value to compare. public static bool operator !=(CloudHsmClusterProvisioningState left, CloudHsmClusterProvisioningState right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator CloudHsmClusterProvisioningState(string value) => new CloudHsmClusterProvisioningState(value); - /// + /// Converts a string to a . + /// The value. + public static implicit operator CloudHsmClusterProvisioningState?(string value) => value == null ? null : new CloudHsmClusterProvisioningState(value); + + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is CloudHsmClusterProvisioningState other && Equals(other); - /// + + /// public bool Equals(CloudHsmClusterProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// + + /// public override string ToString() => _value; } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterPublicNetworkAccess.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterPublicNetworkAccess.cs index 779893c96860..acca3b53b21f 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterPublicNetworkAccess.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterPublicNetworkAccess.cs @@ -7,6 +7,7 @@ using System; using System.ComponentModel; +using Azure.ResourceManager.HardwareSecurityModules; namespace Azure.ResourceManager.HardwareSecurityModules.Models { @@ -14,35 +15,51 @@ namespace Azure.ResourceManager.HardwareSecurityModules.Models public readonly partial struct CloudHsmClusterPublicNetworkAccess : IEquatable { private readonly string _value; + private const string DisabledValue = "Disabled"; /// Initializes a new instance of . + /// The value. /// is null. public CloudHsmClusterPublicNetworkAccess(string value) { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } + Argument.AssertNotNull(value, nameof(value)); - private const string DisabledValue = "Disabled"; + _value = value; + } - /// Disabled. + /// Gets the Disabled. public static CloudHsmClusterPublicNetworkAccess Disabled { get; } = new CloudHsmClusterPublicNetworkAccess(DisabledValue); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(CloudHsmClusterPublicNetworkAccess left, CloudHsmClusterPublicNetworkAccess right) => left.Equals(right); + /// Determines if two values are not the same. + /// The left value to compare. + /// The right value to compare. public static bool operator !=(CloudHsmClusterPublicNetworkAccess left, CloudHsmClusterPublicNetworkAccess right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator CloudHsmClusterPublicNetworkAccess(string value) => new CloudHsmClusterPublicNetworkAccess(value); - /// + /// Converts a string to a . + /// The value. + public static implicit operator CloudHsmClusterPublicNetworkAccess?(string value) => value == null ? null : new CloudHsmClusterPublicNetworkAccess(value); + + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is CloudHsmClusterPublicNetworkAccess other && Equals(other); - /// + + /// public bool Equals(CloudHsmClusterPublicNetworkAccess other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// + + /// public override string ToString() => _value; } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterRestoreContent.Serialization.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterRestoreContent.Serialization.cs index 5e1baf859cdc..3deacd026d7f 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterRestoreContent.Serialization.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterRestoreContent.Serialization.cs @@ -10,13 +10,20 @@ using System.Collections.Generic; using System.Text.Json; using Azure.Core; +using Azure.ResourceManager.HardwareSecurityModules; namespace Azure.ResourceManager.HardwareSecurityModules.Models { - public partial class CloudHsmClusterRestoreContent : IUtf8JsonSerializable, IJsonModel + /// Cloud Hsm Cluster restore information. + public partial class CloudHsmClusterRestoreContent : BackupRestoreRequestBaseProperties, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal CloudHsmClusterRestoreContent() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,72 +35,77 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(CloudHsmClusterRestoreContent)} does not support writing '{format}' format."); } - base.JsonModelWriteCore(writer, options); writer.WritePropertyName("backupId"u8); writer.WriteStringValue(BackupId); } - CloudHsmClusterRestoreContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + CloudHsmClusterRestoreContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => (CloudHsmClusterRestoreContent)JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected override BackupRestoreRequestBaseProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(CloudHsmClusterRestoreContent)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeCloudHsmClusterRestoreContent(document.RootElement, options); } - internal static CloudHsmClusterRestoreContent DeserializeCloudHsmClusterRestoreContent(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static CloudHsmClusterRestoreContent DeserializeCloudHsmClusterRestoreContent(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - string backupId = default; Uri azureStorageBlobContainerUri = default; string token = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + string backupId = default; + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("backupId"u8)) + if (prop.NameEquals("azureStorageBlobContainerUri"u8)) { - backupId = property.Value.GetString(); + azureStorageBlobContainerUri = new Uri(prop.Value.GetString()); continue; } - if (property.NameEquals("azureStorageBlobContainerUri"u8)) + if (prop.NameEquals("token"u8)) { - azureStorageBlobContainerUri = new Uri(property.Value.GetString()); + token = prop.Value.GetString(); continue; } - if (property.NameEquals("token"u8)) + if (prop.NameEquals("backupId"u8)) { - token = property.Value.GetString(); + backupId = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new CloudHsmClusterRestoreContent(azureStorageBlobContainerUri, token, serializedAdditionalRawData, backupId); + return new CloudHsmClusterRestoreContent(azureStorageBlobContainerUri, token, additionalBinaryDataProperties, backupId); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -103,15 +115,20 @@ BinaryData IPersistableModel.Write(ModelReaderWri } } - CloudHsmClusterRestoreContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + CloudHsmClusterRestoreContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => (CloudHsmClusterRestoreContent)PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected override BackupRestoreRequestBaseProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeCloudHsmClusterRestoreContent(document.RootElement, options); } default: @@ -119,6 +136,19 @@ CloudHsmClusterRestoreContent IPersistableModel.C } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to serialize into . + internal static RequestContent ToRequestContent(CloudHsmClusterRestoreContent cloudHsmClusterRestoreContent) + { + if (cloudHsmClusterRestoreContent == null) + { + return null; + } + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(cloudHsmClusterRestoreContent, ModelSerializationExtensions.WireOptions); + return content; + } } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterRestoreContent.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterRestoreContent.cs index ebbc0e8a4165..606e08f3a624 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterRestoreContent.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterRestoreContent.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using Azure.ResourceManager.HardwareSecurityModules; namespace Azure.ResourceManager.HardwareSecurityModules.Models { @@ -28,18 +29,13 @@ public CloudHsmClusterRestoreContent(Uri azureStorageBlobContainerUri, string ba /// Initializes a new instance of . /// The Azure blob storage container Uri which contains the backup. /// The SAS token pointing to an Azure blob storage container. This property is reserved for Azure Backup Service. - /// Keeps track of any properties unknown to the library. + /// Keeps track of any properties unknown to the library. /// An autogenerated unique string ID for labeling the backup. It contains both a UUID and a date timestamp. - internal CloudHsmClusterRestoreContent(Uri azureStorageBlobContainerUri, string token, IDictionary serializedAdditionalRawData, string backupId) : base(azureStorageBlobContainerUri, token, serializedAdditionalRawData) + internal CloudHsmClusterRestoreContent(Uri azureStorageBlobContainerUri, string token, IDictionary additionalBinaryDataProperties, string backupId) : base(azureStorageBlobContainerUri, token, additionalBinaryDataProperties) { BackupId = backupId; } - /// Initializes a new instance of for deserialization. - internal CloudHsmClusterRestoreContent() - { - } - /// An autogenerated unique string ID for labeling the backup. It contains both a UUID and a date timestamp. public string BackupId { get; } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterRestoreResult.Serialization.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterRestoreResult.Serialization.cs index 9ff6f326709d..62b17eda6f96 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterRestoreResult.Serialization.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterRestoreResult.Serialization.cs @@ -9,14 +9,16 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure; +using Azure.ResourceManager.HardwareSecurityModules; namespace Azure.ResourceManager.HardwareSecurityModules.Models { - public partial class CloudHsmClusterRestoreResult : IUtf8JsonSerializable, IJsonModel + /// Restore operation properties. + public partial class CloudHsmClusterRestoreResult : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,26 +30,25 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model /// 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; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(CloudHsmClusterRestoreResult)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Properties)) { writer.WritePropertyName("properties"u8); writer.WriteObjectValue(Properties, options); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -56,53 +57,59 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - CloudHsmClusterRestoreResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + CloudHsmClusterRestoreResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual CloudHsmClusterRestoreResult JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(CloudHsmClusterRestoreResult)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeCloudHsmClusterRestoreResult(document.RootElement, options); } - internal static CloudHsmClusterRestoreResult DeserializeCloudHsmClusterRestoreResult(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static CloudHsmClusterRestoreResult DeserializeCloudHsmClusterRestoreResult(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } BackupRestoreBaseResultProperties properties = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("properties"u8)) + if (prop.NameEquals("properties"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - properties = BackupRestoreBaseResultProperties.DeserializeBackupRestoreBaseResultProperties(property.Value, options); + properties = BackupRestoreBaseResultProperties.DeserializeBackupRestoreBaseResultProperties(prop.Value, options); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new CloudHsmClusterRestoreResult(properties, serializedAdditionalRawData); + return new CloudHsmClusterRestoreResult(properties, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -112,15 +119,20 @@ BinaryData IPersistableModel.Write(ModelReaderWrit } } - CloudHsmClusterRestoreResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + CloudHsmClusterRestoreResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual CloudHsmClusterRestoreResult PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeCloudHsmClusterRestoreResult(document.RootElement, options); } default: @@ -128,6 +140,14 @@ CloudHsmClusterRestoreResult IPersistableModel.Cre } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to deserialize the from. + internal static CloudHsmClusterRestoreResult FromResponse(Response response) + { + using JsonDocument document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCloudHsmClusterRestoreResult(document.RootElement, ModelSerializationExtensions.WireOptions); + } } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterRestoreResult.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterRestoreResult.cs index 252cb5eb8138..b7e03c3238ab 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterRestoreResult.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterRestoreResult.cs @@ -13,37 +13,8 @@ namespace Azure.ResourceManager.HardwareSecurityModules.Models /// Restore operation properties. public partial class CloudHsmClusterRestoreResult { - /// - /// 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; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal CloudHsmClusterRestoreResult() @@ -52,11 +23,11 @@ internal CloudHsmClusterRestoreResult() /// Initializes a new instance of . /// Backup and Restore operation common properties. - /// Keeps track of any properties unknown to the library. - internal CloudHsmClusterRestoreResult(BackupRestoreBaseResultProperties properties, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal CloudHsmClusterRestoreResult(BackupRestoreBaseResultProperties properties, IDictionary additionalBinaryDataProperties) { Properties = properties; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Backup and Restore operation common properties. diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterSku.Serialization.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterSku.Serialization.cs index abf689f056bc..c5daa3cc3c75 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterSku.Serialization.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterSku.Serialization.cs @@ -9,14 +9,20 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.HardwareSecurityModules; namespace Azure.ResourceManager.HardwareSecurityModules.Models { - public partial class CloudHsmClusterSku : IUtf8JsonSerializable, IJsonModel + /// Cloud Hsm Cluster SKU information. + public partial class CloudHsmClusterSku : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal CloudHsmClusterSku() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +34,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit /// 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; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(CloudHsmClusterSku)} does not support writing '{format}' format."); } - writer.WritePropertyName("family"u8); writer.WriteStringValue(Family.ToString()); writer.WritePropertyName("name"u8); @@ -43,15 +48,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("capacity"u8); writer.WriteNumberValue(Capacity.Value); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -60,22 +65,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - CloudHsmClusterSku IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + CloudHsmClusterSku IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual CloudHsmClusterSku JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(CloudHsmClusterSku)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeCloudHsmClusterSku(document.RootElement, options); } - internal static CloudHsmClusterSku DeserializeCloudHsmClusterSku(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static CloudHsmClusterSku DeserializeCloudHsmClusterSku(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -83,42 +93,43 @@ internal static CloudHsmClusterSku DeserializeCloudHsmClusterSku(JsonElement ele CloudHsmClusterSkuFamily family = default; CloudHsmClusterSkuName name = default; int? capacity = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("family"u8)) + if (prop.NameEquals("family"u8)) { - family = new CloudHsmClusterSkuFamily(property.Value.GetString()); + family = new CloudHsmClusterSkuFamily(prop.Value.GetString()); continue; } - if (property.NameEquals("name"u8)) + if (prop.NameEquals("name"u8)) { - name = property.Value.GetString().ToCloudHsmClusterSkuName(); + name = prop.Value.GetString().ToCloudHsmClusterSkuName(); continue; } - if (property.NameEquals("capacity"u8)) + if (prop.NameEquals("capacity"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - capacity = property.Value.GetInt32(); + capacity = prop.Value.GetInt32(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new CloudHsmClusterSku(family, name, capacity, serializedAdditionalRawData); + return new CloudHsmClusterSku(family, name, capacity, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -128,15 +139,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions } } - CloudHsmClusterSku IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + CloudHsmClusterSku IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual CloudHsmClusterSku PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeCloudHsmClusterSku(document.RootElement, options); } default: @@ -144,6 +160,7 @@ CloudHsmClusterSku IPersistableModel.Create(BinaryData data, } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterSku.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterSku.cs index 0417653ba07c..a0db201eedf8 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterSku.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterSku.cs @@ -13,37 +13,8 @@ namespace Azure.ResourceManager.HardwareSecurityModules.Models /// Cloud Hsm Cluster SKU information. public partial class CloudHsmClusterSku { - /// - /// 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; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// Sku family of the Cloud HSM Cluster. @@ -58,24 +29,21 @@ public CloudHsmClusterSku(CloudHsmClusterSkuFamily family, CloudHsmClusterSkuNam /// Sku family of the Cloud HSM Cluster. /// Sku name of the Cloud HSM Cluster. /// Sku capacity. - /// Keeps track of any properties unknown to the library. - internal CloudHsmClusterSku(CloudHsmClusterSkuFamily family, CloudHsmClusterSkuName name, int? capacity, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal CloudHsmClusterSku(CloudHsmClusterSkuFamily family, CloudHsmClusterSkuName name, int? capacity, IDictionary additionalBinaryDataProperties) { Family = family; Name = name; Capacity = capacity; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal CloudHsmClusterSku() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Sku family of the Cloud HSM Cluster. public CloudHsmClusterSkuFamily Family { get; set; } + /// Sku name of the Cloud HSM Cluster. public CloudHsmClusterSkuName Name { get; set; } + /// Sku capacity. public int? Capacity { get; set; } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterSkuFamily.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterSkuFamily.cs index 5e8e7a17702c..009dd68becd3 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterSkuFamily.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterSkuFamily.cs @@ -7,6 +7,7 @@ using System; using System.ComponentModel; +using Azure.ResourceManager.HardwareSecurityModules; namespace Azure.ResourceManager.HardwareSecurityModules.Models { @@ -14,35 +15,51 @@ namespace Azure.ResourceManager.HardwareSecurityModules.Models public readonly partial struct CloudHsmClusterSkuFamily : IEquatable { private readonly string _value; + private const string BValue = "B"; /// Initializes a new instance of . + /// The value. /// is null. public CloudHsmClusterSkuFamily(string value) { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } + Argument.AssertNotNull(value, nameof(value)); - private const string BValue = "B"; + _value = value; + } - /// B. + /// Gets the B. public static CloudHsmClusterSkuFamily B { get; } = new CloudHsmClusterSkuFamily(BValue); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(CloudHsmClusterSkuFamily left, CloudHsmClusterSkuFamily right) => left.Equals(right); + /// Determines if two values are not the same. + /// The left value to compare. + /// The right value to compare. public static bool operator !=(CloudHsmClusterSkuFamily left, CloudHsmClusterSkuFamily right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator CloudHsmClusterSkuFamily(string value) => new CloudHsmClusterSkuFamily(value); - /// + /// Converts a string to a . + /// The value. + public static implicit operator CloudHsmClusterSkuFamily?(string value) => value == null ? null : new CloudHsmClusterSkuFamily(value); + + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is CloudHsmClusterSkuFamily other && Equals(other); - /// + + /// public bool Equals(CloudHsmClusterSkuFamily other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// + + /// public override string ToString() => _value; } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterSkuName.Serialization.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterSkuName.Serialization.cs index 9067873a5d64..162ddc1acef8 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterSkuName.Serialization.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterSkuName.Serialization.cs @@ -11,6 +11,7 @@ namespace Azure.ResourceManager.HardwareSecurityModules.Models { internal static partial class CloudHsmClusterSkuNameExtensions { + /// The value to serialize. public static string ToSerialString(this CloudHsmClusterSkuName value) => value switch { CloudHsmClusterSkuName.StandardB1 => "Standard_B1", @@ -18,10 +19,17 @@ internal static partial class CloudHsmClusterSkuNameExtensions _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown CloudHsmClusterSkuName value.") }; + /// The value to deserialize. public static CloudHsmClusterSkuName ToCloudHsmClusterSkuName(this string value) { - if (StringComparer.OrdinalIgnoreCase.Equals(value, "Standard_B1")) return CloudHsmClusterSkuName.StandardB1; - if (StringComparer.OrdinalIgnoreCase.Equals(value, "Standard B10")) return CloudHsmClusterSkuName.StandardB10; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "Standard_B1")) + { + return CloudHsmClusterSkuName.StandardB1; + } + if (StringComparer.OrdinalIgnoreCase.Equals(value, "Standard B10")) + { + return CloudHsmClusterSkuName.StandardB10; + } throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown CloudHsmClusterSkuName value."); } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterSkuName.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterSkuName.cs index 9aeaf1c7ca03..1b81c8ab4202 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterSkuName.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmClusterSkuName.cs @@ -10,9 +10,9 @@ namespace Azure.ResourceManager.HardwareSecurityModules.Models /// Sku name of the Cloud HSM Cluster. public enum CloudHsmClusterSkuName { - /// Standard_B1. + /// StandardB1. StandardB1, - /// Standard B10. + /// StandardB10. StandardB10 } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmProperties.Serialization.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmProperties.Serialization.cs index 1dec03bdcc18..99b1a411179b 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmProperties.Serialization.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmProperties.Serialization.cs @@ -9,14 +9,15 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.HardwareSecurityModules; namespace Azure.ResourceManager.HardwareSecurityModules.Models { - public partial class CloudHsmProperties : IUtf8JsonSerializable, IJsonModel + /// The Cloud HSM Properties. + public partial class CloudHsmProperties : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +29,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit /// 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; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(CloudHsmProperties)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Fqdn)) { writer.WritePropertyName("fqdn"u8); @@ -49,15 +49,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("stateMessage"u8); writer.WriteStringValue(StateMessage); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -66,22 +66,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - CloudHsmProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + CloudHsmProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual CloudHsmProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(CloudHsmProperties)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeCloudHsmProperties(document.RootElement, options); } - internal static CloudHsmProperties DeserializeCloudHsmProperties(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static CloudHsmProperties DeserializeCloudHsmProperties(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -89,38 +94,39 @@ internal static CloudHsmProperties DeserializeCloudHsmProperties(JsonElement ele string fqdn = default; string state = default; string stateMessage = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("fqdn"u8)) + if (prop.NameEquals("fqdn"u8)) { - fqdn = property.Value.GetString(); + fqdn = prop.Value.GetString(); continue; } - if (property.NameEquals("state"u8)) + if (prop.NameEquals("state"u8)) { - state = property.Value.GetString(); + state = prop.Value.GetString(); continue; } - if (property.NameEquals("stateMessage"u8)) + if (prop.NameEquals("stateMessage"u8)) { - stateMessage = property.Value.GetString(); + stateMessage = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new CloudHsmProperties(fqdn, state, stateMessage, serializedAdditionalRawData); + return new CloudHsmProperties(fqdn, state, stateMessage, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -130,15 +136,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions } } - CloudHsmProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + CloudHsmProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual CloudHsmProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeCloudHsmProperties(document.RootElement, options); } default: @@ -146,6 +157,7 @@ CloudHsmProperties IPersistableModel.Create(BinaryData data, } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmProperties.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmProperties.cs index 9ebd8232623e..2242641fcaa2 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmProperties.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/CloudHsmProperties.cs @@ -13,37 +13,8 @@ namespace Azure.ResourceManager.HardwareSecurityModules.Models /// The Cloud HSM Properties. public partial class CloudHsmProperties { - /// - /// 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; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal CloudHsmProperties() @@ -54,19 +25,21 @@ internal CloudHsmProperties() /// FQDN of the Cloud HSM. /// The Cloud HSM State. Values are: Deploying, ConfiguringSlb, Starting, Starting, Failed, Failed, Deleting, DeletingSlbEntry, InitialProvisioning, Updating. /// The Cloud HSM State message. - /// Keeps track of any properties unknown to the library. - internal CloudHsmProperties(string fqdn, string state, string stateMessage, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal CloudHsmProperties(string fqdn, string state, string stateMessage, IDictionary additionalBinaryDataProperties) { Fqdn = fqdn; State = state; StateMessage = stateMessage; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// FQDN of the Cloud HSM. public string Fqdn { get; } + /// The Cloud HSM State. Values are: Deploying, ConfiguringSlb, Starting, Starting, Failed, Failed, Deleting, DeletingSlbEntry, InitialProvisioning, Updating. public string State { get; } + /// The Cloud HSM State message. public string StateMessage { get; } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmEgressEndpoint.Serialization.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmEgressEndpoint.Serialization.cs index 4596e0c3d533..00790d03e729 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmEgressEndpoint.Serialization.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmEgressEndpoint.Serialization.cs @@ -9,14 +9,15 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.HardwareSecurityModules; namespace Azure.ResourceManager.HardwareSecurityModules.Models { - public partial class DedicatedHsmEgressEndpoint : IUtf8JsonSerializable, IJsonModel + /// Egress endpoints which dedicated hsm service connects to for common purpose. + public partial class DedicatedHsmEgressEndpoint : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +29,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe /// 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; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(DedicatedHsmEgressEndpoint)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Category)) { writer.WritePropertyName("category"u8); @@ -43,21 +43,21 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit { writer.WritePropertyName("endpoints"u8); writer.WriteStartArray(); - foreach (var item in Endpoints) + foreach (DedicatedHsmEndpointDependency item in Endpoints) { writer.WriteObjectValue(item, options); } writer.WriteEndArray(); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -66,45 +66,49 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - DedicatedHsmEgressEndpoint IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + DedicatedHsmEgressEndpoint IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual DedicatedHsmEgressEndpoint JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(DedicatedHsmEgressEndpoint)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeDedicatedHsmEgressEndpoint(document.RootElement, options); } - internal static DedicatedHsmEgressEndpoint DeserializeDedicatedHsmEgressEndpoint(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static DedicatedHsmEgressEndpoint DeserializeDedicatedHsmEgressEndpoint(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string category = default; IReadOnlyList endpoints = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("category"u8)) + if (prop.NameEquals("category"u8)) { - category = property.Value.GetString(); + category = prop.Value.GetString(); continue; } - if (property.NameEquals("endpoints"u8)) + if (prop.NameEquals("endpoints"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { array.Add(DedicatedHsmEndpointDependency.DeserializeDedicatedHsmEndpointDependency(item, options)); } @@ -113,17 +117,19 @@ internal static DedicatedHsmEgressEndpoint DeserializeDedicatedHsmEgressEndpoint } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new DedicatedHsmEgressEndpoint(category, endpoints ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new DedicatedHsmEgressEndpoint(category, endpoints ?? new ChangeTrackingList(), additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -133,15 +139,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriter } } - DedicatedHsmEgressEndpoint IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + DedicatedHsmEgressEndpoint IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual DedicatedHsmEgressEndpoint PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeDedicatedHsmEgressEndpoint(document.RootElement, options); } default: @@ -149,6 +160,7 @@ DedicatedHsmEgressEndpoint IPersistableModel.Create( } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmEgressEndpoint.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmEgressEndpoint.cs index e133da868699..861baff48903 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmEgressEndpoint.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmEgressEndpoint.cs @@ -7,43 +7,15 @@ using System; using System.Collections.Generic; +using Azure.ResourceManager.HardwareSecurityModules; namespace Azure.ResourceManager.HardwareSecurityModules.Models { /// Egress endpoints which dedicated hsm service connects to for common purpose. public partial class DedicatedHsmEgressEndpoint { - /// - /// 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; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal DedicatedHsmEgressEndpoint() @@ -54,16 +26,17 @@ internal DedicatedHsmEgressEndpoint() /// Initializes a new instance of . /// The category of endpoints accessed by the dedicated hsm service, e.g. azure-resource-management, apiserver, etc. /// The endpoints that dedicated hsm service connects to. - /// Keeps track of any properties unknown to the library. - internal DedicatedHsmEgressEndpoint(string category, IReadOnlyList endpoints, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal DedicatedHsmEgressEndpoint(string category, IReadOnlyList endpoints, IDictionary additionalBinaryDataProperties) { Category = category; Endpoints = endpoints; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The category of endpoints accessed by the dedicated hsm service, e.g. azure-resource-management, apiserver, etc. public string Category { get; } + /// The endpoints that dedicated hsm service connects to. public IReadOnlyList Endpoints { get; } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmEgressEndpointListResult.Serialization.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmEgressEndpointListResult.Serialization.cs index 15881ab074ed..ae2caf7b01ea 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmEgressEndpointListResult.Serialization.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmEgressEndpointListResult.Serialization.cs @@ -9,14 +9,21 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure; +using Azure.ResourceManager.HardwareSecurityModules; namespace Azure.ResourceManager.HardwareSecurityModules.Models { - internal partial class DedicatedHsmEgressEndpointListResult : IUtf8JsonSerializable, IJsonModel + /// Collection of OutboundEnvironmentEndpoint. + internal partial class DedicatedHsmEgressEndpointListResult : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal DedicatedHsmEgressEndpointListResult() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,15 +35,14 @@ void IJsonModel.Write(Utf8JsonWriter write /// 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; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(DedicatedHsmEgressEndpointListResult)} does not support writing '{format}' format."); } - writer.WritePropertyName("value"u8); writer.WriteStartArray(); - foreach (var item in Value) + foreach (DedicatedHsmEgressEndpoint item in Value) { writer.WriteObjectValue(item, options); } @@ -46,15 +52,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("nextLink"u8); writer.WriteStringValue(NextLink.AbsoluteUri); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -63,64 +69,70 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - DedicatedHsmEgressEndpointListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + DedicatedHsmEgressEndpointListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual DedicatedHsmEgressEndpointListResult JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(DedicatedHsmEgressEndpointListResult)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeDedicatedHsmEgressEndpointListResult(document.RootElement, options); } - internal static DedicatedHsmEgressEndpointListResult DeserializeDedicatedHsmEgressEndpointListResult(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static DedicatedHsmEgressEndpointListResult DeserializeDedicatedHsmEgressEndpointListResult(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - IReadOnlyList value = default; + IList value = default; Uri nextLink = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("value"u8)) + if (prop.NameEquals("value"u8)) { List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { array.Add(DedicatedHsmEgressEndpoint.DeserializeDedicatedHsmEgressEndpoint(item, options)); } value = array; continue; } - if (property.NameEquals("nextLink"u8)) + if (prop.NameEquals("nextLink"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - nextLink = new Uri(property.Value.GetString()); + nextLink = new Uri(prop.Value.GetString()); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new DedicatedHsmEgressEndpointListResult(value, nextLink, serializedAdditionalRawData); + return new DedicatedHsmEgressEndpointListResult(value, nextLink, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -130,15 +142,20 @@ BinaryData IPersistableModel.Write(ModelRe } } - DedicatedHsmEgressEndpointListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + DedicatedHsmEgressEndpointListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual DedicatedHsmEgressEndpointListResult PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeDedicatedHsmEgressEndpointListResult(document.RootElement, options); } default: @@ -146,6 +163,14 @@ DedicatedHsmEgressEndpointListResult IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to deserialize the from. + internal static DedicatedHsmEgressEndpointListResult FromResponse(Response response) + { + using JsonDocument document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDedicatedHsmEgressEndpointListResult(document.RootElement, ModelSerializationExtensions.WireOptions); + } } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmEgressEndpointListResult.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmEgressEndpointListResult.cs index 969c959d2bac..5a77bb65a453 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmEgressEndpointListResult.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmEgressEndpointListResult.cs @@ -14,66 +14,30 @@ namespace Azure.ResourceManager.HardwareSecurityModules.Models /// Collection of OutboundEnvironmentEndpoint. internal partial class DedicatedHsmEgressEndpointListResult { - /// - /// 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; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The OutboundEnvironmentEndpoint items on this page. - /// is null. internal DedicatedHsmEgressEndpointListResult(IEnumerable value) { - Argument.AssertNotNull(value, nameof(value)); - Value = value.ToList(); } /// Initializes a new instance of . /// The OutboundEnvironmentEndpoint items on this page. /// The link to the next page of items. - /// Keeps track of any properties unknown to the library. - internal DedicatedHsmEgressEndpointListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal DedicatedHsmEgressEndpointListResult(IList value, Uri nextLink, IDictionary additionalBinaryDataProperties) { Value = value; NextLink = nextLink; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal DedicatedHsmEgressEndpointListResult() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The OutboundEnvironmentEndpoint items on this page. - public IReadOnlyList Value { get; } + public IList Value { get; } + /// The link to the next page of items. public Uri NextLink { get; } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmEndpointDependency.Serialization.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmEndpointDependency.Serialization.cs index e21623de709d..426e4f525c24 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmEndpointDependency.Serialization.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmEndpointDependency.Serialization.cs @@ -9,14 +9,15 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.HardwareSecurityModules; namespace Azure.ResourceManager.HardwareSecurityModules.Models { - public partial class DedicatedHsmEndpointDependency : IUtf8JsonSerializable, IJsonModel + /// A domain name that dedicated hsm services are reaching at. + public partial class DedicatedHsmEndpointDependency : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +29,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod /// 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; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(DedicatedHsmEndpointDependency)} does not support writing '{format}' format."); } - if (Optional.IsDefined(DomainName)) { writer.WritePropertyName("domainName"u8); @@ -43,21 +43,21 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit { writer.WritePropertyName("endpointDetails"u8); writer.WriteStartArray(); - foreach (var item in EndpointDetails) + foreach (DedicatedHsmEndpointDetail item in EndpointDetails) { writer.WriteObjectValue(item, options); } writer.WriteEndArray(); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -66,45 +66,49 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - DedicatedHsmEndpointDependency IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + DedicatedHsmEndpointDependency IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual DedicatedHsmEndpointDependency JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(DedicatedHsmEndpointDependency)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeDedicatedHsmEndpointDependency(document.RootElement, options); } - internal static DedicatedHsmEndpointDependency DeserializeDedicatedHsmEndpointDependency(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static DedicatedHsmEndpointDependency DeserializeDedicatedHsmEndpointDependency(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } string domainName = default; IReadOnlyList endpointDetails = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("domainName"u8)) + if (prop.NameEquals("domainName"u8)) { - domainName = property.Value.GetString(); + domainName = prop.Value.GetString(); continue; } - if (property.NameEquals("endpointDetails"u8)) + if (prop.NameEquals("endpointDetails"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { array.Add(DedicatedHsmEndpointDetail.DeserializeDedicatedHsmEndpointDetail(item, options)); } @@ -113,17 +117,19 @@ internal static DedicatedHsmEndpointDependency DeserializeDedicatedHsmEndpointDe } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new DedicatedHsmEndpointDependency(domainName, endpointDetails ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new DedicatedHsmEndpointDependency(domainName, endpointDetails ?? new ChangeTrackingList(), additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -133,15 +139,20 @@ BinaryData IPersistableModel.Write(ModelReaderWr } } - DedicatedHsmEndpointDependency IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + DedicatedHsmEndpointDependency IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual DedicatedHsmEndpointDependency PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeDedicatedHsmEndpointDependency(document.RootElement, options); } default: @@ -149,6 +160,7 @@ DedicatedHsmEndpointDependency IPersistableModel } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmEndpointDependency.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmEndpointDependency.cs index f85f42964d55..2939651da478 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmEndpointDependency.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmEndpointDependency.cs @@ -7,43 +7,15 @@ using System; using System.Collections.Generic; +using Azure.ResourceManager.HardwareSecurityModules; namespace Azure.ResourceManager.HardwareSecurityModules.Models { /// A domain name that dedicated hsm services are reaching at. public partial class DedicatedHsmEndpointDependency { - /// - /// 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; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal DedicatedHsmEndpointDependency() @@ -54,16 +26,17 @@ internal DedicatedHsmEndpointDependency() /// Initializes a new instance of . /// The domain name of the dependency. /// The Ports and Protocols used when connecting to domainName. - /// Keeps track of any properties unknown to the library. - internal DedicatedHsmEndpointDependency(string domainName, IReadOnlyList endpointDetails, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal DedicatedHsmEndpointDependency(string domainName, IReadOnlyList endpointDetails, IDictionary additionalBinaryDataProperties) { DomainName = domainName; EndpointDetails = endpointDetails; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The domain name of the dependency. public string DomainName { get; } + /// The Ports and Protocols used when connecting to domainName. public IReadOnlyList EndpointDetails { get; } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmEndpointDetail.Serialization.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmEndpointDetail.Serialization.cs index 49c775e09a12..cad2ec14443d 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmEndpointDetail.Serialization.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmEndpointDetail.Serialization.cs @@ -9,14 +9,15 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.HardwareSecurityModules; namespace Azure.ResourceManager.HardwareSecurityModules.Models { - public partial class DedicatedHsmEndpointDetail : IUtf8JsonSerializable, IJsonModel + /// Connect information from the dedicated hsm service to a single endpoint. + public partial class DedicatedHsmEndpointDetail : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +29,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe /// 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; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(DedicatedHsmEndpointDetail)} does not support writing '{format}' format."); } - if (Optional.IsDefined(IPAddress)) { writer.WritePropertyName("ipAddress"u8); @@ -54,15 +54,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("description"u8); writer.WriteStringValue(Description); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -71,22 +71,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - DedicatedHsmEndpointDetail IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + DedicatedHsmEndpointDetail IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual DedicatedHsmEndpointDetail JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(DedicatedHsmEndpointDetail)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeDedicatedHsmEndpointDetail(document.RootElement, options); } - internal static DedicatedHsmEndpointDetail DeserializeDedicatedHsmEndpointDetail(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static DedicatedHsmEndpointDetail DeserializeDedicatedHsmEndpointDetail(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -95,47 +100,48 @@ internal static DedicatedHsmEndpointDetail DeserializeDedicatedHsmEndpointDetail int? port = default; string protocol = default; string description = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("ipAddress"u8)) + if (prop.NameEquals("ipAddress"u8)) { - ipAddress = property.Value.GetString(); + ipAddress = prop.Value.GetString(); continue; } - if (property.NameEquals("port"u8)) + if (prop.NameEquals("port"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - port = property.Value.GetInt32(); + port = prop.Value.GetInt32(); continue; } - if (property.NameEquals("protocol"u8)) + if (prop.NameEquals("protocol"u8)) { - protocol = property.Value.GetString(); + protocol = prop.Value.GetString(); continue; } - if (property.NameEquals("description"u8)) + if (prop.NameEquals("description"u8)) { - description = property.Value.GetString(); + description = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new DedicatedHsmEndpointDetail(ipAddress, port, protocol, description, serializedAdditionalRawData); + return new DedicatedHsmEndpointDetail(ipAddress, port, protocol, description, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -145,15 +151,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriter } } - DedicatedHsmEndpointDetail IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + DedicatedHsmEndpointDetail IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual DedicatedHsmEndpointDetail PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeDedicatedHsmEndpointDetail(document.RootElement, options); } default: @@ -161,6 +172,7 @@ DedicatedHsmEndpointDetail IPersistableModel.Create( } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmEndpointDetail.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmEndpointDetail.cs index 4fc712e1bc23..cbcfe9992c5e 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmEndpointDetail.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmEndpointDetail.cs @@ -13,37 +13,8 @@ namespace Azure.ResourceManager.HardwareSecurityModules.Models /// Connect information from the dedicated hsm service to a single endpoint. public partial class DedicatedHsmEndpointDetail { - /// - /// 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; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal DedicatedHsmEndpointDetail() @@ -55,22 +26,25 @@ internal DedicatedHsmEndpointDetail() /// The port an endpoint is connected to. /// The protocol used for connection. /// Description of the detail. - /// Keeps track of any properties unknown to the library. - internal DedicatedHsmEndpointDetail(string ipAddress, int? port, string protocol, string description, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal DedicatedHsmEndpointDetail(string ipAddress, int? port, string protocol, string description, IDictionary additionalBinaryDataProperties) { IPAddress = ipAddress; Port = port; Protocol = protocol; Description = description; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// An IP Address that Domain Name currently resolves to. public string IPAddress { get; } + /// The port an endpoint is connected to. public int? Port { get; } + /// The protocol used for connection. public string Protocol { get; } + /// Description of the detail. public string Description { get; } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmJsonWebKeyType.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmJsonWebKeyType.cs index 092f6385bf3d..12c61ca9830b 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmJsonWebKeyType.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmJsonWebKeyType.cs @@ -7,6 +7,7 @@ using System; using System.ComponentModel; +using Azure.ResourceManager.HardwareSecurityModules; namespace Azure.ResourceManager.HardwareSecurityModules.Models { @@ -14,53 +15,82 @@ namespace Azure.ResourceManager.HardwareSecurityModules.Models public readonly partial struct DedicatedHsmJsonWebKeyType : IEquatable { private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public DedicatedHsmJsonWebKeyType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - + /// The dedicated HSM has been fully provisioned. private const string SucceededValue = "Succeeded"; + /// The dedicated HSM is currently being provisioned. private const string ProvisioningValue = "Provisioning"; + /// A device is currently being allocated for the dedicated HSM resource. private const string AllocatingValue = "Allocating"; + /// The dedicated HSM is being connected to the virtual network. private const string ConnectingValue = "Connecting"; + /// Provisioning of the dedicated HSM has failed. private const string FailedValue = "Failed"; + /// Validating the subscription has sufficient quota to allocate a dedicated HSM device. private const string CheckingQuotaValue = "CheckingQuota"; + /// The dedicated HSM is currently being deleted. private const string DeletingValue = "Deleting"; + /// Initializes a new instance of . + /// The value. + /// is null. + public DedicatedHsmJsonWebKeyType(string value) + { + Argument.AssertNotNull(value, nameof(value)); + + _value = value; + } + /// The dedicated HSM has been fully provisioned. public static DedicatedHsmJsonWebKeyType Succeeded { get; } = new DedicatedHsmJsonWebKeyType(SucceededValue); + /// The dedicated HSM is currently being provisioned. public static DedicatedHsmJsonWebKeyType Provisioning { get; } = new DedicatedHsmJsonWebKeyType(ProvisioningValue); + /// A device is currently being allocated for the dedicated HSM resource. public static DedicatedHsmJsonWebKeyType Allocating { get; } = new DedicatedHsmJsonWebKeyType(AllocatingValue); + /// The dedicated HSM is being connected to the virtual network. public static DedicatedHsmJsonWebKeyType Connecting { get; } = new DedicatedHsmJsonWebKeyType(ConnectingValue); + /// Provisioning of the dedicated HSM has failed. public static DedicatedHsmJsonWebKeyType Failed { get; } = new DedicatedHsmJsonWebKeyType(FailedValue); + /// Validating the subscription has sufficient quota to allocate a dedicated HSM device. public static DedicatedHsmJsonWebKeyType CheckingQuota { get; } = new DedicatedHsmJsonWebKeyType(CheckingQuotaValue); + /// The dedicated HSM is currently being deleted. public static DedicatedHsmJsonWebKeyType Deleting { get; } = new DedicatedHsmJsonWebKeyType(DeletingValue); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(DedicatedHsmJsonWebKeyType left, DedicatedHsmJsonWebKeyType right) => left.Equals(right); + /// Determines if two values are not the same. + /// The left value to compare. + /// The right value to compare. public static bool operator !=(DedicatedHsmJsonWebKeyType left, DedicatedHsmJsonWebKeyType right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator DedicatedHsmJsonWebKeyType(string value) => new DedicatedHsmJsonWebKeyType(value); - /// + /// Converts a string to a . + /// The value. + public static implicit operator DedicatedHsmJsonWebKeyType?(string value) => value == null ? null : new DedicatedHsmJsonWebKeyType(value); + + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is DedicatedHsmJsonWebKeyType other && Equals(other); - /// + + /// public bool Equals(DedicatedHsmJsonWebKeyType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// + + /// public override string ToString() => _value; } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmListResult.Serialization.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmListResult.Serialization.cs index 1e13e5e0abf0..abd83848ef25 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmListResult.Serialization.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmListResult.Serialization.cs @@ -9,14 +9,21 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure; +using Azure.ResourceManager.HardwareSecurityModules; namespace Azure.ResourceManager.HardwareSecurityModules.Models { - internal partial class DedicatedHsmListResult : IUtf8JsonSerializable, IJsonModel + /// The response of a DedicatedHsm list operation. + internal partial class DedicatedHsmListResult : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal DedicatedHsmListResult() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,15 +35,14 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader /// 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; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(DedicatedHsmListResult)} does not support writing '{format}' format."); } - writer.WritePropertyName("value"u8); writer.WriteStartArray(); - foreach (var item in Value) + foreach (DedicatedHsmData item in Value) { writer.WriteObjectValue(item, options); } @@ -46,15 +52,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("nextLink"u8); writer.WriteStringValue(NextLink.AbsoluteUri); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -63,64 +69,70 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - DedicatedHsmListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + DedicatedHsmListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual DedicatedHsmListResult JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(DedicatedHsmListResult)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeDedicatedHsmListResult(document.RootElement, options); } - internal static DedicatedHsmListResult DeserializeDedicatedHsmListResult(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static DedicatedHsmListResult DeserializeDedicatedHsmListResult(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - IReadOnlyList value = default; + IList value = default; Uri nextLink = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("value"u8)) + if (prop.NameEquals("value"u8)) { List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { array.Add(DedicatedHsmData.DeserializeDedicatedHsmData(item, options)); } value = array; continue; } - if (property.NameEquals("nextLink"u8)) + if (prop.NameEquals("nextLink"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - nextLink = new Uri(property.Value.GetString()); + nextLink = new Uri(prop.Value.GetString()); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new DedicatedHsmListResult(value, nextLink, serializedAdditionalRawData); + return new DedicatedHsmListResult(value, nextLink, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -130,15 +142,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOpti } } - DedicatedHsmListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + DedicatedHsmListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual DedicatedHsmListResult PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeDedicatedHsmListResult(document.RootElement, options); } default: @@ -146,6 +163,14 @@ DedicatedHsmListResult IPersistableModel.Create(BinaryDa } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to deserialize the from. + internal static DedicatedHsmListResult FromResponse(Response response) + { + using JsonDocument document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDedicatedHsmListResult(document.RootElement, ModelSerializationExtensions.WireOptions); + } } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmListResult.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmListResult.cs index 8bf7ac571e9d..04d93bcfcea7 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmListResult.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmListResult.cs @@ -8,72 +8,37 @@ using System; using System.Collections.Generic; using System.Linq; +using Azure.ResourceManager.HardwareSecurityModules; namespace Azure.ResourceManager.HardwareSecurityModules.Models { /// The response of a DedicatedHsm list operation. internal partial class DedicatedHsmListResult { - /// - /// 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; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The DedicatedHsm items on this page. - /// is null. internal DedicatedHsmListResult(IEnumerable value) { - Argument.AssertNotNull(value, nameof(value)); - Value = value.ToList(); } /// Initializes a new instance of . /// The DedicatedHsm items on this page. /// The link to the next page of items. - /// Keeps track of any properties unknown to the library. - internal DedicatedHsmListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal DedicatedHsmListResult(IList value, Uri nextLink, IDictionary additionalBinaryDataProperties) { Value = value; NextLink = nextLink; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal DedicatedHsmListResult() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The DedicatedHsm items on this page. - public IReadOnlyList Value { get; } + public IList Value { get; } + /// The link to the next page of items. public Uri NextLink { get; } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmNetworkInterface.Serialization.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmNetworkInterface.Serialization.cs index b0e507b3fd2f..3eb8199e37c6 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmNetworkInterface.Serialization.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmNetworkInterface.Serialization.cs @@ -10,13 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using Azure.Core; +using Azure.ResourceManager.HardwareSecurityModules; namespace Azure.ResourceManager.HardwareSecurityModules.Models { - public partial class DedicatedHsmNetworkInterface : IUtf8JsonSerializable, IJsonModel + /// The network interface definition. + public partial class DedicatedHsmNetworkInterface : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +30,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model /// 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; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(DedicatedHsmNetworkInterface)} does not support writing '{format}' format."); } - if (options.Format != "W" && Optional.IsDefined(ResourceId)) { writer.WritePropertyName("resourceId"u8); @@ -44,15 +45,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("privateIpAddress"u8); writer.WriteStringValue(PrivateIPAddress); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -61,59 +62,65 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - DedicatedHsmNetworkInterface IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + DedicatedHsmNetworkInterface IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual DedicatedHsmNetworkInterface JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(DedicatedHsmNetworkInterface)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeDedicatedHsmNetworkInterface(document.RootElement, options); } - internal static DedicatedHsmNetworkInterface DeserializeDedicatedHsmNetworkInterface(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static DedicatedHsmNetworkInterface DeserializeDedicatedHsmNetworkInterface(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } ResourceIdentifier resourceId = default; string privateIPAddress = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("resourceId"u8)) + if (prop.NameEquals("resourceId"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - resourceId = new ResourceIdentifier(property.Value.GetString()); + resourceId = new ResourceIdentifier(prop.Value.GetString()); continue; } - if (property.NameEquals("privateIpAddress"u8)) + if (prop.NameEquals("privateIpAddress"u8)) { - privateIPAddress = property.Value.GetString(); + privateIPAddress = prop.Value.GetString(); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new DedicatedHsmNetworkInterface(resourceId, privateIPAddress, serializedAdditionalRawData); + return new DedicatedHsmNetworkInterface(resourceId, privateIPAddress, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -123,15 +130,20 @@ BinaryData IPersistableModel.Write(ModelReaderWrit } } - DedicatedHsmNetworkInterface IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + DedicatedHsmNetworkInterface IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual DedicatedHsmNetworkInterface PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeDedicatedHsmNetworkInterface(document.RootElement, options); } default: @@ -139,6 +151,7 @@ DedicatedHsmNetworkInterface IPersistableModel.Cre } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmNetworkInterface.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmNetworkInterface.cs index a7123886dc14..6ec97186ba4b 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmNetworkInterface.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmNetworkInterface.cs @@ -14,37 +14,8 @@ namespace Azure.ResourceManager.HardwareSecurityModules.Models /// The network interface definition. public partial class DedicatedHsmNetworkInterface { - /// - /// 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; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . public DedicatedHsmNetworkInterface() @@ -54,16 +25,17 @@ public DedicatedHsmNetworkInterface() /// Initializes a new instance of . /// The Azure resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... /// Private Ip address of the interface. - /// Keeps track of any properties unknown to the library. - internal DedicatedHsmNetworkInterface(ResourceIdentifier resourceId, string privateIPAddress, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal DedicatedHsmNetworkInterface(ResourceIdentifier resourceId, string privateIPAddress, IDictionary additionalBinaryDataProperties) { ResourceId = resourceId; PrivateIPAddress = privateIPAddress; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The Azure resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... public ResourceIdentifier ResourceId { get; } + /// Private Ip address of the interface. public string PrivateIPAddress { get; set; } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmNetworkProfile.Serialization.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmNetworkProfile.Serialization.cs index 1cecb1df488c..a9e4a8ddeb89 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmNetworkProfile.Serialization.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmNetworkProfile.Serialization.cs @@ -9,14 +9,15 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.HardwareSecurityModules; namespace Azure.ResourceManager.HardwareSecurityModules.Models { - public partial class DedicatedHsmNetworkProfile : IUtf8JsonSerializable, IJsonModel + /// The network profile definition. + public partial class DedicatedHsmNetworkProfile : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +29,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe /// 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; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(DedicatedHsmNetworkProfile)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Subnet)) { writer.WritePropertyName("subnet"u8); @@ -43,21 +43,21 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit { writer.WritePropertyName("networkInterfaces"u8); writer.WriteStartArray(); - foreach (var item in NetworkInterfaces) + foreach (DedicatedHsmNetworkInterface item in NetworkInterfaces) { writer.WriteObjectValue(item, options); } writer.WriteEndArray(); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -66,49 +66,53 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - DedicatedHsmNetworkProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + DedicatedHsmNetworkProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual DedicatedHsmNetworkProfile JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(DedicatedHsmNetworkProfile)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeDedicatedHsmNetworkProfile(document.RootElement, options); } - internal static DedicatedHsmNetworkProfile DeserializeDedicatedHsmNetworkProfile(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static DedicatedHsmNetworkProfile DeserializeDedicatedHsmNetworkProfile(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } ApiEntityReference subnet = default; IList networkInterfaces = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("subnet"u8)) + if (prop.NameEquals("subnet"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - subnet = ApiEntityReference.DeserializeApiEntityReference(property.Value, options); + subnet = ApiEntityReference.DeserializeApiEntityReference(prop.Value, options); continue; } - if (property.NameEquals("networkInterfaces"u8)) + if (prop.NameEquals("networkInterfaces"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { array.Add(DedicatedHsmNetworkInterface.DeserializeDedicatedHsmNetworkInterface(item, options)); } @@ -117,17 +121,19 @@ internal static DedicatedHsmNetworkProfile DeserializeDedicatedHsmNetworkProfile } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new DedicatedHsmNetworkProfile(subnet, networkInterfaces ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new DedicatedHsmNetworkProfile(subnet, networkInterfaces ?? new ChangeTrackingList(), additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -137,15 +143,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriter } } - DedicatedHsmNetworkProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + DedicatedHsmNetworkProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual DedicatedHsmNetworkProfile PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeDedicatedHsmNetworkProfile(document.RootElement, options); } default: @@ -153,6 +164,7 @@ DedicatedHsmNetworkProfile IPersistableModel.Create( } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmNetworkProfile.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmNetworkProfile.cs index cfcfe3e972f8..4c5934ab887b 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmNetworkProfile.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmNetworkProfile.cs @@ -8,43 +8,15 @@ using System; using System.Collections.Generic; using Azure.Core; +using Azure.ResourceManager.HardwareSecurityModules; namespace Azure.ResourceManager.HardwareSecurityModules.Models { /// The network profile definition. public partial class DedicatedHsmNetworkProfile { - /// - /// 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; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . public DedicatedHsmNetworkProfile() @@ -55,29 +27,35 @@ public DedicatedHsmNetworkProfile() /// Initializes a new instance of . /// Specifies the identifier of the subnet. /// Specifies the list of resource Ids for the network interfaces associated with the dedicated HSM. - /// Keeps track of any properties unknown to the library. - internal DedicatedHsmNetworkProfile(ApiEntityReference subnet, IList networkInterfaces, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal DedicatedHsmNetworkProfile(ApiEntityReference subnet, IList networkInterfaces, IDictionary additionalBinaryDataProperties) { Subnet = subnet; NetworkInterfaces = networkInterfaces; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Specifies the identifier of the subnet. internal ApiEntityReference Subnet { get; set; } + + /// Specifies the list of resource Ids for the network interfaces associated with the dedicated HSM. + public IList NetworkInterfaces { get; } + /// The Azure resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... public ResourceIdentifier SubnetResourceId { - get => Subnet is null ? default : Subnet.ResourceId; + get + { + return Subnet is null ? default : Subnet.ResourceId; + } set { if (Subnet is null) + { Subnet = new ApiEntityReference(); + } Subnet.ResourceId = value; } } - - /// Specifies the list of resource Ids for the network interfaces associated with the dedicated HSM. - public IList NetworkInterfaces { get; } } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmPatch.Serialization.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmPatch.Serialization.cs index bfae6912483e..93796d66bb28 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmPatch.Serialization.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmPatch.Serialization.cs @@ -10,13 +10,15 @@ using System.Collections.Generic; using System.Text.Json; using Azure.Core; +using Azure.ResourceManager.HardwareSecurityModules; namespace Azure.ResourceManager.HardwareSecurityModules.Models { - public partial class DedicatedHsmPatch : IUtf8JsonSerializable, IJsonModel + /// Patchable properties of the dedicated HSM. + public partial class DedicatedHsmPatch : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +30,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite /// 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; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(DedicatedHsmPatch)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -41,19 +42,24 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit foreach (var item in Tags) { writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } writer.WriteStringValue(item.Value); } writer.WriteEndObject(); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -62,58 +68,71 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - DedicatedHsmPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + DedicatedHsmPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual DedicatedHsmPatch JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(DedicatedHsmPatch)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeDedicatedHsmPatch(document.RootElement, options); } - internal static DedicatedHsmPatch DeserializeDedicatedHsmPatch(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static DedicatedHsmPatch DeserializeDedicatedHsmPatch(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } IDictionary tags = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("tags"u8)) + if (prop.NameEquals("tags"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) + foreach (var prop0 in prop.Value.EnumerateObject()) { - dictionary.Add(property0.Name, property0.Value.GetString()); + if (prop0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(prop0.Name, null); + } + else + { + dictionary.Add(prop0.Name, prop0.Value.GetString()); + } } tags = dictionary; continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new DedicatedHsmPatch(tags ?? new ChangeTrackingDictionary(), serializedAdditionalRawData); + return new DedicatedHsmPatch(tags ?? new ChangeTrackingDictionary(), additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -123,15 +142,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions o } } - DedicatedHsmPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + DedicatedHsmPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual DedicatedHsmPatch PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeDedicatedHsmPatch(document.RootElement, options); } default: @@ -139,6 +163,19 @@ DedicatedHsmPatch IPersistableModel.Create(BinaryData data, M } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to serialize into . + internal static RequestContent ToRequestContent(DedicatedHsmPatch dedicatedHsmPatch) + { + if (dedicatedHsmPatch == null) + { + return null; + } + Utf8JsonRequestContent content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(dedicatedHsmPatch, ModelSerializationExtensions.WireOptions); + return content; + } } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmPatch.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmPatch.cs index 9be71318fbc9..397e0443095a 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmPatch.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmPatch.cs @@ -7,43 +7,15 @@ using System; using System.Collections.Generic; +using Azure.ResourceManager.HardwareSecurityModules; namespace Azure.ResourceManager.HardwareSecurityModules.Models { /// Patchable properties of the dedicated HSM. public partial class DedicatedHsmPatch { - /// - /// 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; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . public DedicatedHsmPatch() @@ -53,11 +25,11 @@ public DedicatedHsmPatch() /// Initializes a new instance of . /// Resource tags. - /// Keeps track of any properties unknown to the library. - internal DedicatedHsmPatch(IDictionary tags, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal DedicatedHsmPatch(IDictionary tags, IDictionary additionalBinaryDataProperties) { Tags = tags; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Resource tags. diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmProperties.Serialization.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmProperties.Serialization.cs index be6feabc282b..083ae0aa48b1 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmProperties.Serialization.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmProperties.Serialization.cs @@ -9,14 +9,15 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.HardwareSecurityModules; namespace Azure.ResourceManager.HardwareSecurityModules.Models { - public partial class DedicatedHsmProperties : IUtf8JsonSerializable, IJsonModel + /// Properties of the dedicated hsm. + public partial class DedicatedHsmProperties : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,12 +29,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader /// 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; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(DedicatedHsmProperties)} does not support writing '{format}' format."); } - if (Optional.IsDefined(NetworkProfile)) { writer.WritePropertyName("networkProfile"u8); @@ -59,15 +59,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("provisioningState"u8); writer.WriteStringValue(ProvisioningState.Value.ToString()); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -76,22 +76,27 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - DedicatedHsmProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + DedicatedHsmProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual DedicatedHsmProperties JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(DedicatedHsmProperties)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeDedicatedHsmProperties(document.RootElement, options); } - internal static DedicatedHsmProperties DeserializeDedicatedHsmProperties(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static DedicatedHsmProperties DeserializeDedicatedHsmProperties(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; @@ -101,66 +106,67 @@ internal static DedicatedHsmProperties DeserializeDedicatedHsmProperties(JsonEle string stampId = default; string statusMessage = default; DedicatedHsmJsonWebKeyType? provisioningState = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("networkProfile"u8)) + if (prop.NameEquals("networkProfile"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - networkProfile = DedicatedHsmNetworkProfile.DeserializeDedicatedHsmNetworkProfile(property.Value, options); + networkProfile = DedicatedHsmNetworkProfile.DeserializeDedicatedHsmNetworkProfile(prop.Value, options); continue; } - if (property.NameEquals("managementNetworkProfile"u8)) + if (prop.NameEquals("managementNetworkProfile"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - managementNetworkProfile = DedicatedHsmNetworkProfile.DeserializeDedicatedHsmNetworkProfile(property.Value, options); + managementNetworkProfile = DedicatedHsmNetworkProfile.DeserializeDedicatedHsmNetworkProfile(prop.Value, options); continue; } - if (property.NameEquals("stampId"u8)) + if (prop.NameEquals("stampId"u8)) { - stampId = property.Value.GetString(); + stampId = prop.Value.GetString(); continue; } - if (property.NameEquals("statusMessage"u8)) + if (prop.NameEquals("statusMessage"u8)) { - statusMessage = property.Value.GetString(); + statusMessage = prop.Value.GetString(); continue; } - if (property.NameEquals("provisioningState"u8)) + if (prop.NameEquals("provisioningState"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - provisioningState = new DedicatedHsmJsonWebKeyType(property.Value.GetString()); + provisioningState = new DedicatedHsmJsonWebKeyType(prop.Value.GetString()); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; return new DedicatedHsmProperties( networkProfile, managementNetworkProfile, stampId, statusMessage, provisioningState, - serializedAdditionalRawData); + additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -170,15 +176,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOpti } } - DedicatedHsmProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + DedicatedHsmProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual DedicatedHsmProperties PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeDedicatedHsmProperties(document.RootElement, options); } default: @@ -186,6 +197,7 @@ DedicatedHsmProperties IPersistableModel.Create(BinaryDa } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmProperties.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmProperties.cs index b0a9e142fd08..19b298248253 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmProperties.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmProperties.cs @@ -13,37 +13,8 @@ namespace Azure.ResourceManager.HardwareSecurityModules.Models /// Properties of the dedicated hsm. public partial class DedicatedHsmProperties { - /// - /// 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; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . public DedicatedHsmProperties() @@ -56,25 +27,29 @@ public DedicatedHsmProperties() /// This field will be used when RP does not support Availability zones. /// Resource Status Message. /// Provisioning state. - /// Keeps track of any properties unknown to the library. - internal DedicatedHsmProperties(DedicatedHsmNetworkProfile networkProfile, DedicatedHsmNetworkProfile managementNetworkProfile, string stampId, string statusMessage, DedicatedHsmJsonWebKeyType? provisioningState, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal DedicatedHsmProperties(DedicatedHsmNetworkProfile networkProfile, DedicatedHsmNetworkProfile managementNetworkProfile, string stampId, string statusMessage, DedicatedHsmJsonWebKeyType? provisioningState, IDictionary additionalBinaryDataProperties) { NetworkProfile = networkProfile; ManagementNetworkProfile = managementNetworkProfile; StampId = stampId; StatusMessage = statusMessage; ProvisioningState = provisioningState; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Specifies the network interfaces of the dedicated hsm. public DedicatedHsmNetworkProfile NetworkProfile { get; set; } + /// Specifies the management network interfaces of the dedicated hsm. public DedicatedHsmNetworkProfile ManagementNetworkProfile { get; set; } + /// This field will be used when RP does not support Availability zones. public string StampId { get; set; } + /// Resource Status Message. public string StatusMessage { get; } + /// Provisioning state. public DedicatedHsmJsonWebKeyType? ProvisioningState { get; } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmSku.Serialization.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmSku.Serialization.cs index f9e72664c4a7..e20a03b89763 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmSku.Serialization.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmSku.Serialization.cs @@ -9,14 +9,15 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure.ResourceManager.HardwareSecurityModules; namespace Azure.ResourceManager.HardwareSecurityModules.Models { - public partial class DedicatedHsmSku : IUtf8JsonSerializable, IJsonModel + /// SKU of the dedicated HSM. + public partial class DedicatedHsmSku : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,26 +29,25 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterO /// 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; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(DedicatedHsmSku)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); writer.WriteStringValue(Name.Value.ToString()); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -56,53 +56,59 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - DedicatedHsmSku IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + DedicatedHsmSku IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual DedicatedHsmSku JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(DedicatedHsmSku)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeDedicatedHsmSku(document.RootElement, options); } - internal static DedicatedHsmSku DeserializeDedicatedHsmSku(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static DedicatedHsmSku DeserializeDedicatedHsmSku(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } DedicatedHsmSkuName? name = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("name"u8)) + if (prop.NameEquals("name"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - name = new DedicatedHsmSkuName(property.Value.GetString()); + name = new DedicatedHsmSkuName(prop.Value.GetString()); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new DedicatedHsmSku(name, serializedAdditionalRawData); + return new DedicatedHsmSku(name, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -112,15 +118,20 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions opt } } - DedicatedHsmSku IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + DedicatedHsmSku IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual DedicatedHsmSku PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeDedicatedHsmSku(document.RootElement, options); } default: @@ -128,6 +139,7 @@ DedicatedHsmSku IPersistableModel.Create(BinaryData data, Model } } + /// The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmSku.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmSku.cs index 5fc40d4072c9..100408f781ae 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmSku.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmSku.cs @@ -13,37 +13,8 @@ namespace Azure.ResourceManager.HardwareSecurityModules.Models /// SKU of the dedicated HSM. public partial class DedicatedHsmSku { - /// - /// 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; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . public DedicatedHsmSku() @@ -52,11 +23,11 @@ public DedicatedHsmSku() /// Initializes a new instance of . /// SKU of the dedicated HSM. - /// Keeps track of any properties unknown to the library. - internal DedicatedHsmSku(DedicatedHsmSkuName? name, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal DedicatedHsmSku(DedicatedHsmSkuName? name, IDictionary additionalBinaryDataProperties) { Name = name; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// SKU of the dedicated HSM. diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmSkuName.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmSkuName.cs index f90b065e3923..b0cda3e2845c 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmSkuName.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/DedicatedHsmSkuName.cs @@ -7,6 +7,7 @@ using System; using System.ComponentModel; +using Azure.ResourceManager.HardwareSecurityModules; namespace Azure.ResourceManager.HardwareSecurityModules.Models { @@ -14,53 +15,82 @@ namespace Azure.ResourceManager.HardwareSecurityModules.Models public readonly partial struct DedicatedHsmSkuName : IEquatable { private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public DedicatedHsmSkuName(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - + /// The dedicated HSM is a Safenet Luna Network HSM A790 device. private const string SafeNetLunaNetworkHsmA790Value = "SafeNet Luna Network HSM A790"; + /// The dedicated HSM is a payShield 10K, model PS10-D, 10Gb Ethernet Hardware Platform device with 1 local master key which supports up to 60 calls per second. private const string PayShield10KLmk1Cps60Value = "payShield10K_LMK1_CPS60"; + /// The dedicated HSM is a payShield 10K, model PS10-D, 10Gb Ethernet Hardware Platform device with 1 local master key which supports up to 250 calls per second. private const string PayShield10KLmk1Cps250Value = "payShield10K_LMK1_CPS250"; + /// The dedicated HSM is a payShield 10K, model PS10-D, 10Gb Ethernet Hardware Platform device with 1 local master key which supports up to 2500 calls per second. private const string PayShield10KLmk1Cps2500Value = "payShield10K_LMK1_CPS2500"; + /// The dedicated HSM is a payShield 10K, model PS10-D, 10Gb Ethernet Hardware Platform device with 2 local master keys which supports up to 60 calls per second. private const string PayShield10KLmk2Cps60Value = "payShield10K_LMK2_CPS60"; + /// The dedicated HSM is a payShield 10K, model PS10-D, 10Gb Ethernet Hardware Platform device with 2 local master keys which supports up to 250 calls per second. private const string PayShield10KLmk2Cps250Value = "payShield10K_LMK2_CPS250"; + /// The dedicated HSM is a payShield 10K, model PS10-D, 10Gb Ethernet Hardware Platform device with 2 local master keys which supports up to 2500 calls per second. private const string PayShield10KLmk2Cps2500Value = "payShield10K_LMK2_CPS2500"; + /// Initializes a new instance of . + /// The value. + /// is null. + public DedicatedHsmSkuName(string value) + { + Argument.AssertNotNull(value, nameof(value)); + + _value = value; + } + /// The dedicated HSM is a Safenet Luna Network HSM A790 device. public static DedicatedHsmSkuName SafeNetLunaNetworkHsmA790 { get; } = new DedicatedHsmSkuName(SafeNetLunaNetworkHsmA790Value); + /// The dedicated HSM is a payShield 10K, model PS10-D, 10Gb Ethernet Hardware Platform device with 1 local master key which supports up to 60 calls per second. public static DedicatedHsmSkuName PayShield10KLmk1Cps60 { get; } = new DedicatedHsmSkuName(PayShield10KLmk1Cps60Value); + /// The dedicated HSM is a payShield 10K, model PS10-D, 10Gb Ethernet Hardware Platform device with 1 local master key which supports up to 250 calls per second. public static DedicatedHsmSkuName PayShield10KLmk1Cps250 { get; } = new DedicatedHsmSkuName(PayShield10KLmk1Cps250Value); + /// The dedicated HSM is a payShield 10K, model PS10-D, 10Gb Ethernet Hardware Platform device with 1 local master key which supports up to 2500 calls per second. public static DedicatedHsmSkuName PayShield10KLmk1Cps2500 { get; } = new DedicatedHsmSkuName(PayShield10KLmk1Cps2500Value); + /// The dedicated HSM is a payShield 10K, model PS10-D, 10Gb Ethernet Hardware Platform device with 2 local master keys which supports up to 60 calls per second. public static DedicatedHsmSkuName PayShield10KLmk2Cps60 { get; } = new DedicatedHsmSkuName(PayShield10KLmk2Cps60Value); + /// The dedicated HSM is a payShield 10K, model PS10-D, 10Gb Ethernet Hardware Platform device with 2 local master keys which supports up to 250 calls per second. public static DedicatedHsmSkuName PayShield10KLmk2Cps250 { get; } = new DedicatedHsmSkuName(PayShield10KLmk2Cps250Value); + /// The dedicated HSM is a payShield 10K, model PS10-D, 10Gb Ethernet Hardware Platform device with 2 local master keys which supports up to 2500 calls per second. public static DedicatedHsmSkuName PayShield10KLmk2Cps2500 { get; } = new DedicatedHsmSkuName(PayShield10KLmk2Cps2500Value); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(DedicatedHsmSkuName left, DedicatedHsmSkuName right) => left.Equals(right); + /// Determines if two values are not the same. + /// The left value to compare. + /// The right value to compare. public static bool operator !=(DedicatedHsmSkuName left, DedicatedHsmSkuName right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator DedicatedHsmSkuName(string value) => new DedicatedHsmSkuName(value); - /// + /// Converts a string to a . + /// The value. + public static implicit operator DedicatedHsmSkuName?(string value) => value == null ? null : new DedicatedHsmSkuName(value); + + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is DedicatedHsmSkuName other && Equals(other); - /// + + /// public bool Equals(DedicatedHsmSkuName other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// + + /// public override string ToString() => _value; } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/HardwareSecurityModulesPrivateEndpointConnectionListResult.Serialization.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/HardwareSecurityModulesPrivateEndpointConnectionListResult.Serialization.cs index 0848e815b6df..c4ba3712e991 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/HardwareSecurityModulesPrivateEndpointConnectionListResult.Serialization.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/HardwareSecurityModulesPrivateEndpointConnectionListResult.Serialization.cs @@ -9,14 +9,21 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure; +using Azure.ResourceManager.HardwareSecurityModules; namespace Azure.ResourceManager.HardwareSecurityModules.Models { - internal partial class HardwareSecurityModulesPrivateEndpointConnectionListResult : IUtf8JsonSerializable, IJsonModel + /// The response of a PrivateEndpointConnection list operation. + internal partial class HardwareSecurityModulesPrivateEndpointConnectionListResult : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + /// Initializes a new instance of for deserialization. + internal HardwareSecurityModulesPrivateEndpointConnectionListResult() + { + } + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,15 +35,14 @@ void IJsonModel.Writ /// 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; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(HardwareSecurityModulesPrivateEndpointConnectionListResult)} does not support writing '{format}' format."); } - writer.WritePropertyName("value"u8); writer.WriteStartArray(); - foreach (var item in Value) + foreach (CloudHsmClusterPrivateEndpointConnectionData item in Value) { writer.WriteObjectValue(item, options); } @@ -46,15 +52,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("nextLink"u8); writer.WriteStringValue(NextLink.AbsoluteUri); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -63,64 +69,70 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - HardwareSecurityModulesPrivateEndpointConnectionListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + HardwareSecurityModulesPrivateEndpointConnectionListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual HardwareSecurityModulesPrivateEndpointConnectionListResult JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(HardwareSecurityModulesPrivateEndpointConnectionListResult)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeHardwareSecurityModulesPrivateEndpointConnectionListResult(document.RootElement, options); } - internal static HardwareSecurityModulesPrivateEndpointConnectionListResult DeserializeHardwareSecurityModulesPrivateEndpointConnectionListResult(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static HardwareSecurityModulesPrivateEndpointConnectionListResult DeserializeHardwareSecurityModulesPrivateEndpointConnectionListResult(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - IReadOnlyList value = default; + IList value = default; Uri nextLink = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("value"u8)) + if (prop.NameEquals("value"u8)) { List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { array.Add(CloudHsmClusterPrivateEndpointConnectionData.DeserializeCloudHsmClusterPrivateEndpointConnectionData(item, options)); } value = array; continue; } - if (property.NameEquals("nextLink"u8)) + if (prop.NameEquals("nextLink"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - nextLink = new Uri(property.Value.GetString()); + nextLink = new Uri(prop.Value.GetString()); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new HardwareSecurityModulesPrivateEndpointConnectionListResult(value, nextLink, serializedAdditionalRawData); + return new HardwareSecurityModulesPrivateEndpointConnectionListResult(value, nextLink, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -130,15 +142,20 @@ BinaryData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + HardwareSecurityModulesPrivateEndpointConnectionListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual HardwareSecurityModulesPrivateEndpointConnectionListResult PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeHardwareSecurityModulesPrivateEndpointConnectionListResult(document.RootElement, options); } default: @@ -146,6 +163,14 @@ HardwareSecurityModulesPrivateEndpointConnectionListResult IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to deserialize the from. + internal static HardwareSecurityModulesPrivateEndpointConnectionListResult FromResponse(Response response) + { + using JsonDocument document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeHardwareSecurityModulesPrivateEndpointConnectionListResult(document.RootElement, ModelSerializationExtensions.WireOptions); + } } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/HardwareSecurityModulesPrivateEndpointConnectionListResult.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/HardwareSecurityModulesPrivateEndpointConnectionListResult.cs index e026ab2a2333..44491010f530 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/HardwareSecurityModulesPrivateEndpointConnectionListResult.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/HardwareSecurityModulesPrivateEndpointConnectionListResult.cs @@ -8,72 +8,37 @@ using System; using System.Collections.Generic; using System.Linq; +using Azure.ResourceManager.HardwareSecurityModules; namespace Azure.ResourceManager.HardwareSecurityModules.Models { /// The response of a PrivateEndpointConnection list operation. internal partial class HardwareSecurityModulesPrivateEndpointConnectionListResult { - /// - /// 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; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . /// The PrivateEndpointConnection items on this page. - /// is null. internal HardwareSecurityModulesPrivateEndpointConnectionListResult(IEnumerable value) { - Argument.AssertNotNull(value, nameof(value)); - Value = value.ToList(); } /// Initializes a new instance of . /// The PrivateEndpointConnection items on this page. /// The link to the next page of items. - /// Keeps track of any properties unknown to the library. - internal HardwareSecurityModulesPrivateEndpointConnectionListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal HardwareSecurityModulesPrivateEndpointConnectionListResult(IList value, Uri nextLink, IDictionary additionalBinaryDataProperties) { Value = value; NextLink = nextLink; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal HardwareSecurityModulesPrivateEndpointConnectionListResult() - { + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// The PrivateEndpointConnection items on this page. - public IReadOnlyList Value { get; } + public IList Value { get; } + /// The link to the next page of items. public Uri NextLink { get; } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/HardwareSecurityModulesPrivateLinkResourceListResult.Serialization.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/HardwareSecurityModulesPrivateLinkResourceListResult.Serialization.cs index 34f9f25029cc..17b2316247d0 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/HardwareSecurityModulesPrivateLinkResourceListResult.Serialization.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/HardwareSecurityModulesPrivateLinkResourceListResult.Serialization.cs @@ -9,14 +9,16 @@ using System.ClientModel.Primitives; using System.Collections.Generic; using System.Text.Json; -using Azure.Core; +using Azure; +using Azure.ResourceManager.HardwareSecurityModules; namespace Azure.ResourceManager.HardwareSecurityModules.Models { - internal partial class HardwareSecurityModulesPrivateLinkResourceListResult : IUtf8JsonSerializable, IJsonModel + /// A list of private link resources. + internal partial class HardwareSecurityModulesPrivateLinkResourceListResult : IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - + /// The JSON writer. + /// The client options for reading and writing models. void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); @@ -28,17 +30,16 @@ void IJsonModel.Write(Utf8 /// 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; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(HardwareSecurityModulesPrivateLinkResourceListResult)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); writer.WriteStartArray(); - foreach (var item in Value) + foreach (CloudHsmClusterPrivateLinkData item in Value) { writer.WriteObjectValue(item, options); } @@ -49,15 +50,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("nextLink"u8); writer.WriteStringValue(NextLink.AbsoluteUri); } - if (options.Format != "W" && _serializedAdditionalRawData != null) + if (options.Format != "W" && _additionalBinaryDataProperties != null) { - foreach (var item in _serializedAdditionalRawData) + foreach (var item in _additionalBinaryDataProperties) { writer.WritePropertyName(item.Key); #if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); + writer.WriteRawValue(item.Value); #else - using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + using (JsonDocument document = JsonDocument.Parse(item.Value)) { JsonSerializer.Serialize(writer, document.RootElement); } @@ -66,68 +67,74 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - HardwareSecurityModulesPrivateLinkResourceListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + /// The JSON reader. + /// The client options for reading and writing models. + HardwareSecurityModulesPrivateLinkResourceListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual HardwareSecurityModulesPrivateLinkResourceListResult JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { throw new FormatException($"The model {nameof(HardwareSecurityModulesPrivateLinkResourceListResult)} does not support reading '{format}' format."); } - using JsonDocument document = JsonDocument.ParseValue(ref reader); return DeserializeHardwareSecurityModulesPrivateLinkResourceListResult(document.RootElement, options); } - internal static HardwareSecurityModulesPrivateLinkResourceListResult DeserializeHardwareSecurityModulesPrivateLinkResourceListResult(JsonElement element, ModelReaderWriterOptions options = null) + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static HardwareSecurityModulesPrivateLinkResourceListResult DeserializeHardwareSecurityModulesPrivateLinkResourceListResult(JsonElement element, ModelReaderWriterOptions options) { - options ??= ModelSerializationExtensions.WireOptions; - if (element.ValueKind == JsonValueKind.Null) { return null; } - IReadOnlyList value = default; + IList value = default; Uri nextLink = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) { - if (property.NameEquals("value"u8)) + if (prop.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } List array = new List(); - foreach (var item in property.Value.EnumerateArray()) + foreach (var item in prop.Value.EnumerateArray()) { array.Add(CloudHsmClusterPrivateLinkData.DeserializeCloudHsmClusterPrivateLinkData(item, options)); } value = array; continue; } - if (property.NameEquals("nextLink"u8)) + if (prop.NameEquals("nextLink"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) + if (prop.Value.ValueKind == JsonValueKind.Null) { continue; } - nextLink = new Uri(property.Value.GetString()); + nextLink = new Uri(prop.Value.GetString()); continue; } if (options.Format != "W") { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); } } - serializedAdditionalRawData = rawDataDictionary; - return new HardwareSecurityModulesPrivateLinkResourceListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new HardwareSecurityModulesPrivateLinkResourceListResult(value ?? new ChangeTrackingList(), nextLink, additionalBinaryDataProperties); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": @@ -137,15 +144,20 @@ BinaryData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + /// The data to parse. + /// The client options for reading and writing models. + HardwareSecurityModulesPrivateLinkResourceListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + /// The data to parse. + /// The client options for reading and writing models. + protected virtual HardwareSecurityModulesPrivateLinkResourceListResult PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) { - using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); return DeserializeHardwareSecurityModulesPrivateLinkResourceListResult(document.RootElement, options); } default: @@ -153,6 +165,14 @@ HardwareSecurityModulesPrivateLinkResourceListResult IPersistableModel The client options for reading and writing models. string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// The to deserialize the from. + internal static HardwareSecurityModulesPrivateLinkResourceListResult FromResponse(Response response) + { + using JsonDocument document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeHardwareSecurityModulesPrivateLinkResourceListResult(document.RootElement, ModelSerializationExtensions.WireOptions); + } } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/HardwareSecurityModulesPrivateLinkResourceListResult.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/HardwareSecurityModulesPrivateLinkResourceListResult.cs index 3dfa3d7365ff..f8fc0eb3eea4 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/HardwareSecurityModulesPrivateLinkResourceListResult.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/HardwareSecurityModulesPrivateLinkResourceListResult.cs @@ -7,43 +7,15 @@ using System; using System.Collections.Generic; +using Azure.ResourceManager.HardwareSecurityModules; namespace Azure.ResourceManager.HardwareSecurityModules.Models { /// A list of private link resources. internal partial class HardwareSecurityModulesPrivateLinkResourceListResult { - /// - /// 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; + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; /// Initializes a new instance of . internal HardwareSecurityModulesPrivateLinkResourceListResult() @@ -54,16 +26,17 @@ internal HardwareSecurityModulesPrivateLinkResourceListResult() /// Initializes a new instance of . /// Array of private link resources. /// URL to get the next set of operation list results (if there are any). - /// Keeps track of any properties unknown to the library. - internal HardwareSecurityModulesPrivateLinkResourceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + /// Keeps track of any properties unknown to the library. + internal HardwareSecurityModulesPrivateLinkResourceListResult(IList value, Uri nextLink, IDictionary additionalBinaryDataProperties) { Value = value; NextLink = nextLink; - _serializedAdditionalRawData = serializedAdditionalRawData; + _additionalBinaryDataProperties = additionalBinaryDataProperties; } /// Array of private link resources. - public IReadOnlyList Value { get; } + public IList Value { get; } + /// URL to get the next set of operation list results (if there are any). public Uri NextLink { get; } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/PrivateEndpoint.Serialization.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/PrivateEndpoint.Serialization.cs new file mode 100644 index 000000000000..c05b2acd30b7 --- /dev/null +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/PrivateEndpoint.Serialization.cs @@ -0,0 +1,146 @@ +// 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.Json; +using Azure.Core; +using Azure.ResourceManager.HardwareSecurityModules; + +namespace Azure.ResourceManager.HardwareSecurityModules.Models +{ + /// The private endpoint resource. + internal partial class PrivateEndpoint : IJsonModel + { + /// The JSON writer. + /// The client options for reading and writing models. + 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) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PrivateEndpoint)} does not support writing '{format}' format."); + } + if (options.Format != "W" && Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (options.Format != "W" && _additionalBinaryDataProperties != null) + { + foreach (var item in _additionalBinaryDataProperties) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + /// The JSON reader. + /// The client options for reading and writing models. + PrivateEndpoint IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => JsonModelCreateCore(ref reader, options); + + /// The JSON reader. + /// The client options for reading and writing models. + protected virtual PrivateEndpoint JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PrivateEndpoint)} does not support reading '{format}' format."); + } + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePrivateEndpoint(document.RootElement, options); + } + + /// The JSON element to deserialize. + /// The client options for reading and writing models. + internal static PrivateEndpoint DeserializePrivateEndpoint(JsonElement element, ModelReaderWriterOptions options) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + IDictionary additionalBinaryDataProperties = new ChangeTrackingDictionary(); + foreach (var prop in element.EnumerateObject()) + { + if (prop.NameEquals("id"u8)) + { + if (prop.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + id = new ResourceIdentifier(prop.Value.GetString()); + continue; + } + if (options.Format != "W") + { + additionalBinaryDataProperties.Add(prop.Name, BinaryData.FromString(prop.Value.GetRawText())); + } + } + return new PrivateEndpoint(id, additionalBinaryDataProperties); + } + + /// The client options for reading and writing models. + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => PersistableModelWriteCore(options); + + /// The client options for reading and writing models. + protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options, AzureResourceManagerHardwareSecurityModulesContext.Default); + default: + throw new FormatException($"The model {nameof(PrivateEndpoint)} does not support writing '{options.Format}' format."); + } + } + + /// The data to parse. + /// The client options for reading and writing models. + PrivateEndpoint IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => PersistableModelCreateCore(data, options); + + /// The data to parse. + /// The client options for reading and writing models. + protected virtual PrivateEndpoint PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options) + { + string format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + switch (format) + { + case "J": + using (JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions)) + { + return DeserializePrivateEndpoint(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PrivateEndpoint)} does not support reading '{options.Format}' format."); + } + } + + /// The client options for reading and writing models. + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/PrivateEndpoint.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/PrivateEndpoint.cs new file mode 100644 index 000000000000..d0911755b310 --- /dev/null +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/PrivateEndpoint.cs @@ -0,0 +1,37 @@ +// 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.HardwareSecurityModules.Models +{ + /// The private endpoint resource. + internal partial class PrivateEndpoint + { + /// Keeps track of any properties unknown to the library. + private protected readonly IDictionary _additionalBinaryDataProperties; + + /// Initializes a new instance of . + public PrivateEndpoint() + { + } + + /// Initializes a new instance of . + /// The resource identifier of the private endpoint. + /// Keeps track of any properties unknown to the library. + internal PrivateEndpoint(ResourceIdentifier id, IDictionary additionalBinaryDataProperties) + { + Id = id; + _additionalBinaryDataProperties = additionalBinaryDataProperties; + } + + /// The resource identifier of the private endpoint. + public ResourceIdentifier Id { get; } + } +} diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/SecurityDomainActivationState.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/SecurityDomainActivationState.cs index 7697f3acb985..8b39933b287c 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/SecurityDomainActivationState.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/Models/SecurityDomainActivationState.cs @@ -7,6 +7,7 @@ using System; using System.ComponentModel; +using Azure.ResourceManager.HardwareSecurityModules; namespace Azure.ResourceManager.HardwareSecurityModules.Models { @@ -14,47 +15,67 @@ namespace Azure.ResourceManager.HardwareSecurityModules.Models public readonly partial struct SecurityDomainActivationState : IEquatable { private readonly string _value; + private const string NotDefinedValue = "NotDefined"; + private const string NotActivatedValue = "NotActivated"; + private const string ActiveValue = "Active"; + private const string FailedValue = "Failed"; + private const string UnknownValue = "Unknown"; /// Initializes a new instance of . + /// The value. /// is null. public SecurityDomainActivationState(string value) { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } + Argument.AssertNotNull(value, nameof(value)); - private const string NotDefinedValue = "NotDefined"; - private const string NotActivatedValue = "NotActivated"; - private const string ActiveValue = "Active"; - private const string FailedValue = "Failed"; - private const string UnknownValue = "Unknown"; + _value = value; + } - /// NotDefined. + /// Gets the NotDefined. public static SecurityDomainActivationState NotDefined { get; } = new SecurityDomainActivationState(NotDefinedValue); - /// NotActivated. + + /// Gets the NotActivated. public static SecurityDomainActivationState NotActivated { get; } = new SecurityDomainActivationState(NotActivatedValue); - /// Active. + + /// Gets the Active. public static SecurityDomainActivationState Active { get; } = new SecurityDomainActivationState(ActiveValue); - /// Failed. + + /// Gets the Failed. public static SecurityDomainActivationState Failed { get; } = new SecurityDomainActivationState(FailedValue); - /// Unknown. + + /// Gets the Unknown. public static SecurityDomainActivationState Unknown { get; } = new SecurityDomainActivationState(UnknownValue); + /// Determines if two values are the same. + /// The left value to compare. + /// The right value to compare. public static bool operator ==(SecurityDomainActivationState left, SecurityDomainActivationState right) => left.Equals(right); + /// Determines if two values are not the same. + /// The left value to compare. + /// The right value to compare. public static bool operator !=(SecurityDomainActivationState left, SecurityDomainActivationState right) => !left.Equals(right); - /// Converts a to a . + + /// Converts a string to a . + /// The value. public static implicit operator SecurityDomainActivationState(string value) => new SecurityDomainActivationState(value); - /// + /// Converts a string to a . + /// The value. + public static implicit operator SecurityDomainActivationState?(string value) => value == null ? null : new SecurityDomainActivationState(value); + + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => obj is SecurityDomainActivationState other && Equals(other); - /// + + /// public bool Equals(SecurityDomainActivationState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - /// + /// [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; - /// + + /// public override string ToString() => _value; } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/ProviderConstants.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/ProviderConstants.cs index db36230fea1f..e9170f97cd91 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/ProviderConstants.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/ProviderConstants.cs @@ -9,8 +9,9 @@ namespace Azure.ResourceManager.HardwareSecurityModules { - internal static class ProviderConstants + internal static partial class ProviderConstants { + /// Gets the DefaultProviderNamespace. public static string DefaultProviderNamespace { get; } = ClientDiagnostics.GetResourceProviderNamespace(typeof(ProviderConstants).Assembly); } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/RestOperations/CloudHsmClusterBackupStatusRestOperations.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/RestOperations/CloudHsmClusterBackupStatusRestOperations.cs index 38dc6e76013c..5d86a6345924 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/RestOperations/CloudHsmClusterBackupStatusRestOperations.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/RestOperations/CloudHsmClusterBackupStatusRestOperations.cs @@ -6,61 +6,47 @@ #nullable disable using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; +using Azure; using Azure.Core; using Azure.Core.Pipeline; -using Azure.ResourceManager.HardwareSecurityModules.Models; namespace Azure.ResourceManager.HardwareSecurityModules { - internal partial class CloudHsmClusterBackupStatusRestOperations + internal partial class CloudHsmClusterBackupStatus { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; private readonly Uri _endpoint; private readonly string _apiVersion; - /// Initializes a new instance of CloudHsmClusterBackupStatusRestOperations. - /// 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 CloudHsmClusterBackupStatusRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + /// Initializes a new instance of CloudHsmClusterBackupStatus for mocking. + protected CloudHsmClusterBackupStatus() { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2025-03-31"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateGetCloudHsmClusterBackupStatusRequestUri(string subscriptionId, string resourceGroupName, string cloudHsmClusterName, string jobId) + /// Initializes a new instance of CloudHsmClusterBackupStatus. + /// The ClientDiagnostics is used to provide tracing support for the client library. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// Service endpoint. + /// + internal CloudHsmClusterBackupStatus(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Uri endpoint, string apiVersion) { - 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.HardwareSecurityModules/cloudHsmClusters/", false); - uri.AppendPath(cloudHsmClusterName, true); - uri.AppendPath("/backupOperationStatus/", false); - uri.AppendPath(jobId, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; + ClientDiagnostics = clientDiagnostics; + _endpoint = endpoint; + Pipeline = pipeline; + _apiVersion = apiVersion; } - internal HttpMessage CreateGetCloudHsmClusterBackupStatusRequest(string subscriptionId, string resourceGroupName, string cloudHsmClusterName, string jobId) + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline { get; } + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + internal HttpMessage CreateGetCloudHsmClusterBackupStatusRequest(Guid subscriptionId, string resourceGroupName, string cloudHsmClusterName, string jobId, RequestContext context) { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); + RawRequestUriBuilder uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); + uri.AppendPath(subscriptionId.ToString(), true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/", false); @@ -68,76 +54,12 @@ internal HttpMessage CreateGetCloudHsmClusterBackupStatusRequest(string subscrip uri.AppendPath("/backupOperationStatus/", false); uri.AppendPath(jobId, true); uri.AppendQuery("api-version", _apiVersion, true); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); return message; } - - /// Gets the backup operation status of the specified Cloud HSM Cluster. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The to use. - /// Identifier for the backup operation. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetCloudHsmClusterBackupStatusAsync(string subscriptionId, string resourceGroupName, string cloudHsmClusterName, string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(cloudHsmClusterName, nameof(cloudHsmClusterName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var message = CreateGetCloudHsmClusterBackupStatusRequest(subscriptionId, resourceGroupName, cloudHsmClusterName, jobId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CloudHsmClusterBackupResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = CloudHsmClusterBackupResult.DeserializeCloudHsmClusterBackupResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 202: - return Response.FromValue((CloudHsmClusterBackupResult)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets the backup operation status of the specified Cloud HSM Cluster. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The to use. - /// Identifier for the backup operation. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response GetCloudHsmClusterBackupStatus(string subscriptionId, string resourceGroupName, string cloudHsmClusterName, string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(cloudHsmClusterName, nameof(cloudHsmClusterName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var message = CreateGetCloudHsmClusterBackupStatusRequest(subscriptionId, resourceGroupName, cloudHsmClusterName, jobId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CloudHsmClusterBackupResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = CloudHsmClusterBackupResult.DeserializeCloudHsmClusterBackupResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 202: - return Response.FromValue((CloudHsmClusterBackupResult)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/RestOperations/CloudHsmClusterPrivateLinkResourcesRestOperations.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/RestOperations/CloudHsmClusterPrivateLinkResourcesRestOperations.cs index c8e7df48eac3..7222b29c98b8 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/RestOperations/CloudHsmClusterPrivateLinkResourcesRestOperations.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/RestOperations/CloudHsmClusterPrivateLinkResourcesRestOperations.cs @@ -6,212 +6,71 @@ #nullable disable using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; +using Azure; using Azure.Core; using Azure.Core.Pipeline; -using Azure.ResourceManager.HardwareSecurityModules.Models; namespace Azure.ResourceManager.HardwareSecurityModules { - internal partial class CloudHsmClusterPrivateLinkResourcesRestOperations + internal partial class CloudHsmClusterPrivateLinkResources { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; private readonly Uri _endpoint; private readonly string _apiVersion; - /// Initializes a new instance of CloudHsmClusterPrivateLinkResourcesRestOperations. - /// 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 CloudHsmClusterPrivateLinkResourcesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + /// Initializes a new instance of CloudHsmClusterPrivateLinkResources for mocking. + protected CloudHsmClusterPrivateLinkResources() { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2025-03-31"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateListByCloudHsmClusterRequestUri(string subscriptionId, string resourceGroupName, string cloudHsmClusterName) + /// Initializes a new instance of CloudHsmClusterPrivateLinkResources. + /// The ClientDiagnostics is used to provide tracing support for the client library. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// Service endpoint. + /// + internal CloudHsmClusterPrivateLinkResources(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Uri endpoint, string apiVersion) { - 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.HardwareSecurityModules/cloudHsmClusters/", false); - uri.AppendPath(cloudHsmClusterName, true); - uri.AppendPath("/privateLinkResources", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; + ClientDiagnostics = clientDiagnostics; + _endpoint = endpoint; + Pipeline = pipeline; + _apiVersion = apiVersion; } - internal HttpMessage CreateListByCloudHsmClusterRequest(string subscriptionId, string resourceGroupName, string cloudHsmClusterName) + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline { get; } + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + internal HttpMessage CreateGetByCloudHsmClusterRequest(Guid subscriptionId, string resourceGroupName, string cloudHsmClusterName, RequestContext context) { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); + RawRequestUriBuilder uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); + uri.AppendPath(subscriptionId.ToString(), true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/", false); uri.AppendPath(cloudHsmClusterName, true); uri.AppendPath("/privateLinkResources", false); uri.AppendQuery("api-version", _apiVersion, true); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); return message; } - /// Gets the private link resources supported for the Cloud Hsm Cluster. - /// 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 Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListByCloudHsmClusterAsync(string subscriptionId, string resourceGroupName, string cloudHsmClusterName, CancellationToken cancellationToken = default) + internal HttpMessage CreateNextGetByCloudHsmClusterRequest(Uri nextPage, Guid subscriptionId, string resourceGroupName, string cloudHsmClusterName, RequestContext context) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(cloudHsmClusterName, nameof(cloudHsmClusterName)); - - using var message = CreateListByCloudHsmClusterRequest(subscriptionId, resourceGroupName, cloudHsmClusterName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - HardwareSecurityModulesPrivateLinkResourceListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = HardwareSecurityModulesPrivateLinkResourceListResult.DeserializeHardwareSecurityModulesPrivateLinkResourceListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets the private link resources supported for the Cloud Hsm Cluster. - /// 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 Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListByCloudHsmCluster(string subscriptionId, string resourceGroupName, string cloudHsmClusterName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(cloudHsmClusterName, nameof(cloudHsmClusterName)); - - using var message = CreateListByCloudHsmClusterRequest(subscriptionId, resourceGroupName, cloudHsmClusterName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - HardwareSecurityModulesPrivateLinkResourceListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = HardwareSecurityModulesPrivateLinkResourceListResult.DeserializeHardwareSecurityModulesPrivateLinkResourceListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListByCloudHsmClusterNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string cloudHsmClusterName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateListByCloudHsmClusterNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string cloudHsmClusterName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + uri.Reset(nextPage); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); return message; } - - /// Gets the private link resources supported for the Cloud Hsm Cluster. - /// The URL to the next page of results. - /// 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 Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListByCloudHsmClusterNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string cloudHsmClusterName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(cloudHsmClusterName, nameof(cloudHsmClusterName)); - - using var message = CreateListByCloudHsmClusterNextPageRequest(nextLink, subscriptionId, resourceGroupName, cloudHsmClusterName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - HardwareSecurityModulesPrivateLinkResourceListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = HardwareSecurityModulesPrivateLinkResourceListResult.DeserializeHardwareSecurityModulesPrivateLinkResourceListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets the private link resources supported for the Cloud Hsm Cluster. - /// The URL to the next page of results. - /// 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 Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListByCloudHsmClusterNextPage(string nextLink, string subscriptionId, string resourceGroupName, string cloudHsmClusterName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(cloudHsmClusterName, nameof(cloudHsmClusterName)); - - using var message = CreateListByCloudHsmClusterNextPageRequest(nextLink, subscriptionId, resourceGroupName, cloudHsmClusterName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - HardwareSecurityModulesPrivateLinkResourceListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = HardwareSecurityModulesPrivateLinkResourceListResult.DeserializeHardwareSecurityModulesPrivateLinkResourceListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/RestOperations/CloudHsmClusterRestoreStatusRestOperations.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/RestOperations/CloudHsmClusterRestoreStatusRestOperations.cs index 280aeba82494..38f5ea34895d 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/RestOperations/CloudHsmClusterRestoreStatusRestOperations.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/RestOperations/CloudHsmClusterRestoreStatusRestOperations.cs @@ -6,61 +6,47 @@ #nullable disable using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; +using Azure; using Azure.Core; using Azure.Core.Pipeline; -using Azure.ResourceManager.HardwareSecurityModules.Models; namespace Azure.ResourceManager.HardwareSecurityModules { - internal partial class CloudHsmClusterRestoreStatusRestOperations + internal partial class CloudHsmClusterRestoreStatus { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; private readonly Uri _endpoint; private readonly string _apiVersion; - /// Initializes a new instance of CloudHsmClusterRestoreStatusRestOperations. - /// 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 CloudHsmClusterRestoreStatusRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + /// Initializes a new instance of CloudHsmClusterRestoreStatus for mocking. + protected CloudHsmClusterRestoreStatus() { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2025-03-31"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateGetCloudHsmClusterRestoreStatusRequestUri(string subscriptionId, string resourceGroupName, string cloudHsmClusterName, string jobId) + /// Initializes a new instance of CloudHsmClusterRestoreStatus. + /// The ClientDiagnostics is used to provide tracing support for the client library. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// Service endpoint. + /// + internal CloudHsmClusterRestoreStatus(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Uri endpoint, string apiVersion) { - 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.HardwareSecurityModules/cloudHsmClusters/", false); - uri.AppendPath(cloudHsmClusterName, true); - uri.AppendPath("/restoreOperationStatus/", false); - uri.AppendPath(jobId, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; + ClientDiagnostics = clientDiagnostics; + _endpoint = endpoint; + Pipeline = pipeline; + _apiVersion = apiVersion; } - internal HttpMessage CreateGetCloudHsmClusterRestoreStatusRequest(string subscriptionId, string resourceGroupName, string cloudHsmClusterName, string jobId) + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline { get; } + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + internal HttpMessage CreateGetCloudHsmClusterRestoreStatusRequest(Guid subscriptionId, string resourceGroupName, string cloudHsmClusterName, string jobId, RequestContext context) { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); + RawRequestUriBuilder uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); + uri.AppendPath(subscriptionId.ToString(), true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/", false); @@ -68,76 +54,12 @@ internal HttpMessage CreateGetCloudHsmClusterRestoreStatusRequest(string subscri uri.AppendPath("/restoreOperationStatus/", false); uri.AppendPath(jobId, true); uri.AppendQuery("api-version", _apiVersion, true); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); return message; } - - /// Gets the restore operation status of the specified Cloud HSM Cluster. - /// 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 Cloud HSM Cluster. - /// Identifier for the restore operation. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetCloudHsmClusterRestoreStatusAsync(string subscriptionId, string resourceGroupName, string cloudHsmClusterName, string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(cloudHsmClusterName, nameof(cloudHsmClusterName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var message = CreateGetCloudHsmClusterRestoreStatusRequest(subscriptionId, resourceGroupName, cloudHsmClusterName, jobId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CloudHsmClusterRestoreResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = CloudHsmClusterRestoreResult.DeserializeCloudHsmClusterRestoreResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 202: - return Response.FromValue((CloudHsmClusterRestoreResult)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets the restore operation status of the specified Cloud HSM Cluster. - /// 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 Cloud HSM Cluster. - /// Identifier for the restore operation. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response GetCloudHsmClusterRestoreStatus(string subscriptionId, string resourceGroupName, string cloudHsmClusterName, string jobId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(cloudHsmClusterName, nameof(cloudHsmClusterName)); - Argument.AssertNotNullOrEmpty(jobId, nameof(jobId)); - - using var message = CreateGetCloudHsmClusterRestoreStatusRequest(subscriptionId, resourceGroupName, cloudHsmClusterName, jobId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CloudHsmClusterRestoreResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = CloudHsmClusterRestoreResult.DeserializeCloudHsmClusterRestoreResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 202: - return Response.FromValue((CloudHsmClusterRestoreResult)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/RestOperations/CloudHsmClustersRestOperations.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/RestOperations/CloudHsmClustersRestOperations.cs index 8f48b690d523..f8af192eb2ed 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/RestOperations/CloudHsmClustersRestOperations.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/RestOperations/CloudHsmClustersRestOperations.cs @@ -6,425 +6,126 @@ #nullable disable using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; +using Azure; using Azure.Core; using Azure.Core.Pipeline; -using Azure.ResourceManager.HardwareSecurityModules.Models; namespace Azure.ResourceManager.HardwareSecurityModules { - internal partial class CloudHsmClustersRestOperations + internal partial class CloudHsmClusters { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; private readonly Uri _endpoint; private readonly string _apiVersion; - /// Initializes a new instance of CloudHsmClustersRestOperations. - /// 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 CloudHsmClustersRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + /// Initializes a new instance of CloudHsmClusters for mocking. + protected CloudHsmClusters() { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2025-03-31"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string cloudHsmClusterName) - { - 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.HardwareSecurityModules/cloudHsmClusters/", false); - uri.AppendPath(cloudHsmClusterName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string cloudHsmClusterName) - { - 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.HardwareSecurityModules/cloudHsmClusters/", false); - uri.AppendPath(cloudHsmClusterName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; } - /// Gets the specified Cloud HSM Cluster. - /// 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 Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length. - /// 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 cloudHsmClusterName, CancellationToken cancellationToken = default) + /// Initializes a new instance of CloudHsmClusters. + /// The ClientDiagnostics is used to provide tracing support for the client library. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// Service endpoint. + /// + internal CloudHsmClusters(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Uri endpoint, string apiVersion) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(cloudHsmClusterName, nameof(cloudHsmClusterName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, cloudHsmClusterName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CloudHsmClusterData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = CloudHsmClusterData.DeserializeCloudHsmClusterData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((CloudHsmClusterData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } + ClientDiagnostics = clientDiagnostics; + _endpoint = endpoint; + Pipeline = pipeline; + _apiVersion = apiVersion; } - /// Gets the specified Cloud HSM Cluster. - /// 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 Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length. - /// 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 cloudHsmClusterName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(cloudHsmClusterName, nameof(cloudHsmClusterName)); + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline { get; } - using var message = CreateGetRequest(subscriptionId, resourceGroupName, cloudHsmClusterName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CloudHsmClusterData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = CloudHsmClusterData.DeserializeCloudHsmClusterData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((CloudHsmClusterData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } - internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string cloudHsmClusterName, CloudHsmClusterData data) + internal HttpMessage CreateGetRequest(Guid subscriptionId, string resourceGroupName, string cloudHsmClusterName, RequestContext context) { - var uri = new RawRequestUriBuilder(); + RawRequestUriBuilder uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); + uri.AppendPath(subscriptionId.ToString(), true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/", false); uri.AppendPath(cloudHsmClusterName, true); uri.AppendQuery("api-version", _apiVersion, true); - return uri; + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); + return message; } - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string cloudHsmClusterName, CloudHsmClusterData data) + internal HttpMessage CreateCreateOrUpdateRequest(Guid subscriptionId, string resourceGroupName, string cloudHsmClusterName, RequestContent content, RequestContext context) { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); + RawRequestUriBuilder uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); + uri.AppendPath(subscriptionId.ToString(), true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/", false); uri.AppendPath(cloudHsmClusterName, true); uri.AppendQuery("api-version", _apiVersion, true); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; 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.Method = RequestMethod.Put; + request.Headers.SetValue("Content-Type", "application/json"); + request.Headers.SetValue("Accept", "application/json"); request.Content = content; - _userAgent.Apply(message); return message; } - /// Create or Update a Cloud HSM Cluster 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 Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length. - /// Parameters to create Cloud HSM Cluster. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string cloudHsmClusterName, CloudHsmClusterData data, CancellationToken cancellationToken = default) + internal HttpMessage CreateUpdateRequest(Guid subscriptionId, string resourceGroupName, string cloudHsmClusterName, RequestContent content, RequestContext context) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(cloudHsmClusterName, nameof(cloudHsmClusterName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, cloudHsmClusterName, data); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 201: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Create or Update a Cloud HSM Cluster 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 Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length. - /// Parameters to create Cloud HSM Cluster. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string cloudHsmClusterName, CloudHsmClusterData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(cloudHsmClusterName, nameof(cloudHsmClusterName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, cloudHsmClusterName, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string cloudHsmClusterName, CloudHsmClusterPatch patch) - { - var uri = new RawRequestUriBuilder(); + RawRequestUriBuilder 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.HardwareSecurityModules/cloudHsmClusters/", false); - uri.AppendPath(cloudHsmClusterName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string cloudHsmClusterName, CloudHsmClusterPatch patch) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Patch; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); + uri.AppendPath(subscriptionId.ToString(), true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/", false); uri.AppendPath(cloudHsmClusterName, true); uri.AppendQuery("api-version", _apiVersion, true); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; 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.Method = RequestMethod.Patch; + request.Headers.SetValue("Content-Type", "application/json"); + request.Headers.SetValue("Accept", "application/json"); request.Content = content; - _userAgent.Apply(message); return message; } - /// Update a Cloud HSM Cluster 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 Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length. - /// Parameters to create Cloud HSM Cluster. - /// 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 cloudHsmClusterName, CloudHsmClusterPatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(cloudHsmClusterName, nameof(cloudHsmClusterName)); - Argument.AssertNotNull(patch, nameof(patch)); - - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, cloudHsmClusterName, patch); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Update a Cloud HSM Cluster 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 Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length. - /// Parameters to create Cloud HSM Cluster. - /// 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 cloudHsmClusterName, CloudHsmClusterPatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(cloudHsmClusterName, nameof(cloudHsmClusterName)); - Argument.AssertNotNull(patch, nameof(patch)); - - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, cloudHsmClusterName, patch); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string cloudHsmClusterName) - { - 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.HardwareSecurityModules/cloudHsmClusters/", false); - uri.AppendPath(cloudHsmClusterName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string cloudHsmClusterName) + internal HttpMessage CreateDeleteRequest(Guid subscriptionId, string resourceGroupName, string cloudHsmClusterName, RequestContext context) { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); + RawRequestUriBuilder uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); + uri.AppendPath(subscriptionId.ToString(), true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/", false); uri.AppendPath(cloudHsmClusterName, true); uri.AppendQuery("api-version", _apiVersion, true); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; request.Uri = uri; - _userAgent.Apply(message); + request.Method = RequestMethod.Delete; return message; } - /// Deletes the specified Cloud HSM Cluster. - /// 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 Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string cloudHsmClusterName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(cloudHsmClusterName, nameof(cloudHsmClusterName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, cloudHsmClusterName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Deletes the specified Cloud HSM Cluster. - /// 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 Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string cloudHsmClusterName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(cloudHsmClusterName, nameof(cloudHsmClusterName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, cloudHsmClusterName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName, string skiptoken) + internal HttpMessage CreateGetByResourceGroupRequest(Guid subscriptionId, string resourceGroupName, string skiptoken, RequestContext context) { - var uri = new RawRequestUriBuilder(); + RawRequestUriBuilder 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.HardwareSecurityModules/cloudHsmClusters", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (skiptoken != null) - { - uri.AppendQuery("$skiptoken", skiptoken, true); - } - return uri; - } - - internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName, string skiptoken) - { - 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(subscriptionId.ToString(), true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters", false); @@ -433,693 +134,153 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str { uri.AppendQuery("$skiptoken", skiptoken, true); } + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); return message; } - /// The List operation gets information about the Cloud HSM Clusters 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. - /// The page-continuation token to use with a paged version of this API. - /// 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, string skiptoken = null, CancellationToken cancellationToken = default) + internal HttpMessage CreateNextGetByResourceGroupRequest(Uri nextPage, Guid subscriptionId, string resourceGroupName, string skiptoken, RequestContext context) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, skiptoken); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CloudHsmClusterListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = CloudHsmClusterListResult.DeserializeCloudHsmClusterListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// The List operation gets information about the Cloud HSM Clusters 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. - /// The page-continuation token to use with a paged version of this API. - /// 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, string skiptoken = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, skiptoken); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CloudHsmClusterListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = CloudHsmClusterListResult.DeserializeCloudHsmClusterListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId, string skiptoken) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (skiptoken != null) - { - uri.AppendQuery("$skiptoken", skiptoken, true); - } - return uri; + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + uri.Reset(nextPage); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); + return message; } - internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId, string skiptoken) + internal HttpMessage CreateGetBySubscriptionRequest(Guid subscriptionId, string skiptoken, RequestContext context) { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); + RawRequestUriBuilder uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); + uri.AppendPath(subscriptionId.ToString(), true); uri.AppendPath("/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters", false); uri.AppendQuery("api-version", _apiVersion, true); if (skiptoken != null) { uri.AppendQuery("$skiptoken", skiptoken, true); } + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); return message; } - /// The List operation gets information about the Cloud HSM Clusters associated with the subscription. - /// The ID of the target subscription. The value must be an UUID. - /// The page-continuation token to use with a paged version of this API. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionAsync(string subscriptionId, string skiptoken = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionRequest(subscriptionId, skiptoken); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CloudHsmClusterListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = CloudHsmClusterListResult.DeserializeCloudHsmClusterListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// The List operation gets information about the Cloud HSM Clusters associated with the subscription. - /// The ID of the target subscription. The value must be an UUID. - /// The page-continuation token to use with a paged version of this API. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscription(string subscriptionId, string skiptoken = null, CancellationToken cancellationToken = default) + internal HttpMessage CreateNextGetBySubscriptionRequest(Uri nextPage, Guid subscriptionId, string skiptoken, RequestContext context) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionRequest(subscriptionId, skiptoken); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CloudHsmClusterListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = CloudHsmClusterListResult.DeserializeCloudHsmClusterListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateValidateBackupPropertiesRequestUri(string subscriptionId, string resourceGroupName, string cloudHsmClusterName, CloudHsmClusterBackupContent content) - { - 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.HardwareSecurityModules/cloudHsmClusters/", false); - uri.AppendPath(cloudHsmClusterName, true); - uri.AppendPath("/validateBackupProperties", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + uri.Reset(nextPage); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); + return message; } - internal HttpMessage CreateValidateBackupPropertiesRequest(string subscriptionId, string resourceGroupName, string cloudHsmClusterName, CloudHsmClusterBackupContent content) + internal HttpMessage CreateValidateBackupPropertiesRequest(Guid subscriptionId, string resourceGroupName, string cloudHsmClusterName, RequestContent content, RequestContext context) { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); + RawRequestUriBuilder uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); + uri.AppendPath(subscriptionId.ToString(), true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/", false); uri.AppendPath(cloudHsmClusterName, true); uri.AppendPath("/validateBackupProperties", false); uri.AppendQuery("api-version", _apiVersion, true); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - if (content != null) + request.Method = RequestMethod.Post; + if ("application/json" != null) { - request.Headers.Add("Content-Type", "application/json"); - var content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); - request.Content = content0; + request.Headers.SetValue("Content-Type", "application/json"); } - _userAgent.Apply(message); + request.Headers.SetValue("Accept", "application/json"); + request.Content = content; return message; } - /// Pre Backup operation to validate whether the customer can perform a backup on the Cloud HSM Cluster resource 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 Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length. - /// Backup Operation Required properties. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task ValidateBackupPropertiesAsync(string subscriptionId, string resourceGroupName, string cloudHsmClusterName, CloudHsmClusterBackupContent content = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(cloudHsmClusterName, nameof(cloudHsmClusterName)); - - using var message = CreateValidateBackupPropertiesRequest(subscriptionId, resourceGroupName, cloudHsmClusterName, content); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 202: - case 200: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Pre Backup operation to validate whether the customer can perform a backup on the Cloud HSM Cluster resource 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 Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length. - /// Backup Operation Required properties. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ValidateBackupProperties(string subscriptionId, string resourceGroupName, string cloudHsmClusterName, CloudHsmClusterBackupContent content = null, CancellationToken cancellationToken = default) + internal HttpMessage CreateBackupRequest(Guid subscriptionId, string resourceGroupName, string cloudHsmClusterName, RequestContent content, RequestContext context) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(cloudHsmClusterName, nameof(cloudHsmClusterName)); - - using var message = CreateValidateBackupPropertiesRequest(subscriptionId, resourceGroupName, cloudHsmClusterName, content); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 202: - case 200: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateBackupRequestUri(string subscriptionId, string resourceGroupName, string cloudHsmClusterName, CloudHsmClusterBackupContent content) - { - var uri = new RawRequestUriBuilder(); + RawRequestUriBuilder 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.HardwareSecurityModules/cloudHsmClusters/", false); - uri.AppendPath(cloudHsmClusterName, true); - uri.AppendPath("/backup", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateBackupRequest(string subscriptionId, string resourceGroupName, string cloudHsmClusterName, CloudHsmClusterBackupContent 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(subscriptionId.ToString(), true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/", false); uri.AppendPath(cloudHsmClusterName, true); uri.AppendPath("/backup", false); uri.AppendQuery("api-version", _apiVersion, true); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - if (content != null) + request.Method = RequestMethod.Post; + if ("application/json" != null) { - request.Headers.Add("Content-Type", "application/json"); - var content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); - request.Content = content0; + request.Headers.SetValue("Content-Type", "application/json"); } - _userAgent.Apply(message); + request.Headers.SetValue("Accept", "application/json"); + request.Content = content; return message; } - /// Create a backup of the Cloud HSM Cluster 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 Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length. - /// Azure storage Resource Uri. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task BackupAsync(string subscriptionId, string resourceGroupName, string cloudHsmClusterName, CloudHsmClusterBackupContent content = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(cloudHsmClusterName, nameof(cloudHsmClusterName)); - - using var message = CreateBackupRequest(subscriptionId, resourceGroupName, cloudHsmClusterName, content); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 202: - case 200: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Create a backup of the Cloud HSM Cluster 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 Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length. - /// Azure storage Resource Uri. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Backup(string subscriptionId, string resourceGroupName, string cloudHsmClusterName, CloudHsmClusterBackupContent content = null, CancellationToken cancellationToken = default) + internal HttpMessage CreateValidateRestorePropertiesRequest(Guid subscriptionId, string resourceGroupName, string cloudHsmClusterName, RequestContent content, RequestContext context) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(cloudHsmClusterName, nameof(cloudHsmClusterName)); - - using var message = CreateBackupRequest(subscriptionId, resourceGroupName, cloudHsmClusterName, content); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 202: - case 200: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateValidateRestorePropertiesRequestUri(string subscriptionId, string resourceGroupName, string cloudHsmClusterName, CloudHsmClusterRestoreContent content) - { - var uri = new RawRequestUriBuilder(); + RawRequestUriBuilder 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.HardwareSecurityModules/cloudHsmClusters/", false); - uri.AppendPath(cloudHsmClusterName, true); - uri.AppendPath("/validateRestoreProperties", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateValidateRestorePropertiesRequest(string subscriptionId, string resourceGroupName, string cloudHsmClusterName, CloudHsmClusterRestoreContent 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(subscriptionId.ToString(), true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/", false); uri.AppendPath(cloudHsmClusterName, true); uri.AppendPath("/validateRestoreProperties", false); uri.AppendQuery("api-version", _apiVersion, true); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - if (content != null) + request.Method = RequestMethod.Post; + if ("application/json" != null) { - request.Headers.Add("Content-Type", "application/json"); - var content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); - request.Content = content0; + request.Headers.SetValue("Content-Type", "application/json"); } - _userAgent.Apply(message); + request.Headers.SetValue("Accept", "application/json"); + request.Content = content; return message; } - /// Queued validating pre restore operation. - /// 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 Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length. - /// Optional Parameters to validate prior performing a restore operation. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task ValidateRestorePropertiesAsync(string subscriptionId, string resourceGroupName, string cloudHsmClusterName, CloudHsmClusterRestoreContent content = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(cloudHsmClusterName, nameof(cloudHsmClusterName)); - - using var message = CreateValidateRestorePropertiesRequest(subscriptionId, resourceGroupName, cloudHsmClusterName, content); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 202: - case 200: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Queued validating pre restore operation. - /// 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 Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length. - /// Optional Parameters to validate prior performing a restore operation. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ValidateRestoreProperties(string subscriptionId, string resourceGroupName, string cloudHsmClusterName, CloudHsmClusterRestoreContent content = null, CancellationToken cancellationToken = default) + internal HttpMessage CreateRestoreRequest(Guid subscriptionId, string resourceGroupName, string cloudHsmClusterName, RequestContent content, RequestContext context) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(cloudHsmClusterName, nameof(cloudHsmClusterName)); - - using var message = CreateValidateRestorePropertiesRequest(subscriptionId, resourceGroupName, cloudHsmClusterName, content); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 202: - case 200: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateRestoreRequestUri(string subscriptionId, string resourceGroupName, string cloudHsmClusterName, CloudHsmClusterRestoreContent content) - { - var uri = new RawRequestUriBuilder(); + RawRequestUriBuilder uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); + uri.AppendPath(subscriptionId.ToString(), true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/", false); uri.AppendPath(cloudHsmClusterName, true); uri.AppendPath("/restore", false); uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateRestoreRequest(string subscriptionId, string resourceGroupName, string cloudHsmClusterName, CloudHsmClusterRestoreContent 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("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/", false); - uri.AppendPath(cloudHsmClusterName, true); - uri.AppendPath("/restore", 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; - } - - /// Restores all key materials of a specified Cloud HSM Cluster. - /// 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 Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length. - /// Restore Operation Required properties. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task RestoreAsync(string subscriptionId, string resourceGroupName, string cloudHsmClusterName, CloudHsmClusterRestoreContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(cloudHsmClusterName, nameof(cloudHsmClusterName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateRestoreRequest(subscriptionId, resourceGroupName, cloudHsmClusterName, content); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 202: - case 200: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Restores all key materials of a specified Cloud HSM Cluster. - /// 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 Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length. - /// Restore Operation Required properties. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Restore(string subscriptionId, string resourceGroupName, string cloudHsmClusterName, CloudHsmClusterRestoreContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(cloudHsmClusterName, nameof(cloudHsmClusterName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateRestoreRequest(subscriptionId, resourceGroupName, cloudHsmClusterName, content); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 202: - case 200: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string skiptoken) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string skiptoken) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// The List operation gets information about the Cloud HSM Clusters associated with the subscription and within the specified resource group. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The page-continuation token to use with a paged version of this API. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string skiptoken = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, skiptoken); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CloudHsmClusterListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = CloudHsmClusterListResult.DeserializeCloudHsmClusterListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// The List operation gets information about the Cloud HSM Clusters associated with the subscription and within the specified resource group. - /// The URL to the next page of results. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The page-continuation token to use with a paged version of this API. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, string skiptoken = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, skiptoken); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CloudHsmClusterListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = CloudHsmClusterListResult.DeserializeCloudHsmClusterListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId, string skiptoken) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId, string skiptoken) - { - 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); + request.Method = RequestMethod.Post; + request.Headers.SetValue("Content-Type", "application/json"); + request.Headers.SetValue("Accept", "application/json"); + request.Content = content; return message; } - - /// The List operation gets information about the Cloud HSM Clusters 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 page-continuation token to use with a paged version of this API. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, string skiptoken = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId, skiptoken); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CloudHsmClusterListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = CloudHsmClusterListResult.DeserializeCloudHsmClusterListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// The List operation gets information about the Cloud HSM Clusters 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 page-continuation token to use with a paged version of this API. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, string skiptoken = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId, skiptoken); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CloudHsmClusterListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = CloudHsmClusterListResult.DeserializeCloudHsmClusterListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/RestOperations/DedicatedHsmsRestOperations.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/RestOperations/DedicatedHsmsRestOperations.cs index 7da7a1b664c6..d12e10e84298 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/RestOperations/DedicatedHsmsRestOperations.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/RestOperations/DedicatedHsmsRestOperations.cs @@ -6,919 +6,216 @@ #nullable disable using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; +using Azure; using Azure.Core; using Azure.Core.Pipeline; -using Azure.ResourceManager.HardwareSecurityModules.Models; namespace Azure.ResourceManager.HardwareSecurityModules { - internal partial class DedicatedHsmsRestOperations + internal partial class DedicatedHsms { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; private readonly Uri _endpoint; private readonly string _apiVersion; - /// Initializes a new instance of DedicatedHsmsRestOperations. - /// 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 DedicatedHsmsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + /// Initializes a new instance of DedicatedHsms for mocking. + protected DedicatedHsms() { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2025-03-31"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateGetRequestUri(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.HardwareSecurityModules/dedicatedHSMs/", false); - uri.AppendPath(name, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string name) + /// Initializes a new instance of DedicatedHsms. + /// The ClientDiagnostics is used to provide tracing support for the client library. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// Service endpoint. + /// + internal DedicatedHsms(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Uri endpoint, string apiVersion) { - 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.HardwareSecurityModules/dedicatedHSMs/", 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; + ClientDiagnostics = clientDiagnostics; + _endpoint = endpoint; + Pipeline = pipeline; + _apiVersion = apiVersion; } - /// Gets the specified Azure dedicated HSM. - /// 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 dedicated Hsm. - /// 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) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(name, nameof(name)); + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline { get; } - using var message = CreateGetRequest(subscriptionId, resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DedicatedHsmData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DedicatedHsmData.DeserializeDedicatedHsmData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((DedicatedHsmData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } - /// Gets the specified Azure dedicated HSM. - /// 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 dedicated Hsm. - /// 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) + internal HttpMessage CreateGetRequest(Guid subscriptionId, string resourceGroupName, string name, RequestContext context) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(name, nameof(name)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DedicatedHsmData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DedicatedHsmData.DeserializeDedicatedHsmData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((DedicatedHsmData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string name, DedicatedHsmData data) - { - var uri = new RawRequestUriBuilder(); + RawRequestUriBuilder uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); + uri.AppendPath(subscriptionId.ToString(), true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/", false); uri.AppendPath(name, true); uri.AppendQuery("api-version", _apiVersion, true); - return uri; + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); + return message; } - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string name, DedicatedHsmData data) + internal HttpMessage CreateCreateOrUpdateRequest(Guid subscriptionId, string resourceGroupName, string name, RequestContent content, RequestContext context) { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); + RawRequestUriBuilder uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); + uri.AppendPath(subscriptionId.ToString(), true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/", false); uri.AppendPath(name, true); uri.AppendQuery("api-version", _apiVersion, true); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; 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.Method = RequestMethod.Put; + request.Headers.SetValue("Content-Type", "application/json"); + request.Headers.SetValue("Accept", "application/json"); request.Content = content; - _userAgent.Apply(message); return message; } - /// Create or Update a dedicated HSM 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. - /// Name of the dedicated Hsm. - /// Parameters to create or update the dedicated hsm. - /// The cancellation token to use. - /// , , 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, DedicatedHsmData data, CancellationToken cancellationToken = default) + internal HttpMessage CreateUpdateRequest(Guid subscriptionId, string resourceGroupName, string name, RequestContent content, RequestContext context) { - 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); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 201: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Create or Update a dedicated HSM 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. - /// Name of the dedicated Hsm. - /// Parameters to create or update the dedicated hsm. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string name, DedicatedHsmData 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 = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, name, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string name, DedicatedHsmPatch patch) - { - var uri = new RawRequestUriBuilder(); + RawRequestUriBuilder 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.HardwareSecurityModules/dedicatedHSMs/", false); - uri.AppendPath(name, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string name, DedicatedHsmPatch patch) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Patch; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); + uri.AppendPath(subscriptionId.ToString(), true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/", false); uri.AppendPath(name, true); uri.AppendQuery("api-version", _apiVersion, true); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; 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.Method = RequestMethod.Patch; + request.Headers.SetValue("Content-Type", "application/json"); + request.Headers.SetValue("Accept", "application/json"); request.Content = content; - _userAgent.Apply(message); return message; } - /// Update a dedicated HSM 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. - /// Name of the dedicated Hsm. - /// Parameters to patch the dedicated HSM. - /// 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, DedicatedHsmPatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(name, nameof(name)); - Argument.AssertNotNull(patch, nameof(patch)); - - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, name, patch); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Update a dedicated HSM 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. - /// Name of the dedicated Hsm. - /// Parameters to patch the dedicated HSM. - /// 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, DedicatedHsmPatch patch, CancellationToken cancellationToken = default) + internal HttpMessage CreateDeleteRequest(Guid subscriptionId, string resourceGroupName, string name, RequestContext context) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(name, nameof(name)); - Argument.AssertNotNull(patch, nameof(patch)); - - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, name, patch); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string name) - { - var uri = new RawRequestUriBuilder(); + RawRequestUriBuilder 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.HardwareSecurityModules/dedicatedHSMs/", false); - uri.AppendPath(name, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string name) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); + uri.AppendPath(subscriptionId.ToString(), true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/", false); uri.AppendPath(name, true); uri.AppendQuery("api-version", _apiVersion, true); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; request.Uri = uri; - _userAgent.Apply(message); + request.Method = RequestMethod.Delete; return message; } - /// Deletes the specified Azure Dedicated HSM. - /// 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 dedicated Hsm. - /// The cancellation token to use. - /// , 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) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(name, nameof(name)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Deletes the specified Azure Dedicated HSM. - /// 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 dedicated Hsm. - /// The cancellation token to use. - /// , 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) + internal HttpMessage CreateGetByResourceGroupRequest(Guid subscriptionId, string resourceGroupName, int? top, RequestContext context) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(name, nameof(name)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName, int? top) - { - var uri = new RawRequestUriBuilder(); + RawRequestUriBuilder uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); + uri.AppendPath(subscriptionId.ToString(), true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs", false); uri.AppendQuery("api-version", _apiVersion, true); if (top != null) { - uri.AppendQuery("$top", top.Value, true); - } - return uri; - } - - internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName, 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("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (top != null) - { - uri.AppendQuery("$top", top.Value, true); + uri.AppendQuery("$top", TypeFormatters.ConvertToString(top), true); } + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); return message; } - /// The List operation gets information about the dedicated HSMs 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> 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: - { - DedicatedHsmListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DedicatedHsmListResult.DeserializeDedicatedHsmListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// The List operation gets information about the dedicated HSMs 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 ListByResourceGroup(string subscriptionId, string resourceGroupName, int? top = null, CancellationToken cancellationToken = default) + internal HttpMessage CreateNextGetByResourceGroupRequest(Uri nextPage, Guid subscriptionId, string resourceGroupName, int? top, RequestContext context) { - 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: - { - DedicatedHsmListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DedicatedHsmListResult.DeserializeDedicatedHsmListResult(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.HardwareSecurityModules/dedicatedHSMs", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (top != null) - { - uri.AppendQuery("$top", top.Value, true); - } - return uri; + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + uri.Reset(nextPage); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); + return message; } - internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId, int? top) + internal HttpMessage CreateGetBySubscriptionRequest(Guid subscriptionId, int? top, RequestContext context) { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); + RawRequestUriBuilder uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); + uri.AppendPath(subscriptionId.ToString(), true); uri.AppendPath("/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs", false); uri.AppendQuery("api-version", _apiVersion, true); if (top != null) { - uri.AppendQuery("$top", top.Value, true); + uri.AppendQuery("$top", TypeFormatters.ConvertToString(top), true); } + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); return message; } - /// The List operation gets information about the dedicated HSMs 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: - { - DedicatedHsmListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DedicatedHsmListResult.DeserializeDedicatedHsmListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// The List operation gets information about the dedicated HSMs 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: - { - DedicatedHsmListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DedicatedHsmListResult.DeserializeDedicatedHsmListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListOutboundNetworkDependenciesEndpointsRequestUri(string subscriptionId, string resourceGroupName, string name) + internal HttpMessage CreateNextGetBySubscriptionRequest(Uri nextPage, Guid subscriptionId, int? top, RequestContext context) { - 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.HardwareSecurityModules/dedicatedHSMs/", false); - uri.AppendPath(name, true); - uri.AppendPath("/outboundNetworkDependenciesEndpoints", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + uri.Reset(nextPage); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); + return message; } - internal HttpMessage CreateListOutboundNetworkDependenciesEndpointsRequest(string subscriptionId, string resourceGroupName, string name) + internal HttpMessage CreateGetOutboundNetworkDependenciesEndpointsRequest(Guid subscriptionId, string resourceGroupName, string name, RequestContext context) { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); + RawRequestUriBuilder uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); + uri.AppendPath(subscriptionId.ToString(), true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/", false); uri.AppendPath(name, true); uri.AppendPath("/outboundNetworkDependenciesEndpoints", false); uri.AppendQuery("api-version", _apiVersion, true); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified dedicated hsm resource. The operation returns properties of each egress endpoint. - /// 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 dedicated Hsm. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListOutboundNetworkDependenciesEndpointsAsync(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 = CreateListOutboundNetworkDependenciesEndpointsRequest(subscriptionId, resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DedicatedHsmEgressEndpointListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DedicatedHsmEgressEndpointListResult.DeserializeDedicatedHsmEgressEndpointListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified dedicated hsm resource. The operation returns properties of each egress endpoint. - /// 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 dedicated Hsm. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListOutboundNetworkDependenciesEndpoints(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 = CreateListOutboundNetworkDependenciesEndpointsRequest(subscriptionId, resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DedicatedHsmEgressEndpointListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DedicatedHsmEgressEndpointListResult.DeserializeDedicatedHsmEgressEndpointListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, int? top) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, int? top) - { - 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); + request.Headers.SetValue("Accept", "application/json"); return message; } - /// The List operation gets information about the dedicated HSMs associated with the subscription and within the specified resource group. - /// The URL to the next page of results. - /// 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> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, int? top = null, CancellationToken cancellationToken = default) + internal HttpMessage CreateNextGetOutboundNetworkDependenciesEndpointsRequest(Uri nextPage, Guid subscriptionId, string resourceGroupName, string name, RequestContext context) { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, top); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DedicatedHsmListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DedicatedHsmListResult.DeserializeDedicatedHsmListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// The List operation gets information about the dedicated HSMs associated with the subscription and within the specified resource group. - /// The URL to the next page of results. - /// 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 ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, int? top = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, top); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DedicatedHsmListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DedicatedHsmListResult.DeserializeDedicatedHsmListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId, int? top) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId, int? top) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + uri.Reset(nextPage); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// The List operation gets information about the dedicated 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. - /// Maximum number of results to return. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, int? top = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId, top); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DedicatedHsmListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DedicatedHsmListResult.DeserializeDedicatedHsmListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// The List operation gets information about the dedicated 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. - /// Maximum number of results to return. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, int? top = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId, top); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DedicatedHsmListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DedicatedHsmListResult.DeserializeDedicatedHsmListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListOutboundNetworkDependenciesEndpointsNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string name) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateListOutboundNetworkDependenciesEndpointsNextPageRequest(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); + request.Headers.SetValue("Accept", "application/json"); return message; } - - /// Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified dedicated hsm resource. The operation returns properties of each egress endpoint. - /// The URL to the next page of results. - /// 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 dedicated Hsm. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListOutboundNetworkDependenciesEndpointsNextPageAsync(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 = CreateListOutboundNetworkDependenciesEndpointsNextPageRequest(nextLink, subscriptionId, resourceGroupName, name); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DedicatedHsmEgressEndpointListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = DedicatedHsmEgressEndpointListResult.DeserializeDedicatedHsmEgressEndpointListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified dedicated hsm resource. The operation returns properties of each egress endpoint. - /// The URL to the next page of results. - /// 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 dedicated Hsm. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListOutboundNetworkDependenciesEndpointsNextPage(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 = CreateListOutboundNetworkDependenciesEndpointsNextPageRequest(nextLink, subscriptionId, resourceGroupName, name); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DedicatedHsmEgressEndpointListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = DedicatedHsmEgressEndpointListResult.DeserializeDedicatedHsmEgressEndpointListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs index 1791bba3bf67..5aade398e22d 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs @@ -6,146 +6,47 @@ #nullable disable using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; +using Azure; using Azure.Core; using Azure.Core.Pipeline; -using Azure.ResourceManager.HardwareSecurityModules.Models; namespace Azure.ResourceManager.HardwareSecurityModules { - internal partial class PrivateEndpointConnectionsRestOperations + internal partial class PrivateEndpointConnections { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; private readonly Uri _endpoint; private readonly string _apiVersion; - /// 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. - /// 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) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2025-03-31"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string cloudHsmClusterName, string peConnectionName) - { - 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.HardwareSecurityModules/cloudHsmClusters/", false); - uri.AppendPath(cloudHsmClusterName, true); - uri.AppendPath("/privateEndpointConnections/", false); - uri.AppendPath(peConnectionName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string cloudHsmClusterName, string peConnectionName) + /// Initializes a new instance of PrivateEndpointConnections for mocking. + protected PrivateEndpointConnections() { - 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.HardwareSecurityModules/cloudHsmClusters/", false); - uri.AppendPath(cloudHsmClusterName, true); - uri.AppendPath("/privateEndpointConnections/", false); - uri.AppendPath(peConnectionName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; } - /// Gets the private endpoint connection for the Cloud Hsm Cluster. - /// 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 Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length. - /// Name of the private endpoint connection associated with the Cloud HSM Cluster. - /// 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 cloudHsmClusterName, string peConnectionName, CancellationToken cancellationToken = default) + /// Initializes a new instance of PrivateEndpointConnections. + /// The ClientDiagnostics is used to provide tracing support for the client library. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// Service endpoint. + /// + internal PrivateEndpointConnections(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Uri endpoint, string apiVersion) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(cloudHsmClusterName, nameof(cloudHsmClusterName)); - Argument.AssertNotNullOrEmpty(peConnectionName, nameof(peConnectionName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, cloudHsmClusterName, peConnectionName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CloudHsmClusterPrivateEndpointConnectionData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = CloudHsmClusterPrivateEndpointConnectionData.DeserializeCloudHsmClusterPrivateEndpointConnectionData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((CloudHsmClusterPrivateEndpointConnectionData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } + ClientDiagnostics = clientDiagnostics; + _endpoint = endpoint; + Pipeline = pipeline; + _apiVersion = apiVersion; } - /// Gets the private endpoint connection for the Cloud Hsm Cluster. - /// 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 Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length. - /// Name of the private endpoint connection associated with the Cloud HSM Cluster. - /// 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 cloudHsmClusterName, string peConnectionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(cloudHsmClusterName, nameof(cloudHsmClusterName)); - Argument.AssertNotNullOrEmpty(peConnectionName, nameof(peConnectionName)); + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline { get; } - using var message = CreateGetRequest(subscriptionId, resourceGroupName, cloudHsmClusterName, peConnectionName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CloudHsmClusterPrivateEndpointConnectionData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = CloudHsmClusterPrivateEndpointConnectionData.DeserializeCloudHsmClusterPrivateEndpointConnectionData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((CloudHsmClusterPrivateEndpointConnectionData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } - internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string cloudHsmClusterName, string peConnectionName, CloudHsmClusterPrivateEndpointConnectionData data) + internal HttpMessage CreateGetRequest(Guid subscriptionId, string resourceGroupName, string cloudHsmClusterName, string peConnectionName, RequestContext context) { - var uri = new RawRequestUriBuilder(); + RawRequestUriBuilder uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); + uri.AppendPath(subscriptionId.ToString(), true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/", false); @@ -153,18 +54,20 @@ internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string uri.AppendPath("/privateEndpointConnections/", false); uri.AppendPath(peConnectionName, true); uri.AppendQuery("api-version", _apiVersion, true); - return uri; + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; + request.Uri = uri; + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); + return message; } - internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string cloudHsmClusterName, string peConnectionName, CloudHsmClusterPrivateEndpointConnectionData data) + internal HttpMessage CreateCreateRequest(Guid subscriptionId, string resourceGroupName, string cloudHsmClusterName, string peConnectionName, RequestContent content, RequestContext context) { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); + RawRequestUriBuilder uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); + uri.AppendPath(subscriptionId.ToString(), true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/", false); @@ -172,107 +75,22 @@ internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceG uri.AppendPath("/privateEndpointConnections/", false); uri.AppendPath(peConnectionName, true); uri.AppendQuery("api-version", _apiVersion, true); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; 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.Method = RequestMethod.Put; + request.Headers.SetValue("Content-Type", "application/json"); + request.Headers.SetValue("Accept", "application/json"); request.Content = content; - _userAgent.Apply(message); return message; } - /// Creates or updates the private endpoint connection for the Cloud Hsm Cluster. - /// 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 Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length. - /// Name of the private endpoint connection associated with the Cloud HSM Cluster. - /// Parameters of the PrivateEndpointConnection. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> CreateAsync(string subscriptionId, string resourceGroupName, string cloudHsmClusterName, string peConnectionName, CloudHsmClusterPrivateEndpointConnectionData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(cloudHsmClusterName, nameof(cloudHsmClusterName)); - Argument.AssertNotNullOrEmpty(peConnectionName, nameof(peConnectionName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, cloudHsmClusterName, peConnectionName, data); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - CloudHsmClusterPrivateEndpointConnectionData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = CloudHsmClusterPrivateEndpointConnectionData.DeserializeCloudHsmClusterPrivateEndpointConnectionData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Creates or updates the private endpoint connection for the Cloud Hsm Cluster. - /// 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 Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length. - /// Name of the private endpoint connection associated with the Cloud HSM Cluster. - /// Parameters of the PrivateEndpointConnection. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Create(string subscriptionId, string resourceGroupName, string cloudHsmClusterName, string peConnectionName, CloudHsmClusterPrivateEndpointConnectionData data, CancellationToken cancellationToken = default) + internal HttpMessage CreateDeleteRequest(Guid subscriptionId, string resourceGroupName, string cloudHsmClusterName, string peConnectionName, RequestContext context) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(cloudHsmClusterName, nameof(cloudHsmClusterName)); - Argument.AssertNotNullOrEmpty(peConnectionName, nameof(peConnectionName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, cloudHsmClusterName, peConnectionName, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - CloudHsmClusterPrivateEndpointConnectionData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = CloudHsmClusterPrivateEndpointConnectionData.DeserializeCloudHsmClusterPrivateEndpointConnectionData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string cloudHsmClusterName, string peConnectionName) - { - var uri = new RawRequestUriBuilder(); + RawRequestUriBuilder 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.HardwareSecurityModules/cloudHsmClusters/", false); - uri.AppendPath(cloudHsmClusterName, true); - uri.AppendPath("/privateEndpointConnections/", false); - uri.AppendPath(peConnectionName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string cloudHsmClusterName, string peConnectionName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); + uri.AppendPath(subscriptionId.ToString(), true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/", false); @@ -280,241 +98,43 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendPath("/privateEndpointConnections/", false); uri.AppendPath(peConnectionName, true); uri.AppendQuery("api-version", _apiVersion, true); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; request.Uri = uri; - _userAgent.Apply(message); + request.Method = RequestMethod.Delete; return message; } - /// Deletes the private endpoint connection for the Cloud Hsm Cluster. - /// 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 Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length. - /// Name of the private endpoint connection associated with the Cloud HSM Cluster. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string cloudHsmClusterName, string peConnectionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(cloudHsmClusterName, nameof(cloudHsmClusterName)); - Argument.AssertNotNullOrEmpty(peConnectionName, nameof(peConnectionName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, cloudHsmClusterName, peConnectionName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Deletes the private endpoint connection for the Cloud Hsm Cluster. - /// 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 Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length. - /// Name of the private endpoint connection associated with the Cloud HSM Cluster. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string cloudHsmClusterName, string peConnectionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(cloudHsmClusterName, nameof(cloudHsmClusterName)); - Argument.AssertNotNullOrEmpty(peConnectionName, nameof(peConnectionName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, cloudHsmClusterName, peConnectionName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListByCloudHsmClusterRequestUri(string subscriptionId, string resourceGroupName, string cloudHsmClusterName) + internal HttpMessage CreateGetByCloudHsmClusterRequest(Guid subscriptionId, string resourceGroupName, string cloudHsmClusterName, RequestContext context) { - var uri = new RawRequestUriBuilder(); + RawRequestUriBuilder 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.HardwareSecurityModules/cloudHsmClusters/", false); - uri.AppendPath(cloudHsmClusterName, true); - uri.AppendPath("/privateEndpointConnections", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListByCloudHsmClusterRequest(string subscriptionId, string resourceGroupName, string cloudHsmClusterName) - { - 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(subscriptionId.ToString(), true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/", false); uri.AppendPath(cloudHsmClusterName, true); uri.AppendPath("/privateEndpointConnections", false); uri.AppendQuery("api-version", _apiVersion, true); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); return message; } - /// The List operation gets information about the private endpoint connections associated with the Cloud HSM Cluster. - /// 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 Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListByCloudHsmClusterAsync(string subscriptionId, string resourceGroupName, string cloudHsmClusterName, CancellationToken cancellationToken = default) + internal HttpMessage CreateNextGetByCloudHsmClusterRequest(Uri nextPage, Guid subscriptionId, string resourceGroupName, string cloudHsmClusterName, RequestContext context) { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(cloudHsmClusterName, nameof(cloudHsmClusterName)); - - using var message = CreateListByCloudHsmClusterRequest(subscriptionId, resourceGroupName, cloudHsmClusterName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - HardwareSecurityModulesPrivateEndpointConnectionListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = HardwareSecurityModulesPrivateEndpointConnectionListResult.DeserializeHardwareSecurityModulesPrivateEndpointConnectionListResult(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 Cloud HSM Cluster. - /// 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 Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListByCloudHsmCluster(string subscriptionId, string resourceGroupName, string cloudHsmClusterName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(cloudHsmClusterName, nameof(cloudHsmClusterName)); - - using var message = CreateListByCloudHsmClusterRequest(subscriptionId, resourceGroupName, cloudHsmClusterName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - HardwareSecurityModulesPrivateEndpointConnectionListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = HardwareSecurityModulesPrivateEndpointConnectionListResult.DeserializeHardwareSecurityModulesPrivateEndpointConnectionListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListByCloudHsmClusterNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string cloudHsmClusterName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateListByCloudHsmClusterNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string cloudHsmClusterName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); + RawRequestUriBuilder uri = new RawRequestUriBuilder(); + uri.Reset(nextPage); + HttpMessage message = Pipeline.CreateMessage(); + Request request = message.Request; request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); + request.Method = RequestMethod.Get; + request.Headers.SetValue("Accept", "application/json"); return message; } - - /// The List operation gets information about the private endpoint connections associated with the Cloud HSM Cluster. - /// The URL to the next page of results. - /// 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 Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListByCloudHsmClusterNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string cloudHsmClusterName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(cloudHsmClusterName, nameof(cloudHsmClusterName)); - - using var message = CreateListByCloudHsmClusterNextPageRequest(nextLink, subscriptionId, resourceGroupName, cloudHsmClusterName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - HardwareSecurityModulesPrivateEndpointConnectionListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = HardwareSecurityModulesPrivateEndpointConnectionListResult.DeserializeHardwareSecurityModulesPrivateEndpointConnectionListResult(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 Cloud HSM Cluster. - /// The URL to the next page of results. - /// 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 Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListByCloudHsmClusterNextPage(string nextLink, string subscriptionId, string resourceGroupName, string cloudHsmClusterName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(cloudHsmClusterName, nameof(cloudHsmClusterName)); - - using var message = CreateListByCloudHsmClusterNextPageRequest(nextLink, subscriptionId, resourceGroupName, cloudHsmClusterName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - HardwareSecurityModulesPrivateEndpointConnectionListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = HardwareSecurityModulesPrivateEndpointConnectionListResult.DeserializeHardwareSecurityModulesPrivateEndpointConnectionListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } } } diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/tsp-location.yaml b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/tsp-location.yaml index 717fd379f368..45ac8eddf96a 100644 --- a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/tsp-location.yaml +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/HardwareSecurityModules repo: Azure/azure-rest-api-specs -commit: 52fc376d009c4d96b89cfc410c11a38358a18f5b -additionalDirectories: [] +commit: 9eea85c54631fd814365ca77a9dae58885c61bc7 +emitterPackageJsonPath: "eng/azure-typespec-http-client-csharp-mgmt-emitter-package.json" \ No newline at end of file diff --git a/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/tspCodeModel.json b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/tspCodeModel.json new file mode 100644 index 000000000000..e05d61d1b3cf --- /dev/null +++ b/sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules/tspCodeModel.json @@ -0,0 +1,19379 @@ +{ + "name": "Azure.ResourceManager.HardwareSecurityModules", + "apiVersions": [ + "2025-03-31" + ], + "enums": [ + { + "$id": "1", + "kind": "enum", + "name": "Origin", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Origin", + "valueType": { + "$id": "2", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "3", + "kind": "enumvalue", + "name": "user", + "value": "user", + "valueType": { + "$ref": "2" + }, + "enumType": { + "$ref": "1" + }, + "doc": "Indicates the operation is initiated by a user.", + "decorators": [] + }, + { + "$id": "4", + "kind": "enumvalue", + "name": "system", + "value": "system", + "valueType": { + "$ref": "2" + }, + "enumType": { + "$ref": "1" + }, + "doc": "Indicates the operation is initiated by a system.", + "decorators": [] + }, + { + "$id": "5", + "kind": "enumvalue", + "name": "user,system", + "value": "user,system", + "valueType": { + "$ref": "2" + }, + "enumType": { + "$ref": "1" + }, + "doc": "Indicates the operation is initiated by a user or system.", + "decorators": [] + } + ], + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "doc": "The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is \"user,system\"", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json", + "decorators": [] + }, + { + "$id": "6", + "kind": "enum", + "name": "ActionType", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ActionType", + "valueType": { + "$id": "7", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "8", + "kind": "enumvalue", + "name": "Internal", + "value": "Internal", + "valueType": { + "$ref": "7" + }, + "enumType": { + "$ref": "6" + }, + "doc": "Actions are for internal-only APIs.", + "decorators": [] + } + ], + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "doc": "Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for internal only APIs.", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json", + "decorators": [] + }, + { + "$id": "9", + "kind": "enum", + "name": "SecurityDomainActivationState", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.ActivationState", + "valueType": { + "$id": "10", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "11", + "kind": "enumvalue", + "name": "NotDefined", + "value": "NotDefined", + "valueType": { + "$ref": "10" + }, + "enumType": { + "$ref": "9" + }, + "decorators": [] + }, + { + "$id": "12", + "kind": "enumvalue", + "name": "NotActivated", + "value": "NotActivated", + "valueType": { + "$ref": "10" + }, + "enumType": { + "$ref": "9" + }, + "decorators": [] + }, + { + "$id": "13", + "kind": "enumvalue", + "name": "Active", + "value": "Active", + "valueType": { + "$ref": "10" + }, + "enumType": { + "$ref": "9" + }, + "decorators": [] + }, + { + "$id": "14", + "kind": "enumvalue", + "name": "Failed", + "value": "Failed", + "valueType": { + "$ref": "10" + }, + "enumType": { + "$ref": "9" + }, + "decorators": [] + }, + { + "$id": "15", + "kind": "enumvalue", + "name": "Unknown", + "value": "Unknown", + "valueType": { + "$ref": "10" + }, + "enumType": { + "$ref": "9" + }, + "decorators": [] + } + ], + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "doc": "State of security domain activation", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "16", + "kind": "enum", + "name": "AutoGeneratedDomainNameLabelScope", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.AutoGeneratedDomainNameLabelScope", + "valueType": { + "$id": "17", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "18", + "kind": "enumvalue", + "name": "TenantReuse", + "value": "TenantReuse", + "valueType": { + "$ref": "17" + }, + "enumType": { + "$ref": "16" + }, + "decorators": [] + }, + { + "$id": "19", + "kind": "enumvalue", + "name": "SubscriptionReuse", + "value": "SubscriptionReuse", + "valueType": { + "$ref": "17" + }, + "enumType": { + "$ref": "16" + }, + "decorators": [] + }, + { + "$id": "20", + "kind": "enumvalue", + "name": "ResourceGroupReuse", + "value": "ResourceGroupReuse", + "valueType": { + "$ref": "17" + }, + "enumType": { + "$ref": "16" + }, + "decorators": [] + }, + { + "$id": "21", + "kind": "enumvalue", + "name": "NoReuse", + "value": "NoReuse", + "valueType": { + "$ref": "17" + }, + "enumType": { + "$ref": "16" + }, + "decorators": [] + } + ], + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "doc": "The Cloud HSM Cluster's auto-generated Domain Name Label Scope", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "22", + "kind": "enum", + "name": "CloudHsmClusterPrivateEndpointServiceConnectionStatus", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.PrivateEndpointServiceConnectionStatus", + "valueType": { + "$id": "23", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "24", + "kind": "enumvalue", + "name": "Pending", + "value": "Pending", + "valueType": { + "$ref": "23" + }, + "enumType": { + "$ref": "22" + }, + "doc": "Connection waiting for approval or rejection", + "decorators": [] + }, + { + "$id": "25", + "kind": "enumvalue", + "name": "Approved", + "value": "Approved", + "valueType": { + "$ref": "23" + }, + "enumType": { + "$ref": "22" + }, + "doc": "Connection approved", + "decorators": [] + }, + { + "$id": "26", + "kind": "enumvalue", + "name": "Rejected", + "value": "Rejected", + "valueType": { + "$ref": "23" + }, + "enumType": { + "$ref": "22" + }, + "doc": "Connection Rejected", + "decorators": [] + } + ], + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "doc": "The private endpoint connection status.", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "27", + "kind": "enum", + "name": "CloudHsmClusterPrivateEndpointConnectionProvisioningState", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnectionProvisioningState", + "valueType": { + "$id": "28", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "29", + "kind": "enumvalue", + "name": "Succeeded", + "value": "Succeeded", + "valueType": { + "$ref": "28" + }, + "enumType": { + "$ref": "27" + }, + "decorators": [] + }, + { + "$id": "30", + "kind": "enumvalue", + "name": "Creating", + "value": "Creating", + "valueType": { + "$ref": "28" + }, + "enumType": { + "$ref": "27" + }, + "decorators": [] + }, + { + "$id": "31", + "kind": "enumvalue", + "name": "Deleting", + "value": "Deleting", + "valueType": { + "$ref": "28" + }, + "enumType": { + "$ref": "27" + }, + "decorators": [] + }, + { + "$id": "32", + "kind": "enumvalue", + "name": "Failed", + "value": "Failed", + "valueType": { + "$ref": "28" + }, + "enumType": { + "$ref": "27" + }, + "decorators": [] + }, + { + "$id": "33", + "kind": "enumvalue", + "name": "Updating", + "value": "Updating", + "valueType": { + "$ref": "28" + }, + "enumType": { + "$ref": "27" + }, + "decorators": [] + }, + { + "$id": "34", + "kind": "enumvalue", + "name": "InternalError", + "value": "InternalError", + "valueType": { + "$ref": "28" + }, + "enumType": { + "$ref": "27" + }, + "decorators": [] + }, + { + "$id": "35", + "kind": "enumvalue", + "name": "Canceled", + "value": "Canceled", + "valueType": { + "$ref": "28" + }, + "enumType": { + "$ref": "27" + }, + "decorators": [] + } + ], + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "doc": "The current provisioning state.", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "36", + "kind": "enum", + "name": "createdByType", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.createdByType", + "valueType": { + "$id": "37", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "38", + "kind": "enumvalue", + "name": "User", + "value": "User", + "valueType": { + "$ref": "37" + }, + "enumType": { + "$ref": "36" + }, + "doc": "The entity was created by a user.", + "decorators": [] + }, + { + "$id": "39", + "kind": "enumvalue", + "name": "Application", + "value": "Application", + "valueType": { + "$ref": "37" + }, + "enumType": { + "$ref": "36" + }, + "doc": "The entity was created by an application.", + "decorators": [] + }, + { + "$id": "40", + "kind": "enumvalue", + "name": "ManagedIdentity", + "value": "ManagedIdentity", + "valueType": { + "$ref": "37" + }, + "enumType": { + "$ref": "36" + }, + "doc": "The entity was created by a managed identity.", + "decorators": [] + }, + { + "$id": "41", + "kind": "enumvalue", + "name": "Key", + "value": "Key", + "valueType": { + "$ref": "37" + }, + "enumType": { + "$ref": "36" + }, + "doc": "The entity was created by a key.", + "decorators": [] + } + ], + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "doc": "The kind of entity that created the resource.", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "42", + "kind": "enum", + "name": "CloudHsmClusterProvisioningState", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.ProvisioningState", + "valueType": { + "$id": "43", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "44", + "kind": "enumvalue", + "name": "Provisioning", + "value": "Provisioning", + "valueType": { + "$ref": "43" + }, + "enumType": { + "$ref": "42" + }, + "decorators": [] + }, + { + "$id": "45", + "kind": "enumvalue", + "name": "Succeeded", + "value": "Succeeded", + "valueType": { + "$ref": "43" + }, + "enumType": { + "$ref": "42" + }, + "decorators": [] + }, + { + "$id": "46", + "kind": "enumvalue", + "name": "Updating", + "value": "Updating", + "valueType": { + "$ref": "43" + }, + "enumType": { + "$ref": "42" + }, + "decorators": [] + }, + { + "$id": "47", + "kind": "enumvalue", + "name": "Failed", + "value": "Failed", + "valueType": { + "$ref": "43" + }, + "enumType": { + "$ref": "42" + }, + "decorators": [] + }, + { + "$id": "48", + "kind": "enumvalue", + "name": "Deleting", + "value": "Deleting", + "valueType": { + "$ref": "43" + }, + "enumType": { + "$ref": "42" + }, + "decorators": [] + }, + { + "$id": "49", + "kind": "enumvalue", + "name": "Canceled", + "value": "Canceled", + "valueType": { + "$ref": "43" + }, + "enumType": { + "$ref": "42" + }, + "decorators": [] + } + ], + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "doc": "The Cloud HSM Cluster's provisioningState", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "50", + "kind": "enum", + "name": "CloudHsmClusterPublicNetworkAccess", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.PublicNetworkAccess", + "valueType": { + "$id": "51", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "52", + "kind": "enumvalue", + "name": "Disabled", + "value": "Disabled", + "valueType": { + "$ref": "51" + }, + "enumType": { + "$ref": "50" + }, + "decorators": [] + } + ], + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "doc": "The Cloud HSM Cluster public network access", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "53", + "kind": "enum", + "name": "ManagedServiceIdentityType", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentityType", + "valueType": { + "$id": "54", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "55", + "kind": "enumvalue", + "name": "None", + "value": "None", + "valueType": { + "$ref": "54" + }, + "enumType": { + "$ref": "53" + }, + "doc": "No managed identity.", + "decorators": [] + }, + { + "$id": "56", + "kind": "enumvalue", + "name": "SystemAssigned", + "value": "SystemAssigned", + "valueType": { + "$ref": "54" + }, + "enumType": { + "$ref": "53" + }, + "doc": "System assigned managed identity.", + "decorators": [] + }, + { + "$id": "57", + "kind": "enumvalue", + "name": "UserAssigned", + "value": "UserAssigned", + "valueType": { + "$ref": "54" + }, + "enumType": { + "$ref": "53" + }, + "doc": "User assigned managed identity.", + "decorators": [] + }, + { + "$id": "58", + "kind": "enumvalue", + "name": "SystemAssigned,UserAssigned", + "value": "SystemAssigned,UserAssigned", + "valueType": { + "$ref": "54" + }, + "enumType": { + "$ref": "53" + }, + "doc": "System and user assigned managed identity.", + "decorators": [] + } + ], + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "doc": "Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "59", + "kind": "enum", + "name": "CloudHsmClusterSkuFamily", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusterSkuFamily", + "valueType": { + "$id": "60", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "61", + "kind": "enumvalue", + "name": "B", + "value": "B", + "valueType": { + "$ref": "60" + }, + "enumType": { + "$ref": "59" + }, + "decorators": [] + } + ], + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "doc": "Sku family of the Cloud HSM Cluster", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "62", + "kind": "enum", + "name": "CloudHsmClusterSkuName", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusterSkuName", + "valueType": { + "$id": "63", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "64", + "kind": "enumvalue", + "name": "Standard_B1", + "value": "Standard_B1", + "valueType": { + "$ref": "63" + }, + "enumType": { + "$ref": "62" + }, + "decorators": [] + }, + { + "$id": "65", + "kind": "enumvalue", + "name": "Standard B10", + "value": "Standard B10", + "valueType": { + "$ref": "63" + }, + "enumType": { + "$ref": "62" + }, + "decorators": [] + } + ], + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "doc": "Sku name of the Cloud HSM Cluster", + "isFixed": true, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "66", + "kind": "enum", + "name": "ResourceProvisioningState", + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceProvisioningState", + "valueType": { + "$id": "67", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "68", + "kind": "enumvalue", + "name": "Succeeded", + "value": "Succeeded", + "valueType": { + "$ref": "67" + }, + "enumType": { + "$ref": "66" + }, + "doc": "Resource has been created.", + "decorators": [] + }, + { + "$id": "69", + "kind": "enumvalue", + "name": "Failed", + "value": "Failed", + "valueType": { + "$ref": "67" + }, + "enumType": { + "$ref": "66" + }, + "doc": "Resource creation failed.", + "decorators": [] + }, + { + "$id": "70", + "kind": "enumvalue", + "name": "Canceled", + "value": "Canceled", + "valueType": { + "$ref": "67" + }, + "enumType": { + "$ref": "66" + }, + "doc": "Resource creation was canceled.", + "decorators": [] + } + ], + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "doc": "The provisioning state of a resource type.", + "isFixed": false, + "isFlags": false, + "usage": "LroPolling", + "decorators": [] + }, + { + "$id": "71", + "kind": "enum", + "name": "BackupRestoreOperationStatus", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.BackupRestoreOperationStatus", + "valueType": { + "$id": "72", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "73", + "kind": "enumvalue", + "name": "InProgress", + "value": "InProgress", + "valueType": { + "$ref": "72" + }, + "enumType": { + "$ref": "71" + }, + "decorators": [] + }, + { + "$id": "74", + "kind": "enumvalue", + "name": "Succeeded", + "value": "Succeeded", + "valueType": { + "$ref": "72" + }, + "enumType": { + "$ref": "71" + }, + "decorators": [] + }, + { + "$id": "75", + "kind": "enumvalue", + "name": "Failed", + "value": "Failed", + "valueType": { + "$ref": "72" + }, + "enumType": { + "$ref": "71" + }, + "decorators": [] + }, + { + "$id": "76", + "kind": "enumvalue", + "name": "Cancelled", + "value": "Cancelled", + "valueType": { + "$ref": "72" + }, + "enumType": { + "$ref": "71" + }, + "decorators": [] + } + ], + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "doc": "Status of the backup/restore operation", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "77", + "kind": "enum", + "name": "DedicatedHsmJsonWebKeyType", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.JsonWebKeyType", + "valueType": { + "$id": "78", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "79", + "kind": "enumvalue", + "name": "Succeeded", + "value": "Succeeded", + "valueType": { + "$ref": "78" + }, + "enumType": { + "$ref": "77" + }, + "doc": "The dedicated HSM has been fully provisioned.", + "decorators": [] + }, + { + "$id": "80", + "kind": "enumvalue", + "name": "Provisioning", + "value": "Provisioning", + "valueType": { + "$ref": "78" + }, + "enumType": { + "$ref": "77" + }, + "doc": "The dedicated HSM is currently being provisioned.", + "decorators": [] + }, + { + "$id": "81", + "kind": "enumvalue", + "name": "Allocating", + "value": "Allocating", + "valueType": { + "$ref": "78" + }, + "enumType": { + "$ref": "77" + }, + "doc": "A device is currently being allocated for the dedicated HSM resource.", + "decorators": [] + }, + { + "$id": "82", + "kind": "enumvalue", + "name": "Connecting", + "value": "Connecting", + "valueType": { + "$ref": "78" + }, + "enumType": { + "$ref": "77" + }, + "doc": "The dedicated HSM is being connected to the virtual network.", + "decorators": [] + }, + { + "$id": "83", + "kind": "enumvalue", + "name": "Failed", + "value": "Failed", + "valueType": { + "$ref": "78" + }, + "enumType": { + "$ref": "77" + }, + "doc": "Provisioning of the dedicated HSM has failed.", + "decorators": [] + }, + { + "$id": "84", + "kind": "enumvalue", + "name": "CheckingQuota", + "value": "CheckingQuota", + "valueType": { + "$ref": "78" + }, + "enumType": { + "$ref": "77" + }, + "doc": "Validating the subscription has sufficient quota to allocate a dedicated HSM device.", + "decorators": [] + }, + { + "$id": "85", + "kind": "enumvalue", + "name": "Deleting", + "value": "Deleting", + "valueType": { + "$ref": "78" + }, + "enumType": { + "$ref": "77" + }, + "doc": "The dedicated HSM is currently being deleted.", + "decorators": [] + } + ], + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "doc": "Provisioning state.", + "isFixed": false, + "isFlags": false, + "usage": "Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "86", + "kind": "enum", + "name": "DedicatedHsmSkuName", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.SkuName", + "valueType": { + "$id": "87", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "88", + "kind": "enumvalue", + "name": "SafeNetLunaNetworkHsmA790", + "value": "SafeNet Luna Network HSM A790", + "valueType": { + "$ref": "87" + }, + "enumType": { + "$ref": "86" + }, + "doc": "The dedicated HSM is a Safenet Luna Network HSM A790 device.", + "decorators": [] + }, + { + "$id": "89", + "kind": "enumvalue", + "name": "PayShield10KLmk1Cps60", + "value": "payShield10K_LMK1_CPS60", + "valueType": { + "$ref": "87" + }, + "enumType": { + "$ref": "86" + }, + "doc": "The dedicated HSM is a payShield 10K, model PS10-D, 10Gb Ethernet Hardware Platform device with 1 local master key which supports up to 60 calls per second.", + "decorators": [] + }, + { + "$id": "90", + "kind": "enumvalue", + "name": "PayShield10KLmk1Cps250", + "value": "payShield10K_LMK1_CPS250", + "valueType": { + "$ref": "87" + }, + "enumType": { + "$ref": "86" + }, + "doc": "The dedicated HSM is a payShield 10K, model PS10-D, 10Gb Ethernet Hardware Platform device with 1 local master key which supports up to 250 calls per second.", + "decorators": [] + }, + { + "$id": "91", + "kind": "enumvalue", + "name": "PayShield10KLmk1Cps2500", + "value": "payShield10K_LMK1_CPS2500", + "valueType": { + "$ref": "87" + }, + "enumType": { + "$ref": "86" + }, + "doc": "The dedicated HSM is a payShield 10K, model PS10-D, 10Gb Ethernet Hardware Platform device with 1 local master key which supports up to 2500 calls per second.", + "decorators": [] + }, + { + "$id": "92", + "kind": "enumvalue", + "name": "PayShield10KLmk2Cps60", + "value": "payShield10K_LMK2_CPS60", + "valueType": { + "$ref": "87" + }, + "enumType": { + "$ref": "86" + }, + "doc": "The dedicated HSM is a payShield 10K, model PS10-D, 10Gb Ethernet Hardware Platform device with 2 local master keys which supports up to 60 calls per second.", + "decorators": [] + }, + { + "$id": "93", + "kind": "enumvalue", + "name": "PayShield10KLmk2Cps250", + "value": "payShield10K_LMK2_CPS250", + "valueType": { + "$ref": "87" + }, + "enumType": { + "$ref": "86" + }, + "doc": "The dedicated HSM is a payShield 10K, model PS10-D, 10Gb Ethernet Hardware Platform device with 2 local master keys which supports up to 250 calls per second.", + "decorators": [] + }, + { + "$id": "94", + "kind": "enumvalue", + "name": "PayShield10KLmk2Cps2500", + "value": "payShield10K_LMK2_CPS2500", + "valueType": { + "$ref": "87" + }, + "enumType": { + "$ref": "86" + }, + "doc": "The dedicated HSM is a payShield 10K, model PS10-D, 10Gb Ethernet Hardware Platform device with 2 local master keys which supports up to 2500 calls per second.", + "decorators": [] + } + ], + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "doc": "SKU of the dedicated HSM", + "isFixed": false, + "isFlags": false, + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "decorators": [] + }, + { + "$id": "95", + "kind": "enum", + "name": "Versions", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.Versions", + "valueType": { + "$id": "96", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "97", + "kind": "enumvalue", + "name": "v2025_03_31", + "value": "2025-03-31", + "valueType": { + "$ref": "96" + }, + "enumType": { + "$ref": "95" + }, + "doc": "The 2025-03-31 API version.", + "decorators": [] + } + ], + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "doc": "The available API versions.", + "isFixed": true, + "isFlags": false, + "usage": "ApiVersionEnum", + "decorators": [] + } + ], + "constants": [ + { + "$id": "98", + "kind": "constant", + "name": "listContentType", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "99", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + { + "$id": "100", + "kind": "constant", + "name": "getContentType", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "101", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + { + "$id": "102", + "kind": "constant", + "name": "createOrUpdateContentType", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "103", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + { + "$id": "104", + "kind": "constant", + "name": "createOrUpdateContentType1", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "105", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + { + "$id": "106", + "kind": "constant", + "name": "createOrUpdateContentType2", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "107", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + { + "$id": "108", + "kind": "constant", + "name": "createOrUpdateContentType3", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "109", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + { + "$id": "110", + "kind": "constant", + "name": "updateContentType", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "111", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + { + "$id": "112", + "kind": "constant", + "name": "updateContentType1", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "113", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + { + "$id": "114", + "kind": "constant", + "name": "updateContentType2", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "115", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + { + "$id": "116", + "kind": "constant", + "name": "updateContentType3", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "117", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + { + "$id": "118", + "kind": "constant", + "name": "listByResourceGroupContentType", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "119", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + { + "$id": "120", + "kind": "constant", + "name": "listBySubscriptionContentType", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "121", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + { + "$id": "122", + "kind": "constant", + "name": "validateBackupPropertiesContentType", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "123", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + { + "$id": "124", + "kind": "constant", + "name": "validateBackupPropertiesContentType1", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "125", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + { + "$id": "126", + "kind": "constant", + "name": "validateBackupPropertiesContentType2", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "127", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + { + "$id": "128", + "kind": "constant", + "name": "backupContentType", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "129", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + { + "$id": "130", + "kind": "constant", + "name": "backupContentType1", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "131", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + { + "$id": "132", + "kind": "constant", + "name": "backupContentType2", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "133", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + { + "$id": "134", + "kind": "constant", + "name": "validateRestorePropertiesContentType", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "135", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + { + "$id": "136", + "kind": "constant", + "name": "validateRestorePropertiesContentType1", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "137", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + { + "$id": "138", + "kind": "constant", + "name": "validateRestorePropertiesContentType2", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "139", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + { + "$id": "140", + "kind": "constant", + "name": "restoreContentType", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "141", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + { + "$id": "142", + "kind": "constant", + "name": "restoreContentType1", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "143", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + { + "$id": "144", + "kind": "constant", + "name": "restoreContentType2", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "145", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + { + "$id": "146", + "kind": "constant", + "name": "restoreContentType3", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "147", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + { + "$id": "148", + "kind": "constant", + "name": "getContentType1", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "149", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + { + "$id": "150", + "kind": "constant", + "name": "createContentType", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "151", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + { + "$id": "152", + "kind": "constant", + "name": "createContentType1", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "153", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + { + "$id": "154", + "kind": "constant", + "name": "listByCloudHsmClusterContentType", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "155", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + { + "$id": "156", + "kind": "constant", + "name": "getContentType2", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "157", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + { + "$id": "158", + "kind": "constant", + "name": "createOrUpdateContentType4", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "159", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + { + "$id": "160", + "kind": "constant", + "name": "createOrUpdateContentType5", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "161", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + { + "$id": "162", + "kind": "constant", + "name": "createOrUpdateContentType6", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "163", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + { + "$id": "164", + "kind": "constant", + "name": "createOrUpdateContentType7", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "165", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + { + "$id": "166", + "kind": "constant", + "name": "updateContentType4", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "167", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + { + "$id": "168", + "kind": "constant", + "name": "updateContentType5", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "169", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + { + "$id": "170", + "kind": "constant", + "name": "updateContentType6", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "171", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + { + "$id": "172", + "kind": "constant", + "name": "updateContentType7", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "173", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + { + "$id": "174", + "kind": "constant", + "name": "listByResourceGroupContentType1", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "175", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + { + "$id": "176", + "kind": "constant", + "name": "listBySubscriptionContentType1", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "177", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + { + "$id": "178", + "kind": "constant", + "name": "listOutboundNetworkDependenciesEndpointsContentType", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "179", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + { + "$id": "180", + "kind": "constant", + "name": "listByCloudHsmClusterContentType1", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "181", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + { + "$id": "182", + "kind": "constant", + "name": "cloudHsmClusterBackupStatusGetContentType", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "183", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + }, + { + "$id": "184", + "kind": "constant", + "name": "cloudHsmClusterRestoreStatusGetContentType", + "namespace": "", + "usage": "None", + "valueType": { + "$id": "185", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "value": "application/json", + "decorators": [] + } + ], + "models": [ + { + "$id": "186", + "kind": "model", + "name": "OperationListResult", + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationListResult", + "usage": "Output,Json", + "doc": "A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results.", + "decorators": [ + { + "name": "Azure.ResourceManager.@armProviderNamespace", + "arguments": {} + } + ], + "properties": [ + { + "$id": "187", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The Operation items on this page", + "type": { + "$id": "188", + "kind": "array", + "name": "ArrayOperation", + "valueType": { + "$id": "189", + "kind": "model", + "name": "Operation", + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation", + "usage": "Output,Json", + "doc": "Details of a REST API operation, returned from the Resource Provider Operations API", + "summary": "REST API Operation", + "decorators": [ + { + "name": "Azure.ResourceManager.@armProviderNamespace", + "arguments": {} + } + ], + "properties": [ + { + "$id": "190", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the operation, as per Resource-Based Access Control (RBAC). Examples: \"Microsoft.Compute/virtualMachines/write\", \"Microsoft.Compute/virtualMachines/capture/action\"", + "type": { + "$id": "191", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.name", + "serializationOptions": { + "json": { + "name": "name" + } + }, + "isHttpMetadata": false + }, + { + "$id": "192", + "kind": "property", + "name": "isDataAction", + "serializedName": "isDataAction", + "doc": "Whether the operation applies to data-plane. This is \"true\" for data-plane operations and \"false\" for Azure Resource Manager/control-plane operations.", + "type": { + "$id": "193", + "kind": "boolean", + "name": "boolean", + "crossLanguageDefinitionId": "TypeSpec.boolean", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.isDataAction", + "serializationOptions": { + "json": { + "name": "isDataAction" + } + }, + "isHttpMetadata": false + }, + { + "$id": "194", + "kind": "property", + "name": "display", + "serializedName": "display", + "doc": "Localized display information for this particular operation.", + "type": { + "$id": "195", + "kind": "model", + "name": "OperationDisplay", + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay", + "usage": "Output,Json", + "doc": "Localized display information for and operation.", + "decorators": [ + { + "name": "Azure.ResourceManager.@armProviderNamespace", + "arguments": {} + } + ], + "properties": [ + { + "$id": "196", + "kind": "property", + "name": "provider", + "serializedName": "provider", + "doc": "The localized friendly form of the resource provider name, e.g. \"Microsoft Monitoring Insights\" or \"Microsoft Compute\".", + "type": { + "$id": "197", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay.provider", + "serializationOptions": { + "json": { + "name": "provider" + } + }, + "isHttpMetadata": false + }, + { + "$id": "198", + "kind": "property", + "name": "resource", + "serializedName": "resource", + "doc": "The localized friendly name of the resource type related to this operation. E.g. \"Virtual Machines\" or \"Job Schedule Collections\".", + "type": { + "$id": "199", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay.resource", + "serializationOptions": { + "json": { + "name": "resource" + } + }, + "isHttpMetadata": false + }, + { + "$id": "200", + "kind": "property", + "name": "operation", + "serializedName": "operation", + "doc": "The concise, localized friendly name for the operation; suitable for dropdowns. E.g. \"Create or Update Virtual Machine\", \"Restart Virtual Machine\".", + "type": { + "$id": "201", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay.operation", + "serializationOptions": { + "json": { + "name": "operation" + } + }, + "isHttpMetadata": false + }, + { + "$id": "202", + "kind": "property", + "name": "description", + "serializedName": "description", + "doc": "The short, localized friendly description of the operation; suitable for tool tips and detailed views.", + "type": { + "$id": "203", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationDisplay.description", + "serializationOptions": { + "json": { + "name": "description" + } + }, + "isHttpMetadata": false + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.display", + "serializationOptions": { + "json": { + "name": "display" + } + }, + "isHttpMetadata": false + }, + { + "$id": "204", + "kind": "property", + "name": "origin", + "serializedName": "origin", + "doc": "The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is \"user,system\"", + "type": { + "$ref": "1" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.origin", + "serializationOptions": { + "json": { + "name": "origin" + } + }, + "isHttpMetadata": false + }, + { + "$id": "205", + "kind": "property", + "name": "actionType", + "serializedName": "actionType", + "doc": "Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for internal only APIs.", + "type": { + "$ref": "6" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Operation.actionType", + "serializationOptions": { + "json": { + "name": "actionType" + } + }, + "isHttpMetadata": false + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationListResult.value", + "serializationOptions": { + "json": { + "name": "value" + } + }, + "isHttpMetadata": false + }, + { + "$id": "206", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "207", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "208", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.OperationListResult.nextLink", + "serializationOptions": { + "json": { + "name": "nextLink" + } + }, + "isHttpMetadata": false + } + ] + }, + { + "$ref": "189" + }, + { + "$ref": "195" + }, + { + "$id": "209", + "kind": "model", + "name": "ErrorResponse", + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorResponse", + "usage": "Json,Exception", + "doc": "Common error response for all Azure Resource Manager APIs to return error details for failed operations.", + "summary": "Error response", + "decorators": [ + { + "name": "Azure.ResourceManager.@armProviderNamespace", + "arguments": {} + } + ], + "properties": [ + { + "$id": "210", + "kind": "property", + "name": "error", + "serializedName": "error", + "doc": "The error object.", + "type": { + "$id": "211", + "kind": "model", + "name": "ErrorDetail", + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail", + "usage": "Output,Json,Exception,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "The error detail.", + "decorators": [ + { + "name": "Azure.ResourceManager.@armProviderNamespace", + "arguments": {} + } + ], + "properties": [ + { + "$id": "212", + "kind": "property", + "name": "code", + "serializedName": "code", + "doc": "The error code.", + "type": { + "$id": "213", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.code", + "serializationOptions": { + "json": { + "name": "code" + } + }, + "isHttpMetadata": false + }, + { + "$id": "214", + "kind": "property", + "name": "message", + "serializedName": "message", + "doc": "The error message.", + "type": { + "$id": "215", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.message", + "serializationOptions": { + "json": { + "name": "message" + } + }, + "isHttpMetadata": false + }, + { + "$id": "216", + "kind": "property", + "name": "target", + "serializedName": "target", + "doc": "The error target.", + "type": { + "$id": "217", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.target", + "serializationOptions": { + "json": { + "name": "target" + } + }, + "isHttpMetadata": false + }, + { + "$id": "218", + "kind": "property", + "name": "details", + "serializedName": "details", + "doc": "The error details.", + "type": { + "$id": "219", + "kind": "array", + "name": "ArrayErrorDetail", + "valueType": { + "$ref": "211" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.details", + "serializationOptions": { + "json": { + "name": "details" + } + }, + "isHttpMetadata": false + }, + { + "$id": "220", + "kind": "property", + "name": "additionalInfo", + "serializedName": "additionalInfo", + "doc": "The error additional info.", + "type": { + "$id": "221", + "kind": "array", + "name": "ArrayErrorAdditionalInfo", + "valueType": { + "$id": "222", + "kind": "model", + "name": "ErrorAdditionalInfo", + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo", + "usage": "Output,Json,Exception,LroInitial,LroPolling,LroFinalEnvelope", + "doc": "The resource management error additional info.", + "decorators": [ + { + "name": "Azure.ResourceManager.@armProviderNamespace", + "arguments": {} + } + ], + "properties": [ + { + "$id": "223", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "The additional info type.", + "type": { + "$id": "224", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo.type", + "serializationOptions": { + "json": { + "name": "type" + } + }, + "isHttpMetadata": false + }, + { + "$id": "225", + "kind": "property", + "name": "info", + "serializedName": "info", + "doc": "The additional info.", + "type": { + "$id": "226", + "kind": "unknown", + "name": "unknown", + "crossLanguageDefinitionId": "", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo.info", + "serializationOptions": { + "json": { + "name": "info" + } + }, + "isHttpMetadata": false + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorDetail.additionalInfo", + "serializationOptions": { + "json": { + "name": "additionalInfo" + } + }, + "isHttpMetadata": false + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ErrorResponse.error", + "serializationOptions": { + "json": { + "name": "error" + } + }, + "isHttpMetadata": false + } + ] + }, + { + "$ref": "211" + }, + { + "$ref": "222" + }, + { + "$id": "227", + "kind": "model", + "name": "CloudHsmCluster", + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmCluster", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Resource information with extended details.", + "decorators": [ + { + "name": "Azure.ResourceManager.@armProviderNamespace", + "arguments": {} + }, + { + "name": "Azure.ResourceManager.Private.@armResourceInternal", + "arguments": {} + }, + { + "name": "Azure.ClientGenerator.Core.@resourceSchema", + "arguments": { + "resourceIdPattern": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}", + "resourceType": "Microsoft.HardwareSecurityModules/cloudHsmClusters", + "methods": [ + { + "$id": "228", + "methodId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.get", + "kind": "Get", + "operationPath": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}", + "operationScope": "ResourceGroup", + "resourceScope": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}" + }, + { + "$id": "229", + "methodId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.createOrUpdate", + "kind": "Create", + "operationPath": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}", + "operationScope": "ResourceGroup", + "resourceScope": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}" + }, + { + "$id": "230", + "methodId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.update", + "kind": "Update", + "operationPath": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}", + "operationScope": "ResourceGroup", + "resourceScope": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}" + }, + { + "$id": "231", + "methodId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.delete", + "kind": "Delete", + "operationPath": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}", + "operationScope": "ResourceGroup", + "resourceScope": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}" + }, + { + "$id": "232", + "methodId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.listByResourceGroup", + "kind": "List", + "operationPath": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters", + "operationScope": "ResourceGroup" + }, + { + "$id": "233", + "methodId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.listBySubscription", + "kind": "List", + "operationPath": "/subscriptions/{subscriptionId}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters", + "operationScope": "Subscription" + }, + { + "$id": "234", + "methodId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.validateBackupProperties", + "kind": "Action", + "operationPath": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/validateBackupProperties", + "operationScope": "ResourceGroup", + "resourceScope": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}" + }, + { + "$id": "235", + "methodId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.backup", + "kind": "Action", + "operationPath": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/backup", + "operationScope": "ResourceGroup", + "resourceScope": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}" + }, + { + "$id": "236", + "methodId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.validateRestoreProperties", + "kind": "Action", + "operationPath": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/validateRestoreProperties", + "operationScope": "ResourceGroup", + "resourceScope": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}" + }, + { + "$id": "237", + "methodId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.restore", + "kind": "Action", + "operationPath": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/restore", + "operationScope": "ResourceGroup", + "resourceScope": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}" + }, + { + "$id": "238", + "methodId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.listByCloudHsmCluster", + "kind": "Action", + "operationPath": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateLinkResources", + "operationScope": "ResourceGroup", + "resourceScope": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}" + } + ], + "resourceScope": "ResourceGroup", + "resourceName": "CloudHsmCluster" + } + } + ], + "baseModel": { + "$id": "239", + "kind": "model", + "name": "TrackedResource", + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.TrackedResource", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'", + "summary": "Tracked Resource", + "decorators": [ + { + "name": "Azure.ResourceManager.@armProviderNamespace", + "arguments": {} + } + ], + "baseModel": { + "$id": "240", + "kind": "model", + "name": "Resource", + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Resource", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Common fields that are returned in the response for all Azure Resource Manager resources", + "summary": "Resource", + "decorators": [ + { + "name": "Azure.ResourceManager.@armProviderNamespace", + "arguments": {} + } + ], + "properties": [ + { + "$id": "241", + "kind": "property", + "name": "id", + "serializedName": "id", + "doc": "Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}", + "type": { + "$id": "242", + "kind": "string", + "name": "armResourceIdentifier", + "crossLanguageDefinitionId": "Azure.Core.armResourceIdentifier", + "baseType": { + "$id": "243", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Resource.id", + "serializationOptions": { + "json": { + "name": "id" + } + }, + "isHttpMetadata": false + }, + { + "$id": "244", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the resource", + "type": { + "$id": "245", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Resource.name", + "serializationOptions": { + "json": { + "name": "name" + } + }, + "isHttpMetadata": false + }, + { + "$id": "246", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or \"Microsoft.Storage/storageAccounts\"", + "type": { + "$id": "247", + "kind": "string", + "name": "armResourceType", + "crossLanguageDefinitionId": "Azure.Core.armResourceType", + "baseType": { + "$id": "248", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Resource.type", + "serializationOptions": { + "json": { + "name": "type" + } + }, + "isHttpMetadata": false + }, + { + "$id": "249", + "kind": "property", + "name": "systemData", + "serializedName": "systemData", + "doc": "Azure Resource Manager metadata containing createdBy and modifiedBy information.", + "type": { + "$id": "250", + "kind": "model", + "name": "SystemData", + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData", + "usage": "Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Metadata pertaining to creation and last modification of the resource.", + "decorators": [ + { + "name": "Azure.ResourceManager.@armProviderNamespace", + "arguments": {} + } + ], + "properties": [ + { + "$id": "251", + "kind": "property", + "name": "createdBy", + "serializedName": "createdBy", + "doc": "The identity that created the resource.", + "type": { + "$id": "252", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.createdBy", + "serializationOptions": { + "json": { + "name": "createdBy" + } + }, + "isHttpMetadata": false + }, + { + "$id": "253", + "kind": "property", + "name": "createdByType", + "serializedName": "createdByType", + "doc": "The type of identity that created the resource.", + "type": { + "$ref": "36" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.createdByType", + "serializationOptions": { + "json": { + "name": "createdByType" + } + }, + "isHttpMetadata": false + }, + { + "$id": "254", + "kind": "property", + "name": "createdAt", + "serializedName": "createdAt", + "doc": "The timestamp of resource creation (UTC).", + "type": { + "$id": "255", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "256", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.createdAt", + "serializationOptions": { + "json": { + "name": "createdAt" + } + }, + "isHttpMetadata": false + }, + { + "$id": "257", + "kind": "property", + "name": "lastModifiedBy", + "serializedName": "lastModifiedBy", + "doc": "The identity that last modified the resource.", + "type": { + "$id": "258", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.lastModifiedBy", + "serializationOptions": { + "json": { + "name": "lastModifiedBy" + } + }, + "isHttpMetadata": false + }, + { + "$id": "259", + "kind": "property", + "name": "lastModifiedByType", + "serializedName": "lastModifiedByType", + "doc": "The type of identity that last modified the resource.", + "type": { + "$ref": "36" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.lastModifiedByType", + "serializationOptions": { + "json": { + "name": "lastModifiedByType" + } + }, + "isHttpMetadata": false + }, + { + "$id": "260", + "kind": "property", + "name": "lastModifiedAt", + "serializedName": "lastModifiedAt", + "doc": "The timestamp of resource last modification (UTC)", + "type": { + "$id": "261", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "262", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.SystemData.lastModifiedAt", + "serializationOptions": { + "json": { + "name": "lastModifiedAt" + } + }, + "isHttpMetadata": false + } + ] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.Resource.systemData", + "serializationOptions": { + "json": { + "name": "systemData" + } + }, + "isHttpMetadata": false + } + ] + }, + "properties": [ + { + "$id": "263", + "kind": "property", + "name": "tags", + "serializedName": "tags", + "doc": "Resource tags.", + "type": { + "$id": "264", + "kind": "dict", + "keyType": { + "$id": "265", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "266", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.TrackedResource.tags", + "serializationOptions": { + "json": { + "name": "tags" + } + }, + "isHttpMetadata": false + }, + { + "$id": "267", + "kind": "property", + "name": "location", + "serializedName": "location", + "doc": "The geo-location where the resource lives", + "type": { + "$id": "268", + "kind": "string", + "name": "azureLocation", + "crossLanguageDefinitionId": "Azure.Core.azureLocation", + "baseType": { + "$id": "269", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.TrackedResource.location", + "serializationOptions": { + "json": { + "name": "location" + } + }, + "isHttpMetadata": false + } + ] + }, + "properties": [ + { + "$id": "270", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "Properties of the Cloud HSM Cluster", + "type": { + "$id": "271", + "kind": "model", + "name": "CloudHsmClusterProperties", + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusterProperties", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Properties of a Cloud HSM Cluster.", + "decorators": [ + { + "name": "Azure.ResourceManager.@armProviderNamespace", + "arguments": {} + } + ], + "properties": [ + { + "$id": "272", + "kind": "property", + "name": "activationState", + "serializedName": "activationState", + "doc": "State of security domain activation", + "type": { + "$ref": "9" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusterProperties.activationState", + "serializationOptions": { + "json": { + "name": "activationState" + } + }, + "isHttpMetadata": false + }, + { + "$id": "273", + "kind": "property", + "name": "autoGeneratedDomainNameLabelScope", + "serializedName": "autoGeneratedDomainNameLabelScope", + "doc": "The Cloud HSM Cluster's auto-generated Domain Name Label Scope", + "type": { + "$ref": "16" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusterProperties.autoGeneratedDomainNameLabelScope", + "serializationOptions": { + "json": { + "name": "autoGeneratedDomainNameLabelScope" + } + }, + "isHttpMetadata": false + }, + { + "$id": "274", + "kind": "property", + "name": "hsms", + "serializedName": "hsms", + "doc": "An array of Cloud HSM Cluster's HSMs", + "type": { + "$id": "275", + "kind": "array", + "name": "ArrayCloudHsmProperties", + "valueType": { + "$id": "276", + "kind": "model", + "name": "CloudHsmProperties", + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmProperties", + "usage": "Output,Json,LroInitial,LroFinalEnvelope", + "doc": "The Cloud HSM Properties", + "decorators": [ + { + "name": "Azure.ResourceManager.@armProviderNamespace", + "arguments": {} + } + ], + "properties": [ + { + "$id": "277", + "kind": "property", + "name": "fqdn", + "serializedName": "fqdn", + "doc": "FQDN of the Cloud HSM", + "type": { + "$id": "278", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmProperties.fqdn", + "serializationOptions": { + "json": { + "name": "fqdn" + } + }, + "isHttpMetadata": false + }, + { + "$id": "279", + "kind": "property", + "name": "state", + "serializedName": "state", + "doc": "The Cloud HSM State. Values are: Deploying, ConfiguringSlb, Starting, Starting, Failed, Failed, Deleting, DeletingSlbEntry, InitialProvisioning, Updating", + "type": { + "$id": "280", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmProperties.state", + "serializationOptions": { + "json": { + "name": "state" + } + }, + "isHttpMetadata": false + }, + { + "$id": "281", + "kind": "property", + "name": "stateMessage", + "serializedName": "stateMessage", + "doc": "The Cloud HSM State message", + "type": { + "$id": "282", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmProperties.stateMessage", + "serializationOptions": { + "json": { + "name": "stateMessage" + } + }, + "isHttpMetadata": false + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusterProperties.hsms", + "serializationOptions": { + "json": { + "name": "hsms" + } + }, + "isHttpMetadata": false + }, + { + "$id": "283", + "kind": "property", + "name": "privateEndpointConnections", + "serializedName": "privateEndpointConnections", + "doc": "List of private endpoint connection resources", + "type": { + "$id": "284", + "kind": "array", + "name": "ArrayPrivateEndpointConnection", + "valueType": { + "$id": "285", + "kind": "model", + "name": "CloudHsmClusterPrivateEndpointConnection", + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnection", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "The private endpoint connection resource.", + "decorators": [ + { + "name": "Azure.ResourceManager.@armProviderNamespace", + "arguments": {} + }, + { + "name": "Azure.ResourceManager.Private.@armResourceInternal", + "arguments": {} + }, + { + "name": "TypeSpec.Rest.@parentResource", + "arguments": {} + }, + { + "name": "Azure.ClientGenerator.Core.@resourceSchema", + "arguments": { + "resourceIdPattern": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections/{peConnectionName}", + "resourceType": "Microsoft.HardwareSecurityModules/cloudHsmClusters/privateEndpointConnections", + "methods": [ + { + "$id": "286", + "methodId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnections.get", + "kind": "Get", + "operationPath": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections/{peConnectionName}", + "operationScope": "ResourceGroup", + "resourceScope": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections/{peConnectionName}" + }, + { + "$id": "287", + "methodId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnections.create", + "kind": "Create", + "operationPath": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections/{peConnectionName}", + "operationScope": "ResourceGroup", + "resourceScope": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections/{peConnectionName}" + }, + { + "$id": "288", + "methodId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnections.delete", + "kind": "Delete", + "operationPath": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections/{peConnectionName}", + "operationScope": "ResourceGroup", + "resourceScope": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections/{peConnectionName}" + }, + { + "$id": "289", + "methodId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnections.listByCloudHsmCluster", + "kind": "List", + "operationPath": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections", + "operationScope": "ResourceGroup", + "resourceScope": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}" + } + ], + "resourceScope": "ResourceGroup", + "parentResourceId": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}", + "resourceName": "CloudHsmClusterPrivateEndpointConnection" + } + } + ], + "baseModel": { + "$id": "290", + "kind": "model", + "name": "ProxyResource", + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ProxyResource", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location", + "summary": "Proxy Resource", + "decorators": [ + { + "name": "Azure.ResourceManager.@armProviderNamespace", + "arguments": {} + } + ], + "baseModel": { + "$ref": "240" + }, + "properties": [] + }, + "properties": [ + { + "$id": "291", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "Resource properties.", + "type": { + "$id": "292", + "kind": "model", + "name": "CloudHsmClusterPrivateEndpointConnectionProperties", + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnectionProperties", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Properties of the private endpoint connection.", + "decorators": [ + { + "name": "Azure.ResourceManager.@armProviderNamespace", + "arguments": {} + } + ], + "properties": [ + { + "$id": "293", + "kind": "property", + "name": "privateEndpoint", + "serializedName": "privateEndpoint", + "doc": "The private endpoint resource.", + "type": { + "$id": "294", + "kind": "model", + "name": "PrivateEndpoint", + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.PrivateEndpoint", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "The private endpoint resource.", + "decorators": [ + { + "name": "Azure.ResourceManager.@armProviderNamespace", + "arguments": {} + } + ], + "properties": [ + { + "$id": "295", + "kind": "property", + "name": "id", + "serializedName": "id", + "doc": "The resource identifier of the private endpoint", + "type": { + "$id": "296", + "kind": "string", + "name": "armResourceIdentifier", + "crossLanguageDefinitionId": "Azure.Core.armResourceIdentifier", + "baseType": { + "$id": "297", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.PrivateEndpoint.id", + "serializationOptions": { + "json": { + "name": "id" + } + }, + "isHttpMetadata": false + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnectionProperties.privateEndpoint", + "serializationOptions": { + "json": { + "name": "privateEndpoint" + } + }, + "isHttpMetadata": false + }, + { + "$id": "298", + "kind": "property", + "name": "connectionState ", + "serializedName": "privateLinkServiceConnectionState", + "doc": "A collection of information about the state of the connection between service consumer and provider.", + "type": { + "$id": "299", + "kind": "model", + "name": "CloudHsmClusterPrivateLinkServiceConnectionState", + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.PrivateLinkServiceConnectionState", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "A collection of information about the state of the connection between service consumer and provider.", + "decorators": [ + { + "name": "Azure.ResourceManager.@armProviderNamespace", + "arguments": {} + } + ], + "properties": [ + { + "$id": "300", + "kind": "property", + "name": "status", + "serializedName": "status", + "doc": "Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service.", + "type": { + "$ref": "22" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.PrivateLinkServiceConnectionState.status", + "serializationOptions": { + "json": { + "name": "status" + } + }, + "isHttpMetadata": false + }, + { + "$id": "301", + "kind": "property", + "name": "description", + "serializedName": "description", + "doc": "The reason for approval/rejection of the connection.", + "type": { + "$id": "302", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.PrivateLinkServiceConnectionState.description", + "serializationOptions": { + "json": { + "name": "description" + } + }, + "isHttpMetadata": false + }, + { + "$id": "303", + "kind": "property", + "name": "actionsRequired", + "serializedName": "actionsRequired", + "doc": "A message indicating if changes on the service provider require any updates on the consumer.", + "type": { + "$id": "304", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.PrivateLinkServiceConnectionState.actionsRequired", + "serializationOptions": { + "json": { + "name": "actionsRequired" + } + }, + "isHttpMetadata": false + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnectionProperties.privateLinkServiceConnectionState", + "serializationOptions": { + "json": { + "name": "privateLinkServiceConnectionState" + } + }, + "isHttpMetadata": false + }, + { + "$id": "305", + "kind": "property", + "name": "provisioningState", + "serializedName": "provisioningState", + "doc": "The provisioning state of the private endpoint connection resource.", + "type": { + "$ref": "27" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnectionProperties.provisioningState", + "serializationOptions": { + "json": { + "name": "provisioningState" + } + }, + "isHttpMetadata": false + }, + { + "$id": "306", + "kind": "property", + "name": "groupIds", + "serializedName": "groupIds", + "doc": "The group ids for the private endpoint resource.", + "type": { + "$id": "307", + "kind": "array", + "name": "Array", + "valueType": { + "$id": "308", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnectionProperties.groupIds", + "serializationOptions": { + "json": { + "name": "groupIds" + } + }, + "isHttpMetadata": false + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnection.properties", + "serializationOptions": { + "json": { + "name": "properties" + } + }, + "isHttpMetadata": false + }, + { + "$id": "309", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "Name of the private endpoint connection associated with the Cloud HSM Cluster.", + "type": { + "$id": "310", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnection.name", + "serializationOptions": { + "json": { + "name": "name" + } + }, + "isHttpMetadata": true + }, + { + "$id": "311", + "kind": "property", + "name": "etag", + "serializedName": "etag", + "doc": "Modified whenever there is a change in the state of private endpoint connection.", + "type": { + "$id": "312", + "kind": "string", + "name": "eTag", + "crossLanguageDefinitionId": "Azure.Core.eTag", + "baseType": { + "$id": "313", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnection.etag", + "serializationOptions": { + "json": { + "name": "etag" + } + }, + "isHttpMetadata": false + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusterProperties.privateEndpointConnections", + "serializationOptions": { + "json": { + "name": "privateEndpointConnections" + } + }, + "isHttpMetadata": false + }, + { + "$id": "314", + "kind": "property", + "name": "provisioningState", + "serializedName": "provisioningState", + "doc": "The Cloud HSM Cluster's provisioningState", + "type": { + "$ref": "42" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusterProperties.provisioningState", + "serializationOptions": { + "json": { + "name": "provisioningState" + } + }, + "isHttpMetadata": false + }, + { + "$id": "315", + "kind": "property", + "name": "publicNetworkAccess", + "serializedName": "publicNetworkAccess", + "doc": "The Cloud HSM Cluster public network access", + "type": { + "$ref": "50" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusterProperties.publicNetworkAccess", + "serializationOptions": { + "json": { + "name": "publicNetworkAccess" + } + }, + "isHttpMetadata": false + }, + { + "$id": "316", + "kind": "property", + "name": "statusMessage", + "serializedName": "statusMessage", + "doc": "Cloud HSM Cluster status message", + "type": { + "$id": "317", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusterProperties.statusMessage", + "serializationOptions": { + "json": { + "name": "statusMessage" + } + }, + "isHttpMetadata": false + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmCluster.properties", + "serializationOptions": { + "json": { + "name": "properties" + } + }, + "isHttpMetadata": false + }, + { + "$id": "318", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length.", + "type": { + "$id": "319", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmCluster.name", + "serializationOptions": { + "json": { + "name": "name" + } + }, + "isHttpMetadata": true + }, + { + "$id": "320", + "kind": "property", + "name": "identity", + "serializedName": "identity", + "doc": "Managed service identity (system assigned and/or user assigned identities)", + "type": { + "$id": "321", + "kind": "model", + "name": "ManagedServiceIdentity", + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentity", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Managed service identity (system assigned and/or user assigned identities)", + "decorators": [ + { + "name": "Azure.ResourceManager.@armProviderNamespace", + "arguments": {} + } + ], + "properties": [ + { + "$id": "322", + "kind": "property", + "name": "principalId", + "serializedName": "principalId", + "doc": "The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity.", + "type": { + "$id": "323", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "324", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentity.principalId", + "serializationOptions": { + "json": { + "name": "principalId" + } + }, + "isHttpMetadata": false + }, + { + "$id": "325", + "kind": "property", + "name": "tenantId", + "serializedName": "tenantId", + "doc": "The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity.", + "type": { + "$id": "326", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "327", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentity.tenantId", + "serializationOptions": { + "json": { + "name": "tenantId" + } + }, + "isHttpMetadata": false + }, + { + "$id": "328", + "kind": "property", + "name": "type", + "serializedName": "type", + "doc": "The type of managed identity assigned to this resource.", + "type": { + "$ref": "53" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentity.type", + "serializationOptions": { + "json": { + "name": "type" + } + }, + "isHttpMetadata": false + }, + { + "$id": "329", + "kind": "property", + "name": "userAssignedIdentities", + "serializedName": "userAssignedIdentities", + "doc": "The identities assigned to this resource by the user.", + "type": { + "$id": "330", + "kind": "dict", + "keyType": { + "$id": "331", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "valueType": { + "$id": "332", + "kind": "nullable", + "type": { + "$id": "333", + "kind": "model", + "name": "UserAssignedIdentity", + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.UserAssignedIdentity", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "User assigned identity properties", + "decorators": [ + { + "name": "Azure.ResourceManager.@armProviderNamespace", + "arguments": {} + } + ], + "properties": [ + { + "$id": "334", + "kind": "property", + "name": "principalId", + "serializedName": "principalId", + "doc": "The principal ID of the assigned identity.", + "type": { + "$id": "335", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "336", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.UserAssignedIdentity.principalId", + "serializationOptions": { + "json": { + "name": "principalId" + } + }, + "isHttpMetadata": false + }, + { + "$id": "337", + "kind": "property", + "name": "clientId", + "serializedName": "clientId", + "doc": "The client ID of the assigned identity.", + "type": { + "$id": "338", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "339", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.UserAssignedIdentity.clientId", + "serializationOptions": { + "json": { + "name": "clientId" + } + }, + "isHttpMetadata": false + } + ] + }, + "namespace": "Azure.ResourceManager.HardwareSecurityModules" + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentity.userAssignedIdentities", + "serializationOptions": { + "json": { + "name": "userAssignedIdentities" + } + }, + "isHttpMetadata": false + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmCluster.identity", + "serializationOptions": { + "json": { + "name": "identity" + } + }, + "isHttpMetadata": false + }, + { + "$id": "340", + "kind": "property", + "name": "sku", + "serializedName": "sku", + "doc": "SKU details", + "type": { + "$id": "341", + "kind": "model", + "name": "CloudHsmClusterSku", + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusterSku", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Cloud Hsm Cluster SKU information", + "decorators": [ + { + "name": "Azure.ResourceManager.@armProviderNamespace", + "arguments": {} + } + ], + "properties": [ + { + "$id": "342", + "kind": "property", + "name": "family", + "serializedName": "family", + "doc": "Sku family of the Cloud HSM Cluster", + "type": { + "$ref": "59" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusterSku.family", + "serializationOptions": { + "json": { + "name": "family" + } + }, + "isHttpMetadata": false + }, + { + "$id": "343", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "Sku name of the Cloud HSM Cluster", + "type": { + "$ref": "62" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusterSku.name", + "serializationOptions": { + "json": { + "name": "name" + } + }, + "isHttpMetadata": false + }, + { + "$id": "344", + "kind": "property", + "name": "capacity", + "serializedName": "capacity", + "doc": "Sku capacity", + "type": { + "$id": "345", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusterSku.capacity", + "serializationOptions": { + "json": { + "name": "capacity" + } + }, + "isHttpMetadata": false + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmCluster.sku", + "serializationOptions": { + "json": { + "name": "sku" + } + }, + "isHttpMetadata": false + } + ] + }, + { + "$ref": "271" + }, + { + "$ref": "276" + }, + { + "$ref": "285" + }, + { + "$ref": "292" + }, + { + "$ref": "294" + }, + { + "$ref": "299" + }, + { + "$ref": "290" + }, + { + "$ref": "240" + }, + { + "$ref": "250" + }, + { + "$ref": "321" + }, + { + "$ref": "333" + }, + { + "$ref": "341" + }, + { + "$ref": "239" + }, + { + "$id": "346", + "kind": "model", + "name": "ArmOperationStatusResourceProvisioningState", + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus", + "usage": "LroPolling", + "doc": "Standard Azure Resource Manager operation status response", + "decorators": [ + { + "name": "Azure.ResourceManager.@armProviderNamespace", + "arguments": {} + } + ], + "properties": [ + { + "$id": "347", + "kind": "property", + "name": "status", + "serializedName": "status", + "doc": "The operation status", + "type": { + "$ref": "66" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.status", + "serializationOptions": { + "json": { + "name": "status" + } + }, + "isHttpMetadata": false + }, + { + "$id": "348", + "kind": "property", + "name": "id", + "serializedName": "id", + "doc": "The unique identifier for the operationStatus resource", + "type": { + "$id": "349", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.id", + "serializationOptions": { + "json": { + "name": "id" + } + }, + "isHttpMetadata": true + }, + { + "$id": "350", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "The name of the operationStatus resource", + "type": { + "$id": "351", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.name", + "serializationOptions": { + "json": { + "name": "name" + } + }, + "isHttpMetadata": false + }, + { + "$id": "352", + "kind": "property", + "name": "startTime", + "serializedName": "startTime", + "doc": "Operation start time", + "type": { + "$id": "353", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "354", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.startTime", + "serializationOptions": { + "json": { + "name": "startTime" + } + }, + "isHttpMetadata": false + }, + { + "$id": "355", + "kind": "property", + "name": "endTime", + "serializedName": "endTime", + "doc": "Operation complete time", + "type": { + "$id": "356", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "357", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.endTime", + "serializationOptions": { + "json": { + "name": "endTime" + } + }, + "isHttpMetadata": false + }, + { + "$id": "358", + "kind": "property", + "name": "percentComplete", + "serializedName": "percentComplete", + "doc": "The progress made toward completing the operation", + "type": { + "$id": "359", + "kind": "float64", + "name": "float64", + "crossLanguageDefinitionId": "TypeSpec.float64", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.percentComplete", + "serializationOptions": { + "json": { + "name": "percentComplete" + } + }, + "isHttpMetadata": false + }, + { + "$id": "360", + "kind": "property", + "name": "error", + "serializedName": "error", + "doc": "Errors that occurred if the operation ended with Canceled or Failed status", + "type": { + "$ref": "211" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ArmOperationStatus.error", + "serializationOptions": { + "json": { + "name": "error" + } + }, + "isHttpMetadata": false + } + ] + }, + { + "$id": "361", + "kind": "model", + "name": "DedicatedHsmPatch", + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusterPatchParameters", + "usage": "Input,Json", + "doc": "Patchable properties of the Cloud HSM Cluster", + "decorators": [ + { + "name": "Azure.ResourceManager.@armProviderNamespace", + "arguments": {} + } + ], + "properties": [ + { + "$id": "362", + "kind": "property", + "name": "tags", + "serializedName": "tags", + "doc": "The Cloud HSM Cluster's tags", + "type": { + "$ref": "264" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusterPatchParameters.tags", + "serializationOptions": { + "json": { + "name": "tags" + } + }, + "isHttpMetadata": false + }, + { + "$id": "363", + "kind": "property", + "name": "identity", + "serializedName": "identity", + "doc": "Managed service identity (system assigned and/or user assigned identities)", + "type": { + "$ref": "321" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusterPatchParameters.identity", + "serializationOptions": { + "json": { + "name": "identity" + } + }, + "isHttpMetadata": false + } + ] + }, + { + "$id": "364", + "kind": "model", + "name": "CloudHsmClusterListResult", + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult", + "usage": "Output,Json", + "doc": "The response of a CloudHsmCluster list operation.", + "decorators": [ + { + "name": "Azure.ResourceManager.@armProviderNamespace", + "arguments": {} + } + ], + "properties": [ + { + "$id": "365", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The CloudHsmCluster items on this page", + "type": { + "$id": "366", + "kind": "array", + "name": "ArrayCloudHsmCluster", + "valueType": { + "$ref": "227" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.value", + "serializationOptions": { + "json": { + "name": "value" + } + }, + "isHttpMetadata": false + }, + { + "$id": "367", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "368", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "369", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.nextLink", + "serializationOptions": { + "json": { + "name": "nextLink" + } + }, + "isHttpMetadata": false + } + ] + }, + { + "$id": "370", + "kind": "model", + "name": "CloudHsmClusterBackupContent", + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.BackupRequestProperties", + "usage": "Input,Json", + "doc": "Backup properties", + "decorators": [ + { + "name": "Azure.ResourceManager.@armProviderNamespace", + "arguments": {} + } + ], + "baseModel": { + "$id": "371", + "kind": "model", + "name": "BackupRestoreRequestBaseProperties", + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.BackupRestoreRequestBaseProperties", + "usage": "Input,Json", + "doc": "Backup and Restore Common properties", + "decorators": [ + { + "name": "Azure.ResourceManager.@armProviderNamespace", + "arguments": {} + } + ], + "properties": [ + { + "$id": "372", + "kind": "property", + "name": "azureStorageBlobContainerUri", + "serializedName": "azureStorageBlobContainerUri", + "doc": "The Azure blob storage container Uri which contains the backup", + "type": { + "$id": "373", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.BackupRestoreRequestBaseProperties.azureStorageBlobContainerUri", + "serializationOptions": { + "json": { + "name": "azureStorageBlobContainerUri" + } + }, + "isHttpMetadata": false + }, + { + "$id": "374", + "kind": "property", + "name": "token", + "serializedName": "token", + "doc": "The SAS token pointing to an Azure blob storage container. This property is reserved for Azure Backup Service.", + "type": { + "$id": "375", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.BackupRestoreRequestBaseProperties.token", + "serializationOptions": { + "json": { + "name": "token" + } + }, + "isHttpMetadata": false + } + ] + }, + "properties": [] + }, + { + "$ref": "371" + }, + { + "$id": "376", + "kind": "model", + "name": "CloudHsmClusterBackupResult", + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.BackupResult", + "usage": "Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Backup operation Result", + "decorators": [ + { + "name": "Azure.ResourceManager.@armProviderNamespace", + "arguments": {} + } + ], + "properties": [ + { + "$id": "377", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "Properties of the Cloud HSM Cluster", + "type": { + "$id": "378", + "kind": "model", + "name": "CloudHsmClusterBackupResultProperties", + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.BackupResultProperties", + "usage": "Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Properties of the Cloud HSM Cluster", + "decorators": [ + { + "name": "Azure.ResourceManager.@armProviderNamespace", + "arguments": {} + } + ], + "baseModel": { + "$id": "379", + "kind": "model", + "name": "BackupRestoreBaseResultProperties", + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.BackupRestoreBaseResultProperties", + "usage": "Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Backup and Restore operation common properties", + "decorators": [ + { + "name": "Azure.ResourceManager.@armProviderNamespace", + "arguments": {} + } + ], + "properties": [ + { + "$id": "380", + "kind": "property", + "name": "status", + "serializedName": "status", + "doc": "Status of the backup/restore operation", + "type": { + "$ref": "71" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.BackupRestoreBaseResultProperties.status", + "serializationOptions": { + "json": { + "name": "status" + } + }, + "isHttpMetadata": false + }, + { + "$id": "381", + "kind": "property", + "name": "statusDetails", + "serializedName": "statusDetails", + "doc": "The status details of backup/restore operation", + "type": { + "$id": "382", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.BackupRestoreBaseResultProperties.statusDetails", + "serializationOptions": { + "json": { + "name": "statusDetails" + } + }, + "isHttpMetadata": false + }, + { + "$id": "383", + "kind": "property", + "name": "error", + "serializedName": "error", + "doc": "Error encountered, if any, during the backup/restore operation.", + "type": { + "$ref": "211" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.BackupRestoreBaseResultProperties.error", + "serializationOptions": { + "json": { + "name": "error" + } + }, + "isHttpMetadata": false + }, + { + "$id": "384", + "kind": "property", + "name": "startTime", + "serializedName": "startTime", + "doc": "The start time of the backup/restore operation in UTC", + "type": { + "$id": "385", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "386", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.BackupRestoreBaseResultProperties.startTime", + "serializationOptions": { + "json": { + "name": "startTime" + } + }, + "isHttpMetadata": false + }, + { + "$id": "387", + "kind": "property", + "name": "endTime", + "serializedName": "endTime", + "doc": "The end time of the backup/restore operation in UTC", + "type": { + "$id": "388", + "kind": "nullable", + "type": { + "$id": "389", + "kind": "utcDateTime", + "name": "utcDateTime", + "encode": "rfc3339", + "wireType": { + "$id": "390", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "crossLanguageDefinitionId": "TypeSpec.utcDateTime", + "decorators": [] + }, + "namespace": "Azure.ResourceManager.HardwareSecurityModules" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.BackupRestoreBaseResultProperties.endTime", + "serializationOptions": { + "json": { + "name": "endTime" + } + }, + "isHttpMetadata": false + }, + { + "$id": "391", + "kind": "property", + "name": "jobId", + "serializedName": "jobId", + "doc": "Identifier for the backup/restore operation.", + "type": { + "$id": "392", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.BackupRestoreBaseResultProperties.jobId", + "serializationOptions": { + "json": { + "name": "jobId" + } + }, + "isHttpMetadata": false + } + ] + }, + "properties": [ + { + "$id": "393", + "kind": "property", + "name": "azureStorageBlobContainerUri", + "serializedName": "azureStorageBlobContainerUri", + "doc": "The Azure blob storage container Uri which contains the backup", + "type": { + "$id": "394", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.BackupResultProperties.azureStorageBlobContainerUri", + "serializationOptions": { + "json": { + "name": "azureStorageBlobContainerUri" + } + }, + "isHttpMetadata": false + }, + { + "$id": "395", + "kind": "property", + "name": "backupId", + "serializedName": "backupId", + "doc": "The ID of the backup.", + "type": { + "$id": "396", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.BackupResultProperties.backupId", + "serializationOptions": { + "json": { + "name": "backupId" + } + }, + "isHttpMetadata": false + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.BackupResult.properties", + "serializationOptions": { + "json": { + "name": "properties" + } + }, + "isHttpMetadata": false + } + ] + }, + { + "$ref": "378" + }, + { + "$ref": "379" + }, + { + "$id": "397", + "kind": "model", + "name": "CloudHsmClusterRestoreContent", + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.RestoreRequestProperties", + "usage": "Input,Json", + "doc": "Cloud Hsm Cluster restore information", + "decorators": [ + { + "name": "Azure.ResourceManager.@armProviderNamespace", + "arguments": {} + } + ], + "baseModel": { + "$ref": "371" + }, + "properties": [ + { + "$id": "398", + "kind": "property", + "name": "backupId", + "serializedName": "backupId", + "doc": "An autogenerated unique string ID for labeling the backup. It contains both a UUID and a date timestamp.", + "type": { + "$id": "399", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.RestoreRequestProperties.backupId", + "serializationOptions": { + "json": { + "name": "backupId" + } + }, + "isHttpMetadata": false + } + ] + }, + { + "$id": "400", + "kind": "model", + "name": "CloudHsmClusterRestoreResult", + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.RestoreResult", + "usage": "Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Restore operation properties", + "decorators": [ + { + "name": "Azure.ResourceManager.@armProviderNamespace", + "arguments": {} + } + ], + "properties": [ + { + "$id": "401", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "Backup and Restore operation common properties", + "type": { + "$ref": "379" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.RestoreResult.properties", + "serializationOptions": { + "json": { + "name": "properties" + } + }, + "isHttpMetadata": false + } + ] + }, + { + "$id": "402", + "kind": "model", + "name": "PrivateEndpointConnectionListResult", + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult", + "usage": "Output,Json", + "doc": "The response of a PrivateEndpointConnection list operation.", + "decorators": [ + { + "name": "Azure.ResourceManager.@armProviderNamespace", + "arguments": {} + } + ], + "properties": [ + { + "$id": "403", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The PrivateEndpointConnection items on this page", + "type": { + "$ref": "284" + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.value", + "serializationOptions": { + "json": { + "name": "value" + } + }, + "isHttpMetadata": false + }, + { + "$id": "404", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "405", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "406", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.nextLink", + "serializationOptions": { + "json": { + "name": "nextLink" + } + }, + "isHttpMetadata": false + } + ] + }, + { + "$id": "407", + "kind": "model", + "name": "DedicatedHsm", + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsm", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Resource information with extended details.", + "decorators": [ + { + "name": "Azure.ResourceManager.@armProviderNamespace", + "arguments": {} + }, + { + "name": "Azure.ResourceManager.Private.@armResourceInternal", + "arguments": {} + }, + { + "name": "Azure.ClientGenerator.Core.@resourceSchema", + "arguments": { + "resourceIdPattern": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}", + "resourceType": "Microsoft.HardwareSecurityModules/dedicatedHSMs", + "methods": [ + { + "$id": "408", + "methodId": "Microsoft.HardwareSecurityModules.DedicatedHsms.get", + "kind": "Get", + "operationPath": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}", + "operationScope": "ResourceGroup", + "resourceScope": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}" + }, + { + "$id": "409", + "methodId": "Microsoft.HardwareSecurityModules.DedicatedHsms.createOrUpdate", + "kind": "Create", + "operationPath": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}", + "operationScope": "ResourceGroup", + "resourceScope": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}" + }, + { + "$id": "410", + "methodId": "Microsoft.HardwareSecurityModules.DedicatedHsms.update", + "kind": "Update", + "operationPath": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}", + "operationScope": "ResourceGroup", + "resourceScope": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}" + }, + { + "$id": "411", + "methodId": "Microsoft.HardwareSecurityModules.DedicatedHsms.delete", + "kind": "Delete", + "operationPath": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}", + "operationScope": "ResourceGroup", + "resourceScope": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}" + }, + { + "$id": "412", + "methodId": "Microsoft.HardwareSecurityModules.DedicatedHsms.listByResourceGroup", + "kind": "List", + "operationPath": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs", + "operationScope": "ResourceGroup" + }, + { + "$id": "413", + "methodId": "Microsoft.HardwareSecurityModules.DedicatedHsms.listBySubscription", + "kind": "List", + "operationPath": "/subscriptions/{subscriptionId}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs", + "operationScope": "Subscription" + }, + { + "$id": "414", + "methodId": "Microsoft.HardwareSecurityModules.DedicatedHsms.listOutboundNetworkDependenciesEndpoints", + "kind": "Action", + "operationPath": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}/outboundNetworkDependenciesEndpoints", + "operationScope": "ResourceGroup", + "resourceScope": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}" + } + ], + "resourceScope": "ResourceGroup", + "resourceName": "DedicatedHsm" + } + } + ], + "baseModel": { + "$ref": "239" + }, + "properties": [ + { + "$id": "415", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "Properties of the dedicated HSM", + "type": { + "$id": "416", + "kind": "model", + "name": "DedicatedHsmProperties", + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsmProperties", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "Properties of the dedicated hsm", + "decorators": [ + { + "name": "Azure.ResourceManager.@armProviderNamespace", + "arguments": {} + } + ], + "properties": [ + { + "$id": "417", + "kind": "property", + "name": "networkProfile", + "serializedName": "networkProfile", + "doc": "Specifies the network interfaces of the dedicated hsm.", + "type": { + "$id": "418", + "kind": "model", + "name": "DedicatedHsmNetworkProfile", + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.NetworkProfile", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "The network profile definition.", + "decorators": [ + { + "name": "Azure.ResourceManager.@armProviderNamespace", + "arguments": {} + } + ], + "properties": [ + { + "$id": "419", + "kind": "property", + "name": "subnet", + "serializedName": "subnet", + "doc": "Specifies the identifier of the subnet.", + "type": { + "$id": "420", + "kind": "model", + "name": "ApiEntityReference", + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.ApiEntityReference", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "The API entity reference.", + "decorators": [ + { + "name": "Azure.ResourceManager.@armProviderNamespace", + "arguments": {} + } + ], + "properties": [ + { + "$id": "421", + "kind": "property", + "name": "resourceId", + "serializedName": "resourceId", + "doc": "The Azure resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/...", + "type": { + "$id": "422", + "kind": "string", + "name": "armResourceIdentifier", + "crossLanguageDefinitionId": "Azure.Core.armResourceIdentifier", + "baseType": { + "$id": "423", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.ApiEntityReference.resourceId", + "serializationOptions": { + "json": { + "name": "resourceId" + } + }, + "isHttpMetadata": false + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.NetworkProfile.subnet", + "serializationOptions": { + "json": { + "name": "subnet" + } + }, + "isHttpMetadata": false + }, + { + "$id": "424", + "kind": "property", + "name": "networkInterfaces", + "serializedName": "networkInterfaces", + "doc": "Specifies the list of resource Ids for the network interfaces associated with the dedicated HSM.", + "type": { + "$id": "425", + "kind": "array", + "name": "ArrayNetworkInterface", + "valueType": { + "$id": "426", + "kind": "model", + "name": "DedicatedHsmNetworkInterface", + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.NetworkInterface", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "The network interface definition.", + "decorators": [ + { + "name": "Azure.ResourceManager.@armProviderNamespace", + "arguments": {} + } + ], + "properties": [ + { + "$id": "427", + "kind": "property", + "name": "resourceId", + "serializedName": "resourceId", + "doc": "The Azure resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/...", + "type": { + "$id": "428", + "kind": "string", + "name": "armResourceIdentifier", + "crossLanguageDefinitionId": "Azure.Core.armResourceIdentifier", + "baseType": { + "$id": "429", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.NetworkInterface.resourceId", + "serializationOptions": { + "json": { + "name": "resourceId" + } + }, + "isHttpMetadata": false + }, + { + "$id": "430", + "kind": "property", + "name": "PrivateIPAddress", + "serializedName": "privateIpAddress", + "doc": "Private Ip address of the interface", + "type": { + "$id": "431", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.NetworkInterface.privateIpAddress", + "serializationOptions": { + "json": { + "name": "privateIpAddress" + } + }, + "isHttpMetadata": false + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.NetworkProfile.networkInterfaces", + "serializationOptions": { + "json": { + "name": "networkInterfaces" + } + }, + "isHttpMetadata": false + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsmProperties.networkProfile", + "serializationOptions": { + "json": { + "name": "networkProfile" + } + }, + "isHttpMetadata": false + }, + { + "$id": "432", + "kind": "property", + "name": "managementNetworkProfile", + "serializedName": "managementNetworkProfile", + "doc": "Specifies the management network interfaces of the dedicated hsm.", + "type": { + "$ref": "418" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsmProperties.managementNetworkProfile", + "serializationOptions": { + "json": { + "name": "managementNetworkProfile" + } + }, + "isHttpMetadata": false + }, + { + "$id": "433", + "kind": "property", + "name": "stampId", + "serializedName": "stampId", + "doc": "This field will be used when RP does not support Availability zones.", + "type": { + "$id": "434", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsmProperties.stampId", + "serializationOptions": { + "json": { + "name": "stampId" + } + }, + "isHttpMetadata": false + }, + { + "$id": "435", + "kind": "property", + "name": "statusMessage", + "serializedName": "statusMessage", + "doc": "Resource Status Message.", + "type": { + "$id": "436", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsmProperties.statusMessage", + "serializationOptions": { + "json": { + "name": "statusMessage" + } + }, + "isHttpMetadata": false + }, + { + "$id": "437", + "kind": "property", + "name": "provisioningState", + "serializedName": "provisioningState", + "doc": "Provisioning state.", + "type": { + "$ref": "77" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsmProperties.provisioningState", + "serializationOptions": { + "json": { + "name": "provisioningState" + } + }, + "isHttpMetadata": false + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsm.properties", + "serializationOptions": { + "json": { + "name": "properties" + } + }, + "isHttpMetadata": false + }, + { + "$id": "438", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "Name of the dedicated Hsm", + "type": { + "$id": "439", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": false, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsm.name", + "serializationOptions": { + "json": { + "name": "name" + } + }, + "isHttpMetadata": true + }, + { + "$id": "440", + "kind": "property", + "name": "sku", + "serializedName": "sku", + "doc": "SKU details", + "type": { + "$id": "441", + "kind": "model", + "name": "DedicatedHsmSku", + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.Sku", + "usage": "Input,Output,Json,LroInitial,LroFinalEnvelope", + "doc": "SKU of the dedicated HSM", + "decorators": [ + { + "name": "Azure.ResourceManager.@armProviderNamespace", + "arguments": {} + } + ], + "properties": [ + { + "$id": "442", + "kind": "property", + "name": "name", + "serializedName": "name", + "doc": "SKU of the dedicated HSM", + "type": { + "$ref": "86" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.Sku.name", + "serializationOptions": { + "json": { + "name": "name" + } + }, + "isHttpMetadata": false + } + ] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsm.sku", + "serializationOptions": { + "json": { + "name": "sku" + } + }, + "isHttpMetadata": false + }, + { + "$id": "443", + "kind": "property", + "name": "zones", + "serializedName": "zones", + "doc": "The availability zones.", + "type": { + "$ref": "307" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsm.zones", + "serializationOptions": { + "json": { + "name": "zones" + } + }, + "isHttpMetadata": false + } + ] + }, + { + "$ref": "416" + }, + { + "$ref": "418" + }, + { + "$ref": "420" + }, + { + "$ref": "426" + }, + { + "$ref": "441" + }, + { + "$id": "444", + "kind": "model", + "name": "DedicatedHsmError", + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsmError", + "usage": "Json,Exception", + "doc": "The error exception.", + "decorators": [ + { + "name": "Azure.ResourceManager.@armProviderNamespace", + "arguments": {} + } + ], + "properties": [ + { + "$id": "445", + "kind": "property", + "name": "error", + "serializedName": "error", + "doc": "The error detail of the operation if any.", + "type": { + "$id": "446", + "kind": "model", + "name": "Error", + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.Error", + "usage": "Json,Exception", + "doc": "The key vault server error.", + "decorators": [ + { + "name": "Azure.ResourceManager.@armProviderNamespace", + "arguments": {} + } + ], + "properties": [ + { + "$id": "447", + "kind": "property", + "name": "code", + "serializedName": "code", + "doc": "The error code.", + "type": { + "$id": "448", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.Error.code", + "serializationOptions": { + "json": { + "name": "code" + } + }, + "isHttpMetadata": false + }, + { + "$id": "449", + "kind": "property", + "name": "message", + "serializedName": "message", + "doc": "The error message.", + "type": { + "$id": "450", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.Error.message", + "serializationOptions": { + "json": { + "name": "message" + } + }, + "isHttpMetadata": false + }, + { + "$id": "451", + "kind": "property", + "name": "innerError", + "serializedName": "innererror", + "doc": "Contains more specific error that narrows down the cause. May be null.", + "type": { + "$ref": "446" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.Error.innererror", + "serializationOptions": { + "json": { + "name": "innererror" + } + }, + "isHttpMetadata": false + } + ] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsmError.error", + "serializationOptions": { + "json": { + "name": "error" + } + }, + "isHttpMetadata": false + } + ] + }, + { + "$ref": "446" + }, + { + "$id": "452", + "kind": "model", + "name": "DedicatedHsmPatchParameters", + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsmPatchParameters", + "usage": "Input,Json", + "doc": "Patchable properties of the dedicated HSM", + "decorators": [ + { + "name": "Azure.ResourceManager.@armProviderNamespace", + "arguments": {} + } + ], + "properties": [ + { + "$id": "453", + "kind": "property", + "name": "tags", + "serializedName": "tags", + "doc": "Resource tags", + "type": { + "$ref": "264" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsmPatchParameters.tags", + "serializationOptions": { + "json": { + "name": "tags" + } + }, + "isHttpMetadata": false + } + ] + }, + { + "$id": "454", + "kind": "model", + "name": "DedicatedHsmListResult", + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult", + "usage": "Output,Json", + "doc": "The response of a DedicatedHsm list operation.", + "decorators": [ + { + "name": "Azure.ResourceManager.@armProviderNamespace", + "arguments": {} + } + ], + "properties": [ + { + "$id": "455", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The DedicatedHsm items on this page", + "type": { + "$id": "456", + "kind": "array", + "name": "ArrayDedicatedHsm", + "valueType": { + "$ref": "407" + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.value", + "serializationOptions": { + "json": { + "name": "value" + } + }, + "isHttpMetadata": false + }, + { + "$id": "457", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "458", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "459", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.ResourceListResult.nextLink", + "serializationOptions": { + "json": { + "name": "nextLink" + } + }, + "isHttpMetadata": false + } + ] + }, + { + "$id": "460", + "kind": "model", + "name": "DedicatedHsmEgressEndpointListResult", + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.OutboundEnvironmentEndpointCollection", + "usage": "Output,Json", + "doc": "Collection of OutboundEnvironmentEndpoint", + "decorators": [ + { + "name": "Azure.ResourceManager.@armProviderNamespace", + "arguments": {} + } + ], + "properties": [ + { + "$id": "461", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "The OutboundEnvironmentEndpoint items on this page", + "type": { + "$id": "462", + "kind": "array", + "name": "ArrayOutboundEnvironmentEndpoint", + "valueType": { + "$id": "463", + "kind": "model", + "name": "DedicatedHsmEgressEndpoint", + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.OutboundEnvironmentEndpoint", + "usage": "Output,Json", + "doc": "Egress endpoints which dedicated hsm service connects to for common purpose.", + "decorators": [ + { + "name": "Azure.ResourceManager.@armProviderNamespace", + "arguments": {} + } + ], + "properties": [ + { + "$id": "464", + "kind": "property", + "name": "category", + "serializedName": "category", + "doc": "The category of endpoints accessed by the dedicated hsm service, e.g. azure-resource-management, apiserver, etc.", + "type": { + "$id": "465", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.OutboundEnvironmentEndpoint.category", + "serializationOptions": { + "json": { + "name": "category" + } + }, + "isHttpMetadata": false + }, + { + "$id": "466", + "kind": "property", + "name": "endpoints", + "serializedName": "endpoints", + "doc": "The endpoints that dedicated hsm service connects to", + "type": { + "$id": "467", + "kind": "array", + "name": "ArrayEndpointDependency", + "valueType": { + "$id": "468", + "kind": "model", + "name": "DedicatedHsmEndpointDependency", + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.EndpointDependency", + "usage": "Output,Json", + "doc": "A domain name that dedicated hsm services are reaching at.", + "decorators": [ + { + "name": "Azure.ResourceManager.@armProviderNamespace", + "arguments": {} + } + ], + "properties": [ + { + "$id": "469", + "kind": "property", + "name": "domainName", + "serializedName": "domainName", + "doc": "The domain name of the dependency.", + "type": { + "$id": "470", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.EndpointDependency.domainName", + "serializationOptions": { + "json": { + "name": "domainName" + } + }, + "isHttpMetadata": false + }, + { + "$id": "471", + "kind": "property", + "name": "endpointDetails", + "serializedName": "endpointDetails", + "doc": "The Ports and Protocols used when connecting to domainName.", + "type": { + "$id": "472", + "kind": "array", + "name": "ArrayEndpointDetail", + "valueType": { + "$id": "473", + "kind": "model", + "name": "DedicatedHsmEndpointDetail", + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.EndpointDetail", + "usage": "Output,Json", + "doc": "Connect information from the dedicated hsm service to a single endpoint.", + "decorators": [ + { + "name": "Azure.ResourceManager.@armProviderNamespace", + "arguments": {} + } + ], + "properties": [ + { + "$id": "474", + "kind": "property", + "name": "IPAddress", + "serializedName": "ipAddress", + "doc": "An IP Address that Domain Name currently resolves to.", + "type": { + "$id": "475", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.EndpointDetail.ipAddress", + "serializationOptions": { + "json": { + "name": "ipAddress" + } + }, + "isHttpMetadata": false + }, + { + "$id": "476", + "kind": "property", + "name": "port", + "serializedName": "port", + "doc": "The port an endpoint is connected to.", + "type": { + "$id": "477", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.EndpointDetail.port", + "serializationOptions": { + "json": { + "name": "port" + } + }, + "isHttpMetadata": false + }, + { + "$id": "478", + "kind": "property", + "name": "protocol", + "serializedName": "protocol", + "doc": "The protocol used for connection", + "type": { + "$id": "479", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.EndpointDetail.protocol", + "serializationOptions": { + "json": { + "name": "protocol" + } + }, + "isHttpMetadata": false + }, + { + "$id": "480", + "kind": "property", + "name": "description", + "serializedName": "description", + "doc": "Description of the detail", + "type": { + "$id": "481", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.EndpointDetail.description", + "serializationOptions": { + "json": { + "name": "description" + } + }, + "isHttpMetadata": false + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.EndpointDependency.endpointDetails", + "serializationOptions": { + "json": { + "name": "endpointDetails" + } + }, + "isHttpMetadata": false + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.OutboundEnvironmentEndpoint.endpoints", + "serializationOptions": { + "json": { + "name": "endpoints" + } + }, + "isHttpMetadata": false + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": false, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.OutboundEnvironmentEndpointCollection.value", + "serializationOptions": { + "json": { + "name": "value" + } + }, + "isHttpMetadata": false + }, + { + "$id": "482", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "The link to the next page of items", + "type": { + "$id": "483", + "kind": "url", + "name": "ResourceLocation", + "crossLanguageDefinitionId": "TypeSpec.Rest.ResourceLocation", + "baseType": { + "$id": "484", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.OutboundEnvironmentEndpointCollection.nextLink", + "serializationOptions": { + "json": { + "name": "nextLink" + } + }, + "isHttpMetadata": false + } + ] + }, + { + "$ref": "463" + }, + { + "$ref": "468" + }, + { + "$ref": "473" + }, + { + "$id": "485", + "kind": "model", + "name": "PrivateLinkResourceListResult", + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.PrivateLinkResourceListResult", + "usage": "Output,Json", + "doc": "A list of private link resources.", + "decorators": [ + { + "name": "Azure.ResourceManager.@armProviderNamespace", + "arguments": {} + } + ], + "properties": [ + { + "$id": "486", + "kind": "property", + "name": "value", + "serializedName": "value", + "doc": "Array of private link resources", + "type": { + "$id": "487", + "kind": "array", + "name": "ArrayPrivateLinkResource", + "valueType": { + "$id": "488", + "kind": "model", + "name": "CloudHsmClusterPrivateLinkData", + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.PrivateLinkResource", + "usage": "Input,Output,Json", + "doc": "A private link resource.", + "decorators": [ + { + "name": "Azure.ResourceManager.@armProviderNamespace", + "arguments": {} + } + ], + "baseModel": { + "$ref": "240" + }, + "properties": [ + { + "$id": "489", + "kind": "property", + "name": "properties", + "serializedName": "properties", + "doc": "Resource properties.", + "type": { + "$id": "490", + "kind": "model", + "name": "CloudHsmClusterPrivateLinkResourceProperties", + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.PrivateLinkResourceProperties", + "usage": "Input,Output,Json", + "doc": "Properties of a private link resource.", + "decorators": [ + { + "name": "Azure.ResourceManager.@armProviderNamespace", + "arguments": {} + } + ], + "properties": [ + { + "$id": "491", + "kind": "property", + "name": "groupId", + "serializedName": "groupId", + "doc": "The private link resource group id.", + "type": { + "$id": "492", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.PrivateLinkResourceProperties.groupId", + "serializationOptions": { + "json": { + "name": "groupId" + } + }, + "isHttpMetadata": false + }, + { + "$id": "493", + "kind": "property", + "name": "requiredMembers", + "serializedName": "requiredMembers", + "doc": "The private link resource required member names.", + "type": { + "$ref": "307" + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.PrivateLinkResourceProperties.requiredMembers", + "serializationOptions": { + "json": { + "name": "requiredMembers" + } + }, + "isHttpMetadata": false + }, + { + "$id": "494", + "kind": "property", + "name": "requiredZoneNames", + "serializedName": "requiredZoneNames", + "doc": "The private link resource private link DNS zone name.", + "type": { + "$ref": "307" + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.PrivateLinkResourceProperties.requiredZoneNames", + "serializationOptions": { + "json": { + "name": "requiredZoneNames" + } + }, + "isHttpMetadata": false + } + ] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.PrivateLinkResource.properties", + "serializationOptions": { + "json": { + "name": "properties" + } + }, + "isHttpMetadata": false + } + ] + }, + "crossLanguageDefinitionId": "TypeSpec.Array", + "decorators": [] + }, + "optional": true, + "readOnly": false, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.PrivateLinkResourceListResult.value", + "serializationOptions": { + "json": { + "name": "value" + } + }, + "isHttpMetadata": false + }, + { + "$id": "495", + "kind": "property", + "name": "nextLink", + "serializedName": "nextLink", + "doc": "URL to get the next set of operation list results (if there are any).", + "type": { + "$id": "496", + "kind": "url", + "name": "url", + "crossLanguageDefinitionId": "TypeSpec.url", + "decorators": [] + }, + "optional": true, + "readOnly": true, + "discriminator": false, + "flatten": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.CommonTypes.PrivateLinkResourceListResult.nextLink", + "serializationOptions": { + "json": { + "name": "nextLink" + } + }, + "isHttpMetadata": false + } + ] + }, + { + "$ref": "488" + }, + { + "$ref": "490" + } + ], + "clients": [ + { + "$id": "497", + "kind": "client", + "name": "HardwareSecurityModulesClient", + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "doc": "The Azure management API provides a RESTful set of web services that interact with Hardware Security Modules.", + "methods": [], + "parameters": [ + { + "$id": "498", + "kind": "endpoint", + "name": "endpoint", + "serializedName": "endpoint", + "doc": "Service host", + "type": { + "$id": "499", + "kind": "url", + "name": "endpoint", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "isApiVersion": false, + "optional": false, + "scope": "Client", + "isEndpoint": true, + "defaultValue": { + "type": { + "$id": "500", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "https://management.azure.com" + }, + "serverUrlTemplate": "{endpoint}", + "skipUrlEncoding": false, + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.endpoint" + }, + { + "$id": "501", + "kind": "method", + "name": "apiVersion", + "serializedName": "apiVersion", + "doc": "The API version to use for this operation.", + "type": { + "$id": "502", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "", + "isApiVersion": true, + "defaultValue": { + "type": { + "$id": "503", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-31" + }, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Azure.ResourceManager.Operations.list.apiVersion", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "504", + "kind": "method", + "name": "subscriptionId", + "serializedName": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "505", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "506", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.get.subscriptionId", + "readOnly": false, + "access": "public", + "decorators": [] + } + ], + "initializedBy": 1, + "decorators": [ + { + "name": "Azure.ResourceManager.@armProviderNamespace", + "arguments": {} + }, + { + "name": "Azure.ClientGenerator.Core.@nonResourceMethodSchema", + "arguments": { + "nonResourceMethods": [ + { + "methodId": "Azure.ResourceManager.Operations.list", + "operationPath": "/providers/Microsoft.HardwareSecurityModules/operations", + "operationScope": "Tenant" + }, + { + "methodId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.cloudHsmClusterBackupStatusGet", + "operationPath": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/backupOperationStatus/{jobId}", + "operationScope": "ResourceGroup" + }, + { + "methodId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.cloudHsmClusterRestoreStatusGet", + "operationPath": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/restoreOperationStatus/{jobId}", + "operationScope": "ResourceGroup" + } + ] + } + } + ], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules", + "apiVersions": [ + "2025-03-31" + ], + "children": [ + { + "$id": "507", + "kind": "client", + "name": "Operations", + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "methods": [ + { + "$id": "508", + "kind": "paging", + "name": "list", + "accessibility": "public", + "apiVersions": [ + "2025-03-31" + ], + "doc": "List the operations for the provider", + "operation": { + "$id": "509", + "name": "list", + "resourceName": "Operations", + "doc": "List the operations for the provider", + "accessibility": "public", + "parameters": [ + { + "$id": "510", + "kind": "query", + "name": "apiVersion", + "serializedName": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "511", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": true, + "explode": false, + "defaultValue": { + "type": { + "$id": "512", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-31" + }, + "optional": false, + "scope": "Client", + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.Operations.list.apiVersion", + "readOnly": false + }, + { + "$id": "513", + "kind": "header", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "98" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "Azure.ResourceManager.Operations.list.accept" + } + ], + "responses": [ + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "186" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/providers/Microsoft.HardwareSecurityModules/operations", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Azure.ResourceManager.Operations.list", + "decorators": [], + "examples": [ + { + "$id": "514", + "kind": "http", + "name": "Get a list of Payment HSM operations", + "description": "Get a list of Payment HSM operations", + "filePath": "2025-03-31/OperationsList.json", + "parameters": [ + { + "parameter": { + "$ref": "510" + }, + "value": { + "$id": "515", + "kind": "string", + "type": { + "$ref": "511" + }, + "value": "2025-03-31" + } + } + ], + "responses": [ + { + "response": { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "186" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + }, + "statusCode": 200, + "bodyValue": { + "$id": "516", + "kind": "model", + "type": { + "$ref": "186" + }, + "value": { + "value": { + "$id": "517", + "kind": "array", + "type": { + "$ref": "188" + }, + "value": [ + { + "$id": "518", + "kind": "model", + "type": { + "$ref": "189" + }, + "value": { + "name": { + "$id": "519", + "kind": "string", + "type": { + "$ref": "191" + }, + "value": "Microsoft.HardwareSecurityModules/dedicatedhsms/read" + }, + "display": { + "$id": "520", + "kind": "model", + "type": { + "$ref": "195" + }, + "value": { + "description": { + "$id": "521", + "kind": "string", + "type": { + "$ref": "203" + }, + "value": "View the properties of a DedicatedHsm" + }, + "operation": { + "$id": "522", + "kind": "string", + "type": { + "$ref": "201" + }, + "value": "View DedicatedHsm" + }, + "provider": { + "$id": "523", + "kind": "string", + "type": { + "$ref": "197" + }, + "value": "Microsoft Hardware Security Modules" + }, + "resource": { + "$id": "524", + "kind": "string", + "type": { + "$ref": "199" + }, + "value": "DedicatedHsm" + } + } + }, + "isDataAction": { + "$id": "525", + "kind": "boolean", + "type": { + "$ref": "193" + }, + "value": false + }, + "origin": { + "$id": "526", + "kind": "string", + "type": { + "$ref": "1" + }, + "value": "system" + } + } + }, + { + "$id": "527", + "kind": "model", + "type": { + "$ref": "189" + }, + "value": { + "name": { + "$id": "528", + "kind": "string", + "type": { + "$ref": "191" + }, + "value": "Microsoft.HardwareSecurityModules/cloudHsmClusters/read" + }, + "display": { + "$id": "529", + "kind": "model", + "type": { + "$ref": "195" + }, + "value": { + "description": { + "$id": "530", + "kind": "string", + "type": { + "$ref": "203" + }, + "value": "View the properties of a CloudHsm" + }, + "operation": { + "$id": "531", + "kind": "string", + "type": { + "$ref": "201" + }, + "value": "View CloudHsm" + }, + "provider": { + "$id": "532", + "kind": "string", + "type": { + "$ref": "197" + }, + "value": "Microsoft Hardware Security Modules" + }, + "resource": { + "$id": "533", + "kind": "string", + "type": { + "$ref": "199" + }, + "value": "CloudHsm" + } + } + }, + "isDataAction": { + "$id": "534", + "kind": "boolean", + "type": { + "$ref": "193" + }, + "value": false + }, + "origin": { + "$id": "535", + "kind": "string", + "type": { + "$ref": "1" + }, + "value": "system" + } + } + } + ] + } + } + } + } + ] + } + ] + }, + "parameters": [ + { + "$id": "536", + "kind": "method", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "98" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "Azure.ResourceManager.Operations.list.accept", + "readOnly": false, + "access": "public", + "decorators": [] + } + ], + "response": { + "type": { + "$ref": "188" + }, + "resultSegments": [ + "value" + ] + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Azure.ResourceManager.Operations.list", + "pagingMetadata": { + "itemPropertySegments": [ + "value" + ], + "nextLink": { + "responseSegments": [ + "nextLink" + ], + "responseLocation": "Body" + } + } + } + ], + "parameters": [ + { + "$id": "537", + "kind": "endpoint", + "name": "endpoint", + "serializedName": "endpoint", + "doc": "Service host", + "type": { + "$id": "538", + "kind": "url", + "name": "endpoint", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "isApiVersion": false, + "optional": false, + "scope": "Client", + "isEndpoint": true, + "defaultValue": { + "type": { + "$id": "539", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "https://management.azure.com" + }, + "serverUrlTemplate": "{endpoint}", + "skipUrlEncoding": false, + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.endpoint" + }, + { + "$ref": "501" + } + ], + "initializedBy": 0, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.Operations", + "apiVersions": [ + "2025-03-31" + ], + "parent": { + "$ref": "497" + } + }, + { + "$id": "540", + "kind": "client", + "name": "CloudHsmClusters", + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "methods": [ + { + "$id": "541", + "kind": "basic", + "name": "get", + "accessibility": "public", + "apiVersions": [ + "2025-03-31" + ], + "doc": "Gets the specified Cloud HSM Cluster", + "operation": { + "$id": "542", + "name": "get", + "resourceName": "CloudHsmCluster", + "doc": "Gets the specified Cloud HSM Cluster", + "accessibility": "public", + "parameters": [ + { + "$id": "543", + "kind": "query", + "name": "apiVersion", + "serializedName": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "544", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": true, + "explode": false, + "defaultValue": { + "type": { + "$id": "545", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-31" + }, + "optional": false, + "scope": "Client", + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.get.apiVersion", + "readOnly": false + }, + { + "$id": "546", + "kind": "path", + "name": "subscriptionId", + "serializedName": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "547", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "548", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Client", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.get.subscriptionId" + }, + { + "$id": "549", + "kind": "path", + "name": "resourceGroupName", + "serializedName": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "550", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.get.resourceGroupName" + }, + { + "$id": "551", + "kind": "path", + "name": "cloudHsmClusterName", + "serializedName": "cloudHsmClusterName", + "doc": "The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length.", + "type": { + "$id": "552", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.get.cloudHsmClusterName" + }, + { + "$id": "553", + "kind": "header", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "100" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.get.accept" + } + ], + "responses": [ + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "227" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.get", + "decorators": [ + { + "name": "Azure.ResourceManager.@armResourceRead", + "arguments": {} + } + ], + "examples": [ + { + "$id": "554", + "kind": "http", + "name": "CloudHsmCluster_Get_MaximumSet_Gen", + "description": "CloudHsmCluster_Get_MaximumSet_Gen", + "filePath": "2025-03-31/CloudHsmCluster_Get_MaximumSet_Gen.json", + "parameters": [ + { + "parameter": { + "$ref": "543" + }, + "value": { + "$id": "555", + "kind": "string", + "type": { + "$ref": "544" + }, + "value": "2025-03-31" + } + }, + { + "parameter": { + "$ref": "551" + }, + "value": { + "$id": "556", + "kind": "string", + "type": { + "$ref": "552" + }, + "value": "chsm1" + } + }, + { + "parameter": { + "$ref": "549" + }, + "value": { + "$id": "557", + "kind": "string", + "type": { + "$ref": "550" + }, + "value": "rgcloudhsm" + } + }, + { + "parameter": { + "$ref": "546" + }, + "value": { + "$id": "558", + "kind": "string", + "type": { + "$ref": "547" + }, + "value": "00000000-0000-0000-0000-000000000000" + } + } + ], + "responses": [ + { + "response": { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "227" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + }, + "statusCode": 200, + "bodyValue": { + "$id": "559", + "kind": "model", + "type": { + "$ref": "227" + }, + "value": { + "name": { + "$id": "560", + "kind": "string", + "type": { + "$ref": "319" + }, + "value": "chsm1" + }, + "type": { + "$id": "561", + "kind": "string", + "type": { + "$ref": "247" + }, + "value": "Microsoft.HardwareSecurityModules/cloudHsmClusters" + }, + "id": { + "$id": "562", + "kind": "string", + "type": { + "$ref": "242" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgcloudhsm/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/chsm1" + }, + "identity": { + "$id": "563", + "kind": "model", + "type": { + "$ref": "321" + }, + "value": { + "type": { + "$id": "564", + "kind": "string", + "type": { + "$ref": "53" + }, + "value": "UserAssigned" + }, + "userAssignedIdentities": { + "$id": "565", + "kind": "dict", + "type": { + "$ref": "330" + }, + "value": { + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-1": { + "$id": "566", + "kind": "model", + "type": { + "$ref": "333" + }, + "value": { + "clientId": { + "$id": "567", + "kind": "string", + "type": { + "$ref": "338" + }, + "value": "00000000-0000-0000-0000-000000000000" + }, + "principalId": { + "$id": "568", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "00000000-0000-0000-0000-000000000000" + } + } + } + } + } + } + }, + "location": { + "$id": "569", + "kind": "string", + "type": { + "$ref": "268" + }, + "value": "eastus2" + }, + "properties": { + "$id": "570", + "kind": "model", + "type": { + "$ref": "271" + }, + "value": { + "activationState": { + "$id": "571", + "kind": "string", + "type": { + "$ref": "9" + }, + "value": "null" + }, + "autoGeneratedDomainNameLabelScope": { + "$id": "572", + "kind": "string", + "type": { + "$ref": "16" + }, + "value": "TenantReuse" + }, + "provisioningState": { + "$id": "573", + "kind": "string", + "type": { + "$ref": "42" + }, + "value": "Succeeded" + }, + "publicNetworkAccess": { + "$id": "574", + "kind": "string", + "type": { + "$ref": "50" + }, + "value": "Disabled" + }, + "statusMessage": { + "$id": "575", + "kind": "string", + "type": { + "$ref": "317" + }, + "value": "This is a status message" + } + } + }, + "sku": { + "$id": "576", + "kind": "model", + "type": { + "$ref": "341" + }, + "value": { + "name": { + "$id": "577", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Standard_B1" + }, + "family": { + "$id": "578", + "kind": "string", + "type": { + "$ref": "59" + }, + "value": "B" + } + } + }, + "systemData": { + "$id": "579", + "kind": "model", + "type": { + "$ref": "250" + }, + "value": { + "createdAt": { + "$id": "580", + "kind": "string", + "type": { + "$ref": "255" + }, + "value": "2022-09-12T12:00:00.0000000Z" + }, + "createdBy": { + "$id": "581", + "kind": "string", + "type": { + "$ref": "252" + }, + "value": "CHsmUser1" + }, + "createdByType": { + "$id": "582", + "kind": "string", + "type": { + "$ref": "36" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "583", + "kind": "string", + "type": { + "$ref": "261" + }, + "value": "2022-09-12T12:00:00.0000000Z" + }, + "lastModifiedBy": { + "$id": "584", + "kind": "string", + "type": { + "$ref": "258" + }, + "value": "CHsmUser2" + }, + "lastModifiedByType": { + "$id": "585", + "kind": "string", + "type": { + "$ref": "36" + }, + "value": "User" + } + } + }, + "tags": { + "$id": "586", + "kind": "dict", + "type": { + "$ref": "264" + }, + "value": { + "Dept": { + "$id": "587", + "kind": "string", + "type": { + "$ref": "266" + }, + "value": "hsm" + }, + "Environment": { + "$id": "588", + "kind": "string", + "type": { + "$ref": "266" + }, + "value": "dogfood" + } + } + } + } + } + } + ] + } + ] + }, + "parameters": [ + { + "$id": "589", + "kind": "method", + "name": "resourceGroupName", + "serializedName": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "590", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.get.resourceGroupName", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "591", + "kind": "method", + "name": "cloudHsmClusterName", + "serializedName": "cloudHsmClusterName", + "doc": "The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length.", + "type": { + "$id": "592", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.get.cloudHsmClusterName", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "593", + "kind": "method", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "100" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.get.accept", + "readOnly": false, + "access": "public", + "decorators": [] + } + ], + "response": { + "type": { + "$ref": "227" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.get" + }, + { + "$id": "594", + "kind": "lro", + "name": "createOrUpdate", + "accessibility": "public", + "apiVersions": [ + "2025-03-31" + ], + "doc": "Create or Update a Cloud HSM Cluster in the specified subscription.", + "operation": { + "$id": "595", + "name": "createOrUpdate", + "resourceName": "CloudHsmCluster", + "doc": "Create or Update a Cloud HSM Cluster in the specified subscription.", + "accessibility": "public", + "parameters": [ + { + "$id": "596", + "kind": "query", + "name": "apiVersion", + "serializedName": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "597", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": true, + "explode": false, + "defaultValue": { + "type": { + "$id": "598", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-31" + }, + "optional": false, + "scope": "Client", + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.createOrUpdate.apiVersion", + "readOnly": false + }, + { + "$id": "599", + "kind": "path", + "name": "subscriptionId", + "serializedName": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "600", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "601", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Client", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.createOrUpdate.subscriptionId" + }, + { + "$id": "602", + "kind": "path", + "name": "resourceGroupName", + "serializedName": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "603", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.createOrUpdate.resourceGroupName" + }, + { + "$id": "604", + "kind": "path", + "name": "cloudHsmClusterName", + "serializedName": "cloudHsmClusterName", + "doc": "The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length.", + "type": { + "$id": "605", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.createOrUpdate.cloudHsmClusterName" + }, + { + "$id": "606", + "kind": "header", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$ref": "102" + }, + "isApiVersion": false, + "optional": false, + "isContentType": true, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.createOrUpdate.contentType" + }, + { + "$id": "607", + "kind": "header", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "104" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.createOrUpdate.accept" + }, + { + "$id": "608", + "kind": "body", + "name": "body", + "serializedName": "body", + "doc": "Parameters to create Cloud HSM Cluster", + "type": { + "$ref": "227" + }, + "isApiVersion": false, + "contentTypes": [ + "application/json" + ], + "defaultContentType": "application/json", + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.createOrUpdate.resource" + } + ], + "responses": [ + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "227" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + }, + { + "statusCodes": [ + 201 + ], + "bodyType": { + "$ref": "227" + }, + "headers": [ + { + "name": "azureAsyncOperation", + "nameInResponse": "Azure-AsyncOperation", + "doc": "A link to the status monitor", + "type": { + "$id": "609", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "name": "retryAfter", + "nameInResponse": "Retry-After", + "doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "type": { + "$id": "610", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "PUT", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}", + "requestMediaTypes": [ + "application/json" + ], + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.createOrUpdate", + "decorators": [ + { + "name": "Azure.ResourceManager.@armResourceCreateOrUpdate", + "arguments": {} + }, + { + "name": "Azure.Core.@useFinalStateVia", + "arguments": { + "finalState": "original-uri" + } + } + ], + "examples": [ + { + "$id": "611", + "kind": "http", + "name": "CloudHsmCluster_CreateOrUpdate_MaximumSet_Gen", + "description": "CloudHsmCluster_CreateOrUpdate_MaximumSet_Gen", + "filePath": "2025-03-31/CloudHsmCluster_CreateOrUpdate_MaximumSet_Gen.json", + "parameters": [ + { + "parameter": { + "$ref": "596" + }, + "value": { + "$id": "612", + "kind": "string", + "type": { + "$ref": "597" + }, + "value": "2025-03-31" + } + }, + { + "parameter": { + "$ref": "608" + }, + "value": { + "$id": "613", + "kind": "model", + "type": { + "$ref": "227" + }, + "value": { + "identity": { + "$id": "614", + "kind": "model", + "type": { + "$ref": "321" + }, + "value": { + "type": { + "$id": "615", + "kind": "string", + "type": { + "$ref": "53" + }, + "value": "UserAssigned" + }, + "userAssignedIdentities": { + "$id": "616", + "kind": "dict", + "type": { + "$ref": "330" + }, + "value": { + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-1": { + "$id": "617", + "kind": "model", + "type": { + "$ref": "333" + }, + "value": {} + } + } + } + } + }, + "location": { + "$id": "618", + "kind": "string", + "type": { + "$ref": "268" + }, + "value": "eastus2" + }, + "properties": { + "$id": "619", + "kind": "model", + "type": { + "$ref": "271" + }, + "value": { + "publicNetworkAccess": { + "$id": "620", + "kind": "string", + "type": { + "$ref": "50" + }, + "value": "Disabled" + } + } + }, + "sku": { + "$id": "621", + "kind": "model", + "type": { + "$ref": "341" + }, + "value": { + "name": { + "$id": "622", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Standard_B1" + }, + "family": { + "$id": "623", + "kind": "string", + "type": { + "$ref": "59" + }, + "value": "B" + } + } + }, + "tags": { + "$id": "624", + "kind": "dict", + "type": { + "$ref": "264" + }, + "value": { + "Dept": { + "$id": "625", + "kind": "string", + "type": { + "$ref": "266" + }, + "value": "hsm" + }, + "Environment": { + "$id": "626", + "kind": "string", + "type": { + "$ref": "266" + }, + "value": "dogfood" + } + } + } + } + } + }, + { + "parameter": { + "$ref": "604" + }, + "value": { + "$id": "627", + "kind": "string", + "type": { + "$ref": "605" + }, + "value": "chsm1" + } + }, + { + "parameter": { + "$ref": "602" + }, + "value": { + "$id": "628", + "kind": "string", + "type": { + "$ref": "603" + }, + "value": "rgcloudhsm" + } + }, + { + "parameter": { + "$ref": "599" + }, + "value": { + "$id": "629", + "kind": "string", + "type": { + "$ref": "600" + }, + "value": "00000000-0000-0000-0000-000000000000" + } + } + ], + "responses": [ + { + "response": { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "227" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + }, + "statusCode": 200, + "bodyValue": { + "$id": "630", + "kind": "model", + "type": { + "$ref": "227" + }, + "value": { + "name": { + "$id": "631", + "kind": "string", + "type": { + "$ref": "319" + }, + "value": "chsm1" + }, + "type": { + "$id": "632", + "kind": "string", + "type": { + "$ref": "247" + }, + "value": "Microsoft.HardwareSecurityModules/cloudHsmClusters" + }, + "id": { + "$id": "633", + "kind": "string", + "type": { + "$ref": "242" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgcloudhsm/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/chsm1" + }, + "identity": { + "$id": "634", + "kind": "model", + "type": { + "$ref": "321" + }, + "value": { + "type": { + "$id": "635", + "kind": "string", + "type": { + "$ref": "53" + }, + "value": "UserAssigned" + }, + "userAssignedIdentities": { + "$id": "636", + "kind": "dict", + "type": { + "$ref": "330" + }, + "value": { + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-1": { + "$id": "637", + "kind": "model", + "type": { + "$ref": "333" + }, + "value": { + "clientId": { + "$id": "638", + "kind": "string", + "type": { + "$ref": "338" + }, + "value": "00000000-0000-0000-0000-000000000000" + }, + "principalId": { + "$id": "639", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "00000000-0000-0000-0000-000000000000" + } + } + } + } + } + } + }, + "location": { + "$id": "640", + "kind": "string", + "type": { + "$ref": "268" + }, + "value": "eastus2" + }, + "properties": { + "$id": "641", + "kind": "model", + "type": { + "$ref": "271" + }, + "value": { + "activationState": { + "$id": "642", + "kind": "string", + "type": { + "$ref": "9" + }, + "value": "null" + }, + "autoGeneratedDomainNameLabelScope": { + "$id": "643", + "kind": "string", + "type": { + "$ref": "16" + }, + "value": "TenantReuse" + }, + "provisioningState": { + "$id": "644", + "kind": "string", + "type": { + "$ref": "42" + }, + "value": "Succeeded" + }, + "publicNetworkAccess": { + "$id": "645", + "kind": "string", + "type": { + "$ref": "50" + }, + "value": "Disabled" + }, + "statusMessage": { + "$id": "646", + "kind": "string", + "type": { + "$ref": "317" + }, + "value": "This is a status message" + } + } + }, + "sku": { + "$id": "647", + "kind": "model", + "type": { + "$ref": "341" + }, + "value": { + "name": { + "$id": "648", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Standard_B1" + }, + "family": { + "$id": "649", + "kind": "string", + "type": { + "$ref": "59" + }, + "value": "B" + } + } + }, + "systemData": { + "$id": "650", + "kind": "model", + "type": { + "$ref": "250" + }, + "value": { + "createdAt": { + "$id": "651", + "kind": "string", + "type": { + "$ref": "255" + }, + "value": "2022-09-12T12:00:00.0000000Z" + }, + "createdBy": { + "$id": "652", + "kind": "string", + "type": { + "$ref": "252" + }, + "value": "CHsmUser1" + }, + "createdByType": { + "$id": "653", + "kind": "string", + "type": { + "$ref": "36" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "654", + "kind": "string", + "type": { + "$ref": "261" + }, + "value": "2022-09-12T12:00:00.0000000Z" + }, + "lastModifiedBy": { + "$id": "655", + "kind": "string", + "type": { + "$ref": "258" + }, + "value": "CHsmUser2" + }, + "lastModifiedByType": { + "$id": "656", + "kind": "string", + "type": { + "$ref": "36" + }, + "value": "User" + } + } + }, + "tags": { + "$id": "657", + "kind": "dict", + "type": { + "$ref": "264" + }, + "value": { + "Dept": { + "$id": "658", + "kind": "string", + "type": { + "$ref": "266" + }, + "value": "hsm" + }, + "Environment": { + "$id": "659", + "kind": "string", + "type": { + "$ref": "266" + }, + "value": "dogfood" + } + } + } + } + } + }, + { + "response": { + "statusCodes": [ + 201 + ], + "bodyType": { + "$ref": "227" + }, + "headers": [ + { + "name": "azureAsyncOperation", + "nameInResponse": "Azure-AsyncOperation", + "doc": "A link to the status monitor", + "type": { + "$ref": "609" + } + }, + { + "name": "retryAfter", + "nameInResponse": "Retry-After", + "doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "type": { + "$ref": "610" + } + } + ], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + }, + "statusCode": 201, + "bodyValue": { + "$id": "660", + "kind": "model", + "type": { + "$ref": "227" + }, + "value": { + "name": { + "$id": "661", + "kind": "string", + "type": { + "$ref": "319" + }, + "value": "chsm1" + }, + "type": { + "$id": "662", + "kind": "string", + "type": { + "$ref": "247" + }, + "value": "Microsoft.HardwareSecurityModules/cloudHsmClusters" + }, + "id": { + "$id": "663", + "kind": "string", + "type": { + "$ref": "242" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgcloudhsm/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/chsm1" + }, + "identity": { + "$id": "664", + "kind": "model", + "type": { + "$ref": "321" + }, + "value": { + "type": { + "$id": "665", + "kind": "string", + "type": { + "$ref": "53" + }, + "value": "UserAssigned" + }, + "userAssignedIdentities": { + "$id": "666", + "kind": "dict", + "type": { + "$ref": "330" + }, + "value": { + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-1": { + "$id": "667", + "kind": "model", + "type": { + "$ref": "333" + }, + "value": { + "clientId": { + "$id": "668", + "kind": "string", + "type": { + "$ref": "338" + }, + "value": "00000000-0000-0000-0000-000000000000" + }, + "principalId": { + "$id": "669", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "00000000-0000-0000-0000-000000000000" + } + } + } + } + } + } + }, + "location": { + "$id": "670", + "kind": "string", + "type": { + "$ref": "268" + }, + "value": "eastus2" + }, + "properties": { + "$id": "671", + "kind": "model", + "type": { + "$ref": "271" + }, + "value": { + "activationState": { + "$id": "672", + "kind": "string", + "type": { + "$ref": "9" + }, + "value": "null" + }, + "autoGeneratedDomainNameLabelScope": { + "$id": "673", + "kind": "string", + "type": { + "$ref": "16" + }, + "value": "TenantReuse" + }, + "provisioningState": { + "$id": "674", + "kind": "string", + "type": { + "$ref": "42" + }, + "value": "Succeeded" + }, + "publicNetworkAccess": { + "$id": "675", + "kind": "string", + "type": { + "$ref": "50" + }, + "value": "Disabled" + } + } + }, + "sku": { + "$id": "676", + "kind": "model", + "type": { + "$ref": "341" + }, + "value": { + "name": { + "$id": "677", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Standard_B1" + }, + "family": { + "$id": "678", + "kind": "string", + "type": { + "$ref": "59" + }, + "value": "B" + } + } + }, + "systemData": { + "$id": "679", + "kind": "model", + "type": { + "$ref": "250" + }, + "value": { + "createdAt": { + "$id": "680", + "kind": "string", + "type": { + "$ref": "255" + }, + "value": "2022-09-12T12:00:00.0000000Z" + }, + "createdBy": { + "$id": "681", + "kind": "string", + "type": { + "$ref": "252" + }, + "value": "CHsmUser1" + }, + "createdByType": { + "$id": "682", + "kind": "string", + "type": { + "$ref": "36" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "683", + "kind": "string", + "type": { + "$ref": "261" + }, + "value": "2022-09-12T12:00:00.0000000Z" + }, + "lastModifiedBy": { + "$id": "684", + "kind": "string", + "type": { + "$ref": "258" + }, + "value": "CHsmUser2" + }, + "lastModifiedByType": { + "$id": "685", + "kind": "string", + "type": { + "$ref": "36" + }, + "value": "User" + } + } + }, + "tags": { + "$id": "686", + "kind": "dict", + "type": { + "$ref": "264" + }, + "value": { + "Dept": { + "$id": "687", + "kind": "string", + "type": { + "$ref": "266" + }, + "value": "hsm" + }, + "Environment": { + "$id": "688", + "kind": "string", + "type": { + "$ref": "266" + }, + "value": "dogfood" + } + } + } + } + } + } + ] + } + ] + }, + "parameters": [ + { + "$id": "689", + "kind": "method", + "name": "resourceGroupName", + "serializedName": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "690", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.createOrUpdate.resourceGroupName", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "691", + "kind": "method", + "name": "cloudHsmClusterName", + "serializedName": "cloudHsmClusterName", + "doc": "The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length.", + "type": { + "$id": "692", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.createOrUpdate.cloudHsmClusterName", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "693", + "kind": "method", + "name": "body", + "serializedName": "body", + "doc": "Parameters to create Cloud HSM Cluster", + "type": { + "$ref": "227" + }, + "location": "Body", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.createOrUpdate.resource", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "694", + "kind": "method", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$ref": "106" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.createOrUpdate.contentType", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "695", + "kind": "method", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "108" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.createOrUpdate.accept", + "readOnly": false, + "access": "public", + "decorators": [] + } + ], + "response": { + "type": { + "$ref": "227" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.createOrUpdate", + "lroMetadata": { + "finalStateVia": 2, + "finalResponse": { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "227" + } + } + } + }, + { + "$id": "696", + "kind": "lro", + "name": "update", + "accessibility": "public", + "apiVersions": [ + "2025-03-31" + ], + "doc": "Update a Cloud HSM Cluster in the specified subscription.", + "operation": { + "$id": "697", + "name": "update", + "resourceName": "CloudHsmCluster", + "doc": "Update a Cloud HSM Cluster in the specified subscription.", + "accessibility": "public", + "parameters": [ + { + "$id": "698", + "kind": "query", + "name": "apiVersion", + "serializedName": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "699", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": true, + "explode": false, + "defaultValue": { + "type": { + "$id": "700", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-31" + }, + "optional": false, + "scope": "Client", + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.update.apiVersion", + "readOnly": false + }, + { + "$id": "701", + "kind": "path", + "name": "subscriptionId", + "serializedName": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "702", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "703", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Client", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.update.subscriptionId" + }, + { + "$id": "704", + "kind": "path", + "name": "resourceGroupName", + "serializedName": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "705", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.update.resourceGroupName" + }, + { + "$id": "706", + "kind": "path", + "name": "cloudHsmClusterName", + "serializedName": "cloudHsmClusterName", + "doc": "The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length.", + "type": { + "$id": "707", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.update.cloudHsmClusterName" + }, + { + "$id": "708", + "kind": "header", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$ref": "110" + }, + "isApiVersion": false, + "optional": false, + "isContentType": true, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.update.contentType" + }, + { + "$id": "709", + "kind": "header", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "112" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.update.accept" + }, + { + "$id": "710", + "kind": "body", + "name": "body", + "serializedName": "body", + "doc": "Parameters to create Cloud HSM Cluster", + "type": { + "$ref": "361" + }, + "isApiVersion": false, + "contentTypes": [ + "application/json" + ], + "defaultContentType": "application/json", + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.update.properties" + } + ], + "responses": [ + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "227" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + }, + { + "statusCodes": [ + 202 + ], + "headers": [ + { + "name": "location", + "nameInResponse": "Location", + "doc": "The Location header contains the URL where the status of the long running operation can be checked.", + "type": { + "$id": "711", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "name": "retryAfter", + "nameInResponse": "Retry-After", + "doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "type": { + "$id": "712", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "isErrorResponse": false + } + ], + "httpMethod": "PATCH", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}", + "requestMediaTypes": [ + "application/json" + ], + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.update", + "decorators": [ + { + "name": "Azure.ResourceManager.@armResourceUpdate", + "arguments": {} + } + ], + "examples": [ + { + "$id": "713", + "kind": "http", + "name": "CloudHsmCluster_Update_MaximumSet_Gen", + "description": "CloudHsmCluster_Update_MaximumSet_Gen", + "filePath": "2025-03-31/CloudHsmCluster_Update_MaximumSet_Gen.json", + "parameters": [ + { + "parameter": { + "$ref": "698" + }, + "value": { + "$id": "714", + "kind": "string", + "type": { + "$ref": "699" + }, + "value": "2025-03-31" + } + }, + { + "parameter": { + "$ref": "710" + }, + "value": { + "$id": "715", + "kind": "model", + "type": { + "$ref": "361" + }, + "value": { + "identity": { + "$id": "716", + "kind": "model", + "type": { + "$ref": "321" + }, + "value": { + "type": { + "$id": "717", + "kind": "string", + "type": { + "$ref": "53" + }, + "value": "UserAssigned" + }, + "userAssignedIdentities": { + "$id": "718", + "kind": "dict", + "type": { + "$ref": "330" + }, + "value": { + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-1": { + "$id": "719", + "kind": "model", + "type": { + "$ref": "333" + }, + "value": {} + } + } + } + } + }, + "tags": { + "$id": "720", + "kind": "dict", + "type": { + "$ref": "264" + }, + "value": { + "Dept": { + "$id": "721", + "kind": "string", + "type": { + "$ref": "266" + }, + "value": "hsm" + }, + "Environment": { + "$id": "722", + "kind": "string", + "type": { + "$ref": "266" + }, + "value": "dogfood" + }, + "Slice": { + "$id": "723", + "kind": "string", + "type": { + "$ref": "266" + }, + "value": "A" + } + } + } + } + } + }, + { + "parameter": { + "$ref": "706" + }, + "value": { + "$id": "724", + "kind": "string", + "type": { + "$ref": "707" + }, + "value": "chsm1" + } + }, + { + "parameter": { + "$ref": "704" + }, + "value": { + "$id": "725", + "kind": "string", + "type": { + "$ref": "705" + }, + "value": "rgcloudhsm" + } + }, + { + "parameter": { + "$ref": "701" + }, + "value": { + "$id": "726", + "kind": "string", + "type": { + "$ref": "702" + }, + "value": "00000000-0000-0000-0000-000000000000" + } + } + ], + "responses": [ + { + "response": { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "227" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + }, + "statusCode": 200, + "bodyValue": { + "$id": "727", + "kind": "model", + "type": { + "$ref": "227" + }, + "value": { + "name": { + "$id": "728", + "kind": "string", + "type": { + "$ref": "319" + }, + "value": "chsm1" + }, + "type": { + "$id": "729", + "kind": "string", + "type": { + "$ref": "247" + }, + "value": "Microsoft.HardwareSecurityModules/cloudHsmClusters" + }, + "id": { + "$id": "730", + "kind": "string", + "type": { + "$ref": "242" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgcloudhsm/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/chsm1" + }, + "identity": { + "$id": "731", + "kind": "model", + "type": { + "$ref": "321" + }, + "value": { + "type": { + "$id": "732", + "kind": "string", + "type": { + "$ref": "53" + }, + "value": "UserAssigned" + }, + "userAssignedIdentities": { + "$id": "733", + "kind": "dict", + "type": { + "$ref": "330" + }, + "value": { + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-1": { + "$id": "734", + "kind": "model", + "type": { + "$ref": "333" + }, + "value": { + "clientId": { + "$id": "735", + "kind": "string", + "type": { + "$ref": "338" + }, + "value": "00000000-0000-0000-0000-000000000000" + }, + "principalId": { + "$id": "736", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "00000000-0000-0000-0000-000000000000" + } + } + } + } + } + } + }, + "location": { + "$id": "737", + "kind": "string", + "type": { + "$ref": "268" + }, + "value": "eastus2" + }, + "properties": { + "$id": "738", + "kind": "model", + "type": { + "$ref": "271" + }, + "value": { + "activationState": { + "$id": "739", + "kind": "string", + "type": { + "$ref": "9" + }, + "value": "null" + }, + "autoGeneratedDomainNameLabelScope": { + "$id": "740", + "kind": "string", + "type": { + "$ref": "16" + }, + "value": "TenantReuse" + }, + "provisioningState": { + "$id": "741", + "kind": "string", + "type": { + "$ref": "42" + }, + "value": "Updating" + }, + "publicNetworkAccess": { + "$id": "742", + "kind": "string", + "type": { + "$ref": "50" + }, + "value": "Disabled" + }, + "statusMessage": { + "$id": "743", + "kind": "string", + "type": { + "$ref": "317" + }, + "value": "This is a status message" + } + } + }, + "sku": { + "$id": "744", + "kind": "model", + "type": { + "$ref": "341" + }, + "value": { + "name": { + "$id": "745", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Standard_B1" + }, + "family": { + "$id": "746", + "kind": "string", + "type": { + "$ref": "59" + }, + "value": "B" + } + } + }, + "systemData": { + "$id": "747", + "kind": "model", + "type": { + "$ref": "250" + }, + "value": { + "createdAt": { + "$id": "748", + "kind": "string", + "type": { + "$ref": "255" + }, + "value": "2022-09-12T12:00:00.0000000Z" + }, + "createdBy": { + "$id": "749", + "kind": "string", + "type": { + "$ref": "252" + }, + "value": "CHsmUser1" + }, + "createdByType": { + "$id": "750", + "kind": "string", + "type": { + "$ref": "36" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "751", + "kind": "string", + "type": { + "$ref": "261" + }, + "value": "2022-09-12T12:00:00.0000000Z" + }, + "lastModifiedBy": { + "$id": "752", + "kind": "string", + "type": { + "$ref": "258" + }, + "value": "CHsmUser2" + }, + "lastModifiedByType": { + "$id": "753", + "kind": "string", + "type": { + "$ref": "36" + }, + "value": "User" + } + } + }, + "tags": { + "$id": "754", + "kind": "dict", + "type": { + "$ref": "264" + }, + "value": { + "Dept": { + "$id": "755", + "kind": "string", + "type": { + "$ref": "266" + }, + "value": "hsm" + }, + "Environment": { + "$id": "756", + "kind": "string", + "type": { + "$ref": "266" + }, + "value": "dogfood" + }, + "Slice": { + "$id": "757", + "kind": "string", + "type": { + "$ref": "266" + }, + "value": "A" + } + } + } + } + } + }, + { + "response": { + "statusCodes": [ + 202 + ], + "headers": [ + { + "name": "location", + "nameInResponse": "Location", + "doc": "The Location header contains the URL where the status of the long running operation can be checked.", + "type": { + "$ref": "711" + } + }, + { + "name": "retryAfter", + "nameInResponse": "Retry-After", + "doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "type": { + "$ref": "712" + } + } + ], + "isErrorResponse": false + }, + "statusCode": 202 + } + ] + } + ] + }, + "parameters": [ + { + "$id": "758", + "kind": "method", + "name": "resourceGroupName", + "serializedName": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "759", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.update.resourceGroupName", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "760", + "kind": "method", + "name": "cloudHsmClusterName", + "serializedName": "cloudHsmClusterName", + "doc": "The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length.", + "type": { + "$id": "761", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.update.cloudHsmClusterName", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "762", + "kind": "method", + "name": "body", + "serializedName": "body", + "doc": "Parameters to create Cloud HSM Cluster", + "type": { + "$ref": "361" + }, + "location": "Body", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.update.properties", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "763", + "kind": "method", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$ref": "114" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.update.contentType", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "764", + "kind": "method", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "116" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.update.accept", + "readOnly": false, + "access": "public", + "decorators": [] + } + ], + "response": { + "type": { + "$ref": "227" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.update", + "lroMetadata": { + "finalStateVia": 1, + "finalResponse": { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "227" + } + } + } + }, + { + "$id": "765", + "kind": "lro", + "name": "delete", + "accessibility": "public", + "apiVersions": [ + "2025-03-31" + ], + "doc": "Deletes the specified Cloud HSM Cluster", + "operation": { + "$id": "766", + "name": "delete", + "resourceName": "CloudHsmCluster", + "doc": "Deletes the specified Cloud HSM Cluster", + "accessibility": "public", + "parameters": [ + { + "$id": "767", + "kind": "query", + "name": "apiVersion", + "serializedName": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "768", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": true, + "explode": false, + "defaultValue": { + "type": { + "$id": "769", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-31" + }, + "optional": false, + "scope": "Client", + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.delete.apiVersion", + "readOnly": false + }, + { + "$id": "770", + "kind": "path", + "name": "subscriptionId", + "serializedName": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "771", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "772", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Client", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.delete.subscriptionId" + }, + { + "$id": "773", + "kind": "path", + "name": "resourceGroupName", + "serializedName": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "774", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.delete.resourceGroupName" + }, + { + "$id": "775", + "kind": "path", + "name": "cloudHsmClusterName", + "serializedName": "cloudHsmClusterName", + "doc": "The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length.", + "type": { + "$id": "776", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.delete.cloudHsmClusterName" + } + ], + "responses": [ + { + "statusCodes": [ + 202 + ], + "headers": [ + { + "name": "location", + "nameInResponse": "Location", + "doc": "The Location header contains the URL where the status of the long running operation can be checked.", + "type": { + "$id": "777", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "name": "retryAfter", + "nameInResponse": "Retry-After", + "doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "type": { + "$id": "778", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "isErrorResponse": false + }, + { + "statusCodes": [ + 204 + ], + "headers": [], + "isErrorResponse": false + } + ], + "httpMethod": "DELETE", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.delete", + "decorators": [ + { + "name": "Azure.ResourceManager.@armResourceDelete", + "arguments": {} + } + ], + "examples": [ + { + "$id": "779", + "kind": "http", + "name": "CloudHsmCluster_Delete_MaximumSet_Gen", + "description": "CloudHsmCluster_Delete_MaximumSet_Gen", + "filePath": "2025-03-31/CloudHsmCluster_Delete_MaximumSet_Gen.json", + "parameters": [ + { + "parameter": { + "$ref": "767" + }, + "value": { + "$id": "780", + "kind": "string", + "type": { + "$ref": "768" + }, + "value": "2025-03-31" + } + }, + { + "parameter": { + "$ref": "775" + }, + "value": { + "$id": "781", + "kind": "string", + "type": { + "$ref": "776" + }, + "value": "chsm1" + } + }, + { + "parameter": { + "$ref": "773" + }, + "value": { + "$id": "782", + "kind": "string", + "type": { + "$ref": "774" + }, + "value": "rgcloudhsm" + } + }, + { + "parameter": { + "$ref": "770" + }, + "value": { + "$id": "783", + "kind": "string", + "type": { + "$ref": "771" + }, + "value": "00000000-0000-0000-0000-000000000000" + } + } + ], + "responses": [ + { + "response": { + "statusCodes": [ + 202 + ], + "headers": [ + { + "name": "location", + "nameInResponse": "Location", + "doc": "The Location header contains the URL where the status of the long running operation can be checked.", + "type": { + "$ref": "777" + } + }, + { + "name": "retryAfter", + "nameInResponse": "Retry-After", + "doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "type": { + "$ref": "778" + } + } + ], + "isErrorResponse": false + }, + "statusCode": 202 + }, + { + "response": { + "statusCodes": [ + 204 + ], + "headers": [], + "isErrorResponse": false + }, + "statusCode": 204 + } + ] + } + ] + }, + "parameters": [ + { + "$id": "784", + "kind": "method", + "name": "resourceGroupName", + "serializedName": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "785", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.delete.resourceGroupName", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "786", + "kind": "method", + "name": "cloudHsmClusterName", + "serializedName": "cloudHsmClusterName", + "doc": "The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length.", + "type": { + "$id": "787", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.delete.cloudHsmClusterName", + "readOnly": false, + "access": "public", + "decorators": [] + } + ], + "response": {}, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.delete", + "lroMetadata": { + "finalStateVia": 1, + "finalResponse": { + "statusCodes": [ + 204 + ] + } + } + }, + { + "$id": "788", + "kind": "paging", + "name": "listByResourceGroup", + "accessibility": "public", + "apiVersions": [ + "2025-03-31" + ], + "doc": "The List operation gets information about the Cloud HSM Clusters associated with the subscription and within the specified resource group.", + "operation": { + "$id": "789", + "name": "listByResourceGroup", + "resourceName": "CloudHsmCluster", + "doc": "The List operation gets information about the Cloud HSM Clusters associated with the subscription and within the specified resource group.", + "accessibility": "public", + "parameters": [ + { + "$id": "790", + "kind": "query", + "name": "apiVersion", + "serializedName": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "791", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": true, + "explode": false, + "defaultValue": { + "type": { + "$id": "792", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-31" + }, + "optional": false, + "scope": "Client", + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.listByResourceGroup.apiVersion", + "readOnly": false + }, + { + "$id": "793", + "kind": "path", + "name": "subscriptionId", + "serializedName": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "794", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "795", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Client", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.listByResourceGroup.subscriptionId" + }, + { + "$id": "796", + "kind": "path", + "name": "resourceGroupName", + "serializedName": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "797", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.listByResourceGroup.resourceGroupName" + }, + { + "$id": "798", + "kind": "query", + "name": "$skiptoken", + "serializedName": "$skiptoken", + "doc": "The page-continuation token to use with a paged version of this API", + "type": { + "$id": "799", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "optional": true, + "scope": "Method", + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.listByResourceGroup.$skiptoken", + "readOnly": false + }, + { + "$id": "800", + "kind": "header", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "118" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.listByResourceGroup.accept" + } + ], + "responses": [ + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "364" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.listByResourceGroup", + "decorators": [ + { + "name": "Azure.ResourceManager.@armResourceList", + "arguments": {} + } + ], + "examples": [ + { + "$id": "801", + "kind": "http", + "name": "CloudHsmCluster_ListByResourceGroup_MaximumSet_Gen", + "description": "CloudHsmCluster_ListByResourceGroup_MaximumSet_Gen", + "filePath": "2025-03-31/CloudHsmCluster_ListByResourceGroup_MaximumSet_Gen.json", + "parameters": [ + { + "parameter": { + "$ref": "790" + }, + "value": { + "$id": "802", + "kind": "string", + "type": { + "$ref": "791" + }, + "value": "2025-03-31" + } + }, + { + "parameter": { + "$ref": "796" + }, + "value": { + "$id": "803", + "kind": "string", + "type": { + "$ref": "797" + }, + "value": "rgcloudhsm" + } + }, + { + "parameter": { + "$ref": "793" + }, + "value": { + "$id": "804", + "kind": "string", + "type": { + "$ref": "794" + }, + "value": "00000000-0000-0000-0000-000000000000" + } + } + ], + "responses": [ + { + "response": { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "364" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + }, + "statusCode": 200, + "bodyValue": { + "$id": "805", + "kind": "model", + "type": { + "$ref": "364" + }, + "value": { + "nextLink": { + "$id": "806", + "kind": "string", + "type": { + "$ref": "368" + }, + "value": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgcloudhsm/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters?api-version=2022-03-31&$skiptoken=dmF1bHQtcGVza3ktanVyeS03MzA3Ng==" + }, + "value": { + "$id": "807", + "kind": "array", + "type": { + "$ref": "366" + }, + "value": [ + { + "$id": "808", + "kind": "model", + "type": { + "$ref": "227" + }, + "value": { + "name": { + "$id": "809", + "kind": "string", + "type": { + "$ref": "319" + }, + "value": "chsm1" + }, + "type": { + "$id": "810", + "kind": "string", + "type": { + "$ref": "247" + }, + "value": "Microsoft.HardwareSecurityModules/cloudHsmClusters" + }, + "id": { + "$id": "811", + "kind": "string", + "type": { + "$ref": "242" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgcloudhsm/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/chsm1" + }, + "identity": { + "$id": "812", + "kind": "model", + "type": { + "$ref": "321" + }, + "value": { + "type": { + "$id": "813", + "kind": "string", + "type": { + "$ref": "53" + }, + "value": "UserAssigned" + }, + "userAssignedIdentities": { + "$id": "814", + "kind": "dict", + "type": { + "$ref": "330" + }, + "value": { + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-1": { + "$id": "815", + "kind": "model", + "type": { + "$ref": "333" + }, + "value": { + "clientId": { + "$id": "816", + "kind": "string", + "type": { + "$ref": "338" + }, + "value": "00000000-0000-0000-0000-000000000000" + }, + "principalId": { + "$id": "817", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "00000000-0000-0000-0000-000000000000" + } + } + } + } + } + } + }, + "location": { + "$id": "818", + "kind": "string", + "type": { + "$ref": "268" + }, + "value": "eastus2" + }, + "properties": { + "$id": "819", + "kind": "model", + "type": { + "$ref": "271" + }, + "value": { + "activationState": { + "$id": "820", + "kind": "string", + "type": { + "$ref": "9" + }, + "value": "null" + }, + "autoGeneratedDomainNameLabelScope": { + "$id": "821", + "kind": "string", + "type": { + "$ref": "16" + }, + "value": "TenantReuse" + }, + "provisioningState": { + "$id": "822", + "kind": "string", + "type": { + "$ref": "42" + }, + "value": "Succeeded" + }, + "publicNetworkAccess": { + "$id": "823", + "kind": "string", + "type": { + "$ref": "50" + }, + "value": "Disabled" + }, + "statusMessage": { + "$id": "824", + "kind": "string", + "type": { + "$ref": "317" + }, + "value": "This is a status message" + } + } + }, + "sku": { + "$id": "825", + "kind": "model", + "type": { + "$ref": "341" + }, + "value": { + "name": { + "$id": "826", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Standard_B1" + }, + "family": { + "$id": "827", + "kind": "string", + "type": { + "$ref": "59" + }, + "value": "B" + } + } + }, + "systemData": { + "$id": "828", + "kind": "model", + "type": { + "$ref": "250" + }, + "value": { + "createdAt": { + "$id": "829", + "kind": "string", + "type": { + "$ref": "255" + }, + "value": "2022-09-12T12:00:00.0000000Z" + }, + "createdBy": { + "$id": "830", + "kind": "string", + "type": { + "$ref": "252" + }, + "value": "CHsmUser1" + }, + "createdByType": { + "$id": "831", + "kind": "string", + "type": { + "$ref": "36" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "832", + "kind": "string", + "type": { + "$ref": "261" + }, + "value": "2022-09-12T12:00:00.0000000Z" + }, + "lastModifiedBy": { + "$id": "833", + "kind": "string", + "type": { + "$ref": "258" + }, + "value": "CHsmUser2" + }, + "lastModifiedByType": { + "$id": "834", + "kind": "string", + "type": { + "$ref": "36" + }, + "value": "User" + } + } + }, + "tags": { + "$id": "835", + "kind": "dict", + "type": { + "$ref": "264" + }, + "value": { + "Dept": { + "$id": "836", + "kind": "string", + "type": { + "$ref": "266" + }, + "value": "hsm" + }, + "Environment": { + "$id": "837", + "kind": "string", + "type": { + "$ref": "266" + }, + "value": "dogfood" + } + } + } + } + }, + { + "$id": "838", + "kind": "model", + "type": { + "$ref": "227" + }, + "value": { + "name": { + "$id": "839", + "kind": "string", + "type": { + "$ref": "319" + }, + "value": "chsm2" + }, + "type": { + "$id": "840", + "kind": "string", + "type": { + "$ref": "247" + }, + "value": "Microsoft.HardwareSecurityModules/cloudHsmClusters" + }, + "id": { + "$id": "841", + "kind": "string", + "type": { + "$ref": "242" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgcloudhsm/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/chsm2" + }, + "identity": { + "$id": "842", + "kind": "model", + "type": { + "$ref": "321" + }, + "value": { + "type": { + "$id": "843", + "kind": "string", + "type": { + "$ref": "53" + }, + "value": "UserAssigned" + }, + "userAssignedIdentities": { + "$id": "844", + "kind": "dict", + "type": { + "$ref": "330" + }, + "value": { + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-2": { + "$id": "845", + "kind": "model", + "type": { + "$ref": "333" + }, + "value": { + "clientId": { + "$id": "846", + "kind": "string", + "type": { + "$ref": "338" + }, + "value": "00000000-0000-0000-0000-000000000000" + }, + "principalId": { + "$id": "847", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "00000000-0000-0000-0000-000000000000" + } + } + } + } + } + } + }, + "location": { + "$id": "848", + "kind": "string", + "type": { + "$ref": "268" + }, + "value": "eastus2" + }, + "properties": { + "$id": "849", + "kind": "model", + "type": { + "$ref": "271" + }, + "value": { + "activationState": { + "$id": "850", + "kind": "string", + "type": { + "$ref": "9" + }, + "value": "null" + }, + "autoGeneratedDomainNameLabelScope": { + "$id": "851", + "kind": "string", + "type": { + "$ref": "16" + }, + "value": "TenantReuse" + }, + "provisioningState": { + "$id": "852", + "kind": "string", + "type": { + "$ref": "42" + }, + "value": "Succeeded" + }, + "publicNetworkAccess": { + "$id": "853", + "kind": "string", + "type": { + "$ref": "50" + }, + "value": "Disabled" + } + } + }, + "sku": { + "$id": "854", + "kind": "model", + "type": { + "$ref": "341" + }, + "value": { + "name": { + "$id": "855", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Standard_B1" + }, + "family": { + "$id": "856", + "kind": "string", + "type": { + "$ref": "59" + }, + "value": "B" + } + } + }, + "systemData": { + "$id": "857", + "kind": "model", + "type": { + "$ref": "250" + }, + "value": { + "createdAt": { + "$id": "858", + "kind": "string", + "type": { + "$ref": "255" + }, + "value": "2022-09-12T12:00:00.0000000Z" + }, + "createdBy": { + "$id": "859", + "kind": "string", + "type": { + "$ref": "252" + }, + "value": "CHsmUser1" + }, + "createdByType": { + "$id": "860", + "kind": "string", + "type": { + "$ref": "36" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "861", + "kind": "string", + "type": { + "$ref": "261" + }, + "value": "2022-09-12T12:00:00.0000000Z" + }, + "lastModifiedBy": { + "$id": "862", + "kind": "string", + "type": { + "$ref": "258" + }, + "value": "CHsmUser2" + }, + "lastModifiedByType": { + "$id": "863", + "kind": "string", + "type": { + "$ref": "36" + }, + "value": "User" + } + } + }, + "tags": { + "$id": "864", + "kind": "dict", + "type": { + "$ref": "264" + }, + "value": { + "Dept": { + "$id": "865", + "kind": "string", + "type": { + "$ref": "266" + }, + "value": "hsm" + }, + "Environment": { + "$id": "866", + "kind": "string", + "type": { + "$ref": "266" + }, + "value": "dogfood" + } + } + } + } + } + ] + } + } + } + } + ] + } + ] + }, + "parameters": [ + { + "$id": "867", + "kind": "method", + "name": "resourceGroupName", + "serializedName": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "868", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.listByResourceGroup.resourceGroupName", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "869", + "kind": "method", + "name": "$skiptoken", + "serializedName": "$skiptoken", + "doc": "The page-continuation token to use with a paged version of this API", + "type": { + "$id": "870", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "optional": true, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.listByResourceGroup.$skiptoken", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "871", + "kind": "method", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "118" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.listByResourceGroup.accept", + "readOnly": false, + "access": "public", + "decorators": [] + } + ], + "response": { + "type": { + "$ref": "366" + }, + "resultSegments": [ + "value" + ] + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.listByResourceGroup", + "pagingMetadata": { + "itemPropertySegments": [ + "value" + ], + "nextLink": { + "responseSegments": [ + "nextLink" + ], + "responseLocation": "Body" + } + } + }, + { + "$id": "872", + "kind": "paging", + "name": "listBySubscription", + "accessibility": "public", + "apiVersions": [ + "2025-03-31" + ], + "doc": "The List operation gets information about the Cloud HSM Clusters associated with the subscription.", + "operation": { + "$id": "873", + "name": "listBySubscription", + "resourceName": "CloudHsmCluster", + "doc": "The List operation gets information about the Cloud HSM Clusters associated with the subscription.", + "accessibility": "public", + "parameters": [ + { + "$id": "874", + "kind": "query", + "name": "apiVersion", + "serializedName": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "875", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": true, + "explode": false, + "defaultValue": { + "type": { + "$id": "876", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-31" + }, + "optional": false, + "scope": "Client", + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.listBySubscription.apiVersion", + "readOnly": false + }, + { + "$id": "877", + "kind": "path", + "name": "subscriptionId", + "serializedName": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "878", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "879", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Client", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.listBySubscription.subscriptionId" + }, + { + "$id": "880", + "kind": "query", + "name": "$skiptoken", + "serializedName": "$skiptoken", + "doc": "The page-continuation token to use with a paged version of this API", + "type": { + "$id": "881", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "optional": true, + "scope": "Method", + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.listBySubscription.$skiptoken", + "readOnly": false + }, + { + "$id": "882", + "kind": "header", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "120" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.listBySubscription.accept" + } + ], + "responses": [ + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "364" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.listBySubscription", + "decorators": [ + { + "name": "Azure.ResourceManager.@armResourceList", + "arguments": {} + } + ], + "examples": [ + { + "$id": "883", + "kind": "http", + "name": "CloudHsmCluster_ListBySubscription_MaximumSet_Gen", + "description": "CloudHsmCluster_ListBySubscription_MaximumSet_Gen", + "filePath": "2025-03-31/CloudHsmCluster_ListBySubscription_MaximumSet_Gen.json", + "parameters": [ + { + "parameter": { + "$ref": "874" + }, + "value": { + "$id": "884", + "kind": "string", + "type": { + "$ref": "875" + }, + "value": "2025-03-31" + } + }, + { + "parameter": { + "$ref": "877" + }, + "value": { + "$id": "885", + "kind": "string", + "type": { + "$ref": "878" + }, + "value": "00000000-0000-0000-0000-000000000000" + } + } + ], + "responses": [ + { + "response": { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "364" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + }, + "statusCode": 200, + "bodyValue": { + "$id": "886", + "kind": "model", + "type": { + "$ref": "364" + }, + "value": { + "nextLink": { + "$id": "887", + "kind": "string", + "type": { + "$ref": "368" + }, + "value": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters?api-version=2022-07-01&$skiptoken=dmF1bHQtcGVza3ktanVyeS03MzA3Ng==" + }, + "value": { + "$id": "888", + "kind": "array", + "type": { + "$ref": "366" + }, + "value": [ + { + "$id": "889", + "kind": "model", + "type": { + "$ref": "227" + }, + "value": { + "name": { + "$id": "890", + "kind": "string", + "type": { + "$ref": "319" + }, + "value": "chsm1" + }, + "type": { + "$id": "891", + "kind": "string", + "type": { + "$ref": "247" + }, + "value": "Microsoft.HardwareSecurityModules/cloudHsmClusters" + }, + "id": { + "$id": "892", + "kind": "string", + "type": { + "$ref": "242" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgcloudhsm/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/chsm1" + }, + "identity": { + "$id": "893", + "kind": "model", + "type": { + "$ref": "321" + }, + "value": { + "type": { + "$id": "894", + "kind": "string", + "type": { + "$ref": "53" + }, + "value": "UserAssigned" + }, + "userAssignedIdentities": { + "$id": "895", + "kind": "dict", + "type": { + "$ref": "330" + }, + "value": { + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-1": { + "$id": "896", + "kind": "model", + "type": { + "$ref": "333" + }, + "value": {} + } + } + } + } + }, + "location": { + "$id": "897", + "kind": "string", + "type": { + "$ref": "268" + }, + "value": "eastus2" + }, + "properties": { + "$id": "898", + "kind": "model", + "type": { + "$ref": "271" + }, + "value": { + "activationState": { + "$id": "899", + "kind": "string", + "type": { + "$ref": "9" + }, + "value": "null" + }, + "autoGeneratedDomainNameLabelScope": { + "$id": "900", + "kind": "string", + "type": { + "$ref": "16" + }, + "value": "TenantReuse" + }, + "provisioningState": { + "$id": "901", + "kind": "string", + "type": { + "$ref": "42" + }, + "value": "Succeeded" + }, + "publicNetworkAccess": { + "$id": "902", + "kind": "string", + "type": { + "$ref": "50" + }, + "value": "Disabled" + }, + "statusMessage": { + "$id": "903", + "kind": "string", + "type": { + "$ref": "317" + }, + "value": "This is a status message" + } + } + }, + "sku": { + "$id": "904", + "kind": "model", + "type": { + "$ref": "341" + }, + "value": { + "name": { + "$id": "905", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Standard_B1" + }, + "family": { + "$id": "906", + "kind": "string", + "type": { + "$ref": "59" + }, + "value": "B" + } + } + }, + "systemData": { + "$id": "907", + "kind": "model", + "type": { + "$ref": "250" + }, + "value": { + "createdAt": { + "$id": "908", + "kind": "string", + "type": { + "$ref": "255" + }, + "value": "2022-09-12T12:00:00.0000000Z" + }, + "createdBy": { + "$id": "909", + "kind": "string", + "type": { + "$ref": "252" + }, + "value": "CHsmUser1" + }, + "createdByType": { + "$id": "910", + "kind": "string", + "type": { + "$ref": "36" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "911", + "kind": "string", + "type": { + "$ref": "261" + }, + "value": "2022-09-12T12:00:00.0000000Z" + }, + "lastModifiedBy": { + "$id": "912", + "kind": "string", + "type": { + "$ref": "258" + }, + "value": "CHsmUser2" + }, + "lastModifiedByType": { + "$id": "913", + "kind": "string", + "type": { + "$ref": "36" + }, + "value": "User" + } + } + }, + "tags": { + "$id": "914", + "kind": "dict", + "type": { + "$ref": "264" + }, + "value": { + "Dept": { + "$id": "915", + "kind": "string", + "type": { + "$ref": "266" + }, + "value": "hsm" + }, + "Environment": { + "$id": "916", + "kind": "string", + "type": { + "$ref": "266" + }, + "value": "dogfood" + } + } + } + } + }, + { + "$id": "917", + "kind": "model", + "type": { + "$ref": "227" + }, + "value": { + "name": { + "$id": "918", + "kind": "string", + "type": { + "$ref": "319" + }, + "value": "chsm2" + }, + "type": { + "$id": "919", + "kind": "string", + "type": { + "$ref": "247" + }, + "value": "Microsoft.HardwareSecurityModules/cloudHsmClusters" + }, + "id": { + "$id": "920", + "kind": "string", + "type": { + "$ref": "242" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgcloudhsm/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/chsm2" + }, + "identity": { + "$id": "921", + "kind": "model", + "type": { + "$ref": "321" + }, + "value": { + "type": { + "$id": "922", + "kind": "string", + "type": { + "$ref": "53" + }, + "value": "UserAssigned" + }, + "userAssignedIdentities": { + "$id": "923", + "kind": "dict", + "type": { + "$ref": "330" + }, + "value": { + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-2": { + "$id": "924", + "kind": "model", + "type": { + "$ref": "333" + }, + "value": { + "clientId": { + "$id": "925", + "kind": "string", + "type": { + "$ref": "338" + }, + "value": "00000000-0000-0000-0000-000000000000" + }, + "principalId": { + "$id": "926", + "kind": "string", + "type": { + "$ref": "335" + }, + "value": "00000000-0000-0000-0000-000000000000" + } + } + } + } + } + } + }, + "location": { + "$id": "927", + "kind": "string", + "type": { + "$ref": "268" + }, + "value": "eastus2" + }, + "properties": { + "$id": "928", + "kind": "model", + "type": { + "$ref": "271" + }, + "value": { + "activationState": { + "$id": "929", + "kind": "string", + "type": { + "$ref": "9" + }, + "value": "null" + }, + "autoGeneratedDomainNameLabelScope": { + "$id": "930", + "kind": "string", + "type": { + "$ref": "16" + }, + "value": "TenantReuse" + }, + "provisioningState": { + "$id": "931", + "kind": "string", + "type": { + "$ref": "42" + }, + "value": "Succeeded" + }, + "publicNetworkAccess": { + "$id": "932", + "kind": "string", + "type": { + "$ref": "50" + }, + "value": "Disabled" + }, + "statusMessage": { + "$id": "933", + "kind": "string", + "type": { + "$ref": "317" + }, + "value": "This is a status message" + } + } + }, + "sku": { + "$id": "934", + "kind": "model", + "type": { + "$ref": "341" + }, + "value": { + "name": { + "$id": "935", + "kind": "string", + "type": { + "$ref": "62" + }, + "value": "Standard_B1" + }, + "family": { + "$id": "936", + "kind": "string", + "type": { + "$ref": "59" + }, + "value": "B" + } + } + }, + "systemData": { + "$id": "937", + "kind": "model", + "type": { + "$ref": "250" + }, + "value": { + "createdAt": { + "$id": "938", + "kind": "string", + "type": { + "$ref": "255" + }, + "value": "2022-09-12T12:00:00.0000000Z" + }, + "createdBy": { + "$id": "939", + "kind": "string", + "type": { + "$ref": "252" + }, + "value": "CHsmUser1" + }, + "createdByType": { + "$id": "940", + "kind": "string", + "type": { + "$ref": "36" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "941", + "kind": "string", + "type": { + "$ref": "261" + }, + "value": "2022-09-12T12:00:00.0000000Z" + }, + "lastModifiedBy": { + "$id": "942", + "kind": "string", + "type": { + "$ref": "258" + }, + "value": "CHsmUser2" + }, + "lastModifiedByType": { + "$id": "943", + "kind": "string", + "type": { + "$ref": "36" + }, + "value": "User" + } + } + }, + "tags": { + "$id": "944", + "kind": "dict", + "type": { + "$ref": "264" + }, + "value": { + "Dept": { + "$id": "945", + "kind": "string", + "type": { + "$ref": "266" + }, + "value": "hsm" + }, + "Environment": { + "$id": "946", + "kind": "string", + "type": { + "$ref": "266" + }, + "value": "dogfood" + } + } + } + } + } + ] + } + } + } + } + ] + } + ] + }, + "parameters": [ + { + "$id": "947", + "kind": "method", + "name": "$skiptoken", + "serializedName": "$skiptoken", + "doc": "The page-continuation token to use with a paged version of this API", + "type": { + "$id": "948", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "optional": true, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.listBySubscription.$skiptoken", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "949", + "kind": "method", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "120" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.listBySubscription.accept", + "readOnly": false, + "access": "public", + "decorators": [] + } + ], + "response": { + "type": { + "$ref": "366" + }, + "resultSegments": [ + "value" + ] + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.listBySubscription", + "pagingMetadata": { + "itemPropertySegments": [ + "value" + ], + "nextLink": { + "responseSegments": [ + "nextLink" + ], + "responseLocation": "Body" + } + } + }, + { + "$id": "950", + "kind": "lro", + "name": "validateBackupProperties", + "accessibility": "public", + "apiVersions": [ + "2025-03-31" + ], + "doc": "Pre Backup operation to validate whether the customer can perform a backup on the Cloud HSM Cluster resource in the specified subscription.", + "operation": { + "$id": "951", + "name": "validateBackupProperties", + "resourceName": "CloudHsmClusters", + "doc": "Pre Backup operation to validate whether the customer can perform a backup on the Cloud HSM Cluster resource in the specified subscription.", + "accessibility": "public", + "parameters": [ + { + "$id": "952", + "kind": "query", + "name": "apiVersion", + "serializedName": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "953", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": true, + "explode": false, + "defaultValue": { + "type": { + "$id": "954", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-31" + }, + "optional": false, + "scope": "Client", + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.validateBackupProperties.apiVersion", + "readOnly": false + }, + { + "$id": "955", + "kind": "path", + "name": "subscriptionId", + "serializedName": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "956", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "957", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Client", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.validateBackupProperties.subscriptionId" + }, + { + "$id": "958", + "kind": "path", + "name": "resourceGroupName", + "serializedName": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "959", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.validateBackupProperties.resourceGroupName" + }, + { + "$id": "960", + "kind": "path", + "name": "cloudHsmClusterName", + "serializedName": "cloudHsmClusterName", + "doc": "The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length.", + "type": { + "$id": "961", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.validateBackupProperties.cloudHsmClusterName" + }, + { + "$id": "962", + "kind": "header", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$ref": "122" + }, + "isApiVersion": false, + "optional": true, + "isContentType": true, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.validateBackupProperties.contentType" + }, + { + "$id": "963", + "kind": "header", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "124" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.validateBackupProperties.accept" + }, + { + "$id": "964", + "kind": "body", + "name": "backupRequestProperties", + "serializedName": "backupRequestProperties", + "doc": "Backup Operation Required properties", + "type": { + "$ref": "370" + }, + "isApiVersion": false, + "contentTypes": [ + "application/json" + ], + "defaultContentType": "application/json", + "optional": true, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.validateBackupProperties.body" + } + ], + "responses": [ + { + "statusCodes": [ + 202 + ], + "headers": [ + { + "name": "azureAsyncOperation", + "nameInResponse": "Azure-AsyncOperation", + "doc": "A link to the status monitor", + "type": { + "$id": "965", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "name": "location", + "nameInResponse": "Location", + "doc": "The Location header contains the URL where the status of the long running operation can be checked.", + "type": { + "$id": "966", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "name": "retryAfter", + "nameInResponse": "Retry-After", + "doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "type": { + "$id": "967", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + }, + { + "name": "requestId", + "nameInResponse": "x-ms-request-id", + "doc": "An opaque, globally-unique, server-generated string identifier for the request.", + "type": { + "$id": "968", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "969", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + } + } + ], + "isErrorResponse": false + }, + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "376" + }, + "headers": [ + { + "name": "requestId", + "nameInResponse": "x-ms-request-id", + "doc": "An opaque, globally-unique, server-generated string identifier for the request.", + "type": { + "$id": "970", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "971", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + } + } + ], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "POST", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/validateBackupProperties", + "requestMediaTypes": [ + "application/json" + ], + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.validateBackupProperties", + "decorators": [ + { + "name": "Azure.ResourceManager.@armResourceAction", + "arguments": {} + } + ], + "examples": [ + { + "$id": "972", + "kind": "http", + "name": "CloudHsmCluster_ValidateBackup_Validation_MaximumSet_Gen", + "description": "CloudHsmCluster_ValidateBackup_Validation_MaximumSet_Gen", + "filePath": "2025-03-31/CloudHsmCluster_Create_Backup_MaximumSet_Gen_ValidateBackupProperties.json", + "parameters": [ + { + "parameter": { + "$ref": "952" + }, + "value": { + "$id": "973", + "kind": "string", + "type": { + "$ref": "953" + }, + "value": "2025-03-31" + } + }, + { + "parameter": { + "$ref": "964" + }, + "value": { + "$id": "974", + "kind": "model", + "type": { + "$ref": "370" + }, + "value": { + "azureStorageBlobContainerUri": { + "$id": "975", + "kind": "string", + "type": { + "$ref": "373" + }, + "value": "https://myaccount.blob.core.windows.net/sascontainer/sasContainer" + }, + "token": { + "$id": "976", + "kind": "string", + "type": { + "$ref": "375" + }, + "value": "se=2018-02-01T00%3A00Z&spr=https&sv=2017-04-17&sr=b&sig=REDACTED" + } + } + } + }, + { + "parameter": { + "$ref": "960" + }, + "value": { + "$id": "977", + "kind": "string", + "type": { + "$ref": "961" + }, + "value": "chsm1" + } + }, + { + "parameter": { + "$ref": "958" + }, + "value": { + "$id": "978", + "kind": "string", + "type": { + "$ref": "959" + }, + "value": "rgcloudhsm" + } + }, + { + "parameter": { + "$ref": "955" + }, + "value": { + "$id": "979", + "kind": "string", + "type": { + "$ref": "956" + }, + "value": "00000000-0000-0000-0000-000000000000" + } + } + ], + "responses": [ + { + "response": { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "376" + }, + "headers": [ + { + "name": "requestId", + "nameInResponse": "x-ms-request-id", + "doc": "An opaque, globally-unique, server-generated string identifier for the request.", + "type": { + "$ref": "970" + } + } + ], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + }, + "statusCode": 200, + "bodyValue": { + "$id": "980", + "kind": "model", + "type": { + "$ref": "376" + }, + "value": { + "properties": { + "$id": "981", + "kind": "model", + "type": { + "$ref": "378" + }, + "value": { + "azureStorageBlobContainerUri": { + "$id": "982", + "kind": "string", + "type": { + "$ref": "394" + }, + "value": "https://myaccount.blob.core.windows.net/sascontainer/sasContainer" + }, + "endTime": { + "$id": "983", + "kind": "string", + "type": { + "$ref": "389" + }, + "value": "2022-09-12T12:00:00.0000000Z" + }, + "jobId": { + "$id": "984", + "kind": "string", + "type": { + "$ref": "392" + }, + "value": "572a45927fc240e1ac075de27371680b" + }, + "startTime": { + "$id": "985", + "kind": "string", + "type": { + "$ref": "385" + }, + "value": "2022-09-12T12:00:00.0000000Z" + }, + "status": { + "$id": "986", + "kind": "string", + "type": { + "$ref": "71" + }, + "value": "InProgress" + }, + "statusDetails": { + "$id": "987", + "kind": "string", + "type": { + "$ref": "382" + }, + "value": "Backup operation is in progress" + } + } + } + } + } + }, + { + "response": { + "statusCodes": [ + 202 + ], + "headers": [ + { + "name": "azureAsyncOperation", + "nameInResponse": "Azure-AsyncOperation", + "doc": "A link to the status monitor", + "type": { + "$ref": "965" + } + }, + { + "name": "location", + "nameInResponse": "Location", + "doc": "The Location header contains the URL where the status of the long running operation can be checked.", + "type": { + "$ref": "966" + } + }, + { + "name": "retryAfter", + "nameInResponse": "Retry-After", + "doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "type": { + "$ref": "967" + } + }, + { + "name": "requestId", + "nameInResponse": "x-ms-request-id", + "doc": "An opaque, globally-unique, server-generated string identifier for the request.", + "type": { + "$ref": "968" + } + } + ], + "isErrorResponse": false + }, + "statusCode": 202 + } + ] + } + ] + }, + "parameters": [ + { + "$id": "988", + "kind": "method", + "name": "resourceGroupName", + "serializedName": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "989", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.validateBackupProperties.resourceGroupName", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "990", + "kind": "method", + "name": "cloudHsmClusterName", + "serializedName": "cloudHsmClusterName", + "doc": "The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length.", + "type": { + "$id": "991", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.validateBackupProperties.cloudHsmClusterName", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "992", + "kind": "method", + "name": "backupRequestProperties", + "serializedName": "backupRequestProperties", + "doc": "Backup Operation Required properties", + "type": { + "$ref": "370" + }, + "location": "Body", + "isApiVersion": false, + "optional": true, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.validateBackupProperties.body", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "993", + "kind": "method", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$id": "994", + "kind": "enum", + "name": "validateBackupPropertiesContentType", + "crossLanguageDefinitionId": "", + "valueType": { + "$id": "995", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "996", + "kind": "enumvalue", + "name": "application/json", + "value": "application/json", + "valueType": { + "$id": "997", + "kind": "string", + "decorators": [], + "doc": "A sequence of textual characters.", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "enumType": { + "$ref": "994" + }, + "decorators": [] + } + ], + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "isFixed": false, + "isFlags": false, + "usage": "None", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "optional": true, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.validateBackupProperties.contentType", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "998", + "kind": "method", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "126" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.validateBackupProperties.accept", + "readOnly": false, + "access": "public", + "decorators": [] + } + ], + "response": { + "type": { + "$ref": "376" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.validateBackupProperties", + "lroMetadata": { + "finalStateVia": 0, + "finalResponse": { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "376" + } + } + } + }, + { + "$id": "999", + "kind": "lro", + "name": "backup", + "accessibility": "public", + "apiVersions": [ + "2025-03-31" + ], + "doc": "Create a backup of the Cloud HSM Cluster in the specified subscription", + "operation": { + "$id": "1000", + "name": "backup", + "resourceName": "CloudHsmClusters", + "doc": "Create a backup of the Cloud HSM Cluster in the specified subscription", + "accessibility": "public", + "parameters": [ + { + "$id": "1001", + "kind": "query", + "name": "apiVersion", + "serializedName": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1002", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": true, + "explode": false, + "defaultValue": { + "type": { + "$id": "1003", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-31" + }, + "optional": false, + "scope": "Client", + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.backup.apiVersion", + "readOnly": false + }, + { + "$id": "1004", + "kind": "path", + "name": "subscriptionId", + "serializedName": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "1005", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1006", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Client", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.backup.subscriptionId" + }, + { + "$id": "1007", + "kind": "path", + "name": "resourceGroupName", + "serializedName": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1008", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.backup.resourceGroupName" + }, + { + "$id": "1009", + "kind": "path", + "name": "cloudHsmClusterName", + "serializedName": "cloudHsmClusterName", + "doc": "The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length.", + "type": { + "$id": "1010", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.backup.cloudHsmClusterName" + }, + { + "$id": "1011", + "kind": "header", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$ref": "128" + }, + "isApiVersion": false, + "optional": true, + "isContentType": true, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.backup.contentType" + }, + { + "$id": "1012", + "kind": "header", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "130" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.backup.accept" + }, + { + "$id": "1013", + "kind": "body", + "name": "backupRequestProperties", + "serializedName": "backupRequestProperties", + "doc": "Azure storage Resource Uri", + "type": { + "$ref": "370" + }, + "isApiVersion": false, + "contentTypes": [ + "application/json" + ], + "defaultContentType": "application/json", + "optional": true, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.backup.body" + } + ], + "responses": [ + { + "statusCodes": [ + 202 + ], + "headers": [ + { + "name": "azureAsyncOperation", + "nameInResponse": "Azure-AsyncOperation", + "doc": "A link to the status monitor", + "type": { + "$id": "1014", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "name": "location", + "nameInResponse": "Location", + "doc": "The Location header contains the URL where the status of the long running operation can be checked.", + "type": { + "$id": "1015", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "name": "retryAfter", + "nameInResponse": "Retry-After", + "doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "type": { + "$id": "1016", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + }, + { + "name": "requestId", + "nameInResponse": "x-ms-request-id", + "doc": "An opaque, globally-unique, server-generated string identifier for the request.", + "type": { + "$id": "1017", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1018", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + } + } + ], + "isErrorResponse": false + }, + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "376" + }, + "headers": [ + { + "name": "requestId", + "nameInResponse": "x-ms-request-id", + "doc": "An opaque, globally-unique, server-generated string identifier for the request.", + "type": { + "$id": "1019", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1020", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + } + } + ], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "POST", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/backup", + "requestMediaTypes": [ + "application/json" + ], + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.backup", + "decorators": [ + { + "name": "Azure.ResourceManager.@armResourceAction", + "arguments": {} + } + ], + "examples": [ + { + "$id": "1021", + "kind": "http", + "name": "CloudHsmCluster_Create_Backup_MaximumSet_Gen", + "description": "CloudHsmCluster_Create_Backup_MaximumSet_Gen", + "filePath": "2025-03-31/CloudHsmCluster_CreateOrValidate_Backup_MaximumSet_Gen.json", + "parameters": [ + { + "parameter": { + "$ref": "1001" + }, + "value": { + "$id": "1022", + "kind": "string", + "type": { + "$ref": "1002" + }, + "value": "2025-03-31" + } + }, + { + "parameter": { + "$ref": "1013" + }, + "value": { + "$id": "1023", + "kind": "model", + "type": { + "$ref": "370" + }, + "value": { + "azureStorageBlobContainerUri": { + "$id": "1024", + "kind": "string", + "type": { + "$ref": "373" + }, + "value": "https://myaccount.blob.core.windows.net/sascontainer/sasContainer" + }, + "token": { + "$id": "1025", + "kind": "string", + "type": { + "$ref": "375" + }, + "value": "se=2018-02-01T00%3A00Z&spr=https&sv=2017-04-17&sr=b&sig=REDACTED" + } + } + } + }, + { + "parameter": { + "$ref": "1009" + }, + "value": { + "$id": "1026", + "kind": "string", + "type": { + "$ref": "1010" + }, + "value": "chsm1" + } + }, + { + "parameter": { + "$ref": "1007" + }, + "value": { + "$id": "1027", + "kind": "string", + "type": { + "$ref": "1008" + }, + "value": "rgcloudhsm" + } + }, + { + "parameter": { + "$ref": "1004" + }, + "value": { + "$id": "1028", + "kind": "string", + "type": { + "$ref": "1005" + }, + "value": "00000000-0000-0000-0000-000000000000" + } + } + ], + "responses": [ + { + "response": { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "376" + }, + "headers": [ + { + "name": "requestId", + "nameInResponse": "x-ms-request-id", + "doc": "An opaque, globally-unique, server-generated string identifier for the request.", + "type": { + "$ref": "1019" + } + } + ], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + }, + "statusCode": 200, + "bodyValue": { + "$id": "1029", + "kind": "model", + "type": { + "$ref": "376" + }, + "value": { + "properties": { + "$id": "1030", + "kind": "model", + "type": { + "$ref": "378" + }, + "value": { + "azureStorageBlobContainerUri": { + "$id": "1031", + "kind": "string", + "type": { + "$ref": "394" + }, + "value": "https://myaccount.blob.core.windows.net/sascontainer/sasContainer" + }, + "endTime": { + "$id": "1032", + "kind": "string", + "type": { + "$ref": "389" + }, + "value": "2022-09-12T12:00:00.0000000Z" + }, + "jobId": { + "$id": "1033", + "kind": "string", + "type": { + "$ref": "392" + }, + "value": "572a45927fc240e1ac075de27371680b" + }, + "startTime": { + "$id": "1034", + "kind": "string", + "type": { + "$ref": "385" + }, + "value": "2022-09-12T12:00:00.0000000Z" + }, + "status": { + "$id": "1035", + "kind": "string", + "type": { + "$ref": "71" + }, + "value": "InProgress" + }, + "statusDetails": { + "$id": "1036", + "kind": "string", + "type": { + "$ref": "382" + }, + "value": "Backup operation is in progress" + } + } + } + } + } + }, + { + "response": { + "statusCodes": [ + 202 + ], + "headers": [ + { + "name": "azureAsyncOperation", + "nameInResponse": "Azure-AsyncOperation", + "doc": "A link to the status monitor", + "type": { + "$ref": "1014" + } + }, + { + "name": "location", + "nameInResponse": "Location", + "doc": "The Location header contains the URL where the status of the long running operation can be checked.", + "type": { + "$ref": "1015" + } + }, + { + "name": "retryAfter", + "nameInResponse": "Retry-After", + "doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "type": { + "$ref": "1016" + } + }, + { + "name": "requestId", + "nameInResponse": "x-ms-request-id", + "doc": "An opaque, globally-unique, server-generated string identifier for the request.", + "type": { + "$ref": "1017" + } + } + ], + "isErrorResponse": false + }, + "statusCode": 202 + } + ] + } + ] + }, + "parameters": [ + { + "$id": "1037", + "kind": "method", + "name": "resourceGroupName", + "serializedName": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1038", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.backup.resourceGroupName", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "1039", + "kind": "method", + "name": "cloudHsmClusterName", + "serializedName": "cloudHsmClusterName", + "doc": "The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length.", + "type": { + "$id": "1040", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.backup.cloudHsmClusterName", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "1041", + "kind": "method", + "name": "backupRequestProperties", + "serializedName": "backupRequestProperties", + "doc": "Azure storage Resource Uri", + "type": { + "$ref": "370" + }, + "location": "Body", + "isApiVersion": false, + "optional": true, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.backup.body", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "1042", + "kind": "method", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$id": "1043", + "kind": "enum", + "name": "backupContentType", + "crossLanguageDefinitionId": "", + "valueType": { + "$id": "1044", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "1045", + "kind": "enumvalue", + "name": "application/json", + "value": "application/json", + "valueType": { + "$id": "1046", + "kind": "string", + "decorators": [], + "doc": "A sequence of textual characters.", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "enumType": { + "$ref": "1043" + }, + "decorators": [] + } + ], + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "isFixed": false, + "isFlags": false, + "usage": "None", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "optional": true, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.backup.contentType", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "1047", + "kind": "method", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "132" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.backup.accept", + "readOnly": false, + "access": "public", + "decorators": [] + } + ], + "response": { + "type": { + "$ref": "376" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.backup", + "lroMetadata": { + "finalStateVia": 0, + "finalResponse": { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "376" + } + } + } + }, + { + "$id": "1048", + "kind": "lro", + "name": "validateRestoreProperties", + "accessibility": "public", + "apiVersions": [ + "2025-03-31" + ], + "doc": "Queued validating pre restore operation", + "operation": { + "$id": "1049", + "name": "validateRestoreProperties", + "resourceName": "CloudHsmClusters", + "doc": "Queued validating pre restore operation", + "accessibility": "public", + "parameters": [ + { + "$id": "1050", + "kind": "query", + "name": "apiVersion", + "serializedName": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1051", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": true, + "explode": false, + "defaultValue": { + "type": { + "$id": "1052", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-31" + }, + "optional": false, + "scope": "Client", + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.validateRestoreProperties.apiVersion", + "readOnly": false + }, + { + "$id": "1053", + "kind": "path", + "name": "subscriptionId", + "serializedName": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "1054", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1055", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Client", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.validateRestoreProperties.subscriptionId" + }, + { + "$id": "1056", + "kind": "path", + "name": "resourceGroupName", + "serializedName": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1057", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.validateRestoreProperties.resourceGroupName" + }, + { + "$id": "1058", + "kind": "path", + "name": "cloudHsmClusterName", + "serializedName": "cloudHsmClusterName", + "doc": "The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length.", + "type": { + "$id": "1059", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.validateRestoreProperties.cloudHsmClusterName" + }, + { + "$id": "1060", + "kind": "header", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$ref": "134" + }, + "isApiVersion": false, + "optional": true, + "isContentType": true, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.validateRestoreProperties.contentType" + }, + { + "$id": "1061", + "kind": "header", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "136" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.validateRestoreProperties.accept" + }, + { + "$id": "1062", + "kind": "body", + "name": "restoreRequestProperties", + "serializedName": "restoreRequestProperties", + "doc": "Optional Parameters to validate prior performing a restore operation.", + "type": { + "$ref": "397" + }, + "isApiVersion": false, + "contentTypes": [ + "application/json" + ], + "defaultContentType": "application/json", + "optional": true, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.validateRestoreProperties.body" + } + ], + "responses": [ + { + "statusCodes": [ + 202 + ], + "headers": [ + { + "name": "azureAsyncOperation", + "nameInResponse": "Azure-AsyncOperation", + "doc": "A link to the status monitor", + "type": { + "$id": "1063", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "name": "location", + "nameInResponse": "Location", + "doc": "The Location header contains the URL where the status of the long running operation can be checked.", + "type": { + "$id": "1064", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "name": "retryAfter", + "nameInResponse": "Retry-After", + "doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "type": { + "$id": "1065", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + }, + { + "name": "requestId", + "nameInResponse": "x-ms-request-id", + "doc": "An opaque, globally-unique, server-generated string identifier for the request.", + "type": { + "$id": "1066", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1067", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + } + } + ], + "isErrorResponse": false + }, + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "400" + }, + "headers": [ + { + "name": "requestId", + "nameInResponse": "x-ms-request-id", + "doc": "An opaque, globally-unique, server-generated string identifier for the request.", + "type": { + "$id": "1068", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1069", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + } + } + ], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "POST", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/validateRestoreProperties", + "requestMediaTypes": [ + "application/json" + ], + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.validateRestoreProperties", + "decorators": [ + { + "name": "Azure.ResourceManager.@armResourceAction", + "arguments": {} + } + ], + "examples": [ + { + "$id": "1070", + "kind": "http", + "name": "CloudHsmCluster_ValidateRestore_MaximumSet_Gen", + "description": "CloudHsmCluster_ValidateRestore_MaximumSet_Gen", + "filePath": "2025-03-31/CloudHsmCluster_RequestOrValidate_Restore_MaximumSet_Gen_ValidateRestoreProperties.json", + "parameters": [ + { + "parameter": { + "$ref": "1050" + }, + "value": { + "$id": "1071", + "kind": "string", + "type": { + "$ref": "1051" + }, + "value": "2025-03-31" + } + }, + { + "parameter": { + "$ref": "1058" + }, + "value": { + "$id": "1072", + "kind": "string", + "type": { + "$ref": "1059" + }, + "value": "chsm1" + } + }, + { + "parameter": { + "$ref": "1056" + }, + "value": { + "$id": "1073", + "kind": "string", + "type": { + "$ref": "1057" + }, + "value": "rgcloudhsm" + } + }, + { + "parameter": { + "$ref": "1062" + }, + "value": { + "$id": "1074", + "kind": "model", + "type": { + "$ref": "397" + }, + "value": { + "azureStorageBlobContainerUri": { + "$id": "1075", + "kind": "string", + "type": { + "$ref": "373" + }, + "value": "https://myaccount.blob.core.windows.net/sascontainer/sasContainer" + }, + "backupId": { + "$id": "1076", + "kind": "string", + "type": { + "$ref": "399" + }, + "value": "backupId" + } + } + } + }, + { + "parameter": { + "$ref": "1053" + }, + "value": { + "$id": "1077", + "kind": "string", + "type": { + "$ref": "1054" + }, + "value": "00000000-0000-0000-0000-000000000000" + } + } + ], + "responses": [ + { + "response": { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "400" + }, + "headers": [ + { + "name": "requestId", + "nameInResponse": "x-ms-request-id", + "doc": "An opaque, globally-unique, server-generated string identifier for the request.", + "type": { + "$ref": "1068" + } + } + ], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + }, + "statusCode": 200, + "bodyValue": { + "$id": "1078", + "kind": "model", + "type": { + "$ref": "400" + }, + "value": { + "properties": { + "$id": "1079", + "kind": "model", + "type": { + "$ref": "379" + }, + "value": { + "endTime": { + "$id": "1080", + "kind": "string", + "type": { + "$ref": "389" + }, + "value": "2022-09-12T12:00:00.0000000Z" + }, + "jobId": { + "$id": "1081", + "kind": "string", + "type": { + "$ref": "392" + }, + "value": "572a45927fc240e1ac075de27371680b" + }, + "startTime": { + "$id": "1082", + "kind": "string", + "type": { + "$ref": "385" + }, + "value": "2022-09-12T12:00:00.0000000Z" + }, + "status": { + "$id": "1083", + "kind": "string", + "type": { + "$ref": "71" + }, + "value": "InProgress" + }, + "statusDetails": { + "$id": "1084", + "kind": "string", + "type": { + "$ref": "382" + }, + "value": "Restore operation is in progress" + } + } + } + } + } + }, + { + "response": { + "statusCodes": [ + 202 + ], + "headers": [ + { + "name": "azureAsyncOperation", + "nameInResponse": "Azure-AsyncOperation", + "doc": "A link to the status monitor", + "type": { + "$ref": "1063" + } + }, + { + "name": "location", + "nameInResponse": "Location", + "doc": "The Location header contains the URL where the status of the long running operation can be checked.", + "type": { + "$ref": "1064" + } + }, + { + "name": "retryAfter", + "nameInResponse": "Retry-After", + "doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "type": { + "$ref": "1065" + } + }, + { + "name": "requestId", + "nameInResponse": "x-ms-request-id", + "doc": "An opaque, globally-unique, server-generated string identifier for the request.", + "type": { + "$ref": "1066" + } + } + ], + "isErrorResponse": false + }, + "statusCode": 202 + } + ] + } + ] + }, + "parameters": [ + { + "$id": "1085", + "kind": "method", + "name": "resourceGroupName", + "serializedName": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1086", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.validateRestoreProperties.resourceGroupName", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "1087", + "kind": "method", + "name": "cloudHsmClusterName", + "serializedName": "cloudHsmClusterName", + "doc": "The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length.", + "type": { + "$id": "1088", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.validateRestoreProperties.cloudHsmClusterName", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "1089", + "kind": "method", + "name": "restoreRequestProperties", + "serializedName": "restoreRequestProperties", + "doc": "Optional Parameters to validate prior performing a restore operation.", + "type": { + "$ref": "397" + }, + "location": "Body", + "isApiVersion": false, + "optional": true, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.validateRestoreProperties.body", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "1090", + "kind": "method", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$id": "1091", + "kind": "enum", + "name": "validateRestorePropertiesContentType", + "crossLanguageDefinitionId": "", + "valueType": { + "$id": "1092", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "values": [ + { + "$id": "1093", + "kind": "enumvalue", + "name": "application/json", + "value": "application/json", + "valueType": { + "$id": "1094", + "kind": "string", + "decorators": [], + "doc": "A sequence of textual characters.", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "enumType": { + "$ref": "1091" + }, + "decorators": [] + } + ], + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "isFixed": false, + "isFlags": false, + "usage": "None", + "decorators": [] + }, + "location": "Header", + "isApiVersion": false, + "optional": true, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.validateRestoreProperties.contentType", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "1095", + "kind": "method", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "138" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.validateRestoreProperties.accept", + "readOnly": false, + "access": "public", + "decorators": [] + } + ], + "response": { + "type": { + "$ref": "400" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.validateRestoreProperties", + "lroMetadata": { + "finalStateVia": 0, + "finalResponse": { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "400" + } + } + } + }, + { + "$id": "1096", + "kind": "lro", + "name": "restore", + "accessibility": "public", + "apiVersions": [ + "2025-03-31" + ], + "doc": "Restores all key materials of a specified Cloud HSM Cluster", + "operation": { + "$id": "1097", + "name": "restore", + "resourceName": "CloudHsmClusters", + "doc": "Restores all key materials of a specified Cloud HSM Cluster", + "accessibility": "public", + "parameters": [ + { + "$id": "1098", + "kind": "query", + "name": "apiVersion", + "serializedName": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1099", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": true, + "explode": false, + "defaultValue": { + "type": { + "$id": "1100", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-31" + }, + "optional": false, + "scope": "Client", + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.restore.apiVersion", + "readOnly": false + }, + { + "$id": "1101", + "kind": "path", + "name": "subscriptionId", + "serializedName": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "1102", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1103", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Client", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.restore.subscriptionId" + }, + { + "$id": "1104", + "kind": "path", + "name": "resourceGroupName", + "serializedName": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1105", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.restore.resourceGroupName" + }, + { + "$id": "1106", + "kind": "path", + "name": "cloudHsmClusterName", + "serializedName": "cloudHsmClusterName", + "doc": "The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length.", + "type": { + "$id": "1107", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.restore.cloudHsmClusterName" + }, + { + "$id": "1108", + "kind": "header", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$ref": "140" + }, + "isApiVersion": false, + "optional": false, + "isContentType": true, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.restore.contentType" + }, + { + "$id": "1109", + "kind": "header", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "142" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.restore.accept" + }, + { + "$id": "1110", + "kind": "body", + "name": "restoreRequestProperties", + "serializedName": "restoreRequestProperties", + "doc": "Restore Operation Required properties", + "type": { + "$ref": "397" + }, + "isApiVersion": false, + "contentTypes": [ + "application/json" + ], + "defaultContentType": "application/json", + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.restore.body" + } + ], + "responses": [ + { + "statusCodes": [ + 202 + ], + "headers": [ + { + "name": "azureAsyncOperation", + "nameInResponse": "Azure-AsyncOperation", + "doc": "A link to the status monitor", + "type": { + "$id": "1111", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "name": "location", + "nameInResponse": "Location", + "doc": "The Location header contains the URL where the status of the long running operation can be checked.", + "type": { + "$id": "1112", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "name": "retryAfter", + "nameInResponse": "Retry-After", + "doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "type": { + "$id": "1113", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + }, + { + "name": "requestId", + "nameInResponse": "x-ms-request-id", + "doc": "An opaque, globally-unique, server-generated string identifier for the request.", + "type": { + "$id": "1114", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1115", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + } + } + ], + "isErrorResponse": false + }, + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "400" + }, + "headers": [ + { + "name": "requestId", + "nameInResponse": "x-ms-request-id", + "doc": "An opaque, globally-unique, server-generated string identifier for the request.", + "type": { + "$id": "1116", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1117", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + } + } + ], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "POST", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/restore", + "requestMediaTypes": [ + "application/json" + ], + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.restore", + "decorators": [ + { + "name": "Azure.ResourceManager.@armResourceAction", + "arguments": {} + } + ], + "examples": [ + { + "$id": "1118", + "kind": "http", + "name": "CloudHsmCluster_Restore_MaximumSet_Gen", + "description": "CloudHsmCluster_Restore_MaximumSet_Gen", + "filePath": "2025-03-31/CloudHsmCluster_RequestOrValidate_Restore_MaximumSet_Gen.json", + "parameters": [ + { + "parameter": { + "$ref": "1098" + }, + "value": { + "$id": "1119", + "kind": "string", + "type": { + "$ref": "1099" + }, + "value": "2025-03-31" + } + }, + { + "parameter": { + "$ref": "1106" + }, + "value": { + "$id": "1120", + "kind": "string", + "type": { + "$ref": "1107" + }, + "value": "chsm1" + } + }, + { + "parameter": { + "$ref": "1104" + }, + "value": { + "$id": "1121", + "kind": "string", + "type": { + "$ref": "1105" + }, + "value": "rgcloudhsm" + } + }, + { + "parameter": { + "$ref": "1110" + }, + "value": { + "$id": "1122", + "kind": "model", + "type": { + "$ref": "397" + }, + "value": { + "azureStorageBlobContainerUri": { + "$id": "1123", + "kind": "string", + "type": { + "$ref": "373" + }, + "value": "https://myaccount.blob.core.windows.net/sascontainer/sasContainer" + }, + "backupId": { + "$id": "1124", + "kind": "string", + "type": { + "$ref": "399" + }, + "value": "backupId" + } + } + } + }, + { + "parameter": { + "$ref": "1101" + }, + "value": { + "$id": "1125", + "kind": "string", + "type": { + "$ref": "1102" + }, + "value": "00000000-0000-0000-0000-000000000000" + } + } + ], + "responses": [ + { + "response": { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "400" + }, + "headers": [ + { + "name": "requestId", + "nameInResponse": "x-ms-request-id", + "doc": "An opaque, globally-unique, server-generated string identifier for the request.", + "type": { + "$ref": "1116" + } + } + ], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + }, + "statusCode": 200, + "bodyValue": { + "$id": "1126", + "kind": "model", + "type": { + "$ref": "400" + }, + "value": { + "properties": { + "$id": "1127", + "kind": "model", + "type": { + "$ref": "379" + }, + "value": { + "endTime": { + "$id": "1128", + "kind": "string", + "type": { + "$ref": "389" + }, + "value": "2022-09-12T12:00:00.0000000Z" + }, + "jobId": { + "$id": "1129", + "kind": "string", + "type": { + "$ref": "392" + }, + "value": "572a45927fc240e1ac075de27371680b" + }, + "startTime": { + "$id": "1130", + "kind": "string", + "type": { + "$ref": "385" + }, + "value": "2022-09-12T12:00:00.0000000Z" + }, + "status": { + "$id": "1131", + "kind": "string", + "type": { + "$ref": "71" + }, + "value": "InProgress" + }, + "statusDetails": { + "$id": "1132", + "kind": "string", + "type": { + "$ref": "382" + }, + "value": "Restore operation is in progress" + } + } + } + } + } + }, + { + "response": { + "statusCodes": [ + 202 + ], + "headers": [ + { + "name": "azureAsyncOperation", + "nameInResponse": "Azure-AsyncOperation", + "doc": "A link to the status monitor", + "type": { + "$ref": "1111" + } + }, + { + "name": "location", + "nameInResponse": "Location", + "doc": "The Location header contains the URL where the status of the long running operation can be checked.", + "type": { + "$ref": "1112" + } + }, + { + "name": "retryAfter", + "nameInResponse": "Retry-After", + "doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "type": { + "$ref": "1113" + } + }, + { + "name": "requestId", + "nameInResponse": "x-ms-request-id", + "doc": "An opaque, globally-unique, server-generated string identifier for the request.", + "type": { + "$ref": "1114" + } + } + ], + "isErrorResponse": false + }, + "statusCode": 202 + } + ] + } + ] + }, + "parameters": [ + { + "$id": "1133", + "kind": "method", + "name": "resourceGroupName", + "serializedName": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1134", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.restore.resourceGroupName", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "1135", + "kind": "method", + "name": "cloudHsmClusterName", + "serializedName": "cloudHsmClusterName", + "doc": "The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length.", + "type": { + "$id": "1136", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.restore.cloudHsmClusterName", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "1137", + "kind": "method", + "name": "restoreRequestProperties", + "serializedName": "restoreRequestProperties", + "doc": "Restore Operation Required properties", + "type": { + "$ref": "397" + }, + "location": "Body", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.restore.body", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "1138", + "kind": "method", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$ref": "144" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.restore.contentType", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "1139", + "kind": "method", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "146" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.restore.accept", + "readOnly": false, + "access": "public", + "decorators": [] + } + ], + "response": { + "type": { + "$ref": "400" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.restore", + "lroMetadata": { + "finalStateVia": 0, + "finalResponse": { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "400" + } + } + } + } + ], + "parameters": [ + { + "$id": "1140", + "kind": "endpoint", + "name": "endpoint", + "serializedName": "endpoint", + "doc": "Service host", + "type": { + "$id": "1141", + "kind": "url", + "name": "endpoint", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "isApiVersion": false, + "optional": false, + "scope": "Client", + "isEndpoint": true, + "defaultValue": { + "type": { + "$id": "1142", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "https://management.azure.com" + }, + "serverUrlTemplate": "{endpoint}", + "skipUrlEncoding": false, + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.endpoint" + }, + { + "$id": "1143", + "kind": "method", + "name": "apiVersion", + "serializedName": "apiVersion", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1144", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "", + "isApiVersion": true, + "defaultValue": { + "type": { + "$id": "1145", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-31" + }, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.get.apiVersion", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$ref": "504" + } + ], + "initializedBy": 0, + "decorators": [ + { + "name": "Azure.ResourceManager.@armResourceOperations", + "arguments": {} + } + ], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters", + "apiVersions": [ + "2025-03-31" + ], + "parent": { + "$ref": "497" + } + }, + { + "$id": "1146", + "kind": "client", + "name": "PrivateEndpointConnections", + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "methods": [ + { + "$id": "1147", + "kind": "basic", + "name": "get", + "accessibility": "public", + "apiVersions": [ + "2025-03-31" + ], + "doc": "Gets the private endpoint connection for the Cloud Hsm Cluster.", + "operation": { + "$id": "1148", + "name": "get", + "resourceName": "PrivateEndpointConnection", + "doc": "Gets the private endpoint connection for the Cloud Hsm Cluster.", + "accessibility": "public", + "parameters": [ + { + "$id": "1149", + "kind": "query", + "name": "apiVersion", + "serializedName": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1150", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": true, + "explode": false, + "defaultValue": { + "type": { + "$id": "1151", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-31" + }, + "optional": false, + "scope": "Client", + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnections.get.apiVersion", + "readOnly": false + }, + { + "$id": "1152", + "kind": "path", + "name": "subscriptionId", + "serializedName": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "1153", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1154", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Client", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnections.get.subscriptionId" + }, + { + "$id": "1155", + "kind": "path", + "name": "resourceGroupName", + "serializedName": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1156", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnections.get.resourceGroupName" + }, + { + "$id": "1157", + "kind": "path", + "name": "cloudHsmClusterName", + "serializedName": "cloudHsmClusterName", + "doc": "The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length.", + "type": { + "$id": "1158", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnections.get.cloudHsmClusterName" + }, + { + "$id": "1159", + "kind": "path", + "name": "peConnectionName", + "serializedName": "peConnectionName", + "doc": "Name of the private endpoint connection associated with the Cloud HSM Cluster.", + "type": { + "$id": "1160", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnections.get.peConnectionName" + }, + { + "$id": "1161", + "kind": "header", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "148" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnections.get.accept" + } + ], + "responses": [ + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "285" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections/{peConnectionName}", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnections.get", + "decorators": [ + { + "name": "Azure.ResourceManager.@armResourceRead", + "arguments": {} + } + ] + }, + "parameters": [ + { + "$id": "1162", + "kind": "method", + "name": "resourceGroupName", + "serializedName": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1163", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnections.get.resourceGroupName", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "1164", + "kind": "method", + "name": "cloudHsmClusterName", + "serializedName": "cloudHsmClusterName", + "doc": "The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length.", + "type": { + "$id": "1165", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnections.get.cloudHsmClusterName", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "1166", + "kind": "method", + "name": "peConnectionName", + "serializedName": "peConnectionName", + "doc": "Name of the private endpoint connection associated with the Cloud HSM Cluster.", + "type": { + "$id": "1167", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnections.get.peConnectionName", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "1168", + "kind": "method", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "148" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnections.get.accept", + "readOnly": false, + "access": "public", + "decorators": [] + } + ], + "response": { + "type": { + "$ref": "285" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnections.get" + }, + { + "$id": "1169", + "kind": "basic", + "name": "create", + "accessibility": "public", + "apiVersions": [ + "2025-03-31" + ], + "doc": "Creates or updates the private endpoint connection for the Cloud Hsm Cluster.", + "operation": { + "$id": "1170", + "name": "create", + "resourceName": "PrivateEndpointConnection", + "doc": "Creates or updates the private endpoint connection for the Cloud Hsm Cluster.", + "accessibility": "public", + "parameters": [ + { + "$id": "1171", + "kind": "query", + "name": "apiVersion", + "serializedName": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1172", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": true, + "explode": false, + "defaultValue": { + "type": { + "$id": "1173", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-31" + }, + "optional": false, + "scope": "Client", + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnections.create.apiVersion", + "readOnly": false + }, + { + "$id": "1174", + "kind": "path", + "name": "subscriptionId", + "serializedName": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "1175", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1176", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Client", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnections.create.subscriptionId" + }, + { + "$id": "1177", + "kind": "path", + "name": "resourceGroupName", + "serializedName": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1178", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnections.create.resourceGroupName" + }, + { + "$id": "1179", + "kind": "path", + "name": "cloudHsmClusterName", + "serializedName": "cloudHsmClusterName", + "doc": "The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length.", + "type": { + "$id": "1180", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnections.create.cloudHsmClusterName" + }, + { + "$id": "1181", + "kind": "path", + "name": "peConnectionName", + "serializedName": "peConnectionName", + "doc": "Name of the private endpoint connection associated with the Cloud HSM Cluster.", + "type": { + "$id": "1182", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnections.create.peConnectionName" + }, + { + "$id": "1183", + "kind": "header", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$ref": "150" + }, + "isApiVersion": false, + "optional": false, + "isContentType": true, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnections.create.contentType" + }, + { + "$id": "1184", + "kind": "header", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "152" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnections.create.accept" + }, + { + "$id": "1185", + "kind": "body", + "name": "properties", + "serializedName": "properties", + "doc": "Parameters of the PrivateEndpointConnection", + "type": { + "$ref": "285" + }, + "isApiVersion": false, + "contentTypes": [ + "application/json" + ], + "defaultContentType": "application/json", + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnections.create.resource" + } + ], + "responses": [ + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "285" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "PUT", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections/{peConnectionName}", + "requestMediaTypes": [ + "application/json" + ], + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnections.create", + "decorators": [ + { + "name": "Azure.ResourceManager.@armResourceCreateOrUpdate", + "arguments": {} + } + ] + }, + "parameters": [ + { + "$id": "1186", + "kind": "method", + "name": "resourceGroupName", + "serializedName": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1187", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnections.create.resourceGroupName", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "1188", + "kind": "method", + "name": "cloudHsmClusterName", + "serializedName": "cloudHsmClusterName", + "doc": "The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length.", + "type": { + "$id": "1189", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnections.create.cloudHsmClusterName", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "1190", + "kind": "method", + "name": "peConnectionName", + "serializedName": "peConnectionName", + "doc": "Name of the private endpoint connection associated with the Cloud HSM Cluster.", + "type": { + "$id": "1191", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnections.create.peConnectionName", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "1192", + "kind": "method", + "name": "properties", + "serializedName": "properties", + "doc": "Parameters of the PrivateEndpointConnection", + "type": { + "$ref": "285" + }, + "location": "Body", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnections.create.resource", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "1193", + "kind": "method", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$ref": "150" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnections.create.contentType", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "1194", + "kind": "method", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "152" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnections.create.accept", + "readOnly": false, + "access": "public", + "decorators": [] + } + ], + "response": { + "type": { + "$ref": "285" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnections.create" + }, + { + "$id": "1195", + "kind": "lro", + "name": "delete", + "accessibility": "public", + "apiVersions": [ + "2025-03-31" + ], + "doc": "Deletes the private endpoint connection for the Cloud Hsm Cluster.", + "operation": { + "$id": "1196", + "name": "delete", + "resourceName": "PrivateEndpointConnection", + "doc": "Deletes the private endpoint connection for the Cloud Hsm Cluster.", + "accessibility": "public", + "parameters": [ + { + "$id": "1197", + "kind": "query", + "name": "apiVersion", + "serializedName": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1198", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": true, + "explode": false, + "defaultValue": { + "type": { + "$id": "1199", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-31" + }, + "optional": false, + "scope": "Client", + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnections.delete.apiVersion", + "readOnly": false + }, + { + "$id": "1200", + "kind": "path", + "name": "subscriptionId", + "serializedName": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "1201", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1202", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Client", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnections.delete.subscriptionId" + }, + { + "$id": "1203", + "kind": "path", + "name": "resourceGroupName", + "serializedName": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1204", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnections.delete.resourceGroupName" + }, + { + "$id": "1205", + "kind": "path", + "name": "cloudHsmClusterName", + "serializedName": "cloudHsmClusterName", + "doc": "The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length.", + "type": { + "$id": "1206", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnections.delete.cloudHsmClusterName" + }, + { + "$id": "1207", + "kind": "path", + "name": "peConnectionName", + "serializedName": "peConnectionName", + "doc": "Name of the private endpoint connection associated with the Cloud HSM Cluster.", + "type": { + "$id": "1208", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnections.delete.peConnectionName" + } + ], + "responses": [ + { + "statusCodes": [ + 202 + ], + "headers": [ + { + "name": "location", + "nameInResponse": "Location", + "doc": "The Location header contains the URL where the status of the long running operation can be checked.", + "type": { + "$id": "1209", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "name": "retryAfter", + "nameInResponse": "Retry-After", + "doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "type": { + "$id": "1210", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "isErrorResponse": false + }, + { + "statusCodes": [ + 204 + ], + "headers": [], + "isErrorResponse": false + } + ], + "httpMethod": "DELETE", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections/{peConnectionName}", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnections.delete", + "decorators": [ + { + "name": "Azure.ResourceManager.@armResourceDelete", + "arguments": {} + } + ] + }, + "parameters": [ + { + "$id": "1211", + "kind": "method", + "name": "resourceGroupName", + "serializedName": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1212", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnections.delete.resourceGroupName", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "1213", + "kind": "method", + "name": "cloudHsmClusterName", + "serializedName": "cloudHsmClusterName", + "doc": "The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length.", + "type": { + "$id": "1214", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnections.delete.cloudHsmClusterName", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "1215", + "kind": "method", + "name": "peConnectionName", + "serializedName": "peConnectionName", + "doc": "Name of the private endpoint connection associated with the Cloud HSM Cluster.", + "type": { + "$id": "1216", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnections.delete.peConnectionName", + "readOnly": false, + "access": "public", + "decorators": [] + } + ], + "response": {}, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnections.delete", + "lroMetadata": { + "finalStateVia": 1, + "finalResponse": { + "statusCodes": [ + 204 + ] + } + } + }, + { + "$id": "1217", + "kind": "paging", + "name": "listByCloudHsmCluster", + "accessibility": "public", + "apiVersions": [ + "2025-03-31" + ], + "doc": "The List operation gets information about the private endpoint connections associated with the Cloud HSM Cluster", + "operation": { + "$id": "1218", + "name": "listByCloudHsmCluster", + "resourceName": "PrivateEndpointConnection", + "doc": "The List operation gets information about the private endpoint connections associated with the Cloud HSM Cluster", + "accessibility": "public", + "parameters": [ + { + "$id": "1219", + "kind": "query", + "name": "apiVersion", + "serializedName": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1220", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": true, + "explode": false, + "defaultValue": { + "type": { + "$id": "1221", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-31" + }, + "optional": false, + "scope": "Client", + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnections.listByCloudHsmCluster.apiVersion", + "readOnly": false + }, + { + "$id": "1222", + "kind": "path", + "name": "subscriptionId", + "serializedName": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "1223", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1224", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Client", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnections.listByCloudHsmCluster.subscriptionId" + }, + { + "$id": "1225", + "kind": "path", + "name": "resourceGroupName", + "serializedName": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1226", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnections.listByCloudHsmCluster.resourceGroupName" + }, + { + "$id": "1227", + "kind": "path", + "name": "cloudHsmClusterName", + "serializedName": "cloudHsmClusterName", + "doc": "The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length.", + "type": { + "$id": "1228", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnections.listByCloudHsmCluster.cloudHsmClusterName" + }, + { + "$id": "1229", + "kind": "header", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "154" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnections.listByCloudHsmCluster.accept" + } + ], + "responses": [ + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "402" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnections.listByCloudHsmCluster", + "decorators": [ + { + "name": "Azure.ResourceManager.@armResourceList", + "arguments": {} + } + ], + "examples": [ + { + "$id": "1230", + "kind": "http", + "name": "CloudHsmClusterPrivateEndpointConnection_ListByResource_MaximumSet_Gen", + "description": "CloudHsmClusterPrivateEndpointConnection_ListByResource_MaximumSet_Gen", + "filePath": "2025-03-31/CloudHsmClusterPrivateEndpointConnection_ListByCloudHsmCluster_MaximumSet_Gen.json", + "parameters": [ + { + "parameter": { + "$ref": "1219" + }, + "value": { + "$id": "1231", + "kind": "string", + "type": { + "$ref": "1220" + }, + "value": "2025-03-31" + } + }, + { + "parameter": { + "$ref": "1227" + }, + "value": { + "$id": "1232", + "kind": "string", + "type": { + "$ref": "1228" + }, + "value": "chsm1" + } + }, + { + "parameter": { + "$ref": "1225" + }, + "value": { + "$id": "1233", + "kind": "string", + "type": { + "$ref": "1226" + }, + "value": "rgcloudhsm" + } + }, + { + "parameter": { + "$ref": "1222" + }, + "value": { + "$id": "1234", + "kind": "string", + "type": { + "$ref": "1223" + }, + "value": "00000000-0000-0000-0000-000000000000" + } + } + ], + "responses": [ + { + "response": { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "402" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + }, + "statusCode": 200, + "bodyValue": { + "$id": "1235", + "kind": "model", + "type": { + "$ref": "402" + }, + "value": { + "value": { + "$id": "1236", + "kind": "array", + "type": { + "$ref": "284" + }, + "value": [ + { + "$id": "1237", + "kind": "model", + "type": { + "$ref": "285" + }, + "value": { + "name": { + "$id": "1238", + "kind": "string", + "type": { + "$ref": "310" + }, + "value": "chsm1" + }, + "type": { + "$id": "1239", + "kind": "string", + "type": { + "$ref": "247" + }, + "value": "Microsoft.HardwareSecurityModules/cloudHsmClusters/privateEndpointConnections" + }, + "id": { + "$id": "1240", + "kind": "string", + "type": { + "$ref": "242" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgcloudhsm/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/chsm1/privateEndpointConnections/sample-pec1" + }, + "properties": { + "$id": "1241", + "kind": "model", + "type": { + "$ref": "292" + }, + "value": { + "privateEndpoint": { + "$id": "1242", + "kind": "model", + "type": { + "$ref": "294" + }, + "value": { + "id": { + "$id": "1243", + "kind": "string", + "type": { + "$ref": "296" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgcloudhsm/providers/Microsoft.Network/privateEndpoints/sample-pec1" + } + } + }, + "privateLinkServiceConnectionState": { + "$id": "1244", + "kind": "model", + "type": { + "$ref": "299" + }, + "value": { + "description": { + "$id": "1245", + "kind": "string", + "type": { + "$ref": "302" + }, + "value": "This was automatically approved by user1234@contoso.com" + }, + "actionsRequired": { + "$id": "1246", + "kind": "string", + "type": { + "$ref": "304" + }, + "value": "None" + }, + "status": { + "$id": "1247", + "kind": "string", + "type": { + "$ref": "22" + }, + "value": "Approved" + } + } + }, + "provisioningState": { + "$id": "1248", + "kind": "string", + "type": { + "$ref": "27" + }, + "value": "Succeeded" + } + } + }, + "systemData": { + "$id": "1249", + "kind": "model", + "type": { + "$ref": "250" + }, + "value": { + "createdAt": { + "$id": "1250", + "kind": "string", + "type": { + "$ref": "255" + }, + "value": "2020-01-01T12:00:00.0000000Z" + }, + "createdBy": { + "$id": "1251", + "kind": "string", + "type": { + "$ref": "252" + }, + "value": "User1" + }, + "createdByType": { + "$id": "1252", + "kind": "string", + "type": { + "$ref": "36" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "1253", + "kind": "string", + "type": { + "$ref": "261" + }, + "value": "2020-01-01T12:00:00.0000000Z" + }, + "lastModifiedBy": { + "$id": "1254", + "kind": "string", + "type": { + "$ref": "258" + }, + "value": "User2" + }, + "lastModifiedByType": { + "$id": "1255", + "kind": "string", + "type": { + "$ref": "36" + }, + "value": "User" + } + } + } + } + }, + { + "$id": "1256", + "kind": "model", + "type": { + "$ref": "285" + }, + "value": { + "name": { + "$id": "1257", + "kind": "string", + "type": { + "$ref": "310" + }, + "value": "chsm2" + }, + "type": { + "$id": "1258", + "kind": "string", + "type": { + "$ref": "247" + }, + "value": "Microsoft.HardwareSecurityModules/cloudHsmClusters/privateEndpointConnections" + }, + "id": { + "$id": "1259", + "kind": "string", + "type": { + "$ref": "242" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgcloudhsm/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/chsm2/privateEndpointConnections/sample-pec2" + }, + "properties": { + "$id": "1260", + "kind": "model", + "type": { + "$ref": "292" + }, + "value": { + "privateEndpoint": { + "$id": "1261", + "kind": "model", + "type": { + "$ref": "294" + }, + "value": { + "id": { + "$id": "1262", + "kind": "string", + "type": { + "$ref": "296" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgcloudhsm/providers/Microsoft.Network/privateEndpoints/sample-pec2" + } + } + }, + "privateLinkServiceConnectionState": { + "$id": "1263", + "kind": "model", + "type": { + "$ref": "299" + }, + "value": { + "description": { + "$id": "1264", + "kind": "string", + "type": { + "$ref": "302" + }, + "value": "This was automatically approved by user1234@contoso.com" + }, + "actionsRequired": { + "$id": "1265", + "kind": "string", + "type": { + "$ref": "304" + }, + "value": "None" + }, + "status": { + "$id": "1266", + "kind": "string", + "type": { + "$ref": "22" + }, + "value": "Approved" + } + } + }, + "provisioningState": { + "$id": "1267", + "kind": "string", + "type": { + "$ref": "27" + }, + "value": "Succeeded" + } + } + }, + "systemData": { + "$id": "1268", + "kind": "model", + "type": { + "$ref": "250" + }, + "value": { + "createdAt": { + "$id": "1269", + "kind": "string", + "type": { + "$ref": "255" + }, + "value": "2020-01-01T12:00:00.0000000Z" + }, + "createdBy": { + "$id": "1270", + "kind": "string", + "type": { + "$ref": "252" + }, + "value": "User1" + }, + "createdByType": { + "$id": "1271", + "kind": "string", + "type": { + "$ref": "36" + }, + "value": "User" + }, + "lastModifiedAt": { + "$id": "1272", + "kind": "string", + "type": { + "$ref": "261" + }, + "value": "2020-01-01T12:00:00.0000000Z" + }, + "lastModifiedBy": { + "$id": "1273", + "kind": "string", + "type": { + "$ref": "258" + }, + "value": "User2" + }, + "lastModifiedByType": { + "$id": "1274", + "kind": "string", + "type": { + "$ref": "36" + }, + "value": "User" + } + } + } + } + } + ] + } + } + } + } + ] + } + ] + }, + "parameters": [ + { + "$id": "1275", + "kind": "method", + "name": "resourceGroupName", + "serializedName": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1276", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnections.listByCloudHsmCluster.resourceGroupName", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "1277", + "kind": "method", + "name": "cloudHsmClusterName", + "serializedName": "cloudHsmClusterName", + "doc": "The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length.", + "type": { + "$id": "1278", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnections.listByCloudHsmCluster.cloudHsmClusterName", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "1279", + "kind": "method", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "154" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnections.listByCloudHsmCluster.accept", + "readOnly": false, + "access": "public", + "decorators": [] + } + ], + "response": { + "type": { + "$ref": "284" + }, + "resultSegments": [ + "value" + ] + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnections.listByCloudHsmCluster", + "pagingMetadata": { + "itemPropertySegments": [ + "value" + ], + "nextLink": { + "responseSegments": [ + "nextLink" + ], + "responseLocation": "Body" + } + } + } + ], + "parameters": [ + { + "$id": "1280", + "kind": "endpoint", + "name": "endpoint", + "serializedName": "endpoint", + "doc": "Service host", + "type": { + "$id": "1281", + "kind": "url", + "name": "endpoint", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "isApiVersion": false, + "optional": false, + "scope": "Client", + "isEndpoint": true, + "defaultValue": { + "type": { + "$id": "1282", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "https://management.azure.com" + }, + "serverUrlTemplate": "{endpoint}", + "skipUrlEncoding": false, + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.endpoint" + }, + { + "$id": "1283", + "kind": "method", + "name": "apiVersion", + "serializedName": "apiVersion", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1284", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "", + "isApiVersion": true, + "defaultValue": { + "type": { + "$id": "1285", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-31" + }, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnections.get.apiVersion", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "1286", + "kind": "method", + "name": "subscriptionId", + "serializedName": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "1287", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1288", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnections.get.subscriptionId", + "readOnly": false, + "access": "public", + "decorators": [] + } + ], + "initializedBy": 0, + "decorators": [ + { + "name": "Azure.ResourceManager.@armResourceOperations", + "arguments": {} + } + ], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.PrivateEndpointConnections", + "apiVersions": [ + "2025-03-31" + ], + "parent": { + "$ref": "497" + } + }, + { + "$id": "1289", + "kind": "client", + "name": "DedicatedHsms", + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "methods": [ + { + "$id": "1290", + "kind": "basic", + "name": "get", + "accessibility": "public", + "apiVersions": [ + "2025-03-31" + ], + "doc": "Gets the specified Azure dedicated HSM.", + "operation": { + "$id": "1291", + "name": "get", + "resourceName": "DedicatedHsm", + "doc": "Gets the specified Azure dedicated HSM.", + "accessibility": "public", + "parameters": [ + { + "$id": "1292", + "kind": "query", + "name": "apiVersion", + "serializedName": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1293", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": true, + "explode": false, + "defaultValue": { + "type": { + "$id": "1294", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-31" + }, + "optional": false, + "scope": "Client", + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.get.apiVersion", + "readOnly": false + }, + { + "$id": "1295", + "kind": "path", + "name": "subscriptionId", + "serializedName": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "1296", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1297", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Client", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.get.subscriptionId" + }, + { + "$id": "1298", + "kind": "path", + "name": "resourceGroupName", + "serializedName": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1299", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.get.resourceGroupName" + }, + { + "$id": "1300", + "kind": "path", + "name": "name", + "serializedName": "name", + "doc": "Name of the dedicated Hsm", + "type": { + "$id": "1301", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.get.name" + }, + { + "$id": "1302", + "kind": "header", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "156" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.get.accept" + } + ], + "responses": [ + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "407" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.get", + "decorators": [ + { + "name": "Azure.ResourceManager.@armResourceRead", + "arguments": {} + } + ] + }, + "parameters": [ + { + "$id": "1303", + "kind": "method", + "name": "resourceGroupName", + "serializedName": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1304", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.get.resourceGroupName", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "1305", + "kind": "method", + "name": "name", + "serializedName": "name", + "doc": "Name of the dedicated Hsm", + "type": { + "$id": "1306", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.get.name", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "1307", + "kind": "method", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "156" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.get.accept", + "readOnly": false, + "access": "public", + "decorators": [] + } + ], + "response": { + "type": { + "$ref": "407" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.get" + }, + { + "$id": "1308", + "kind": "lro", + "name": "createOrUpdate", + "accessibility": "public", + "apiVersions": [ + "2025-03-31" + ], + "doc": "Create or Update a dedicated HSM in the specified subscription.", + "operation": { + "$id": "1309", + "name": "createOrUpdate", + "resourceName": "DedicatedHsm", + "doc": "Create or Update a dedicated HSM in the specified subscription.", + "accessibility": "public", + "parameters": [ + { + "$id": "1310", + "kind": "query", + "name": "apiVersion", + "serializedName": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1311", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": true, + "explode": false, + "defaultValue": { + "type": { + "$id": "1312", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-31" + }, + "optional": false, + "scope": "Client", + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.createOrUpdate.apiVersion", + "readOnly": false + }, + { + "$id": "1313", + "kind": "path", + "name": "subscriptionId", + "serializedName": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "1314", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1315", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Client", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.createOrUpdate.subscriptionId" + }, + { + "$id": "1316", + "kind": "path", + "name": "resourceGroupName", + "serializedName": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1317", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.createOrUpdate.resourceGroupName" + }, + { + "$id": "1318", + "kind": "path", + "name": "name", + "serializedName": "name", + "doc": "Name of the dedicated Hsm", + "type": { + "$id": "1319", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.createOrUpdate.name" + }, + { + "$id": "1320", + "kind": "header", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$ref": "158" + }, + "isApiVersion": false, + "optional": false, + "isContentType": true, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.createOrUpdate.contentType" + }, + { + "$id": "1321", + "kind": "header", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "160" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.createOrUpdate.accept" + }, + { + "$id": "1322", + "kind": "body", + "name": "parameters", + "serializedName": "parameters", + "doc": "Parameters to create or update the dedicated hsm", + "type": { + "$ref": "407" + }, + "isApiVersion": false, + "contentTypes": [ + "application/json" + ], + "defaultContentType": "application/json", + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.createOrUpdate.resource" + } + ], + "responses": [ + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "407" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + }, + { + "statusCodes": [ + 201 + ], + "bodyType": { + "$ref": "407" + }, + "headers": [ + { + "name": "azureAsyncOperation", + "nameInResponse": "Azure-AsyncOperation", + "doc": "A link to the status monitor", + "type": { + "$id": "1323", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "name": "retryAfter", + "nameInResponse": "Retry-After", + "doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "type": { + "$id": "1324", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "PUT", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}", + "requestMediaTypes": [ + "application/json" + ], + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.createOrUpdate", + "decorators": [ + { + "name": "Azure.ResourceManager.@armResourceCreateOrUpdate", + "arguments": {} + } + ] + }, + "parameters": [ + { + "$id": "1325", + "kind": "method", + "name": "resourceGroupName", + "serializedName": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1326", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.createOrUpdate.resourceGroupName", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "1327", + "kind": "method", + "name": "name", + "serializedName": "name", + "doc": "Name of the dedicated Hsm", + "type": { + "$id": "1328", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.createOrUpdate.name", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "1329", + "kind": "method", + "name": "parameters", + "serializedName": "parameters", + "doc": "Parameters to create or update the dedicated hsm", + "type": { + "$ref": "407" + }, + "location": "Body", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.createOrUpdate.resource", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "1330", + "kind": "method", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$ref": "162" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.createOrUpdate.contentType", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "1331", + "kind": "method", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "164" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.createOrUpdate.accept", + "readOnly": false, + "access": "public", + "decorators": [] + } + ], + "response": { + "type": { + "$ref": "407" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.createOrUpdate", + "lroMetadata": { + "finalStateVia": 0, + "finalResponse": { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "407" + } + } + } + }, + { + "$id": "1332", + "kind": "lro", + "name": "update", + "accessibility": "public", + "apiVersions": [ + "2025-03-31" + ], + "doc": "Update a dedicated HSM in the specified subscription.", + "operation": { + "$id": "1333", + "name": "update", + "resourceName": "DedicatedHsm", + "doc": "Update a dedicated HSM in the specified subscription.", + "accessibility": "public", + "parameters": [ + { + "$id": "1334", + "kind": "query", + "name": "apiVersion", + "serializedName": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1335", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": true, + "explode": false, + "defaultValue": { + "type": { + "$id": "1336", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-31" + }, + "optional": false, + "scope": "Client", + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.update.apiVersion", + "readOnly": false + }, + { + "$id": "1337", + "kind": "path", + "name": "subscriptionId", + "serializedName": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "1338", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1339", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Client", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.update.subscriptionId" + }, + { + "$id": "1340", + "kind": "path", + "name": "resourceGroupName", + "serializedName": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1341", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.update.resourceGroupName" + }, + { + "$id": "1342", + "kind": "path", + "name": "name", + "serializedName": "name", + "doc": "Name of the dedicated Hsm", + "type": { + "$id": "1343", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.update.name" + }, + { + "$id": "1344", + "kind": "header", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$ref": "166" + }, + "isApiVersion": false, + "optional": false, + "isContentType": true, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.update.contentType" + }, + { + "$id": "1345", + "kind": "header", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "168" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.update.accept" + }, + { + "$id": "1346", + "kind": "body", + "name": "parameters", + "serializedName": "parameters", + "doc": "Parameters to patch the dedicated HSM", + "type": { + "$ref": "452" + }, + "isApiVersion": false, + "contentTypes": [ + "application/json" + ], + "defaultContentType": "application/json", + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.update.properties" + } + ], + "responses": [ + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "407" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + }, + { + "statusCodes": [ + 202 + ], + "headers": [ + { + "name": "location", + "nameInResponse": "Location", + "doc": "The Location header contains the URL where the status of the long running operation can be checked.", + "type": { + "$id": "1347", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "name": "retryAfter", + "nameInResponse": "Retry-After", + "doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "type": { + "$id": "1348", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "isErrorResponse": false + } + ], + "httpMethod": "PATCH", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}", + "requestMediaTypes": [ + "application/json" + ], + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.update", + "decorators": [ + { + "name": "Azure.ResourceManager.@armResourceUpdate", + "arguments": {} + } + ] + }, + "parameters": [ + { + "$id": "1349", + "kind": "method", + "name": "resourceGroupName", + "serializedName": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1350", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.update.resourceGroupName", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "1351", + "kind": "method", + "name": "name", + "serializedName": "name", + "doc": "Name of the dedicated Hsm", + "type": { + "$id": "1352", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.update.name", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "1353", + "kind": "method", + "name": "parameters", + "serializedName": "parameters", + "doc": "Parameters to patch the dedicated HSM", + "type": { + "$ref": "452" + }, + "location": "Body", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.update.properties", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "1354", + "kind": "method", + "name": "contentType", + "serializedName": "Content-Type", + "doc": "Body parameter's content type. Known values are application/json", + "type": { + "$ref": "170" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.update.contentType", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "1355", + "kind": "method", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "172" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.update.accept", + "readOnly": false, + "access": "public", + "decorators": [] + } + ], + "response": { + "type": { + "$ref": "407" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.update", + "lroMetadata": { + "finalStateVia": 1, + "finalResponse": { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "407" + } + } + } + }, + { + "$id": "1356", + "kind": "lro", + "name": "delete", + "accessibility": "public", + "apiVersions": [ + "2025-03-31" + ], + "doc": "Deletes the specified Azure Dedicated HSM.", + "operation": { + "$id": "1357", + "name": "delete", + "resourceName": "DedicatedHsm", + "doc": "Deletes the specified Azure Dedicated HSM.", + "accessibility": "public", + "parameters": [ + { + "$id": "1358", + "kind": "query", + "name": "apiVersion", + "serializedName": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1359", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": true, + "explode": false, + "defaultValue": { + "type": { + "$id": "1360", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-31" + }, + "optional": false, + "scope": "Client", + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.delete.apiVersion", + "readOnly": false + }, + { + "$id": "1361", + "kind": "path", + "name": "subscriptionId", + "serializedName": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "1362", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1363", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Client", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.delete.subscriptionId" + }, + { + "$id": "1364", + "kind": "path", + "name": "resourceGroupName", + "serializedName": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1365", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.delete.resourceGroupName" + }, + { + "$id": "1366", + "kind": "path", + "name": "name", + "serializedName": "name", + "doc": "Name of the dedicated Hsm", + "type": { + "$id": "1367", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.delete.name" + } + ], + "responses": [ + { + "statusCodes": [ + 202 + ], + "headers": [ + { + "name": "location", + "nameInResponse": "Location", + "doc": "The Location header contains the URL where the status of the long running operation can be checked.", + "type": { + "$id": "1368", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "name": "retryAfter", + "nameInResponse": "Retry-After", + "doc": "The Retry-After header can indicate how long the client should wait before polling the operation status.", + "type": { + "$id": "1369", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + } + } + ], + "isErrorResponse": false + }, + { + "statusCodes": [ + 204 + ], + "headers": [], + "isErrorResponse": false + } + ], + "httpMethod": "DELETE", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.delete", + "decorators": [ + { + "name": "Azure.ResourceManager.@armResourceDelete", + "arguments": {} + } + ] + }, + "parameters": [ + { + "$id": "1370", + "kind": "method", + "name": "resourceGroupName", + "serializedName": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1371", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.delete.resourceGroupName", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "1372", + "kind": "method", + "name": "name", + "serializedName": "name", + "doc": "Name of the dedicated Hsm", + "type": { + "$id": "1373", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.delete.name", + "readOnly": false, + "access": "public", + "decorators": [] + } + ], + "response": {}, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.delete", + "lroMetadata": { + "finalStateVia": 1, + "finalResponse": { + "statusCodes": [ + 204 + ] + } + } + }, + { + "$id": "1374", + "kind": "paging", + "name": "listByResourceGroup", + "accessibility": "public", + "apiVersions": [ + "2025-03-31" + ], + "doc": "The List operation gets information about the dedicated HSMs associated with the subscription and within the specified resource group.", + "operation": { + "$id": "1375", + "name": "listByResourceGroup", + "resourceName": "DedicatedHsm", + "doc": "The List operation gets information about the dedicated HSMs associated with the subscription and within the specified resource group.", + "accessibility": "public", + "parameters": [ + { + "$id": "1376", + "kind": "query", + "name": "apiVersion", + "serializedName": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1377", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": true, + "explode": false, + "defaultValue": { + "type": { + "$id": "1378", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-31" + }, + "optional": false, + "scope": "Client", + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.listByResourceGroup.apiVersion", + "readOnly": false + }, + { + "$id": "1379", + "kind": "path", + "name": "subscriptionId", + "serializedName": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "1380", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1381", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Client", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.listByResourceGroup.subscriptionId" + }, + { + "$id": "1382", + "kind": "path", + "name": "resourceGroupName", + "serializedName": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1383", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.listByResourceGroup.resourceGroupName" + }, + { + "$id": "1384", + "kind": "query", + "name": "$top", + "serializedName": "$top", + "doc": "Maximum number of results to return.", + "type": { + "$id": "1385", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "optional": true, + "scope": "Method", + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.listByResourceGroup.$top", + "readOnly": false + }, + { + "$id": "1386", + "kind": "header", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "174" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.listByResourceGroup.accept" + } + ], + "responses": [ + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "454" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.listByResourceGroup", + "decorators": [ + { + "name": "Azure.ResourceManager.@armResourceList", + "arguments": {} + } + ] + }, + "parameters": [ + { + "$id": "1387", + "kind": "method", + "name": "resourceGroupName", + "serializedName": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1388", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.listByResourceGroup.resourceGroupName", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "1389", + "kind": "method", + "name": "$top", + "serializedName": "$top", + "doc": "Maximum number of results to return.", + "type": { + "$id": "1390", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "optional": true, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.listByResourceGroup.$top", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "1391", + "kind": "method", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "174" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.listByResourceGroup.accept", + "readOnly": false, + "access": "public", + "decorators": [] + } + ], + "response": { + "type": { + "$ref": "456" + }, + "resultSegments": [ + "value" + ] + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.listByResourceGroup", + "pagingMetadata": { + "itemPropertySegments": [ + "value" + ], + "nextLink": { + "responseSegments": [ + "nextLink" + ], + "responseLocation": "Body" + } + } + }, + { + "$id": "1392", + "kind": "paging", + "name": "listBySubscription", + "accessibility": "public", + "apiVersions": [ + "2025-03-31" + ], + "doc": "The List operation gets information about the dedicated HSMs associated with the subscription.", + "operation": { + "$id": "1393", + "name": "listBySubscription", + "resourceName": "DedicatedHsm", + "doc": "The List operation gets information about the dedicated HSMs associated with the subscription.", + "accessibility": "public", + "parameters": [ + { + "$id": "1394", + "kind": "query", + "name": "apiVersion", + "serializedName": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1395", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": true, + "explode": false, + "defaultValue": { + "type": { + "$id": "1396", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-31" + }, + "optional": false, + "scope": "Client", + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.listBySubscription.apiVersion", + "readOnly": false + }, + { + "$id": "1397", + "kind": "path", + "name": "subscriptionId", + "serializedName": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "1398", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1399", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Client", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.listBySubscription.subscriptionId" + }, + { + "$id": "1400", + "kind": "query", + "name": "$top", + "serializedName": "$top", + "doc": "Maximum number of results to return.", + "type": { + "$id": "1401", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "optional": true, + "scope": "Method", + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.listBySubscription.$top", + "readOnly": false + }, + { + "$id": "1402", + "kind": "header", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "176" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.listBySubscription.accept" + } + ], + "responses": [ + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "454" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.listBySubscription", + "decorators": [ + { + "name": "Azure.ResourceManager.@armResourceList", + "arguments": {} + } + ] + }, + "parameters": [ + { + "$id": "1403", + "kind": "method", + "name": "$top", + "serializedName": "$top", + "doc": "Maximum number of results to return.", + "type": { + "$id": "1404", + "kind": "int32", + "name": "int32", + "crossLanguageDefinitionId": "TypeSpec.int32", + "decorators": [] + }, + "location": "Query", + "isApiVersion": false, + "optional": true, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.listBySubscription.$top", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "1405", + "kind": "method", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "176" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.listBySubscription.accept", + "readOnly": false, + "access": "public", + "decorators": [] + } + ], + "response": { + "type": { + "$ref": "456" + }, + "resultSegments": [ + "value" + ] + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.listBySubscription", + "pagingMetadata": { + "itemPropertySegments": [ + "value" + ], + "nextLink": { + "responseSegments": [ + "nextLink" + ], + "responseLocation": "Body" + } + } + }, + { + "$id": "1406", + "kind": "paging", + "name": "listOutboundNetworkDependenciesEndpoints", + "accessibility": "public", + "apiVersions": [ + "2025-03-31" + ], + "doc": "Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified dedicated hsm resource. The operation returns properties of each egress endpoint.", + "operation": { + "$id": "1407", + "name": "listOutboundNetworkDependenciesEndpoints", + "resourceName": "DedicatedHsms", + "doc": "Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified dedicated hsm resource. The operation returns properties of each egress endpoint.", + "accessibility": "public", + "parameters": [ + { + "$id": "1408", + "kind": "query", + "name": "apiVersion", + "serializedName": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1409", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": true, + "explode": false, + "defaultValue": { + "type": { + "$id": "1410", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-31" + }, + "optional": false, + "scope": "Client", + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.listOutboundNetworkDependenciesEndpoints.apiVersion", + "readOnly": false + }, + { + "$id": "1411", + "kind": "path", + "name": "subscriptionId", + "serializedName": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "1412", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1413", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Client", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.listOutboundNetworkDependenciesEndpoints.subscriptionId" + }, + { + "$id": "1414", + "kind": "path", + "name": "resourceGroupName", + "serializedName": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1415", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.listOutboundNetworkDependenciesEndpoints.resourceGroupName" + }, + { + "$id": "1416", + "kind": "path", + "name": "name", + "serializedName": "name", + "doc": "Name of the dedicated Hsm", + "type": { + "$id": "1417", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.listOutboundNetworkDependenciesEndpoints.name" + }, + { + "$id": "1418", + "kind": "header", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "178" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.listOutboundNetworkDependenciesEndpoints.accept" + } + ], + "responses": [ + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "460" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}/outboundNetworkDependenciesEndpoints", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.listOutboundNetworkDependenciesEndpoints", + "decorators": [ + { + "name": "Azure.ResourceManager.@armResourceAction", + "arguments": {} + } + ] + }, + "parameters": [ + { + "$id": "1419", + "kind": "method", + "name": "resourceGroupName", + "serializedName": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1420", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.listOutboundNetworkDependenciesEndpoints.resourceGroupName", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "1421", + "kind": "method", + "name": "name", + "serializedName": "name", + "doc": "Name of the dedicated Hsm", + "type": { + "$id": "1422", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.listOutboundNetworkDependenciesEndpoints.name", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "1423", + "kind": "method", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "178" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.listOutboundNetworkDependenciesEndpoints.accept", + "readOnly": false, + "access": "public", + "decorators": [] + } + ], + "response": { + "type": { + "$ref": "462" + }, + "resultSegments": [ + "value" + ] + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.listOutboundNetworkDependenciesEndpoints", + "pagingMetadata": { + "itemPropertySegments": [ + "value" + ], + "nextLink": { + "responseSegments": [ + "nextLink" + ], + "responseLocation": "Body" + } + } + } + ], + "parameters": [ + { + "$id": "1424", + "kind": "endpoint", + "name": "endpoint", + "serializedName": "endpoint", + "doc": "Service host", + "type": { + "$id": "1425", + "kind": "url", + "name": "endpoint", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "isApiVersion": false, + "optional": false, + "scope": "Client", + "isEndpoint": true, + "defaultValue": { + "type": { + "$id": "1426", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "https://management.azure.com" + }, + "serverUrlTemplate": "{endpoint}", + "skipUrlEncoding": false, + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.endpoint" + }, + { + "$id": "1427", + "kind": "method", + "name": "apiVersion", + "serializedName": "apiVersion", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1428", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "", + "isApiVersion": true, + "defaultValue": { + "type": { + "$id": "1429", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-31" + }, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.get.apiVersion", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "1430", + "kind": "method", + "name": "subscriptionId", + "serializedName": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "1431", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1432", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms.get.subscriptionId", + "readOnly": false, + "access": "public", + "decorators": [] + } + ], + "initializedBy": 0, + "decorators": [ + { + "name": "Azure.ResourceManager.@armResourceOperations", + "arguments": {} + } + ], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.DedicatedHsms", + "apiVersions": [ + "2025-03-31" + ], + "parent": { + "$ref": "497" + } + }, + { + "$id": "1433", + "kind": "client", + "name": "CloudHsmClusterPrivateLinkResources", + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "methods": [ + { + "$id": "1434", + "kind": "paging", + "name": "listByCloudHsmCluster", + "accessibility": "public", + "apiVersions": [ + "2025-03-31" + ], + "doc": "Gets the private link resources supported for the Cloud Hsm Cluster.", + "operation": { + "$id": "1435", + "name": "listByCloudHsmCluster", + "resourceName": "CloudHsmClusters", + "doc": "Gets the private link resources supported for the Cloud Hsm Cluster.", + "accessibility": "public", + "parameters": [ + { + "$id": "1436", + "kind": "query", + "name": "apiVersion", + "serializedName": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1437", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": true, + "explode": false, + "defaultValue": { + "type": { + "$id": "1438", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-31" + }, + "optional": false, + "scope": "Client", + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.listByCloudHsmCluster.apiVersion", + "readOnly": false + }, + { + "$id": "1439", + "kind": "path", + "name": "subscriptionId", + "serializedName": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "1440", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1441", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Client", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.listByCloudHsmCluster.subscriptionId" + }, + { + "$id": "1442", + "kind": "path", + "name": "resourceGroupName", + "serializedName": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1443", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.listByCloudHsmCluster.resourceGroupName" + }, + { + "$id": "1444", + "kind": "path", + "name": "cloudHsmClusterName", + "serializedName": "cloudHsmClusterName", + "doc": "The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length.", + "type": { + "$id": "1445", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.listByCloudHsmCluster.cloudHsmClusterName" + }, + { + "$id": "1446", + "kind": "header", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "180" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.listByCloudHsmCluster.accept" + } + ], + "responses": [ + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "485" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateLinkResources", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.listByCloudHsmCluster", + "decorators": [ + { + "name": "Azure.ResourceManager.@armResourceAction", + "arguments": {} + } + ], + "examples": [ + { + "$id": "1447", + "kind": "http", + "name": "CloudHsmClusterPrivateLinkResources_ListByResource_MaximumSet_Gen", + "description": "CloudHsmClusterPrivateLinkResources_ListByResource_MaximumSet_Gen", + "filePath": "2025-03-31/CloudHsmClusterPrivateLinkResource_ListByCloudHsmCluster_MaximumSet_Gen.json", + "parameters": [ + { + "parameter": { + "$ref": "1436" + }, + "value": { + "$id": "1448", + "kind": "string", + "type": { + "$ref": "1437" + }, + "value": "2025-03-31" + } + }, + { + "parameter": { + "$ref": "1444" + }, + "value": { + "$id": "1449", + "kind": "string", + "type": { + "$ref": "1445" + }, + "value": "chsm1" + } + }, + { + "parameter": { + "$ref": "1442" + }, + "value": { + "$id": "1450", + "kind": "string", + "type": { + "$ref": "1443" + }, + "value": "rgcloudhsm" + } + }, + { + "parameter": { + "$ref": "1439" + }, + "value": { + "$id": "1451", + "kind": "string", + "type": { + "$ref": "1440" + }, + "value": "00000000-0000-0000-0000-000000000000" + } + } + ], + "responses": [ + { + "response": { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "485" + }, + "headers": [], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + }, + "statusCode": 200, + "bodyValue": { + "$id": "1452", + "kind": "model", + "type": { + "$ref": "485" + }, + "value": { + "value": { + "$id": "1453", + "kind": "array", + "type": { + "$ref": "487" + }, + "value": [ + { + "$id": "1454", + "kind": "model", + "type": { + "$ref": "488" + }, + "value": { + "name": { + "$id": "1455", + "kind": "string", + "type": { + "$ref": "245" + }, + "value": "sample-pls" + }, + "type": { + "$id": "1456", + "kind": "string", + "type": { + "$ref": "247" + }, + "value": "Microsoft.HardwareSecurityModules/cloudHsmClusters/privateLinkResources" + }, + "id": { + "$id": "1457", + "kind": "string", + "type": { + "$ref": "242" + }, + "value": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rgcloudhsm/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/chsm1/privateLinkResources/sample-pls" + }, + "properties": { + "$id": "1458", + "kind": "model", + "type": { + "$ref": "490" + }, + "value": { + "groupId": { + "$id": "1459", + "kind": "string", + "type": { + "$ref": "492" + }, + "value": "cloudHsm" + }, + "requiredMembers": { + "$id": "1460", + "kind": "array", + "type": { + "$ref": "307" + }, + "value": [ + { + "$id": "1461", + "kind": "string", + "type": { + "$ref": "308" + }, + "value": "hsm1" + }, + { + "$id": "1462", + "kind": "string", + "type": { + "$ref": "308" + }, + "value": "hsm2" + }, + { + "$id": "1463", + "kind": "string", + "type": { + "$ref": "308" + }, + "value": "hsm3" + } + ] + }, + "requiredZoneNames": { + "$id": "1464", + "kind": "array", + "type": { + "$ref": "307" + }, + "value": [ + { + "$id": "1465", + "kind": "string", + "type": { + "$ref": "308" + }, + "value": "privatelink.cloudhsm.azure-int.net" + } + ] + } + } + } + } + } + ] + } + } + } + } + ] + } + ] + }, + "parameters": [ + { + "$id": "1466", + "kind": "method", + "name": "resourceGroupName", + "serializedName": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1467", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.listByCloudHsmCluster.resourceGroupName", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "1468", + "kind": "method", + "name": "cloudHsmClusterName", + "serializedName": "cloudHsmClusterName", + "doc": "The name of the Cloud HSM Cluster within the specified resource group. Cloud HSM Cluster names must be between 3 and 23 characters in length.", + "type": { + "$id": "1469", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.listByCloudHsmCluster.cloudHsmClusterName", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "1470", + "kind": "method", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "180" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.listByCloudHsmCluster.accept", + "readOnly": false, + "access": "public", + "decorators": [] + } + ], + "response": { + "type": { + "$ref": "487" + }, + "resultSegments": [ + "value" + ] + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.listByCloudHsmCluster", + "pagingMetadata": { + "itemPropertySegments": [ + "value" + ], + "nextLink": { + "responseSegments": [ + "nextLink" + ], + "responseLocation": "Body" + } + } + } + ], + "parameters": [ + { + "$id": "1471", + "kind": "endpoint", + "name": "endpoint", + "serializedName": "endpoint", + "doc": "Service host", + "type": { + "$id": "1472", + "kind": "url", + "name": "endpoint", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "isApiVersion": false, + "optional": false, + "scope": "Client", + "isEndpoint": true, + "defaultValue": { + "type": { + "$id": "1473", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "https://management.azure.com" + }, + "serverUrlTemplate": "{endpoint}", + "skipUrlEncoding": false, + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.endpoint" + }, + { + "$id": "1474", + "kind": "method", + "name": "apiVersion", + "serializedName": "apiVersion", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1475", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "", + "isApiVersion": true, + "defaultValue": { + "type": { + "$id": "1476", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-31" + }, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.listByCloudHsmCluster.apiVersion", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "1477", + "kind": "method", + "name": "subscriptionId", + "serializedName": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "1478", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1479", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.listByCloudHsmCluster.subscriptionId", + "readOnly": false, + "access": "public", + "decorators": [] + } + ], + "initializedBy": 0, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules", + "apiVersions": [ + "2025-03-31" + ], + "parent": { + "$ref": "497" + } + }, + { + "$id": "1480", + "kind": "client", + "name": "CloudHsmClusterBackupStatus", + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "methods": [ + { + "$id": "1481", + "kind": "basic", + "name": "GetCloudHsmClusterBackupStatus", + "accessibility": "public", + "apiVersions": [ + "2025-03-31" + ], + "doc": "Gets the backup operation status of the specified Cloud HSM Cluster", + "operation": { + "$id": "1482", + "name": "GetCloudHsmClusterBackupStatus", + "resourceName": "CloudHsmClusters", + "doc": "Gets the backup operation status of the specified Cloud HSM Cluster", + "accessibility": "public", + "parameters": [ + { + "$id": "1483", + "kind": "query", + "name": "apiVersion", + "serializedName": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1484", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": true, + "explode": false, + "defaultValue": { + "type": { + "$id": "1485", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-31" + }, + "optional": false, + "scope": "Client", + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.cloudHsmClusterBackupStatusGet.apiVersion", + "readOnly": false + }, + { + "$id": "1486", + "kind": "path", + "name": "subscriptionId", + "serializedName": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "1487", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1488", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Client", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.cloudHsmClusterBackupStatusGet.subscriptionId" + }, + { + "$id": "1489", + "kind": "path", + "name": "resourceGroupName", + "serializedName": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1490", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.cloudHsmClusterBackupStatusGet.resourceGroupName" + }, + { + "$id": "1491", + "kind": "path", + "name": "cloudHsmClusterName", + "serializedName": "cloudHsmClusterName", + "type": { + "$id": "1492", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.cloudHsmClusterBackupStatusGet.cloudHsmClusterName" + }, + { + "$id": "1493", + "kind": "path", + "name": "jobId", + "serializedName": "jobId", + "doc": "Identifier for the backup operation", + "type": { + "$id": "1494", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.cloudHsmClusterBackupStatusGet.jobId" + }, + { + "$id": "1495", + "kind": "header", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "182" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.cloudHsmClusterBackupStatusGet.accept" + } + ], + "responses": [ + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "376" + }, + "headers": [ + { + "name": "requestId", + "nameInResponse": "x-ms-request-id", + "doc": "An opaque, globally-unique, server-generated string identifier for the request.", + "type": { + "$id": "1496", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1497", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + } + } + ], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + }, + { + "statusCodes": [ + 202 + ], + "headers": [ + { + "name": "location", + "nameInResponse": "Location", + "doc": "The Location header contains the URL where the status of the long running operation can be checked.", + "type": { + "$id": "1498", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "name": "requestId", + "nameInResponse": "x-ms-request-id", + "doc": "An opaque, globally-unique, server-generated string identifier for the request.", + "type": { + "$id": "1499", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1500", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + } + } + ], + "isErrorResponse": false + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/backupOperationStatus/{jobId}", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.cloudHsmClusterBackupStatusGet", + "decorators": [] + }, + "parameters": [ + { + "$id": "1501", + "kind": "method", + "name": "resourceGroupName", + "serializedName": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1502", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.cloudHsmClusterBackupStatusGet.resourceGroupName", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "1503", + "kind": "method", + "name": "cloudHsmClusterName", + "serializedName": "cloudHsmClusterName", + "type": { + "$id": "1504", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.cloudHsmClusterBackupStatusGet.cloudHsmClusterName", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "1505", + "kind": "method", + "name": "jobId", + "serializedName": "jobId", + "doc": "Identifier for the backup operation", + "type": { + "$id": "1506", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.cloudHsmClusterBackupStatusGet.jobId", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "1507", + "kind": "method", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "182" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.cloudHsmClusterBackupStatusGet.accept", + "readOnly": false, + "access": "public", + "decorators": [] + } + ], + "response": { + "type": { + "$id": "1508", + "kind": "nullable", + "type": { + "$ref": "376" + }, + "namespace": "Azure.ResourceManager.HardwareSecurityModules" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.cloudHsmClusterBackupStatusGet" + } + ], + "parameters": [ + { + "$id": "1509", + "kind": "endpoint", + "name": "endpoint", + "serializedName": "endpoint", + "doc": "Service host", + "type": { + "$id": "1510", + "kind": "url", + "name": "endpoint", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "isApiVersion": false, + "optional": false, + "scope": "Client", + "isEndpoint": true, + "defaultValue": { + "type": { + "$id": "1511", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "https://management.azure.com" + }, + "serverUrlTemplate": "{endpoint}", + "skipUrlEncoding": false, + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.endpoint" + }, + { + "$id": "1512", + "kind": "method", + "name": "apiVersion", + "serializedName": "apiVersion", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1513", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "", + "isApiVersion": true, + "defaultValue": { + "type": { + "$id": "1514", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-31" + }, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.cloudHsmClusterBackupStatusGet.apiVersion", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "1515", + "kind": "method", + "name": "subscriptionId", + "serializedName": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "1516", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1517", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.cloudHsmClusterBackupStatusGet.subscriptionId", + "readOnly": false, + "access": "public", + "decorators": [] + } + ], + "initializedBy": 0, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules", + "apiVersions": [ + "2025-03-31" + ], + "parent": { + "$ref": "497" + } + }, + { + "$id": "1518", + "kind": "client", + "name": "CloudHsmClusterRestoreStatus", + "namespace": "Azure.ResourceManager.HardwareSecurityModules", + "methods": [ + { + "$id": "1519", + "kind": "basic", + "name": "GetCloudHsmClusterRestoreStatus", + "accessibility": "public", + "apiVersions": [ + "2025-03-31" + ], + "doc": "Gets the restore operation status of the specified Cloud HSM Cluster", + "operation": { + "$id": "1520", + "name": "GetCloudHsmClusterRestoreStatus", + "resourceName": "CloudHsmClusters", + "doc": "Gets the restore operation status of the specified Cloud HSM Cluster", + "accessibility": "public", + "parameters": [ + { + "$id": "1521", + "kind": "query", + "name": "apiVersion", + "serializedName": "api-version", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1522", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": true, + "explode": false, + "defaultValue": { + "type": { + "$id": "1523", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-31" + }, + "optional": false, + "scope": "Client", + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.cloudHsmClusterRestoreStatusGet.apiVersion", + "readOnly": false + }, + { + "$id": "1524", + "kind": "path", + "name": "subscriptionId", + "serializedName": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "1525", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1526", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Client", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.cloudHsmClusterRestoreStatusGet.subscriptionId" + }, + { + "$id": "1527", + "kind": "path", + "name": "resourceGroupName", + "serializedName": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1528", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.cloudHsmClusterRestoreStatusGet.resourceGroupName" + }, + { + "$id": "1529", + "kind": "path", + "name": "cloudHsmClusterName", + "serializedName": "cloudHsmClusterName", + "doc": "Name of the Cloud HSM Cluster", + "type": { + "$id": "1530", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.cloudHsmClusterRestoreStatusGet.cloudHsmClusterName" + }, + { + "$id": "1531", + "kind": "path", + "name": "jobId", + "serializedName": "jobId", + "doc": "Identifier for the restore operation", + "type": { + "$id": "1532", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "isApiVersion": false, + "explode": false, + "style": "simple", + "allowReserved": false, + "skipUrlEncoding": false, + "optional": false, + "scope": "Method", + "decorators": [], + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.cloudHsmClusterRestoreStatusGet.jobId" + }, + { + "$id": "1533", + "kind": "header", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "184" + }, + "isApiVersion": false, + "optional": false, + "isContentType": false, + "scope": "Constant", + "readOnly": false, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.cloudHsmClusterRestoreStatusGet.accept" + } + ], + "responses": [ + { + "statusCodes": [ + 200 + ], + "bodyType": { + "$ref": "400" + }, + "headers": [ + { + "name": "requestId", + "nameInResponse": "x-ms-request-id", + "doc": "An opaque, globally-unique, server-generated string identifier for the request.", + "type": { + "$id": "1534", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1535", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + } + } + ], + "isErrorResponse": false, + "contentTypes": [ + "application/json" + ] + }, + { + "statusCodes": [ + 202 + ], + "headers": [ + { + "name": "location", + "nameInResponse": "Location", + "doc": "The Location header contains the URL where the status of the long running operation can be checked.", + "type": { + "$id": "1536", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + } + }, + { + "name": "requestId", + "nameInResponse": "x-ms-request-id", + "doc": "An opaque, globally-unique, server-generated string identifier for the request.", + "type": { + "$id": "1537", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1538", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + } + } + ], + "isErrorResponse": false + } + ], + "httpMethod": "GET", + "uri": "{endpoint}", + "path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/restoreOperationStatus/{jobId}", + "bufferResponse": true, + "generateProtocolMethod": true, + "generateConvenienceMethod": true, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.cloudHsmClusterRestoreStatusGet", + "decorators": [] + }, + "parameters": [ + { + "$id": "1539", + "kind": "method", + "name": "resourceGroupName", + "serializedName": "resourceGroupName", + "doc": "The name of the resource group. The name is case insensitive.", + "type": { + "$id": "1540", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.cloudHsmClusterRestoreStatusGet.resourceGroupName", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "1541", + "kind": "method", + "name": "cloudHsmClusterName", + "serializedName": "cloudHsmClusterName", + "doc": "Name of the Cloud HSM Cluster", + "type": { + "$id": "1542", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.cloudHsmClusterRestoreStatusGet.cloudHsmClusterName", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "1543", + "kind": "method", + "name": "jobId", + "serializedName": "jobId", + "doc": "Identifier for the restore operation", + "type": { + "$id": "1544", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "Path", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.cloudHsmClusterRestoreStatusGet.jobId", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "1545", + "kind": "method", + "name": "accept", + "serializedName": "Accept", + "type": { + "$ref": "184" + }, + "location": "Header", + "isApiVersion": false, + "optional": false, + "scope": "Constant", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.cloudHsmClusterRestoreStatusGet.accept", + "readOnly": false, + "access": "public", + "decorators": [] + } + ], + "response": { + "type": { + "$id": "1546", + "kind": "nullable", + "type": { + "$ref": "400" + }, + "namespace": "Azure.ResourceManager.HardwareSecurityModules" + } + }, + "isOverride": false, + "generateConvenient": true, + "generateProtocol": true, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.cloudHsmClusterRestoreStatusGet" + } + ], + "parameters": [ + { + "$id": "1547", + "kind": "endpoint", + "name": "endpoint", + "serializedName": "endpoint", + "doc": "Service host", + "type": { + "$id": "1548", + "kind": "url", + "name": "endpoint", + "crossLanguageDefinitionId": "TypeSpec.url" + }, + "isApiVersion": false, + "optional": false, + "scope": "Client", + "isEndpoint": true, + "defaultValue": { + "type": { + "$id": "1549", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "https://management.azure.com" + }, + "serverUrlTemplate": "{endpoint}", + "skipUrlEncoding": false, + "readOnly": false, + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.endpoint" + }, + { + "$id": "1550", + "kind": "method", + "name": "apiVersion", + "serializedName": "apiVersion", + "doc": "The API version to use for this operation.", + "type": { + "$id": "1551", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "location": "", + "isApiVersion": true, + "defaultValue": { + "type": { + "$id": "1552", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string" + }, + "value": "2025-03-31" + }, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.cloudHsmClusterRestoreStatusGet.apiVersion", + "readOnly": false, + "access": "public", + "decorators": [] + }, + { + "$id": "1553", + "kind": "method", + "name": "subscriptionId", + "serializedName": "subscriptionId", + "doc": "The ID of the target subscription. The value must be an UUID.", + "type": { + "$id": "1554", + "kind": "string", + "name": "uuid", + "crossLanguageDefinitionId": "Azure.Core.uuid", + "baseType": { + "$id": "1555", + "kind": "string", + "name": "string", + "crossLanguageDefinitionId": "TypeSpec.string", + "decorators": [] + }, + "decorators": [] + }, + "location": "", + "isApiVersion": false, + "optional": false, + "scope": "Method", + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules.CloudHsmClusters.cloudHsmClusterRestoreStatusGet.subscriptionId", + "readOnly": false, + "access": "public", + "decorators": [] + } + ], + "initializedBy": 0, + "decorators": [], + "crossLanguageDefinitionId": "Microsoft.HardwareSecurityModules", + "apiVersions": [ + "2025-03-31" + ], + "parent": { + "$ref": "497" + } + } + ] + } + ], + "auth": { + "oAuth2": { + "flows": [ + { + "scopes": [ + "user_impersonation" + ], + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize" + } + ] + } + } +}