diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/Azure.ResourceManager.ElasticSan.sln b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/Azure.ResourceManager.ElasticSan.sln index 525825ae0fade..6301b0f7f2b82 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/Azure.ResourceManager.ElasticSan.sln +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/Azure.ResourceManager.ElasticSan.sln @@ -1,21 +1,15 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.30309.148 +# Visual Studio Version 17 +VisualStudioVersion = 17.6.33829.357 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FE69A640-C572-4EE6-B221-5D477FB6CA6F}") = "Azure.ResourceManager.ElasticSan", "src\Azure.ResourceManager.ElasticSan.csproj", "{BEA00890-2EA2-41D3-9E4F-A1719665DD30}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.ResourceManager.ElasticSan", "src\Azure.ResourceManager.ElasticSan.csproj", "{BEA00890-2EA2-41D3-9E4F-A1719665DD30}" EndProject -Project("{FE69A640-C572-4EE6-B221-5D477FB6CA6F}") = "Azure.ResourceManager.ElasticSan.Tests", "tests\Azure.ResourceManager.ElasticSan.Tests.csproj", "{D338961A-0DA5-49C0-A186-C2EADCD59EDF}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.ResourceManager.ElasticSan.Tests", "tests\Azure.ResourceManager.ElasticSan.Tests.csproj", "{D338961A-0DA5-49C0-A186-C2EADCD59EDF}" EndProject -Project("{FE69A640-C572-4EE6-B221-5D477FB6CA6F}") = "Azure.ResourceManager.ElasticSan.Samples", "samples\Azure.ResourceManager.ElasticSan.Samples.csproj", "{F52C3F32-493F-40C0-AD5B-FA095845A6C8}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.ResourceManager.ElasticSan.Samples", "samples\Azure.ResourceManager.ElasticSan.Samples.csproj", "{F52C3F32-493F-40C0-AD5B-FA095845A6C8}" EndProject Global - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {6A7D8D43-D917-49BD-B643-7BEA9FDE9AF5} - EndGlobalSection GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Debug|x64 = Debug|x64 @@ -49,5 +43,23 @@ Global {D338961A-0DA5-49C0-A186-C2EADCD59EDF}.Release|x64.Build.0 = Release|Any CPU {D338961A-0DA5-49C0-A186-C2EADCD59EDF}.Release|x86.ActiveCfg = Release|Any CPU {D338961A-0DA5-49C0-A186-C2EADCD59EDF}.Release|x86.Build.0 = Release|Any CPU + {F52C3F32-493F-40C0-AD5B-FA095845A6C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F52C3F32-493F-40C0-AD5B-FA095845A6C8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F52C3F32-493F-40C0-AD5B-FA095845A6C8}.Debug|x64.ActiveCfg = Debug|Any CPU + {F52C3F32-493F-40C0-AD5B-FA095845A6C8}.Debug|x64.Build.0 = Debug|Any CPU + {F52C3F32-493F-40C0-AD5B-FA095845A6C8}.Debug|x86.ActiveCfg = Debug|Any CPU + {F52C3F32-493F-40C0-AD5B-FA095845A6C8}.Debug|x86.Build.0 = Debug|Any CPU + {F52C3F32-493F-40C0-AD5B-FA095845A6C8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F52C3F32-493F-40C0-AD5B-FA095845A6C8}.Release|Any CPU.Build.0 = Release|Any CPU + {F52C3F32-493F-40C0-AD5B-FA095845A6C8}.Release|x64.ActiveCfg = Release|Any CPU + {F52C3F32-493F-40C0-AD5B-FA095845A6C8}.Release|x64.Build.0 = Release|Any CPU + {F52C3F32-493F-40C0-AD5B-FA095845A6C8}.Release|x86.ActiveCfg = Release|Any CPU + {F52C3F32-493F-40C0-AD5B-FA095845A6C8}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {6A7D8D43-D917-49BD-B643-7BEA9FDE9AF5} EndGlobalSection EndGlobal diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/CHANGELOG.md b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/CHANGELOG.md index b58df3a7fc1b5..10ac99284b4b3 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/CHANGELOG.md +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/CHANGELOG.md @@ -4,6 +4,8 @@ ### Features Added +- Supported private endpoints for ElasticSan + ### Breaking Changes ### Bugs Fixed diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/api/Azure.ResourceManager.ElasticSan.netstandard2.0.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/api/Azure.ResourceManager.ElasticSan.netstandard2.0.cs index 6ade9a05bdb45..3df08653bc845 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/api/Azure.ResourceManager.ElasticSan.netstandard2.0.cs +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/api/Azure.ResourceManager.ElasticSan.netstandard2.0.cs @@ -21,6 +21,7 @@ public ElasticSanData(Azure.Core.AzureLocation location, Azure.ResourceManager.E public System.Collections.Generic.IList AvailabilityZones { get { throw null; } } public long BaseSizeTiB { get { throw null; } set { } } public long ExtendedCapacitySizeTiB { get { throw null; } set { } } + public System.Collections.Generic.IReadOnlyList PrivateEndpointConnections { get { throw null; } } public Azure.ResourceManager.ElasticSan.Models.ElasticSanProvisioningState? ProvisioningState { get { throw null; } } public Azure.ResourceManager.ElasticSan.Models.ElasticSanSku Sku { get { throw null; } set { } } public long? TotalIops { get { throw null; } } @@ -33,6 +34,7 @@ public static partial class ElasticSanExtensions { public static Azure.Response GetElasticSan(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string elasticSanName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetElasticSanAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string elasticSanName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.ElasticSan.ElasticSanPrivateEndpointConnectionResource GetElasticSanPrivateEndpointConnectionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.ElasticSan.ElasticSanResource GetElasticSanResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.ElasticSan.ElasticSanCollection GetElasticSans(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } public static Azure.Pageable GetElasticSans(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -42,6 +44,43 @@ public static partial class ElasticSanExtensions public static Azure.Pageable GetSkus(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string filter = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable GetSkusAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string filter = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } + public partial class ElasticSanPrivateEndpointConnectionCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ElasticSanPrivateEndpointConnectionCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string privateEndpointConnectionName, Azure.ResourceManager.ElasticSan.ElasticSanPrivateEndpointConnectionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string privateEndpointConnectionName, Azure.ResourceManager.ElasticSan.ElasticSanPrivateEndpointConnectionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class ElasticSanPrivateEndpointConnectionData : Azure.ResourceManager.Models.ResourceData + { + public ElasticSanPrivateEndpointConnectionData(Azure.ResourceManager.ElasticSan.Models.ElasticSanPrivateLinkServiceConnectionState connectionState) { } + public Azure.ResourceManager.ElasticSan.Models.ElasticSanPrivateLinkServiceConnectionState ConnectionState { get { throw null; } set { } } + public System.Collections.Generic.IList GroupIds { get { throw null; } } + public Azure.Core.ResourceIdentifier PrivateEndpointId { get { throw null; } } + public Azure.ResourceManager.ElasticSan.Models.ElasticSanProvisioningState? ProvisioningState { get { throw null; } } + } + public partial class ElasticSanPrivateEndpointConnectionResource : Azure.ResourceManager.ArmResource + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ElasticSanPrivateEndpointConnectionResource() { } + public virtual Azure.ResourceManager.ElasticSan.ElasticSanPrivateEndpointConnectionData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string elasticSanName, string privateEndpointConnectionName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + 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.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ElasticSan.ElasticSanPrivateEndpointConnectionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ElasticSan.ElasticSanPrivateEndpointConnectionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } public partial class ElasticSanResource : Azure.ResourceManager.ArmResource { public static readonly Azure.Core.ResourceType ResourceType; @@ -55,9 +94,14 @@ protected ElasticSanResource() { } 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 GetElasticSanPrivateEndpointConnection(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetElasticSanPrivateEndpointConnectionAsync(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ElasticSan.ElasticSanPrivateEndpointConnectionCollection GetElasticSanPrivateEndpointConnections() { throw null; } public virtual Azure.Response GetElasticSanVolumeGroup(string volumeGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetElasticSanVolumeGroupAsync(string volumeGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.ElasticSan.ElasticSanVolumeGroupCollection GetElasticSanVolumeGroups() { throw null; } + public virtual Azure.Pageable GetPrivateLinkResources(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetPrivateLinkResourcesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -82,11 +126,10 @@ protected ElasticSanVolumeCollection() { } } public partial class ElasticSanVolumeData : Azure.ResourceManager.Models.ResourceData { - public ElasticSanVolumeData() { } + public ElasticSanVolumeData(long sizeGiB) { } public Azure.ResourceManager.ElasticSan.Models.ElasticSanVolumeDataSourceInfo CreationData { get { throw null; } set { } } - public long? SizeGiB { get { throw null; } set { } } + public long SizeGiB { get { throw null; } set { } } public Azure.ResourceManager.ElasticSan.Models.IscsiTargetInfo StorageTarget { get { throw null; } } - public System.Collections.Generic.IDictionary Tags { get { throw null; } } public System.Guid? VolumeId { get { throw null; } } } public partial class ElasticSanVolumeGroupCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable @@ -108,9 +151,9 @@ public partial class ElasticSanVolumeGroupData : Azure.ResourceManager.Models.Re { public ElasticSanVolumeGroupData() { } public Azure.ResourceManager.ElasticSan.Models.ElasticSanEncryptionType? Encryption { get { throw null; } set { } } + public System.Collections.Generic.IReadOnlyList PrivateEndpointConnections { get { throw null; } } public Azure.ResourceManager.ElasticSan.Models.StorageTargetType? ProtocolType { get { throw null; } set { } } public Azure.ResourceManager.ElasticSan.Models.ElasticSanProvisioningState? ProvisioningState { get { throw null; } } - public System.Collections.Generic.IDictionary Tags { get { throw null; } } public System.Collections.Generic.IList VirtualNetworkRules { get { throw null; } } } public partial class ElasticSanVolumeGroupResource : Azure.ResourceManager.ArmResource @@ -119,8 +162,6 @@ public partial class ElasticSanVolumeGroupResource : Azure.ResourceManager.ArmRe protected ElasticSanVolumeGroupResource() { } public virtual Azure.ResourceManager.ElasticSan.ElasticSanVolumeGroupData Data { get { throw null; } } public virtual bool HasData { get { throw null; } } - public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string elasticSanName, string volumeGroupName) { throw null; } public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -129,10 +170,6 @@ protected ElasticSanVolumeGroupResource() { } public virtual Azure.Response GetElasticSanVolume(string volumeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetElasticSanVolumeAsync(string volumeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.ElasticSan.ElasticSanVolumeCollection GetElasticSanVolumes() { throw null; } - public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ElasticSan.Models.ElasticSanVolumeGroupPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ElasticSan.Models.ElasticSanVolumeGroupPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } @@ -142,17 +179,11 @@ public partial class ElasticSanVolumeResource : Azure.ResourceManager.ArmResourc protected ElasticSanVolumeResource() { } public virtual Azure.ResourceManager.ElasticSan.ElasticSanVolumeData Data { get { throw null; } } public virtual bool HasData { get { throw null; } } - public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string elasticSanName, string volumeGroupName, string volumeName) { throw null; } public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } 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 RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ElasticSan.Models.ElasticSanVolumePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ElasticSan.Models.ElasticSanVolumePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } @@ -161,13 +192,15 @@ namespace Azure.ResourceManager.ElasticSan.Models { public static partial class ArmElasticSanModelFactory { - public static Azure.ResourceManager.ElasticSan.ElasticSanData ElasticSanData(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.ElasticSan.Models.ElasticSanSku sku = null, System.Collections.Generic.IEnumerable availabilityZones = null, Azure.ResourceManager.ElasticSan.Models.ElasticSanProvisioningState? provisioningState = default(Azure.ResourceManager.ElasticSan.Models.ElasticSanProvisioningState?), long baseSizeTiB = (long)0, long extendedCapacitySizeTiB = (long)0, long? totalVolumeSizeGiB = default(long?), long? volumeGroupCount = default(long?), long? totalIops = default(long?), long? totalMbps = default(long?), long? totalSizeTiB = default(long?)) { throw null; } + public static Azure.ResourceManager.ElasticSan.ElasticSanData ElasticSanData(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.ElasticSan.Models.ElasticSanSku sku = null, System.Collections.Generic.IEnumerable availabilityZones = null, Azure.ResourceManager.ElasticSan.Models.ElasticSanProvisioningState? provisioningState = default(Azure.ResourceManager.ElasticSan.Models.ElasticSanProvisioningState?), long baseSizeTiB = (long)0, long extendedCapacitySizeTiB = (long)0, long? totalVolumeSizeGiB = default(long?), long? volumeGroupCount = default(long?), long? totalIops = default(long?), long? totalMbps = default(long?), long? totalSizeTiB = default(long?), System.Collections.Generic.IEnumerable privateEndpointConnections = null) { throw null; } + public static Azure.ResourceManager.ElasticSan.ElasticSanPrivateEndpointConnectionData ElasticSanPrivateEndpointConnectionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ElasticSan.Models.ElasticSanProvisioningState? provisioningState = default(Azure.ResourceManager.ElasticSan.Models.ElasticSanProvisioningState?), Azure.Core.ResourceIdentifier privateEndpointId = null, Azure.ResourceManager.ElasticSan.Models.ElasticSanPrivateLinkServiceConnectionState connectionState = null, System.Collections.Generic.IEnumerable groupIds = null) { throw null; } + public static Azure.ResourceManager.ElasticSan.Models.ElasticSanPrivateLinkResource ElasticSanPrivateLinkResource(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string groupId = null, System.Collections.Generic.IEnumerable requiredMembers = null, System.Collections.Generic.IEnumerable requiredZoneNames = null) { throw null; } public static Azure.ResourceManager.ElasticSan.Models.ElasticSanSkuCapability ElasticSanSkuCapability(string name = null, string value = null) { throw null; } public static Azure.ResourceManager.ElasticSan.Models.ElasticSanSkuInformation ElasticSanSkuInformation(Azure.ResourceManager.ElasticSan.Models.ElasticSanSkuName name = default(Azure.ResourceManager.ElasticSan.Models.ElasticSanSkuName), Azure.ResourceManager.ElasticSan.Models.ElasticSanSkuTier? tier = default(Azure.ResourceManager.ElasticSan.Models.ElasticSanSkuTier?), string resourceType = null, System.Collections.Generic.IEnumerable locations = null, System.Collections.Generic.IEnumerable locationInfo = null, System.Collections.Generic.IEnumerable capabilities = null) { throw null; } public static Azure.ResourceManager.ElasticSan.Models.ElasticSanSkuLocationInfo ElasticSanSkuLocationInfo(Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), System.Collections.Generic.IEnumerable zones = null) { throw null; } public static Azure.ResourceManager.ElasticSan.Models.ElasticSanVirtualNetworkRule ElasticSanVirtualNetworkRule(Azure.Core.ResourceIdentifier virtualNetworkResourceId = null, Azure.ResourceManager.ElasticSan.Models.ElasticSanVirtualNetworkRuleAction? action = default(Azure.ResourceManager.ElasticSan.Models.ElasticSanVirtualNetworkRuleAction?), Azure.ResourceManager.ElasticSan.Models.ElasticSanVirtualNetworkRuleState? state = default(Azure.ResourceManager.ElasticSan.Models.ElasticSanVirtualNetworkRuleState?)) { throw null; } - public static Azure.ResourceManager.ElasticSan.ElasticSanVolumeData ElasticSanVolumeData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Guid? volumeId = default(System.Guid?), Azure.ResourceManager.ElasticSan.Models.ElasticSanVolumeDataSourceInfo creationData = null, long? sizeGiB = default(long?), Azure.ResourceManager.ElasticSan.Models.IscsiTargetInfo storageTarget = null, System.Collections.Generic.IDictionary tags = null) { throw null; } - public static Azure.ResourceManager.ElasticSan.ElasticSanVolumeGroupData ElasticSanVolumeGroupData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ElasticSan.Models.ElasticSanProvisioningState? provisioningState = default(Azure.ResourceManager.ElasticSan.Models.ElasticSanProvisioningState?), Azure.ResourceManager.ElasticSan.Models.StorageTargetType? protocolType = default(Azure.ResourceManager.ElasticSan.Models.StorageTargetType?), Azure.ResourceManager.ElasticSan.Models.ElasticSanEncryptionType? encryption = default(Azure.ResourceManager.ElasticSan.Models.ElasticSanEncryptionType?), System.Collections.Generic.IEnumerable virtualNetworkRules = null, System.Collections.Generic.IDictionary tags = null) { throw null; } + public static Azure.ResourceManager.ElasticSan.ElasticSanVolumeData ElasticSanVolumeData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Guid? volumeId = default(System.Guid?), Azure.ResourceManager.ElasticSan.Models.ElasticSanVolumeDataSourceInfo creationData = null, long sizeGiB = (long)0, Azure.ResourceManager.ElasticSan.Models.IscsiTargetInfo storageTarget = null) { throw null; } + public static Azure.ResourceManager.ElasticSan.ElasticSanVolumeGroupData ElasticSanVolumeGroupData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.ElasticSan.Models.ElasticSanProvisioningState? provisioningState = default(Azure.ResourceManager.ElasticSan.Models.ElasticSanProvisioningState?), Azure.ResourceManager.ElasticSan.Models.StorageTargetType? protocolType = default(Azure.ResourceManager.ElasticSan.Models.StorageTargetType?), Azure.ResourceManager.ElasticSan.Models.ElasticSanEncryptionType? encryption = default(Azure.ResourceManager.ElasticSan.Models.ElasticSanEncryptionType?), System.Collections.Generic.IEnumerable virtualNetworkRules = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null) { throw null; } public static Azure.ResourceManager.ElasticSan.Models.IscsiTargetInfo IscsiTargetInfo(string targetIqn = null, string targetPortalHostname = null, int? targetPortalPort = default(int?), Azure.ResourceManager.ElasticSan.Models.ElasticSanProvisioningState? provisioningState = default(Azure.ResourceManager.ElasticSan.Models.ElasticSanProvisioningState?), Azure.ResourceManager.ElasticSan.Models.ResourceOperationalStatus? status = default(Azure.ResourceManager.ElasticSan.Models.ResourceOperationalStatus?)) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] @@ -195,6 +228,40 @@ public ElasticSanPatch() { } public System.Collections.Generic.IDictionary Tags { get { throw null; } } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ElasticSanPrivateEndpointServiceConnectionStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ElasticSanPrivateEndpointServiceConnectionStatus(string value) { throw null; } + public static Azure.ResourceManager.ElasticSan.Models.ElasticSanPrivateEndpointServiceConnectionStatus Approved { get { throw null; } } + public static Azure.ResourceManager.ElasticSan.Models.ElasticSanPrivateEndpointServiceConnectionStatus Failed { get { throw null; } } + public static Azure.ResourceManager.ElasticSan.Models.ElasticSanPrivateEndpointServiceConnectionStatus Pending { get { throw null; } } + public static Azure.ResourceManager.ElasticSan.Models.ElasticSanPrivateEndpointServiceConnectionStatus Rejected { get { throw null; } } + public bool Equals(Azure.ResourceManager.ElasticSan.Models.ElasticSanPrivateEndpointServiceConnectionStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ElasticSan.Models.ElasticSanPrivateEndpointServiceConnectionStatus left, Azure.ResourceManager.ElasticSan.Models.ElasticSanPrivateEndpointServiceConnectionStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.ElasticSan.Models.ElasticSanPrivateEndpointServiceConnectionStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ElasticSan.Models.ElasticSanPrivateEndpointServiceConnectionStatus left, Azure.ResourceManager.ElasticSan.Models.ElasticSanPrivateEndpointServiceConnectionStatus right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ElasticSanPrivateLinkResource : Azure.ResourceManager.Models.ResourceData + { + public ElasticSanPrivateLinkResource() { } + public string GroupId { get { throw null; } } + public System.Collections.Generic.IReadOnlyList RequiredMembers { get { throw null; } } + public System.Collections.Generic.IList RequiredZoneNames { get { throw null; } } + } + public partial class ElasticSanPrivateLinkServiceConnectionState + { + public ElasticSanPrivateLinkServiceConnectionState() { } + public string ActionsRequired { get { throw null; } set { } } + public string Description { get { throw null; } set { } } + public Azure.ResourceManager.ElasticSan.Models.ElasticSanPrivateEndpointServiceConnectionStatus? Status { get { throw null; } set { } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct ElasticSanProvisioningState : System.IEquatable { private readonly object _dummy; @@ -341,14 +408,12 @@ public partial class ElasticSanVolumeGroupPatch public ElasticSanVolumeGroupPatch() { } public Azure.ResourceManager.ElasticSan.Models.ElasticSanEncryptionType? Encryption { get { throw null; } set { } } public Azure.ResourceManager.ElasticSan.Models.StorageTargetType? ProtocolType { get { throw null; } set { } } - public System.Collections.Generic.IDictionary Tags { get { throw null; } } public System.Collections.Generic.IList VirtualNetworkRules { get { throw null; } } } public partial class ElasticSanVolumePatch { public ElasticSanVolumePatch() { } public long? SizeGiB { get { throw null; } set { } } - public System.Collections.Generic.IDictionary Tags { get { throw null; } } } public partial class IscsiTargetInfo { diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/assets.json b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/assets.json index 1eeb3f531835c..1c614d0950da4 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/assets.json +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/elasticsan/Azure.ResourceManager.ElasticSan", - "Tag": "net/elasticsan/Azure.ResourceManager.ElasticSan_211fba6ee7" + "Tag": "net/elasticsan/Azure.ResourceManager.ElasticSan_229c79a266" } diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/samples/Azure.ResourceManager.ElasticSan.Samples.csproj b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/samples/Azure.ResourceManager.ElasticSan.Samples.csproj index f9f82674bfe35..26f71dc195515 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/samples/Azure.ResourceManager.ElasticSan.Samples.csproj +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/samples/Azure.ResourceManager.ElasticSan.Samples.csproj @@ -1,10 +1,14 @@  - - - + + + + + + + \ No newline at end of file diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/samples/Generated/Samples/Sample_ElasticSanCollection.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/samples/Generated/Samples/Sample_ElasticSanCollection.cs index 14ea0c610c780..8a373181d8d08 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/samples/Generated/Samples/Sample_ElasticSanCollection.cs +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/samples/Generated/Samples/Sample_ElasticSanCollection.cs @@ -24,7 +24,7 @@ public partial class Sample_ElasticSanCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ElasticSansListByResourceGroupMaximumSetGen() { - // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_ListByResourceGroup_MaximumSet_Gen.json + // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_ListByResourceGroup_MaximumSet_Gen.json // this example is just showing the usage of "ElasticSans_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -34,8 +34,8 @@ public async Task GetAll_ElasticSansListByResourceGroupMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "aaaaaaaaaaaaaaaaaa"; - string resourceGroupName = "rgelasticsan"; + string subscriptionId = "subscriptionid"; + string resourceGroupName = "resourcegroupname"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -60,7 +60,7 @@ public async Task GetAll_ElasticSansListByResourceGroupMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ElasticSansListByResourceGroupMinimumSetGen() { - // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_ListByResourceGroup_MinimumSet_Gen.json + // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_ListByResourceGroup_MinimumSet_Gen.json // this example is just showing the usage of "ElasticSans_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -70,8 +70,8 @@ public async Task GetAll_ElasticSansListByResourceGroupMinimumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "aaaaaaaaaaaaaaaaaa"; - string resourceGroupName = "rgelasticsan"; + string subscriptionId = "subscriptionid"; + string resourceGroupName = "resourcegroupname"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -96,7 +96,7 @@ public async Task GetAll_ElasticSansListByResourceGroupMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_ElasticSansCreateMaximumSetGen() { - // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_Create_MaximumSet_Gen.json + // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_Create_MaximumSet_Gen.json // this example is just showing the usage of "ElasticSans_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -106,8 +106,8 @@ public async Task CreateOrUpdate_ElasticSansCreateMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "aaaaaaaaaaaaaaaaaa"; - string resourceGroupName = "rgelasticsan"; + string subscriptionId = "subscriptionid"; + string resourceGroupName = "resourcegroupname"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -115,19 +115,19 @@ public async Task CreateOrUpdate_ElasticSansCreateMaximumSetGen() ElasticSanCollection collection = resourceGroupResource.GetElasticSans(); // invoke the operation - string elasticSanName = "ti7q-k952-1qB3J_5"; - ElasticSanData data = new ElasticSanData(new AzureLocation("aaaaaaaaaaaaaaaaaaaaaaaaaaa"), new ElasticSanSku(ElasticSanSkuName.PremiumLrs) + string elasticSanName = "elasticsanname"; + ElasticSanData data = new ElasticSanData(new AzureLocation("South Central US"), new ElasticSanSku(ElasticSanSkuName.PremiumLrs) { Tier = ElasticSanSkuTier.Premium, - }, 26, 7) + }, 5, 25) { AvailabilityZones = { -"aaaaaaaaaaaaaaaaa" +"1" }, Tags = { -["key896"] = "aaaaaaaaaaaaaaaaaa", +["key9316"] = "ihndtieqibtob", }, }; ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, elasticSanName, data); @@ -145,7 +145,7 @@ public async Task CreateOrUpdate_ElasticSansCreateMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_ElasticSansCreateMinimumSetGen() { - // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_Create_MinimumSet_Gen.json + // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_Create_MinimumSet_Gen.json // this example is just showing the usage of "ElasticSans_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -155,8 +155,8 @@ public async Task CreateOrUpdate_ElasticSansCreateMinimumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "aaaaaaaaaaaaaaaaaa"; - string resourceGroupName = "rgelasticsan"; + string subscriptionId = "subscriptionid"; + string resourceGroupName = "resourcegroupname"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -164,8 +164,8 @@ public async Task CreateOrUpdate_ElasticSansCreateMinimumSetGen() ElasticSanCollection collection = resourceGroupResource.GetElasticSans(); // invoke the operation - string elasticSanName = "ti7q-k952-1qB3J_5"; - ElasticSanData data = new ElasticSanData(new AzureLocation("placeholder"), new ElasticSanSku(ElasticSanSkuName.PremiumLrs), 26, 7); + string elasticSanName = "elasticsanname"; + ElasticSanData data = new ElasticSanData(new AzureLocation("South Central US"), new ElasticSanSku(ElasticSanSkuName.PremiumLrs), 5, 25); ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, elasticSanName, data); ElasticSanResource result = lro.Value; @@ -181,7 +181,7 @@ public async Task CreateOrUpdate_ElasticSansCreateMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_ElasticSansGetMaximumSetGen() { - // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_Get_MaximumSet_Gen.json + // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_Get_MaximumSet_Gen.json // this example is just showing the usage of "ElasticSans_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -191,8 +191,8 @@ public async Task Get_ElasticSansGetMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "aaaaaaaaaaaaaaaaaa"; - string resourceGroupName = "rgelasticsan"; + string subscriptionId = "subscriptionid"; + string resourceGroupName = "resourcegroupname"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -200,7 +200,7 @@ public async Task Get_ElasticSansGetMaximumSetGen() ElasticSanCollection collection = resourceGroupResource.GetElasticSans(); // invoke the operation - string elasticSanName = "ti7q-k952-1qB3J_5"; + string elasticSanName = "elasticsanname"; ElasticSanResource result = await collection.GetAsync(elasticSanName); // the variable result is a resource, you could call other operations on this instance as well @@ -215,7 +215,7 @@ public async Task Get_ElasticSansGetMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_ElasticSansGetMaximumSetGen() { - // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_Get_MaximumSet_Gen.json + // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_Get_MaximumSet_Gen.json // this example is just showing the usage of "ElasticSans_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -225,8 +225,8 @@ public async Task Exists_ElasticSansGetMaximumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "aaaaaaaaaaaaaaaaaa"; - string resourceGroupName = "rgelasticsan"; + string subscriptionId = "subscriptionid"; + string resourceGroupName = "resourcegroupname"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -234,7 +234,7 @@ public async Task Exists_ElasticSansGetMaximumSetGen() ElasticSanCollection collection = resourceGroupResource.GetElasticSans(); // invoke the operation - string elasticSanName = "ti7q-k952-1qB3J_5"; + string elasticSanName = "elasticsanname"; bool result = await collection.ExistsAsync(elasticSanName); Console.WriteLine($"Succeeded: {result}"); @@ -245,7 +245,7 @@ public async Task Exists_ElasticSansGetMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_ElasticSansGetMinimumSetGen() { - // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_Get_MinimumSet_Gen.json + // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_Get_MinimumSet_Gen.json // this example is just showing the usage of "ElasticSans_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -255,8 +255,8 @@ public async Task Get_ElasticSansGetMinimumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "aaaaaaaaaaaaaaaaaa"; - string resourceGroupName = "rgelasticsan"; + string subscriptionId = "subscriptionid"; + string resourceGroupName = "resourcegroupname"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -264,7 +264,7 @@ public async Task Get_ElasticSansGetMinimumSetGen() ElasticSanCollection collection = resourceGroupResource.GetElasticSans(); // invoke the operation - string elasticSanName = "ti7q-k952-1qB3J_5"; + string elasticSanName = "elasticsanname"; ElasticSanResource result = await collection.GetAsync(elasticSanName); // the variable result is a resource, you could call other operations on this instance as well @@ -279,7 +279,7 @@ public async Task Get_ElasticSansGetMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_ElasticSansGetMinimumSetGen() { - // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_Get_MinimumSet_Gen.json + // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_Get_MinimumSet_Gen.json // this example is just showing the usage of "ElasticSans_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -289,8 +289,8 @@ public async Task Exists_ElasticSansGetMinimumSetGen() // this example assumes you already have this ResourceGroupResource created on azure // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "aaaaaaaaaaaaaaaaaa"; - string resourceGroupName = "rgelasticsan"; + string subscriptionId = "subscriptionid"; + string resourceGroupName = "resourcegroupname"; ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); @@ -298,7 +298,7 @@ public async Task Exists_ElasticSansGetMinimumSetGen() ElasticSanCollection collection = resourceGroupResource.GetElasticSans(); // invoke the operation - string elasticSanName = "ti7q-k952-1qB3J_5"; + string elasticSanName = "elasticsanname"; bool result = await collection.ExistsAsync(elasticSanName); Console.WriteLine($"Succeeded: {result}"); diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/samples/Generated/Samples/Sample_ElasticSanPrivateEndpointConnectionCollection.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/samples/Generated/Samples/Sample_ElasticSanPrivateEndpointConnectionCollection.cs new file mode 100644 index 0000000000000..4a62be05d0f3b --- /dev/null +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/samples/Generated/Samples/Sample_ElasticSanPrivateEndpointConnectionCollection.cs @@ -0,0 +1,317 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.ElasticSan; +using Azure.ResourceManager.ElasticSan.Models; + +namespace Azure.ResourceManager.ElasticSan.Samples +{ + public partial class Sample_ElasticSanPrivateEndpointConnectionCollection + { + // PrivateEndpointConnections_Create_MaximumSet_Gen + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_PrivateEndpointConnectionsCreateMaximumSetGen() + { + // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/PrivateEndpointConnections_Create_MaximumSet_Gen.json + // this example is just showing the usage of "PrivateEndpointConnections_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ElasticSanResource created on azure + // for more information of creating ElasticSanResource, please refer to the document of ElasticSanResource + string subscriptionId = "subscriptionid"; + string resourceGroupName = "resourcegroupname"; + string elasticSanName = "elasticsanname"; + ResourceIdentifier elasticSanResourceId = ElasticSanResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, elasticSanName); + ElasticSanResource elasticSan = client.GetElasticSanResource(elasticSanResourceId); + + // get the collection of this ElasticSanPrivateEndpointConnectionResource + ElasticSanPrivateEndpointConnectionCollection collection = elasticSan.GetElasticSanPrivateEndpointConnections(); + + // invoke the operation + string privateEndpointConnectionName = "privateendpointconnectionname"; + ElasticSanPrivateEndpointConnectionData data = new ElasticSanPrivateEndpointConnectionData(new ElasticSanPrivateLinkServiceConnectionState() + { + Status = ElasticSanPrivateEndpointServiceConnectionStatus.Pending, + Description = "Auto-Approved", + ActionsRequired = "None", + }) + { + GroupIds = +{ +"sytxzqlcoapcaywthgwvwcw" +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, privateEndpointConnectionName, data); + ElasticSanPrivateEndpointConnectionResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ElasticSanPrivateEndpointConnectionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // PrivateEndpointConnections_Create_MinimumSet_Gen + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_PrivateEndpointConnectionsCreateMinimumSetGen() + { + // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/PrivateEndpointConnections_Create_MinimumSet_Gen.json + // this example is just showing the usage of "PrivateEndpointConnections_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ElasticSanResource created on azure + // for more information of creating ElasticSanResource, please refer to the document of ElasticSanResource + string subscriptionId = "subscriptionid"; + string resourceGroupName = "resourcegroupname"; + string elasticSanName = "elasticsanname"; + ResourceIdentifier elasticSanResourceId = ElasticSanResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, elasticSanName); + ElasticSanResource elasticSan = client.GetElasticSanResource(elasticSanResourceId); + + // get the collection of this ElasticSanPrivateEndpointConnectionResource + ElasticSanPrivateEndpointConnectionCollection collection = elasticSan.GetElasticSanPrivateEndpointConnections(); + + // invoke the operation + string privateEndpointConnectionName = "privateendpointconnectionname"; + ElasticSanPrivateEndpointConnectionData data = new ElasticSanPrivateEndpointConnectionData(new ElasticSanPrivateLinkServiceConnectionState() + { + Status = ElasticSanPrivateEndpointServiceConnectionStatus.Pending, + Description = "Auto-Approved", + ActionsRequired = "None", + }); + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, privateEndpointConnectionName, data); + ElasticSanPrivateEndpointConnectionResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ElasticSanPrivateEndpointConnectionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // PrivateEndpointConnections_Get_MaximumSet_Gen + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_PrivateEndpointConnectionsGetMaximumSetGen() + { + // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/PrivateEndpointConnections_Get_MaximumSet_Gen.json + // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ElasticSanResource created on azure + // for more information of creating ElasticSanResource, please refer to the document of ElasticSanResource + string subscriptionId = "subscriptionid"; + string resourceGroupName = "resourcegroupname"; + string elasticSanName = "elasticsanname"; + ResourceIdentifier elasticSanResourceId = ElasticSanResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, elasticSanName); + ElasticSanResource elasticSan = client.GetElasticSanResource(elasticSanResourceId); + + // get the collection of this ElasticSanPrivateEndpointConnectionResource + ElasticSanPrivateEndpointConnectionCollection collection = elasticSan.GetElasticSanPrivateEndpointConnections(); + + // invoke the operation + string privateEndpointConnectionName = "privateendpointconnectionname"; + ElasticSanPrivateEndpointConnectionResource result = await collection.GetAsync(privateEndpointConnectionName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ElasticSanPrivateEndpointConnectionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // PrivateEndpointConnections_Get_MaximumSet_Gen + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_PrivateEndpointConnectionsGetMaximumSetGen() + { + // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/PrivateEndpointConnections_Get_MaximumSet_Gen.json + // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ElasticSanResource created on azure + // for more information of creating ElasticSanResource, please refer to the document of ElasticSanResource + string subscriptionId = "subscriptionid"; + string resourceGroupName = "resourcegroupname"; + string elasticSanName = "elasticsanname"; + ResourceIdentifier elasticSanResourceId = ElasticSanResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, elasticSanName); + ElasticSanResource elasticSan = client.GetElasticSanResource(elasticSanResourceId); + + // get the collection of this ElasticSanPrivateEndpointConnectionResource + ElasticSanPrivateEndpointConnectionCollection collection = elasticSan.GetElasticSanPrivateEndpointConnections(); + + // invoke the operation + string privateEndpointConnectionName = "privateendpointconnectionname"; + bool result = await collection.ExistsAsync(privateEndpointConnectionName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // PrivateEndpointConnections_Get_MinimumSet_Gen + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_PrivateEndpointConnectionsGetMinimumSetGen() + { + // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/PrivateEndpointConnections_Get_MinimumSet_Gen.json + // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ElasticSanResource created on azure + // for more information of creating ElasticSanResource, please refer to the document of ElasticSanResource + string subscriptionId = "subscriptionid"; + string resourceGroupName = "resourcegroupname"; + string elasticSanName = "elasticsanname"; + ResourceIdentifier elasticSanResourceId = ElasticSanResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, elasticSanName); + ElasticSanResource elasticSan = client.GetElasticSanResource(elasticSanResourceId); + + // get the collection of this ElasticSanPrivateEndpointConnectionResource + ElasticSanPrivateEndpointConnectionCollection collection = elasticSan.GetElasticSanPrivateEndpointConnections(); + + // invoke the operation + string privateEndpointConnectionName = "privateendpointconnectionname"; + ElasticSanPrivateEndpointConnectionResource result = await collection.GetAsync(privateEndpointConnectionName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ElasticSanPrivateEndpointConnectionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // PrivateEndpointConnections_Get_MinimumSet_Gen + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_PrivateEndpointConnectionsGetMinimumSetGen() + { + // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/PrivateEndpointConnections_Get_MinimumSet_Gen.json + // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ElasticSanResource created on azure + // for more information of creating ElasticSanResource, please refer to the document of ElasticSanResource + string subscriptionId = "subscriptionid"; + string resourceGroupName = "resourcegroupname"; + string elasticSanName = "elasticsanname"; + ResourceIdentifier elasticSanResourceId = ElasticSanResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, elasticSanName); + ElasticSanResource elasticSan = client.GetElasticSanResource(elasticSanResourceId); + + // get the collection of this ElasticSanPrivateEndpointConnectionResource + ElasticSanPrivateEndpointConnectionCollection collection = elasticSan.GetElasticSanPrivateEndpointConnections(); + + // invoke the operation + string privateEndpointConnectionName = "privateendpointconnectionname"; + bool result = await collection.ExistsAsync(privateEndpointConnectionName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // PrivateEndpointConnections_List_MaximumSet_Gen + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_PrivateEndpointConnectionsListMaximumSetGen() + { + // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/PrivateEndpointConnections_List_MaximumSet_Gen.json + // this example is just showing the usage of "PrivateEndpointConnections_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ElasticSanResource created on azure + // for more information of creating ElasticSanResource, please refer to the document of ElasticSanResource + string subscriptionId = "subscriptionid"; + string resourceGroupName = "resourcegroupname"; + string elasticSanName = "elasticsanname"; + ResourceIdentifier elasticSanResourceId = ElasticSanResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, elasticSanName); + ElasticSanResource elasticSan = client.GetElasticSanResource(elasticSanResourceId); + + // get the collection of this ElasticSanPrivateEndpointConnectionResource + ElasticSanPrivateEndpointConnectionCollection collection = elasticSan.GetElasticSanPrivateEndpointConnections(); + + // invoke the operation and iterate over the result + await foreach (ElasticSanPrivateEndpointConnectionResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ElasticSanPrivateEndpointConnectionData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // PrivateEndpointConnections_List_MinimumSet_Gen + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_PrivateEndpointConnectionsListMinimumSetGen() + { + // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/PrivateEndpointConnections_List_MinimumSet_Gen.json + // this example is just showing the usage of "PrivateEndpointConnections_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ElasticSanResource created on azure + // for more information of creating ElasticSanResource, please refer to the document of ElasticSanResource + string subscriptionId = "subscriptionid"; + string resourceGroupName = "resourcegroupname"; + string elasticSanName = "elasticsanname"; + ResourceIdentifier elasticSanResourceId = ElasticSanResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, elasticSanName); + ElasticSanResource elasticSan = client.GetElasticSanResource(elasticSanResourceId); + + // get the collection of this ElasticSanPrivateEndpointConnectionResource + ElasticSanPrivateEndpointConnectionCollection collection = elasticSan.GetElasticSanPrivateEndpointConnections(); + + // invoke the operation and iterate over the result + await foreach (ElasticSanPrivateEndpointConnectionResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ElasticSanPrivateEndpointConnectionData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + } +} diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/samples/Generated/Samples/Sample_ElasticSanPrivateEndpointConnectionResource.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/samples/Generated/Samples/Sample_ElasticSanPrivateEndpointConnectionResource.cs new file mode 100644 index 0000000000000..0753f7a63bd9d --- /dev/null +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/samples/Generated/Samples/Sample_ElasticSanPrivateEndpointConnectionResource.cs @@ -0,0 +1,225 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.ElasticSan; +using Azure.ResourceManager.ElasticSan.Models; + +namespace Azure.ResourceManager.ElasticSan.Samples +{ + public partial class Sample_ElasticSanPrivateEndpointConnectionResource + { + // PrivateEndpointConnections_Create_MaximumSet_Gen + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_PrivateEndpointConnectionsCreateMaximumSetGen() + { + // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/PrivateEndpointConnections_Create_MaximumSet_Gen.json + // this example is just showing the usage of "PrivateEndpointConnections_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ElasticSanPrivateEndpointConnectionResource created on azure + // for more information of creating ElasticSanPrivateEndpointConnectionResource, please refer to the document of ElasticSanPrivateEndpointConnectionResource + string subscriptionId = "subscriptionid"; + string resourceGroupName = "resourcegroupname"; + string elasticSanName = "elasticsanname"; + string privateEndpointConnectionName = "privateendpointconnectionname"; + ResourceIdentifier elasticSanPrivateEndpointConnectionResourceId = ElasticSanPrivateEndpointConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, elasticSanName, privateEndpointConnectionName); + ElasticSanPrivateEndpointConnectionResource elasticSanPrivateEndpointConnection = client.GetElasticSanPrivateEndpointConnectionResource(elasticSanPrivateEndpointConnectionResourceId); + + // invoke the operation + ElasticSanPrivateEndpointConnectionData data = new ElasticSanPrivateEndpointConnectionData(new ElasticSanPrivateLinkServiceConnectionState() + { + Status = ElasticSanPrivateEndpointServiceConnectionStatus.Pending, + Description = "Auto-Approved", + ActionsRequired = "None", + }) + { + GroupIds = +{ +"sytxzqlcoapcaywthgwvwcw" +}, + }; + ArmOperation lro = await elasticSanPrivateEndpointConnection.UpdateAsync(WaitUntil.Completed, data); + ElasticSanPrivateEndpointConnectionResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ElasticSanPrivateEndpointConnectionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // PrivateEndpointConnections_Create_MinimumSet_Gen + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_PrivateEndpointConnectionsCreateMinimumSetGen() + { + // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/PrivateEndpointConnections_Create_MinimumSet_Gen.json + // this example is just showing the usage of "PrivateEndpointConnections_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ElasticSanPrivateEndpointConnectionResource created on azure + // for more information of creating ElasticSanPrivateEndpointConnectionResource, please refer to the document of ElasticSanPrivateEndpointConnectionResource + string subscriptionId = "subscriptionid"; + string resourceGroupName = "resourcegroupname"; + string elasticSanName = "elasticsanname"; + string privateEndpointConnectionName = "privateendpointconnectionname"; + ResourceIdentifier elasticSanPrivateEndpointConnectionResourceId = ElasticSanPrivateEndpointConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, elasticSanName, privateEndpointConnectionName); + ElasticSanPrivateEndpointConnectionResource elasticSanPrivateEndpointConnection = client.GetElasticSanPrivateEndpointConnectionResource(elasticSanPrivateEndpointConnectionResourceId); + + // invoke the operation + ElasticSanPrivateEndpointConnectionData data = new ElasticSanPrivateEndpointConnectionData(new ElasticSanPrivateLinkServiceConnectionState() + { + Status = ElasticSanPrivateEndpointServiceConnectionStatus.Pending, + Description = "Auto-Approved", + ActionsRequired = "None", + }); + ArmOperation lro = await elasticSanPrivateEndpointConnection.UpdateAsync(WaitUntil.Completed, data); + ElasticSanPrivateEndpointConnectionResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ElasticSanPrivateEndpointConnectionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // PrivateEndpointConnections_Get_MaximumSet_Gen + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_PrivateEndpointConnectionsGetMaximumSetGen() + { + // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/PrivateEndpointConnections_Get_MaximumSet_Gen.json + // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ElasticSanPrivateEndpointConnectionResource created on azure + // for more information of creating ElasticSanPrivateEndpointConnectionResource, please refer to the document of ElasticSanPrivateEndpointConnectionResource + string subscriptionId = "subscriptionid"; + string resourceGroupName = "resourcegroupname"; + string elasticSanName = "elasticsanname"; + string privateEndpointConnectionName = "privateendpointconnectionname"; + ResourceIdentifier elasticSanPrivateEndpointConnectionResourceId = ElasticSanPrivateEndpointConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, elasticSanName, privateEndpointConnectionName); + ElasticSanPrivateEndpointConnectionResource elasticSanPrivateEndpointConnection = client.GetElasticSanPrivateEndpointConnectionResource(elasticSanPrivateEndpointConnectionResourceId); + + // invoke the operation + ElasticSanPrivateEndpointConnectionResource result = await elasticSanPrivateEndpointConnection.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ElasticSanPrivateEndpointConnectionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // PrivateEndpointConnections_Get_MinimumSet_Gen + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_PrivateEndpointConnectionsGetMinimumSetGen() + { + // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/PrivateEndpointConnections_Get_MinimumSet_Gen.json + // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ElasticSanPrivateEndpointConnectionResource created on azure + // for more information of creating ElasticSanPrivateEndpointConnectionResource, please refer to the document of ElasticSanPrivateEndpointConnectionResource + string subscriptionId = "subscriptionid"; + string resourceGroupName = "resourcegroupname"; + string elasticSanName = "elasticsanname"; + string privateEndpointConnectionName = "privateendpointconnectionname"; + ResourceIdentifier elasticSanPrivateEndpointConnectionResourceId = ElasticSanPrivateEndpointConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, elasticSanName, privateEndpointConnectionName); + ElasticSanPrivateEndpointConnectionResource elasticSanPrivateEndpointConnection = client.GetElasticSanPrivateEndpointConnectionResource(elasticSanPrivateEndpointConnectionResourceId); + + // invoke the operation + ElasticSanPrivateEndpointConnectionResource result = await elasticSanPrivateEndpointConnection.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ElasticSanPrivateEndpointConnectionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // PrivateEndpointConnections_Delete_MaximumSet_Gen + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Delete_PrivateEndpointConnectionsDeleteMaximumSetGen() + { + // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/PrivateEndpointConnections_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "PrivateEndpointConnections_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ElasticSanPrivateEndpointConnectionResource created on azure + // for more information of creating ElasticSanPrivateEndpointConnectionResource, please refer to the document of ElasticSanPrivateEndpointConnectionResource + string subscriptionId = "subscriptionid"; + string resourceGroupName = "resourcegroupname"; + string elasticSanName = "elasticsanname"; + string privateEndpointConnectionName = "privateendpointconnectionname"; + ResourceIdentifier elasticSanPrivateEndpointConnectionResourceId = ElasticSanPrivateEndpointConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, elasticSanName, privateEndpointConnectionName); + ElasticSanPrivateEndpointConnectionResource elasticSanPrivateEndpointConnection = client.GetElasticSanPrivateEndpointConnectionResource(elasticSanPrivateEndpointConnectionResourceId); + + // invoke the operation + await elasticSanPrivateEndpointConnection.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + + // PrivateEndpointConnections_Delete_MinimumSet_Gen + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Delete_PrivateEndpointConnectionsDeleteMinimumSetGen() + { + // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/PrivateEndpointConnections_Delete_MinimumSet_Gen.json + // this example is just showing the usage of "PrivateEndpointConnections_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ElasticSanPrivateEndpointConnectionResource created on azure + // for more information of creating ElasticSanPrivateEndpointConnectionResource, please refer to the document of ElasticSanPrivateEndpointConnectionResource + string subscriptionId = "subscriptionid"; + string resourceGroupName = "resourcegroupname"; + string elasticSanName = "elasticsanname"; + string privateEndpointConnectionName = "privateendpointconnectionname"; + ResourceIdentifier elasticSanPrivateEndpointConnectionResourceId = ElasticSanPrivateEndpointConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, elasticSanName, privateEndpointConnectionName); + ElasticSanPrivateEndpointConnectionResource elasticSanPrivateEndpointConnection = client.GetElasticSanPrivateEndpointConnectionResource(elasticSanPrivateEndpointConnectionResourceId); + + // invoke the operation + await elasticSanPrivateEndpointConnection.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + } +} diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/samples/Generated/Samples/Sample_ElasticSanResource.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/samples/Generated/Samples/Sample_ElasticSanResource.cs index f920ff9c21bdb..46afadd2bd90b 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/samples/Generated/Samples/Sample_ElasticSanResource.cs +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/samples/Generated/Samples/Sample_ElasticSanResource.cs @@ -24,7 +24,7 @@ public partial class Sample_ElasticSanResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetElasticSans_ElasticSansListBySubscriptionMaximumSetGen() { - // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_ListBySubscription_MaximumSet_Gen.json + // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_ListBySubscription_MaximumSet_Gen.json // this example is just showing the usage of "ElasticSans_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -34,7 +34,7 @@ public async Task GetElasticSans_ElasticSansListBySubscriptionMaximumSetGen() // this example assumes you already have this SubscriptionResource created on azure // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "aaaaaaaaaaaaaaaaaa"; + string subscriptionId = "subscriptionid"; ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); @@ -56,7 +56,7 @@ public async Task GetElasticSans_ElasticSansListBySubscriptionMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetElasticSans_ElasticSansListBySubscriptionMinimumSetGen() { - // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_ListBySubscription_MinimumSet_Gen.json + // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_ListBySubscription_MinimumSet_Gen.json // this example is just showing the usage of "ElasticSans_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -66,7 +66,7 @@ public async Task GetElasticSans_ElasticSansListBySubscriptionMinimumSetGen() // this example assumes you already have this SubscriptionResource created on azure // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "aaaaaaaaaaaaaaaaaa"; + string subscriptionId = "subscriptionid"; ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); @@ -88,7 +88,7 @@ public async Task GetElasticSans_ElasticSansListBySubscriptionMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_ElasticSansUpdateMaximumSetGen() { - // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_Update_MaximumSet_Gen.json + // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_Update_MaximumSet_Gen.json // this example is just showing the usage of "ElasticSans_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -98,9 +98,9 @@ public async Task Update_ElasticSansUpdateMaximumSetGen() // this example assumes you already have this ElasticSanResource created on azure // for more information of creating ElasticSanResource, please refer to the document of ElasticSanResource - string subscriptionId = "aaaaaaaaaaaaaaaaaa"; - string resourceGroupName = "rgelasticsan"; - string elasticSanName = "ti7q-k952-1qB3J_5"; + string subscriptionId = "subscriptionid"; + string resourceGroupName = "resourcegroupname"; + string elasticSanName = "elasticsanname"; ResourceIdentifier elasticSanResourceId = ElasticSanResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, elasticSanName); ElasticSanResource elasticSan = client.GetElasticSanResource(elasticSanResourceId); @@ -109,10 +109,10 @@ public async Task Update_ElasticSansUpdateMaximumSetGen() { Tags = { -["key3137"] = "aaaaaaaaaaaaaaa", +["key4212"] = "cqvcnwfefljntgeio", }, - BaseSizeTiB = 23, - ExtendedCapacitySizeTiB = 4, + BaseSizeTiB = 10, + ExtendedCapacitySizeTiB = 22, }; ArmOperation lro = await elasticSan.UpdateAsync(WaitUntil.Completed, patch); ElasticSanResource result = lro.Value; @@ -129,7 +129,7 @@ public async Task Update_ElasticSansUpdateMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_ElasticSansUpdateMinimumSetGen() { - // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_Update_MinimumSet_Gen.json + // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_Update_MinimumSet_Gen.json // this example is just showing the usage of "ElasticSans_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -139,9 +139,9 @@ public async Task Update_ElasticSansUpdateMinimumSetGen() // this example assumes you already have this ElasticSanResource created on azure // for more information of creating ElasticSanResource, please refer to the document of ElasticSanResource - string subscriptionId = "aaaaaaaaaaaaaaaaaa"; - string resourceGroupName = "rgelasticsan"; - string elasticSanName = "ti7q-k952-1qB3J_5"; + string subscriptionId = "subscriptionid"; + string resourceGroupName = "resourcegroupname"; + string elasticSanName = "elasticsanname"; ResourceIdentifier elasticSanResourceId = ElasticSanResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, elasticSanName); ElasticSanResource elasticSan = client.GetElasticSanResource(elasticSanResourceId); @@ -162,7 +162,7 @@ public async Task Update_ElasticSansUpdateMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_ElasticSansDeleteMaximumSetGen() { - // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_Delete_MaximumSet_Gen.json + // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_Delete_MaximumSet_Gen.json // this example is just showing the usage of "ElasticSans_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -172,9 +172,9 @@ public async Task Delete_ElasticSansDeleteMaximumSetGen() // this example assumes you already have this ElasticSanResource created on azure // for more information of creating ElasticSanResource, please refer to the document of ElasticSanResource - string subscriptionId = "aaaaaaaaaaaaaaaaaa"; - string resourceGroupName = "rgelasticsan"; - string elasticSanName = "ti7q-k952-1qB3J_5"; + string subscriptionId = "subscriptionid"; + string resourceGroupName = "resourcegroupname"; + string elasticSanName = "elasticsanname"; ResourceIdentifier elasticSanResourceId = ElasticSanResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, elasticSanName); ElasticSanResource elasticSan = client.GetElasticSanResource(elasticSanResourceId); @@ -189,7 +189,7 @@ public async Task Delete_ElasticSansDeleteMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_ElasticSansDeleteMinimumSetGen() { - // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_Delete_MinimumSet_Gen.json + // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_Delete_MinimumSet_Gen.json // this example is just showing the usage of "ElasticSans_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -199,9 +199,9 @@ public async Task Delete_ElasticSansDeleteMinimumSetGen() // this example assumes you already have this ElasticSanResource created on azure // for more information of creating ElasticSanResource, please refer to the document of ElasticSanResource - string subscriptionId = "aaaaaaaaaaaaaaaaaa"; - string resourceGroupName = "rgelasticsan"; - string elasticSanName = "ti7q-k952-1qB3J_5"; + string subscriptionId = "subscriptionid"; + string resourceGroupName = "resourcegroupname"; + string elasticSanName = "elasticsanname"; ResourceIdentifier elasticSanResourceId = ElasticSanResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, elasticSanName); ElasticSanResource elasticSan = client.GetElasticSanResource(elasticSanResourceId); @@ -216,7 +216,7 @@ public async Task Delete_ElasticSansDeleteMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_ElasticSansGetMaximumSetGen() { - // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_Get_MaximumSet_Gen.json + // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_Get_MaximumSet_Gen.json // this example is just showing the usage of "ElasticSans_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -226,9 +226,9 @@ public async Task Get_ElasticSansGetMaximumSetGen() // this example assumes you already have this ElasticSanResource created on azure // for more information of creating ElasticSanResource, please refer to the document of ElasticSanResource - string subscriptionId = "aaaaaaaaaaaaaaaaaa"; - string resourceGroupName = "rgelasticsan"; - string elasticSanName = "ti7q-k952-1qB3J_5"; + string subscriptionId = "subscriptionid"; + string resourceGroupName = "resourcegroupname"; + string elasticSanName = "elasticsanname"; ResourceIdentifier elasticSanResourceId = ElasticSanResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, elasticSanName); ElasticSanResource elasticSan = client.GetElasticSanResource(elasticSanResourceId); @@ -247,7 +247,7 @@ public async Task Get_ElasticSansGetMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_ElasticSansGetMinimumSetGen() { - // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/ElasticSans_Get_MinimumSet_Gen.json + // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/ElasticSans_Get_MinimumSet_Gen.json // this example is just showing the usage of "ElasticSans_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -257,9 +257,9 @@ public async Task Get_ElasticSansGetMinimumSetGen() // this example assumes you already have this ElasticSanResource created on azure // for more information of creating ElasticSanResource, please refer to the document of ElasticSanResource - string subscriptionId = "aaaaaaaaaaaaaaaaaa"; - string resourceGroupName = "rgelasticsan"; - string elasticSanName = "ti7q-k952-1qB3J_5"; + string subscriptionId = "subscriptionid"; + string resourceGroupName = "resourcegroupname"; + string elasticSanName = "elasticsanname"; ResourceIdentifier elasticSanResourceId = ElasticSanResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, elasticSanName); ElasticSanResource elasticSan = client.GetElasticSanResource(elasticSanResourceId); @@ -272,5 +272,65 @@ public async Task Get_ElasticSansGetMinimumSetGen() // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + + // PrivateLinkResources_ListByElasticSan_MaximumSet_Gen + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetPrivateLinkResources_PrivateLinkResourcesListByElasticSanMaximumSetGen() + { + // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/PrivateLinkResources_ListByElasticSan_MaximumSet_Gen.json + // this example is just showing the usage of "PrivateLinkResources_ListByElasticSan" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ElasticSanResource created on azure + // for more information of creating ElasticSanResource, please refer to the document of ElasticSanResource + string subscriptionId = "subscriptionid"; + string resourceGroupName = "resourcegroupname"; + string elasticSanName = "elasticsanname"; + ResourceIdentifier elasticSanResourceId = ElasticSanResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, elasticSanName); + ElasticSanResource elasticSan = client.GetElasticSanResource(elasticSanResourceId); + + // invoke the operation and iterate over the result + await foreach (ElasticSanPrivateLinkResource item in elasticSan.GetPrivateLinkResourcesAsync()) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine($"Succeeded"); + } + + // PrivateLinkResources_ListByElasticSan_MinimumSet_Gen + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetPrivateLinkResources_PrivateLinkResourcesListByElasticSanMinimumSetGen() + { + // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/PrivateLinkResources_ListByElasticSan_MinimumSet_Gen.json + // this example is just showing the usage of "PrivateLinkResources_ListByElasticSan" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ElasticSanResource created on azure + // for more information of creating ElasticSanResource, please refer to the document of ElasticSanResource + string subscriptionId = "subscriptionid"; + string resourceGroupName = "resourcegroupname"; + string elasticSanName = "elasticsanname"; + ResourceIdentifier elasticSanResourceId = ElasticSanResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, elasticSanName); + ElasticSanResource elasticSan = client.GetElasticSanResource(elasticSanResourceId); + + // invoke the operation and iterate over the result + await foreach (ElasticSanPrivateLinkResource item in elasticSan.GetPrivateLinkResourcesAsync()) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine($"Succeeded"); + } } } diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/samples/Generated/Samples/Sample_ElasticSanVolumeCollection.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/samples/Generated/Samples/Sample_ElasticSanVolumeCollection.cs index 883f677571cf7..1e0fc927f832f 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/samples/Generated/Samples/Sample_ElasticSanVolumeCollection.cs +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/samples/Generated/Samples/Sample_ElasticSanVolumeCollection.cs @@ -23,7 +23,7 @@ public partial class Sample_ElasticSanVolumeCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_VolumesCreateMaximumSetGen() { - // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Volumes_Create_MaximumSet_Gen.json + // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_Create_MaximumSet_Gen.json // this example is just showing the usage of "Volumes_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -33,10 +33,10 @@ public async Task CreateOrUpdate_VolumesCreateMaximumSetGen() // this example assumes you already have this ElasticSanVolumeGroupResource created on azure // for more information of creating ElasticSanVolumeGroupResource, please refer to the document of ElasticSanVolumeGroupResource - string subscriptionId = "aaaaaaaaaaaaaaaaaa"; - string resourceGroupName = "rgelasticsan"; - string elasticSanName = "ti7q-k952-1qB3J_5"; - string volumeGroupName = "u_5I_1j4t3"; + string subscriptionId = "subscriptionid"; + string resourceGroupName = "resourcegroupname"; + string elasticSanName = "elasticsanname"; + string volumeGroupName = "volumegroupname"; ResourceIdentifier elasticSanVolumeGroupResourceId = ElasticSanVolumeGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, elasticSanName, volumeGroupName); ElasticSanVolumeGroupResource elasticSanVolumeGroup = client.GetElasticSanVolumeGroupResource(elasticSanVolumeGroupResourceId); @@ -44,19 +44,14 @@ public async Task CreateOrUpdate_VolumesCreateMaximumSetGen() ElasticSanVolumeCollection collection = elasticSanVolumeGroup.GetElasticSanVolumes(); // invoke the operation - string volumeName = "9132y"; - ElasticSanVolumeData data = new ElasticSanVolumeData() + string volumeName = "volumename"; + ElasticSanVolumeData data = new ElasticSanVolumeData(23) { CreationData = new ElasticSanVolumeDataSourceInfo() { CreateSource = ElasticSanVolumeCreateOption.None, - SourceUri = new Uri("aaaaaa"), + SourceUri = new Uri(" ARM Id of resource"), }, - SizeGiB = 22, - Tags = -{ -["key7423"] = "aaaa", -}, }; ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, volumeName, data); ElasticSanVolumeResource result = lro.Value; @@ -73,7 +68,7 @@ public async Task CreateOrUpdate_VolumesCreateMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_VolumesCreateMinimumSetGen() { - // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Volumes_Create_MinimumSet_Gen.json + // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_Create_MinimumSet_Gen.json // this example is just showing the usage of "Volumes_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -83,10 +78,10 @@ public async Task CreateOrUpdate_VolumesCreateMinimumSetGen() // this example assumes you already have this ElasticSanVolumeGroupResource created on azure // for more information of creating ElasticSanVolumeGroupResource, please refer to the document of ElasticSanVolumeGroupResource - string subscriptionId = "aaaaaaaaaaaaaaaaaa"; - string resourceGroupName = "rgelasticsan"; - string elasticSanName = "ti7q-k952-1qB3J_5"; - string volumeGroupName = "u_5I_1j4t3"; + string subscriptionId = "subscriptionid"; + string resourceGroupName = "resourcegroupname"; + string elasticSanName = "elasticsanname"; + string volumeGroupName = "volumegroupname"; ResourceIdentifier elasticSanVolumeGroupResourceId = ElasticSanVolumeGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, elasticSanName, volumeGroupName); ElasticSanVolumeGroupResource elasticSanVolumeGroup = client.GetElasticSanVolumeGroupResource(elasticSanVolumeGroupResourceId); @@ -94,8 +89,8 @@ public async Task CreateOrUpdate_VolumesCreateMinimumSetGen() ElasticSanVolumeCollection collection = elasticSanVolumeGroup.GetElasticSanVolumes(); // invoke the operation - string volumeName = "9132y"; - ElasticSanVolumeData data = new ElasticSanVolumeData(); + string volumeName = "volumename"; + ElasticSanVolumeData data = new ElasticSanVolumeData(23); ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, volumeName, data); ElasticSanVolumeResource result = lro.Value; @@ -111,7 +106,7 @@ public async Task CreateOrUpdate_VolumesCreateMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_VolumesGetMaximumSetGen() { - // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Volumes_Get_MaximumSet_Gen.json + // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_Get_MaximumSet_Gen.json // this example is just showing the usage of "Volumes_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -121,10 +116,10 @@ public async Task Get_VolumesGetMaximumSetGen() // this example assumes you already have this ElasticSanVolumeGroupResource created on azure // for more information of creating ElasticSanVolumeGroupResource, please refer to the document of ElasticSanVolumeGroupResource - string subscriptionId = "aaaaaaaaaaaaaaaaaa"; - string resourceGroupName = "rgelasticsan"; - string elasticSanName = "ti7q-k952-1qB3J_5"; - string volumeGroupName = "u_5I_1j4t3"; + string subscriptionId = "subscriptionid"; + string resourceGroupName = "resourcegroupname"; + string elasticSanName = "elasticsanname"; + string volumeGroupName = "volumegroupname"; ResourceIdentifier elasticSanVolumeGroupResourceId = ElasticSanVolumeGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, elasticSanName, volumeGroupName); ElasticSanVolumeGroupResource elasticSanVolumeGroup = client.GetElasticSanVolumeGroupResource(elasticSanVolumeGroupResourceId); @@ -132,7 +127,7 @@ public async Task Get_VolumesGetMaximumSetGen() ElasticSanVolumeCollection collection = elasticSanVolumeGroup.GetElasticSanVolumes(); // invoke the operation - string volumeName = "9132y"; + string volumeName = "volumename"; ElasticSanVolumeResource result = await collection.GetAsync(volumeName); // the variable result is a resource, you could call other operations on this instance as well @@ -147,7 +142,7 @@ public async Task Get_VolumesGetMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_VolumesGetMaximumSetGen() { - // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Volumes_Get_MaximumSet_Gen.json + // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_Get_MaximumSet_Gen.json // this example is just showing the usage of "Volumes_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -157,10 +152,10 @@ public async Task Exists_VolumesGetMaximumSetGen() // this example assumes you already have this ElasticSanVolumeGroupResource created on azure // for more information of creating ElasticSanVolumeGroupResource, please refer to the document of ElasticSanVolumeGroupResource - string subscriptionId = "aaaaaaaaaaaaaaaaaa"; - string resourceGroupName = "rgelasticsan"; - string elasticSanName = "ti7q-k952-1qB3J_5"; - string volumeGroupName = "u_5I_1j4t3"; + string subscriptionId = "subscriptionid"; + string resourceGroupName = "resourcegroupname"; + string elasticSanName = "elasticsanname"; + string volumeGroupName = "volumegroupname"; ResourceIdentifier elasticSanVolumeGroupResourceId = ElasticSanVolumeGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, elasticSanName, volumeGroupName); ElasticSanVolumeGroupResource elasticSanVolumeGroup = client.GetElasticSanVolumeGroupResource(elasticSanVolumeGroupResourceId); @@ -168,7 +163,7 @@ public async Task Exists_VolumesGetMaximumSetGen() ElasticSanVolumeCollection collection = elasticSanVolumeGroup.GetElasticSanVolumes(); // invoke the operation - string volumeName = "9132y"; + string volumeName = "volumename"; bool result = await collection.ExistsAsync(volumeName); Console.WriteLine($"Succeeded: {result}"); @@ -179,7 +174,7 @@ public async Task Exists_VolumesGetMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_VolumesGetMinimumSetGen() { - // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Volumes_Get_MinimumSet_Gen.json + // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_Get_MinimumSet_Gen.json // this example is just showing the usage of "Volumes_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -189,10 +184,10 @@ public async Task Get_VolumesGetMinimumSetGen() // this example assumes you already have this ElasticSanVolumeGroupResource created on azure // for more information of creating ElasticSanVolumeGroupResource, please refer to the document of ElasticSanVolumeGroupResource - string subscriptionId = "aaaaaaaaaaaaaaaaaa"; - string resourceGroupName = "rgelasticsan"; - string elasticSanName = "ti7q-k952-1qB3J_5"; - string volumeGroupName = "u_5I_1j4t3"; + string subscriptionId = "subscriptionid"; + string resourceGroupName = "resourcegroupname"; + string elasticSanName = "elasticsanname"; + string volumeGroupName = "volumegroupname"; ResourceIdentifier elasticSanVolumeGroupResourceId = ElasticSanVolumeGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, elasticSanName, volumeGroupName); ElasticSanVolumeGroupResource elasticSanVolumeGroup = client.GetElasticSanVolumeGroupResource(elasticSanVolumeGroupResourceId); @@ -200,7 +195,7 @@ public async Task Get_VolumesGetMinimumSetGen() ElasticSanVolumeCollection collection = elasticSanVolumeGroup.GetElasticSanVolumes(); // invoke the operation - string volumeName = "9132y"; + string volumeName = "volumename"; ElasticSanVolumeResource result = await collection.GetAsync(volumeName); // the variable result is a resource, you could call other operations on this instance as well @@ -215,7 +210,7 @@ public async Task Get_VolumesGetMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_VolumesGetMinimumSetGen() { - // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Volumes_Get_MinimumSet_Gen.json + // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_Get_MinimumSet_Gen.json // this example is just showing the usage of "Volumes_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -225,10 +220,10 @@ public async Task Exists_VolumesGetMinimumSetGen() // this example assumes you already have this ElasticSanVolumeGroupResource created on azure // for more information of creating ElasticSanVolumeGroupResource, please refer to the document of ElasticSanVolumeGroupResource - string subscriptionId = "aaaaaaaaaaaaaaaaaa"; - string resourceGroupName = "rgelasticsan"; - string elasticSanName = "ti7q-k952-1qB3J_5"; - string volumeGroupName = "u_5I_1j4t3"; + string subscriptionId = "subscriptionid"; + string resourceGroupName = "resourcegroupname"; + string elasticSanName = "elasticsanname"; + string volumeGroupName = "volumegroupname"; ResourceIdentifier elasticSanVolumeGroupResourceId = ElasticSanVolumeGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, elasticSanName, volumeGroupName); ElasticSanVolumeGroupResource elasticSanVolumeGroup = client.GetElasticSanVolumeGroupResource(elasticSanVolumeGroupResourceId); @@ -236,7 +231,7 @@ public async Task Exists_VolumesGetMinimumSetGen() ElasticSanVolumeCollection collection = elasticSanVolumeGroup.GetElasticSanVolumes(); // invoke the operation - string volumeName = "9132y"; + string volumeName = "volumename"; bool result = await collection.ExistsAsync(volumeName); Console.WriteLine($"Succeeded: {result}"); @@ -247,7 +242,7 @@ public async Task Exists_VolumesGetMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_VolumesListByVolumeGroupMaximumSetGen() { - // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Volumes_ListByVolumeGroup_MaximumSet_Gen.json + // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_ListByVolumeGroup_MaximumSet_Gen.json // this example is just showing the usage of "Volumes_ListByVolumeGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -257,10 +252,10 @@ public async Task GetAll_VolumesListByVolumeGroupMaximumSetGen() // this example assumes you already have this ElasticSanVolumeGroupResource created on azure // for more information of creating ElasticSanVolumeGroupResource, please refer to the document of ElasticSanVolumeGroupResource - string subscriptionId = "aaaaaaaaaaaaaaaaaa"; - string resourceGroupName = "rgelasticsan"; - string elasticSanName = "ti7q-k952-1qB3J_5"; - string volumeGroupName = "u_5I_1j4t3"; + string subscriptionId = "subscriptionid"; + string resourceGroupName = "resourcegroupname"; + string elasticSanName = "elasticsanname"; + string volumeGroupName = "volumegroupname"; ResourceIdentifier elasticSanVolumeGroupResourceId = ElasticSanVolumeGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, elasticSanName, volumeGroupName); ElasticSanVolumeGroupResource elasticSanVolumeGroup = client.GetElasticSanVolumeGroupResource(elasticSanVolumeGroupResourceId); @@ -285,7 +280,7 @@ public async Task GetAll_VolumesListByVolumeGroupMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_VolumesListByVolumeGroupMinimumSetGen() { - // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Volumes_ListByVolumeGroup_MinimumSet_Gen.json + // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_ListByVolumeGroup_MinimumSet_Gen.json // this example is just showing the usage of "Volumes_ListByVolumeGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -295,10 +290,10 @@ public async Task GetAll_VolumesListByVolumeGroupMinimumSetGen() // this example assumes you already have this ElasticSanVolumeGroupResource created on azure // for more information of creating ElasticSanVolumeGroupResource, please refer to the document of ElasticSanVolumeGroupResource - string subscriptionId = "aaaaaaaaaaaaaaaaaa"; - string resourceGroupName = "rgelasticsan"; - string elasticSanName = "ti7q-k952-1qB3J_5"; - string volumeGroupName = "u_5I_1j4t3"; + string subscriptionId = "subscriptionid"; + string resourceGroupName = "resourcegroupname"; + string elasticSanName = "elasticsanname"; + string volumeGroupName = "volumegroupname"; ResourceIdentifier elasticSanVolumeGroupResourceId = ElasticSanVolumeGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, elasticSanName, volumeGroupName); ElasticSanVolumeGroupResource elasticSanVolumeGroup = client.GetElasticSanVolumeGroupResource(elasticSanVolumeGroupResourceId); diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/samples/Generated/Samples/Sample_ElasticSanVolumeGroupCollection.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/samples/Generated/Samples/Sample_ElasticSanVolumeGroupCollection.cs index 5ba1eb3fa2d8a..6636b230d3a98 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/samples/Generated/Samples/Sample_ElasticSanVolumeGroupCollection.cs +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/samples/Generated/Samples/Sample_ElasticSanVolumeGroupCollection.cs @@ -23,7 +23,7 @@ public partial class Sample_ElasticSanVolumeGroupCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_VolumeGroupsListByElasticSanMaximumSetGen() { - // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/VolumeGroups_ListByElasticSan_MaximumSet_Gen.json + // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/VolumeGroups_ListByElasticSan_MaximumSet_Gen.json // this example is just showing the usage of "VolumeGroups_ListByElasticSan" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -33,9 +33,9 @@ public async Task GetAll_VolumeGroupsListByElasticSanMaximumSetGen() // this example assumes you already have this ElasticSanResource created on azure // for more information of creating ElasticSanResource, please refer to the document of ElasticSanResource - string subscriptionId = "aaaaaaaaaaaaaaaaaa"; - string resourceGroupName = "rgelasticsan"; - string elasticSanName = "ti7q-k952-1qB3J_5"; + string subscriptionId = "subscriptionid"; + string resourceGroupName = "resourcegroupname"; + string elasticSanName = "elasticsanname"; ResourceIdentifier elasticSanResourceId = ElasticSanResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, elasticSanName); ElasticSanResource elasticSan = client.GetElasticSanResource(elasticSanResourceId); @@ -60,7 +60,7 @@ public async Task GetAll_VolumeGroupsListByElasticSanMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_VolumeGroupsListByElasticSanMinimumSetGen() { - // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/VolumeGroups_ListByElasticSan_MinimumSet_Gen.json + // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/VolumeGroups_ListByElasticSan_MinimumSet_Gen.json // this example is just showing the usage of "VolumeGroups_ListByElasticSan" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -70,9 +70,9 @@ public async Task GetAll_VolumeGroupsListByElasticSanMinimumSetGen() // this example assumes you already have this ElasticSanResource created on azure // for more information of creating ElasticSanResource, please refer to the document of ElasticSanResource - string subscriptionId = "aaaaaaaaaaaaaaaaaa"; - string resourceGroupName = "rgelasticsan"; - string elasticSanName = "ti7q-k952-1qB3J_5"; + string subscriptionId = "subscriptionid"; + string resourceGroupName = "resourcegroupname"; + string elasticSanName = "elasticsanname"; ResourceIdentifier elasticSanResourceId = ElasticSanResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, elasticSanName); ElasticSanResource elasticSan = client.GetElasticSanResource(elasticSanResourceId); @@ -97,7 +97,7 @@ public async Task GetAll_VolumeGroupsListByElasticSanMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_VolumeGroupsCreateMaximumSetGen() { - // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/VolumeGroups_Create_MaximumSet_Gen.json + // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/VolumeGroups_Create_MaximumSet_Gen.json // this example is just showing the usage of "VolumeGroups_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -107,9 +107,9 @@ public async Task CreateOrUpdate_VolumeGroupsCreateMaximumSetGen() // this example assumes you already have this ElasticSanResource created on azure // for more information of creating ElasticSanResource, please refer to the document of ElasticSanResource - string subscriptionId = "aaaaaaaaaaaaaaaaaa"; - string resourceGroupName = "rgelasticsan"; - string elasticSanName = "ti7q-k952-1qB3J_5"; + string subscriptionId = "subscriptionid"; + string resourceGroupName = "resourcegroupname"; + string elasticSanName = "elasticsanname"; ResourceIdentifier elasticSanResourceId = ElasticSanResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, elasticSanName); ElasticSanResource elasticSan = client.GetElasticSanResource(elasticSanResourceId); @@ -117,21 +117,17 @@ public async Task CreateOrUpdate_VolumeGroupsCreateMaximumSetGen() ElasticSanVolumeGroupCollection collection = elasticSan.GetElasticSanVolumeGroups(); // invoke the operation - string volumeGroupName = "u_5I_1j4t3"; + string volumeGroupName = "volumegroupname"; ElasticSanVolumeGroupData data = new ElasticSanVolumeGroupData() { ProtocolType = StorageTargetType.Iscsi, Encryption = ElasticSanEncryptionType.EncryptionAtRestWithPlatformKey, VirtualNetworkRules = { -new ElasticSanVirtualNetworkRule(new ResourceIdentifier("aaaaaaaaaaaaaaaa")) +new ElasticSanVirtualNetworkRule(new ResourceIdentifier("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}")) { Action = ElasticSanVirtualNetworkRuleAction.Allow, } -}, - Tags = -{ -["key5933"] = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaa", }, }; ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, volumeGroupName, data); @@ -149,7 +145,7 @@ public async Task CreateOrUpdate_VolumeGroupsCreateMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_VolumeGroupsCreateMinimumSetGen() { - // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/VolumeGroups_Create_MinimumSet_Gen.json + // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/VolumeGroups_Create_MinimumSet_Gen.json // this example is just showing the usage of "VolumeGroups_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -159,9 +155,9 @@ public async Task CreateOrUpdate_VolumeGroupsCreateMinimumSetGen() // this example assumes you already have this ElasticSanResource created on azure // for more information of creating ElasticSanResource, please refer to the document of ElasticSanResource - string subscriptionId = "aaaaaaaaaaaaaaaaaa"; - string resourceGroupName = "rgelasticsan"; - string elasticSanName = "ti7q-k952-1qB3J_5"; + string subscriptionId = "subscriptionid"; + string resourceGroupName = "resourcegroupname"; + string elasticSanName = "elasticsanname"; ResourceIdentifier elasticSanResourceId = ElasticSanResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, elasticSanName); ElasticSanResource elasticSan = client.GetElasticSanResource(elasticSanResourceId); @@ -169,7 +165,7 @@ public async Task CreateOrUpdate_VolumeGroupsCreateMinimumSetGen() ElasticSanVolumeGroupCollection collection = elasticSan.GetElasticSanVolumeGroups(); // invoke the operation - string volumeGroupName = "u_5I_1j4t3"; + string volumeGroupName = "volumegroupname"; ElasticSanVolumeGroupData data = new ElasticSanVolumeGroupData(); ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, volumeGroupName, data); ElasticSanVolumeGroupResource result = lro.Value; @@ -186,7 +182,7 @@ public async Task CreateOrUpdate_VolumeGroupsCreateMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_VolumeGroupsGetMaximumSetGen() { - // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/VolumeGroups_Get_MaximumSet_Gen.json + // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/VolumeGroups_Get_MaximumSet_Gen.json // this example is just showing the usage of "VolumeGroups_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -196,9 +192,9 @@ public async Task Get_VolumeGroupsGetMaximumSetGen() // this example assumes you already have this ElasticSanResource created on azure // for more information of creating ElasticSanResource, please refer to the document of ElasticSanResource - string subscriptionId = "aaaaaaaaaaaaaaaaaa"; - string resourceGroupName = "rgelasticsan"; - string elasticSanName = "ti7q-k952-1qB3J_5"; + string subscriptionId = "subscriptionid"; + string resourceGroupName = "resourcegroupname"; + string elasticSanName = "elasticsanname"; ResourceIdentifier elasticSanResourceId = ElasticSanResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, elasticSanName); ElasticSanResource elasticSan = client.GetElasticSanResource(elasticSanResourceId); @@ -206,7 +202,7 @@ public async Task Get_VolumeGroupsGetMaximumSetGen() ElasticSanVolumeGroupCollection collection = elasticSan.GetElasticSanVolumeGroups(); // invoke the operation - string volumeGroupName = "u_5I_1j4t3"; + string volumeGroupName = "volumegroupname"; ElasticSanVolumeGroupResource result = await collection.GetAsync(volumeGroupName); // the variable result is a resource, you could call other operations on this instance as well @@ -221,7 +217,7 @@ public async Task Get_VolumeGroupsGetMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_VolumeGroupsGetMaximumSetGen() { - // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/VolumeGroups_Get_MaximumSet_Gen.json + // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/VolumeGroups_Get_MaximumSet_Gen.json // this example is just showing the usage of "VolumeGroups_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -231,9 +227,9 @@ public async Task Exists_VolumeGroupsGetMaximumSetGen() // this example assumes you already have this ElasticSanResource created on azure // for more information of creating ElasticSanResource, please refer to the document of ElasticSanResource - string subscriptionId = "aaaaaaaaaaaaaaaaaa"; - string resourceGroupName = "rgelasticsan"; - string elasticSanName = "ti7q-k952-1qB3J_5"; + string subscriptionId = "subscriptionid"; + string resourceGroupName = "resourcegroupname"; + string elasticSanName = "elasticsanname"; ResourceIdentifier elasticSanResourceId = ElasticSanResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, elasticSanName); ElasticSanResource elasticSan = client.GetElasticSanResource(elasticSanResourceId); @@ -241,7 +237,7 @@ public async Task Exists_VolumeGroupsGetMaximumSetGen() ElasticSanVolumeGroupCollection collection = elasticSan.GetElasticSanVolumeGroups(); // invoke the operation - string volumeGroupName = "u_5I_1j4t3"; + string volumeGroupName = "volumegroupname"; bool result = await collection.ExistsAsync(volumeGroupName); Console.WriteLine($"Succeeded: {result}"); @@ -252,7 +248,7 @@ public async Task Exists_VolumeGroupsGetMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_VolumeGroupsGetMinimumSetGen() { - // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/VolumeGroups_Get_MinimumSet_Gen.json + // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/VolumeGroups_Get_MinimumSet_Gen.json // this example is just showing the usage of "VolumeGroups_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -262,9 +258,9 @@ public async Task Get_VolumeGroupsGetMinimumSetGen() // this example assumes you already have this ElasticSanResource created on azure // for more information of creating ElasticSanResource, please refer to the document of ElasticSanResource - string subscriptionId = "aaaaaaaaaaaaaaaaaa"; - string resourceGroupName = "rgelasticsan"; - string elasticSanName = "ti7q-k952-1qB3J_5"; + string subscriptionId = "subscriptionid"; + string resourceGroupName = "resourcegroupname"; + string elasticSanName = "elasticsanname"; ResourceIdentifier elasticSanResourceId = ElasticSanResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, elasticSanName); ElasticSanResource elasticSan = client.GetElasticSanResource(elasticSanResourceId); @@ -272,7 +268,7 @@ public async Task Get_VolumeGroupsGetMinimumSetGen() ElasticSanVolumeGroupCollection collection = elasticSan.GetElasticSanVolumeGroups(); // invoke the operation - string volumeGroupName = "u_5I_1j4t3"; + string volumeGroupName = "volumegroupname"; ElasticSanVolumeGroupResource result = await collection.GetAsync(volumeGroupName); // the variable result is a resource, you could call other operations on this instance as well @@ -287,7 +283,7 @@ public async Task Get_VolumeGroupsGetMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_VolumeGroupsGetMinimumSetGen() { - // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/VolumeGroups_Get_MinimumSet_Gen.json + // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/VolumeGroups_Get_MinimumSet_Gen.json // this example is just showing the usage of "VolumeGroups_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -297,9 +293,9 @@ public async Task Exists_VolumeGroupsGetMinimumSetGen() // this example assumes you already have this ElasticSanResource created on azure // for more information of creating ElasticSanResource, please refer to the document of ElasticSanResource - string subscriptionId = "aaaaaaaaaaaaaaaaaa"; - string resourceGroupName = "rgelasticsan"; - string elasticSanName = "ti7q-k952-1qB3J_5"; + string subscriptionId = "subscriptionid"; + string resourceGroupName = "resourcegroupname"; + string elasticSanName = "elasticsanname"; ResourceIdentifier elasticSanResourceId = ElasticSanResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, elasticSanName); ElasticSanResource elasticSan = client.GetElasticSanResource(elasticSanResourceId); @@ -307,7 +303,7 @@ public async Task Exists_VolumeGroupsGetMinimumSetGen() ElasticSanVolumeGroupCollection collection = elasticSan.GetElasticSanVolumeGroups(); // invoke the operation - string volumeGroupName = "u_5I_1j4t3"; + string volumeGroupName = "volumegroupname"; bool result = await collection.ExistsAsync(volumeGroupName); Console.WriteLine($"Succeeded: {result}"); diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/samples/Generated/Samples/Sample_ElasticSanVolumeGroupResource.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/samples/Generated/Samples/Sample_ElasticSanVolumeGroupResource.cs index 648c39c1c0c4e..c4d971fa0c0da 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/samples/Generated/Samples/Sample_ElasticSanVolumeGroupResource.cs +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/samples/Generated/Samples/Sample_ElasticSanVolumeGroupResource.cs @@ -23,7 +23,7 @@ public partial class Sample_ElasticSanVolumeGroupResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_VolumeGroupsUpdateMaximumSetGen() { - // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/VolumeGroups_Update_MaximumSet_Gen.json + // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/VolumeGroups_Update_MaximumSet_Gen.json // this example is just showing the usage of "VolumeGroups_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -33,25 +33,21 @@ public async Task Update_VolumeGroupsUpdateMaximumSetGen() // this example assumes you already have this ElasticSanVolumeGroupResource created on azure // for more information of creating ElasticSanVolumeGroupResource, please refer to the document of ElasticSanVolumeGroupResource - string subscriptionId = "aaaaaaaaaaaaaaaaaa"; - string resourceGroupName = "rgelasticsan"; - string elasticSanName = "ti7q-k952-1qB3J_5"; - string volumeGroupName = "u_5I_1j4t3"; + string subscriptionId = "subscriptionid"; + string resourceGroupName = "resourcegroupname"; + string elasticSanName = "elasticsanname"; + string volumeGroupName = "volumegroupname"; ResourceIdentifier elasticSanVolumeGroupResourceId = ElasticSanVolumeGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, elasticSanName, volumeGroupName); ElasticSanVolumeGroupResource elasticSanVolumeGroup = client.GetElasticSanVolumeGroupResource(elasticSanVolumeGroupResourceId); // invoke the operation ElasticSanVolumeGroupPatch patch = new ElasticSanVolumeGroupPatch() { - Tags = -{ -["key7542"] = "aaaaaaaaaaaaaaaaaaaa", -}, ProtocolType = StorageTargetType.Iscsi, Encryption = ElasticSanEncryptionType.EncryptionAtRestWithPlatformKey, VirtualNetworkRules = { -new ElasticSanVirtualNetworkRule(new ResourceIdentifier("aaaaaaaaaaaaaaaa")) +new ElasticSanVirtualNetworkRule(new ResourceIdentifier("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}")) { Action = ElasticSanVirtualNetworkRuleAction.Allow, } @@ -72,7 +68,7 @@ public async Task Update_VolumeGroupsUpdateMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_VolumeGroupsUpdateMinimumSetGen() { - // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/VolumeGroups_Update_MinimumSet_Gen.json + // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/VolumeGroups_Update_MinimumSet_Gen.json // this example is just showing the usage of "VolumeGroups_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -82,10 +78,10 @@ public async Task Update_VolumeGroupsUpdateMinimumSetGen() // this example assumes you already have this ElasticSanVolumeGroupResource created on azure // for more information of creating ElasticSanVolumeGroupResource, please refer to the document of ElasticSanVolumeGroupResource - string subscriptionId = "aaaaaaaaaaaaaaaaaa"; - string resourceGroupName = "rgelasticsan"; - string elasticSanName = "ti7q-k952-1qB3J_5"; - string volumeGroupName = "u_5I_1j4t3"; + string subscriptionId = "subscriptionid"; + string resourceGroupName = "resourcegroupname"; + string elasticSanName = "elasticsanname"; + string volumeGroupName = "volumegroupname"; ResourceIdentifier elasticSanVolumeGroupResourceId = ElasticSanVolumeGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, elasticSanName, volumeGroupName); ElasticSanVolumeGroupResource elasticSanVolumeGroup = client.GetElasticSanVolumeGroupResource(elasticSanVolumeGroupResourceId); @@ -106,7 +102,7 @@ public async Task Update_VolumeGroupsUpdateMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_VolumeGroupsDeleteMaximumSetGen() { - // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/VolumeGroups_Delete_MaximumSet_Gen.json + // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/VolumeGroups_Delete_MaximumSet_Gen.json // this example is just showing the usage of "VolumeGroups_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -116,10 +112,10 @@ public async Task Delete_VolumeGroupsDeleteMaximumSetGen() // this example assumes you already have this ElasticSanVolumeGroupResource created on azure // for more information of creating ElasticSanVolumeGroupResource, please refer to the document of ElasticSanVolumeGroupResource - string subscriptionId = "aaaaaaaaaaaaaaaaaa"; - string resourceGroupName = "rgelasticsan"; - string elasticSanName = "ti7q-k952-1qB3J_5"; - string volumeGroupName = "u_5I_1j4t3"; + string subscriptionId = "subscriptionid"; + string resourceGroupName = "resourcegroupname"; + string elasticSanName = "elasticsanname"; + string volumeGroupName = "volumegroupname"; ResourceIdentifier elasticSanVolumeGroupResourceId = ElasticSanVolumeGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, elasticSanName, volumeGroupName); ElasticSanVolumeGroupResource elasticSanVolumeGroup = client.GetElasticSanVolumeGroupResource(elasticSanVolumeGroupResourceId); @@ -134,7 +130,7 @@ public async Task Delete_VolumeGroupsDeleteMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_VolumeGroupsDeleteMinimumSetGen() { - // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/VolumeGroups_Delete_MinimumSet_Gen.json + // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/VolumeGroups_Delete_MinimumSet_Gen.json // this example is just showing the usage of "VolumeGroups_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -144,10 +140,10 @@ public async Task Delete_VolumeGroupsDeleteMinimumSetGen() // this example assumes you already have this ElasticSanVolumeGroupResource created on azure // for more information of creating ElasticSanVolumeGroupResource, please refer to the document of ElasticSanVolumeGroupResource - string subscriptionId = "aaaaaaaaaaaaaaaaaa"; - string resourceGroupName = "rgelasticsan"; - string elasticSanName = "ti7q-k952-1qB3J_5"; - string volumeGroupName = "u_5I_1j4t3"; + string subscriptionId = "subscriptionid"; + string resourceGroupName = "resourcegroupname"; + string elasticSanName = "elasticsanname"; + string volumeGroupName = "volumegroupname"; ResourceIdentifier elasticSanVolumeGroupResourceId = ElasticSanVolumeGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, elasticSanName, volumeGroupName); ElasticSanVolumeGroupResource elasticSanVolumeGroup = client.GetElasticSanVolumeGroupResource(elasticSanVolumeGroupResourceId); @@ -162,7 +158,7 @@ public async Task Delete_VolumeGroupsDeleteMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_VolumeGroupsGetMaximumSetGen() { - // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/VolumeGroups_Get_MaximumSet_Gen.json + // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/VolumeGroups_Get_MaximumSet_Gen.json // this example is just showing the usage of "VolumeGroups_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -172,10 +168,10 @@ public async Task Get_VolumeGroupsGetMaximumSetGen() // this example assumes you already have this ElasticSanVolumeGroupResource created on azure // for more information of creating ElasticSanVolumeGroupResource, please refer to the document of ElasticSanVolumeGroupResource - string subscriptionId = "aaaaaaaaaaaaaaaaaa"; - string resourceGroupName = "rgelasticsan"; - string elasticSanName = "ti7q-k952-1qB3J_5"; - string volumeGroupName = "u_5I_1j4t3"; + string subscriptionId = "subscriptionid"; + string resourceGroupName = "resourcegroupname"; + string elasticSanName = "elasticsanname"; + string volumeGroupName = "volumegroupname"; ResourceIdentifier elasticSanVolumeGroupResourceId = ElasticSanVolumeGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, elasticSanName, volumeGroupName); ElasticSanVolumeGroupResource elasticSanVolumeGroup = client.GetElasticSanVolumeGroupResource(elasticSanVolumeGroupResourceId); @@ -194,7 +190,7 @@ public async Task Get_VolumeGroupsGetMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_VolumeGroupsGetMinimumSetGen() { - // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/VolumeGroups_Get_MinimumSet_Gen.json + // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/VolumeGroups_Get_MinimumSet_Gen.json // this example is just showing the usage of "VolumeGroups_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -204,10 +200,10 @@ public async Task Get_VolumeGroupsGetMinimumSetGen() // this example assumes you already have this ElasticSanVolumeGroupResource created on azure // for more information of creating ElasticSanVolumeGroupResource, please refer to the document of ElasticSanVolumeGroupResource - string subscriptionId = "aaaaaaaaaaaaaaaaaa"; - string resourceGroupName = "rgelasticsan"; - string elasticSanName = "ti7q-k952-1qB3J_5"; - string volumeGroupName = "u_5I_1j4t3"; + string subscriptionId = "subscriptionid"; + string resourceGroupName = "resourcegroupname"; + string elasticSanName = "elasticsanname"; + string volumeGroupName = "volumegroupname"; ResourceIdentifier elasticSanVolumeGroupResourceId = ElasticSanVolumeGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, elasticSanName, volumeGroupName); ElasticSanVolumeGroupResource elasticSanVolumeGroup = client.GetElasticSanVolumeGroupResource(elasticSanVolumeGroupResourceId); diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/samples/Generated/Samples/Sample_ElasticSanVolumeResource.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/samples/Generated/Samples/Sample_ElasticSanVolumeResource.cs index 971580dd5e4f3..ce8710505d90b 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/samples/Generated/Samples/Sample_ElasticSanVolumeResource.cs +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/samples/Generated/Samples/Sample_ElasticSanVolumeResource.cs @@ -23,7 +23,7 @@ public partial class Sample_ElasticSanVolumeResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_VolumesUpdateMaximumSetGen() { - // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Volumes_Update_MaximumSet_Gen.json + // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_Update_MaximumSet_Gen.json // this example is just showing the usage of "Volumes_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -33,22 +33,18 @@ public async Task Update_VolumesUpdateMaximumSetGen() // this example assumes you already have this ElasticSanVolumeResource created on azure // for more information of creating ElasticSanVolumeResource, please refer to the document of ElasticSanVolumeResource - string subscriptionId = "aaaaaaaaaaaaaaaaaa"; - string resourceGroupName = "rgelasticsan"; - string elasticSanName = "ti7q-k952-1qB3J_5"; - string volumeGroupName = "u_5I_1j4t3"; - string volumeName = "9132y"; + string subscriptionId = "subscriptionid"; + string resourceGroupName = "resourcegroupname"; + string elasticSanName = "elasticsanname"; + string volumeGroupName = "volumegroupname"; + string volumeName = "volumename"; ResourceIdentifier elasticSanVolumeResourceId = ElasticSanVolumeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, elasticSanName, volumeGroupName, volumeName); ElasticSanVolumeResource elasticSanVolume = client.GetElasticSanVolumeResource(elasticSanVolumeResourceId); // invoke the operation ElasticSanVolumePatch patch = new ElasticSanVolumePatch() { - Tags = -{ -["key1864"] = "aaaaaaaaa", -}, - SizeGiB = 9, + SizeGiB = 11, }; ArmOperation lro = await elasticSanVolume.UpdateAsync(WaitUntil.Completed, patch); ElasticSanVolumeResource result = lro.Value; @@ -65,7 +61,7 @@ public async Task Update_VolumesUpdateMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_VolumesUpdateMinimumSetGen() { - // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Volumes_Update_MinimumSet_Gen.json + // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_Update_MinimumSet_Gen.json // this example is just showing the usage of "Volumes_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -75,11 +71,11 @@ public async Task Update_VolumesUpdateMinimumSetGen() // this example assumes you already have this ElasticSanVolumeResource created on azure // for more information of creating ElasticSanVolumeResource, please refer to the document of ElasticSanVolumeResource - string subscriptionId = "aaaaaaaaaaaaaaaaaa"; - string resourceGroupName = "rgelasticsan"; - string elasticSanName = "ti7q-k952-1qB3J_5"; - string volumeGroupName = "u_5I_1j4t3"; - string volumeName = "9132y"; + string subscriptionId = "subscriptionid"; + string resourceGroupName = "resourcegroupname"; + string elasticSanName = "elasticsanname"; + string volumeGroupName = "volumegroupname"; + string volumeName = "volumename"; ResourceIdentifier elasticSanVolumeResourceId = ElasticSanVolumeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, elasticSanName, volumeGroupName, volumeName); ElasticSanVolumeResource elasticSanVolume = client.GetElasticSanVolumeResource(elasticSanVolumeResourceId); @@ -100,7 +96,7 @@ public async Task Update_VolumesUpdateMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_VolumesDeleteMaximumSetGen() { - // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Volumes_Delete_MaximumSet_Gen.json + // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_Delete_MaximumSet_Gen.json // this example is just showing the usage of "Volumes_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -110,11 +106,11 @@ public async Task Delete_VolumesDeleteMaximumSetGen() // this example assumes you already have this ElasticSanVolumeResource created on azure // for more information of creating ElasticSanVolumeResource, please refer to the document of ElasticSanVolumeResource - string subscriptionId = "aaaaaaaaaaaaaaaaaa"; - string resourceGroupName = "rgelasticsan"; - string elasticSanName = "ti7q-k952-1qB3J_5"; - string volumeGroupName = "u_5I_1j4t3"; - string volumeName = "9132y"; + string subscriptionId = "subscriptionid"; + string resourceGroupName = "resourcegroupname"; + string elasticSanName = "elasticsanname"; + string volumeGroupName = "volumegroupname"; + string volumeName = "volumename"; ResourceIdentifier elasticSanVolumeResourceId = ElasticSanVolumeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, elasticSanName, volumeGroupName, volumeName); ElasticSanVolumeResource elasticSanVolume = client.GetElasticSanVolumeResource(elasticSanVolumeResourceId); @@ -129,7 +125,7 @@ public async Task Delete_VolumesDeleteMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_VolumesDeleteMinimumSetGen() { - // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Volumes_Delete_MinimumSet_Gen.json + // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_Delete_MinimumSet_Gen.json // this example is just showing the usage of "Volumes_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -139,11 +135,11 @@ public async Task Delete_VolumesDeleteMinimumSetGen() // this example assumes you already have this ElasticSanVolumeResource created on azure // for more information of creating ElasticSanVolumeResource, please refer to the document of ElasticSanVolumeResource - string subscriptionId = "aaaaaaaaaaaaaaaaaa"; - string resourceGroupName = "rgelasticsan"; - string elasticSanName = "ti7q-k952-1qB3J_5"; - string volumeGroupName = "u_5I_1j4t3"; - string volumeName = "9132y"; + string subscriptionId = "subscriptionid"; + string resourceGroupName = "resourcegroupname"; + string elasticSanName = "elasticsanname"; + string volumeGroupName = "volumegroupname"; + string volumeName = "volumename"; ResourceIdentifier elasticSanVolumeResourceId = ElasticSanVolumeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, elasticSanName, volumeGroupName, volumeName); ElasticSanVolumeResource elasticSanVolume = client.GetElasticSanVolumeResource(elasticSanVolumeResourceId); @@ -158,7 +154,7 @@ public async Task Delete_VolumesDeleteMinimumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_VolumesGetMaximumSetGen() { - // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Volumes_Get_MaximumSet_Gen.json + // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_Get_MaximumSet_Gen.json // this example is just showing the usage of "Volumes_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -168,11 +164,11 @@ public async Task Get_VolumesGetMaximumSetGen() // this example assumes you already have this ElasticSanVolumeResource created on azure // for more information of creating ElasticSanVolumeResource, please refer to the document of ElasticSanVolumeResource - string subscriptionId = "aaaaaaaaaaaaaaaaaa"; - string resourceGroupName = "rgelasticsan"; - string elasticSanName = "ti7q-k952-1qB3J_5"; - string volumeGroupName = "u_5I_1j4t3"; - string volumeName = "9132y"; + string subscriptionId = "subscriptionid"; + string resourceGroupName = "resourcegroupname"; + string elasticSanName = "elasticsanname"; + string volumeGroupName = "volumegroupname"; + string volumeName = "volumename"; ResourceIdentifier elasticSanVolumeResourceId = ElasticSanVolumeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, elasticSanName, volumeGroupName, volumeName); ElasticSanVolumeResource elasticSanVolume = client.GetElasticSanVolumeResource(elasticSanVolumeResourceId); @@ -191,7 +187,7 @@ public async Task Get_VolumesGetMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_VolumesGetMinimumSetGen() { - // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Volumes_Get_MinimumSet_Gen.json + // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Volumes_Get_MinimumSet_Gen.json // this example is just showing the usage of "Volumes_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -201,11 +197,11 @@ public async Task Get_VolumesGetMinimumSetGen() // this example assumes you already have this ElasticSanVolumeResource created on azure // for more information of creating ElasticSanVolumeResource, please refer to the document of ElasticSanVolumeResource - string subscriptionId = "aaaaaaaaaaaaaaaaaa"; - string resourceGroupName = "rgelasticsan"; - string elasticSanName = "ti7q-k952-1qB3J_5"; - string volumeGroupName = "u_5I_1j4t3"; - string volumeName = "9132y"; + string subscriptionId = "subscriptionid"; + string resourceGroupName = "resourcegroupname"; + string elasticSanName = "elasticsanname"; + string volumeGroupName = "volumegroupname"; + string volumeName = "volumename"; ResourceIdentifier elasticSanVolumeResourceId = ElasticSanVolumeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, elasticSanName, volumeGroupName, volumeName); ElasticSanVolumeResource elasticSanVolume = client.GetElasticSanVolumeResource(elasticSanVolumeResourceId); diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs index cf01999674de2..f222a0f412e60 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -23,7 +23,7 @@ public partial class Sample_SubscriptionResourceExtensions [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetSkus_SkusListMaximumSetGen() { - // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Skus_List_MaximumSet_Gen.json + // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Skus_List_MaximumSet_Gen.json // this example is just showing the usage of "Skus_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -33,12 +33,12 @@ public async Task GetSkus_SkusListMaximumSetGen() // this example assumes you already have this SubscriptionResource created on azure // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "aaaaaaaaaaaaaaaaaa"; + string subscriptionId = "subscriptionid"; ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); // invoke the operation and iterate over the result - string filter = "aaaa"; + string filter = "dtycml"; await foreach (ElasticSanSkuInformation item in subscriptionResource.GetSkusAsync(filter: filter)) { Console.WriteLine($"Succeeded: {item}"); @@ -52,7 +52,7 @@ public async Task GetSkus_SkusListMaximumSetGen() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetSkus_SkusListMinimumSetGen() { - // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2021-11-20-preview/examples/Skus_List_MinimumSet_Gen.json + // Generated from example definition: specification/elasticsan/resource-manager/Microsoft.ElasticSan/preview/2022-12-01-preview/examples/Skus_List_MinimumSet_Gen.json // this example is just showing the usage of "Skus_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -62,7 +62,7 @@ public async Task GetSkus_SkusListMinimumSetGen() // this example assumes you already have this SubscriptionResource created on azure // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "aaaaaaaaaaaaaaaaaa"; + string subscriptionId = "subscriptionid"; ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/ArmElasticSanModelFactory.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/ArmElasticSanModelFactory.cs index b912aadcf7207..3eb73b6865a47 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/ArmElasticSanModelFactory.cs +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/ArmElasticSanModelFactory.cs @@ -71,13 +71,32 @@ public static ElasticSanSkuCapability ElasticSanSkuCapability(string name = null /// Total Provisioned IOPS of the Elastic San appliance. /// Total Provisioned MBps Elastic San appliance. /// Total size of the Elastic San appliance in TB. + /// The list of Private Endpoint Connections. /// A new instance for mocking. - public static ElasticSanData ElasticSanData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ElasticSanSku sku = null, IEnumerable availabilityZones = null, ElasticSanProvisioningState? provisioningState = null, long baseSizeTiB = default, long extendedCapacitySizeTiB = default, long? totalVolumeSizeGiB = null, long? volumeGroupCount = null, long? totalIops = null, long? totalMbps = null, long? totalSizeTiB = null) + public static ElasticSanData ElasticSanData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ElasticSanSku sku = null, IEnumerable availabilityZones = null, ElasticSanProvisioningState? provisioningState = null, long baseSizeTiB = default, long extendedCapacitySizeTiB = default, long? totalVolumeSizeGiB = null, long? volumeGroupCount = null, long? totalIops = null, long? totalMbps = null, long? totalSizeTiB = null, IEnumerable privateEndpointConnections = null) { tags ??= new Dictionary(); availabilityZones ??= new List(); + privateEndpointConnections ??= new List(); - return new ElasticSanData(id, name, resourceType, systemData, tags, location, sku, availabilityZones?.ToList(), provisioningState, baseSizeTiB, extendedCapacitySizeTiB, totalVolumeSizeGiB, volumeGroupCount, totalIops, totalMbps, totalSizeTiB); + return new ElasticSanData(id, name, resourceType, systemData, tags, location, sku, availabilityZones?.ToList(), provisioningState, baseSizeTiB, extendedCapacitySizeTiB, totalVolumeSizeGiB, volumeGroupCount, totalIops, totalMbps, totalSizeTiB, privateEndpointConnections?.ToList()); + } + + /// Initializes a new instance of ElasticSanPrivateEndpointConnectionData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Provisioning State of Private Endpoint connection resource. + /// Private Endpoint resource. + /// Private Link Service Connection State. + /// List of resources private endpoint is mapped. + /// A new instance for mocking. + public static ElasticSanPrivateEndpointConnectionData ElasticSanPrivateEndpointConnectionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ElasticSanProvisioningState? provisioningState = null, ResourceIdentifier privateEndpointId = null, ElasticSanPrivateLinkServiceConnectionState connectionState = null, IEnumerable groupIds = null) + { + groupIds ??= new List(); + + return new ElasticSanPrivateEndpointConnectionData(id, name, resourceType, systemData, provisioningState, privateEndpointId != null ? ResourceManagerModelFactory.SubResource(privateEndpointId) : null, connectionState, groupIds?.ToList()); } /// Initializes a new instance of ElasticSanVolumeGroupData. @@ -89,14 +108,14 @@ public static ElasticSanData ElasticSanData(ResourceIdentifier id = null, string /// Type of storage target. /// Type of encryption. /// A collection of rules governing the accessibility from specific network locations. - /// Azure resource tags. + /// The list of Private Endpoint Connections. /// A new instance for mocking. - public static ElasticSanVolumeGroupData ElasticSanVolumeGroupData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ElasticSanProvisioningState? provisioningState = null, StorageTargetType? protocolType = null, ElasticSanEncryptionType? encryption = null, IEnumerable virtualNetworkRules = null, IDictionary tags = null) + public static ElasticSanVolumeGroupData ElasticSanVolumeGroupData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ElasticSanProvisioningState? provisioningState = null, StorageTargetType? protocolType = null, ElasticSanEncryptionType? encryption = null, IEnumerable virtualNetworkRules = null, IEnumerable privateEndpointConnections = null) { virtualNetworkRules ??= new List(); - tags ??= new Dictionary(); + privateEndpointConnections ??= new List(); - return new ElasticSanVolumeGroupData(id, name, resourceType, systemData, provisioningState, protocolType, encryption, virtualNetworkRules != null ? new NetworkRuleSet(virtualNetworkRules?.ToList()) : null, tags); + return new ElasticSanVolumeGroupData(id, name, resourceType, systemData, provisioningState, protocolType, encryption, virtualNetworkRules != null ? new NetworkRuleSet(virtualNetworkRules?.ToList()) : null, privateEndpointConnections?.ToList()); } /// Initializes a new instance of ElasticSanVirtualNetworkRule. @@ -118,13 +137,10 @@ public static ElasticSanVirtualNetworkRule ElasticSanVirtualNetworkRule(Resource /// State of the operation on the resource. /// Volume size. /// Storage target information. - /// Azure resource tags. /// A new instance for mocking. - public static ElasticSanVolumeData ElasticSanVolumeData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, Guid? volumeId = null, ElasticSanVolumeDataSourceInfo creationData = null, long? sizeGiB = null, IscsiTargetInfo storageTarget = null, IDictionary tags = null) + public static ElasticSanVolumeData ElasticSanVolumeData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, Guid? volumeId = null, ElasticSanVolumeDataSourceInfo creationData = null, long sizeGiB = default, IscsiTargetInfo storageTarget = null) { - tags ??= new Dictionary(); - - return new ElasticSanVolumeData(id, name, resourceType, systemData, volumeId, creationData, sizeGiB, storageTarget, tags); + return new ElasticSanVolumeData(id, name, resourceType, systemData, volumeId, creationData, sizeGiB, storageTarget); } /// Initializes a new instance of IscsiTargetInfo. @@ -138,5 +154,22 @@ public static IscsiTargetInfo IscsiTargetInfo(string targetIqn = null, string ta { return new IscsiTargetInfo(targetIqn, targetPortalHostname, targetPortalPort, provisioningState, status); } + + /// Initializes a new instance of ElasticSanPrivateLinkResource. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// 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 ElasticSanPrivateLinkResource ElasticSanPrivateLinkResource(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string groupId = null, IEnumerable requiredMembers = null, IEnumerable requiredZoneNames = null) + { + requiredMembers ??= new List(); + requiredZoneNames ??= new List(); + + return new ElasticSanPrivateLinkResource(id, name, resourceType, systemData, groupId, requiredMembers?.ToList(), requiredZoneNames?.ToList()); + } } } diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/ElasticSanCollection.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/ElasticSanCollection.cs index 612e4d796eb01..7605589eb8695 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/ElasticSanCollection.cs +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/ElasticSanCollection.cs @@ -82,7 +82,7 @@ public virtual async Task> CreateOrUpdateAsync( try { var response = await _elasticSanRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, elasticSanName, data, cancellationToken).ConfigureAwait(false); - var operation = new ElasticSanArmOperation(new ElasticSanOperationSource(Client), _elasticSanClientDiagnostics, Pipeline, _elasticSanRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, elasticSanName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var operation = new ElasticSanArmOperation(new ElasticSanOperationSource(Client), _elasticSanClientDiagnostics, Pipeline, _elasticSanRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, elasticSanName, data).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -123,7 +123,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitUnt try { var response = _elasticSanRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, elasticSanName, data, cancellationToken); - var operation = new ElasticSanArmOperation(new ElasticSanOperationSource(Client), _elasticSanClientDiagnostics, Pipeline, _elasticSanRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, elasticSanName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var operation = new ElasticSanArmOperation(new ElasticSanOperationSource(Client), _elasticSanClientDiagnostics, Pipeline, _elasticSanRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, elasticSanName, data).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/ElasticSanData.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/ElasticSanData.cs index ac2b090180468..0a8a4b399bce2 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/ElasticSanData.cs +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/ElasticSanData.cs @@ -33,6 +33,7 @@ public ElasticSanData(AzureLocation location, ElasticSanSku sku, long baseSizeTi AvailabilityZones = new ChangeTrackingList(); BaseSizeTiB = baseSizeTiB; ExtendedCapacitySizeTiB = extendedCapacitySizeTiB; + PrivateEndpointConnections = new ChangeTrackingList(); } /// Initializes a new instance of ElasticSanData. @@ -52,7 +53,8 @@ public ElasticSanData(AzureLocation location, ElasticSanSku sku, long baseSizeTi /// Total Provisioned IOPS of the Elastic San appliance. /// Total Provisioned MBps Elastic San appliance. /// Total size of the Elastic San appliance in TB. - internal ElasticSanData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ElasticSanSku sku, IList availabilityZones, ElasticSanProvisioningState? provisioningState, long baseSizeTiB, long extendedCapacitySizeTiB, long? totalVolumeSizeGiB, long? volumeGroupCount, long? totalIops, long? totalMbps, long? totalSizeTiB) : base(id, name, resourceType, systemData, tags, location) + /// The list of Private Endpoint Connections. + internal ElasticSanData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ElasticSanSku sku, IList availabilityZones, ElasticSanProvisioningState? provisioningState, long baseSizeTiB, long extendedCapacitySizeTiB, long? totalVolumeSizeGiB, long? volumeGroupCount, long? totalIops, long? totalMbps, long? totalSizeTiB, IReadOnlyList privateEndpointConnections) : base(id, name, resourceType, systemData, tags, location) { Sku = sku; AvailabilityZones = availabilityZones; @@ -64,6 +66,7 @@ internal ElasticSanData(ResourceIdentifier id, string name, ResourceType resourc TotalIops = totalIops; TotalMbps = totalMbps; TotalSizeTiB = totalSizeTiB; + PrivateEndpointConnections = privateEndpointConnections; } /// resource sku. @@ -86,5 +89,7 @@ internal ElasticSanData(ResourceIdentifier id, string name, ResourceType resourc public long? TotalMbps { get; } /// Total size of the Elastic San appliance in TB. public long? TotalSizeTiB { get; } + /// The list of Private Endpoint Connections. + public IReadOnlyList PrivateEndpointConnections { get; } } } diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/ElasticSanPrivateEndpointConnectionCollection.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/ElasticSanPrivateEndpointConnectionCollection.cs new file mode 100644 index 0000000000000..3db2fff7f6c5f --- /dev/null +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/ElasticSanPrivateEndpointConnectionCollection.cs @@ -0,0 +1,338 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.ElasticSan +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get an instance call the GetElasticSanPrivateEndpointConnections method from an instance of . + /// + public partial class ElasticSanPrivateEndpointConnectionCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _elasticSanPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics; + private readonly PrivateEndpointConnectionsRestOperations _elasticSanPrivateEndpointConnectionPrivateEndpointConnectionsRestClient; + + /// Initializes a new instance of the class for mocking. + protected ElasticSanPrivateEndpointConnectionCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal ElasticSanPrivateEndpointConnectionCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _elasticSanPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ElasticSan", ElasticSanPrivateEndpointConnectionResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ElasticSanPrivateEndpointConnectionResource.ResourceType, out string elasticSanPrivateEndpointConnectionPrivateEndpointConnectionsApiVersion); + _elasticSanPrivateEndpointConnectionPrivateEndpointConnectionsRestClient = new PrivateEndpointConnectionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, elasticSanPrivateEndpointConnectionPrivateEndpointConnectionsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ElasticSanResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ElasticSanResource.ResourceType), nameof(id)); + } + + /// + /// Update the state of specified private endpoint connection associated with the Elastic San + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnections_Create + /// + /// + /// + /// 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. + /// The name of the Private Endpoint connection. + /// Private Endpoint Connection Approval object. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string privateEndpointConnectionName, ElasticSanPrivateEndpointConnectionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _elasticSanPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("ElasticSanPrivateEndpointConnectionCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _elasticSanPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, data, cancellationToken).ConfigureAwait(false); + var operation = new ElasticSanArmOperation(new ElasticSanPrivateEndpointConnectionOperationSource(Client), _elasticSanPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics, Pipeline, _elasticSanPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update the state of specified private endpoint connection associated with the Elastic San + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnections_Create + /// + /// + /// + /// 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. + /// The name of the Private Endpoint connection. + /// Private Endpoint Connection Approval object. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string privateEndpointConnectionName, ElasticSanPrivateEndpointConnectionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _elasticSanPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("ElasticSanPrivateEndpointConnectionCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _elasticSanPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, data, cancellationToken); + var operation = new ElasticSanArmOperation(new ElasticSanPrivateEndpointConnectionOperationSource(Client), _elasticSanPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics, Pipeline, _elasticSanPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the specified private endpoint connection associated with the Elastic San + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnections_Get + /// + /// + /// + /// The name of the Private Endpoint connection. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var scope = _elasticSanPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("ElasticSanPrivateEndpointConnectionCollection.Get"); + scope.Start(); + try + { + var response = await _elasticSanPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ElasticSanPrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the specified private endpoint connection associated with the Elastic San + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnections_Get + /// + /// + /// + /// The name of the Private Endpoint connection. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var scope = _elasticSanPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("ElasticSanPrivateEndpointConnectionCollection.Get"); + scope.Start(); + try + { + var response = _elasticSanPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ElasticSanPrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List all Private Endpoint Connections associated with the Elastic San. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateEndpointConnections + /// + /// + /// Operation Id + /// PrivateEndpointConnections_List + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _elasticSanPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return PageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new ElasticSanPrivateEndpointConnectionResource(Client, ElasticSanPrivateEndpointConnectionData.DeserializeElasticSanPrivateEndpointConnectionData(e)), _elasticSanPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics, Pipeline, "ElasticSanPrivateEndpointConnectionCollection.GetAll", "value", null, cancellationToken); + } + + /// + /// List all Private Endpoint Connections associated with the Elastic San. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateEndpointConnections + /// + /// + /// Operation Id + /// PrivateEndpointConnections_List + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _elasticSanPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return PageableHelpers.CreatePageable(FirstPageRequest, null, e => new ElasticSanPrivateEndpointConnectionResource(Client, ElasticSanPrivateEndpointConnectionData.DeserializeElasticSanPrivateEndpointConnectionData(e)), _elasticSanPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics, Pipeline, "ElasticSanPrivateEndpointConnectionCollection.GetAll", "value", null, cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnections_Get + /// + /// + /// + /// The name of the Private Endpoint connection. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var scope = _elasticSanPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("ElasticSanPrivateEndpointConnectionCollection.Exists"); + scope.Start(); + try + { + var response = await _elasticSanPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnections_Get + /// + /// + /// + /// The name of the Private Endpoint connection. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var scope = _elasticSanPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("ElasticSanPrivateEndpointConnectionCollection.Exists"); + scope.Start(); + try + { + var response = _elasticSanPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/ElasticSanPrivateEndpointConnectionData.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/ElasticSanPrivateEndpointConnectionData.cs new file mode 100644 index 0000000000000..ea82a63455243 --- /dev/null +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/ElasticSanPrivateEndpointConnectionData.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.ElasticSan.Models; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.ElasticSan +{ + /// + /// A class representing the ElasticSanPrivateEndpointConnection data model. + /// Response for PrivateEndpoint Connection object + /// + public partial class ElasticSanPrivateEndpointConnectionData : ResourceData + { + /// Initializes a new instance of ElasticSanPrivateEndpointConnectionData. + /// Private Link Service Connection State. + /// is null. + public ElasticSanPrivateEndpointConnectionData(ElasticSanPrivateLinkServiceConnectionState connectionState) + { + Argument.AssertNotNull(connectionState, nameof(connectionState)); + + ConnectionState = connectionState; + GroupIds = new ChangeTrackingList(); + } + + /// Initializes a new instance of ElasticSanPrivateEndpointConnectionData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Provisioning State of Private Endpoint connection resource. + /// Private Endpoint resource. + /// Private Link Service Connection State. + /// List of resources private endpoint is mapped. + internal ElasticSanPrivateEndpointConnectionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ElasticSanProvisioningState? provisioningState, SubResource privateEndpoint, ElasticSanPrivateLinkServiceConnectionState connectionState, IList groupIds) : base(id, name, resourceType, systemData) + { + ProvisioningState = provisioningState; + PrivateEndpoint = privateEndpoint; + ConnectionState = connectionState; + GroupIds = groupIds; + } + + /// Provisioning State of Private Endpoint connection resource. + public ElasticSanProvisioningState? ProvisioningState { get; } + /// Private Endpoint resource. + internal SubResource PrivateEndpoint { get; set; } + /// Gets Id. + public ResourceIdentifier PrivateEndpointId + { + get => PrivateEndpoint is null ? default : PrivateEndpoint.Id; + } + + /// Private Link Service Connection State. + public ElasticSanPrivateLinkServiceConnectionState ConnectionState { get; set; } + /// List of resources private endpoint is mapped. + public IList GroupIds { get; } + } +} diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/ElasticSanPrivateEndpointConnectionResource.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/ElasticSanPrivateEndpointConnectionResource.cs new file mode 100644 index 0000000000000..148cb8b91b6a1 --- /dev/null +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/ElasticSanPrivateEndpointConnectionResource.cs @@ -0,0 +1,297 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.ElasticSan +{ + /// + /// A Class representing an ElasticSanPrivateEndpointConnection along with the instance operations that can be performed on it. + /// If you have a you can construct an + /// from an instance of using the GetElasticSanPrivateEndpointConnectionResource method. + /// Otherwise you can get one from its parent resource using the GetElasticSanPrivateEndpointConnection method. + /// + public partial class ElasticSanPrivateEndpointConnectionResource : ArmResource + { + /// Generate the resource identifier of a instance. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string elasticSanName, string privateEndpointConnectionName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateEndpointConnections/{privateEndpointConnectionName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _elasticSanPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics; + private readonly PrivateEndpointConnectionsRestOperations _elasticSanPrivateEndpointConnectionPrivateEndpointConnectionsRestClient; + private readonly ElasticSanPrivateEndpointConnectionData _data; + + /// Initializes a new instance of the class for mocking. + protected ElasticSanPrivateEndpointConnectionResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal ElasticSanPrivateEndpointConnectionResource(ArmClient client, ElasticSanPrivateEndpointConnectionData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal ElasticSanPrivateEndpointConnectionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _elasticSanPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ElasticSan", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string elasticSanPrivateEndpointConnectionPrivateEndpointConnectionsApiVersion); + _elasticSanPrivateEndpointConnectionPrivateEndpointConnectionsRestClient = new PrivateEndpointConnectionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, elasticSanPrivateEndpointConnectionPrivateEndpointConnectionsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.ElasticSan/elasticSans/privateEndpointConnections"; + + /// 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 ElasticSanPrivateEndpointConnectionData 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 the specified private endpoint connection associated with the Elastic San + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnections_Get + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _elasticSanPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("ElasticSanPrivateEndpointConnectionResource.Get"); + scope.Start(); + try + { + var response = await _elasticSanPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ElasticSanPrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the specified private endpoint connection associated with the Elastic San + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnections_Get + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _elasticSanPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("ElasticSanPrivateEndpointConnectionResource.Get"); + scope.Start(); + try + { + var response = _elasticSanPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ElasticSanPrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes the specified private endpoint connection associated with the Elastic San + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnections_Delete + /// + /// + /// + /// 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. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _elasticSanPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("ElasticSanPrivateEndpointConnectionResource.Delete"); + scope.Start(); + try + { + var response = await _elasticSanPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ElasticSanArmOperation(_elasticSanPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics, Pipeline, _elasticSanPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes the specified private endpoint connection associated with the Elastic San + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnections_Delete + /// + /// + /// + /// 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. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _elasticSanPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("ElasticSanPrivateEndpointConnectionResource.Delete"); + scope.Start(); + try + { + var response = _elasticSanPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new ElasticSanArmOperation(_elasticSanPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics, Pipeline, _elasticSanPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update the state of specified private endpoint connection associated with the Elastic San + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnections_Create + /// + /// + /// + /// 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. + /// Private Endpoint Connection Approval object. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, ElasticSanPrivateEndpointConnectionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _elasticSanPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("ElasticSanPrivateEndpointConnectionResource.Update"); + scope.Start(); + try + { + var response = await _elasticSanPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new ElasticSanArmOperation(new ElasticSanPrivateEndpointConnectionOperationSource(Client), _elasticSanPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics, Pipeline, _elasticSanPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update the state of specified private endpoint connection associated with the Elastic San + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnections_Create + /// + /// + /// + /// 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. + /// Private Endpoint Connection Approval object. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, ElasticSanPrivateEndpointConnectionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _elasticSanPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("ElasticSanPrivateEndpointConnectionResource.Update"); + scope.Start(); + try + { + var response = _elasticSanPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new ElasticSanArmOperation(new ElasticSanPrivateEndpointConnectionOperationSource(Client), _elasticSanPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics, Pipeline, _elasticSanPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/ElasticSanResource.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/ElasticSanResource.cs index ab6fa26ae9fe2..ee2f9156e8ce4 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/ElasticSanResource.cs +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/ElasticSanResource.cs @@ -36,6 +36,8 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, private readonly ClientDiagnostics _elasticSanClientDiagnostics; private readonly ElasticSansRestOperations _elasticSanRestClient; + private readonly ClientDiagnostics _privateLinkResourcesClientDiagnostics; + private readonly PrivateLinkResourcesRestOperations _privateLinkResourcesRestClient; private readonly ElasticSanData _data; /// Initializes a new instance of the class for mocking. @@ -60,6 +62,8 @@ internal ElasticSanResource(ArmClient client, ResourceIdentifier id) : base(clie _elasticSanClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ElasticSan", ResourceType.Namespace, Diagnostics); TryGetApiVersion(ResourceType, out string elasticSanApiVersion); _elasticSanRestClient = new ElasticSansRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, elasticSanApiVersion); + _privateLinkResourcesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ElasticSan", ProviderConstants.DefaultProviderNamespace, Diagnostics); + _privateLinkResourcesRestClient = new PrivateLinkResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); #if DEBUG ValidateResourceId(Id); #endif @@ -142,6 +146,59 @@ public virtual Response GetElasticSanVolumeGroup( return GetElasticSanVolumeGroups().Get(volumeGroupName, cancellationToken); } + /// Gets a collection of ElasticSanPrivateEndpointConnectionResources in the ElasticSan. + /// An object representing collection of ElasticSanPrivateEndpointConnectionResources and their operations over a ElasticSanPrivateEndpointConnectionResource. + public virtual ElasticSanPrivateEndpointConnectionCollection GetElasticSanPrivateEndpointConnections() + { + return GetCachedClient(Client => new ElasticSanPrivateEndpointConnectionCollection(Client, Id)); + } + + /// + /// Gets the specified private endpoint connection associated with the Elastic San + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnections_Get + /// + /// + /// + /// The name of the Private Endpoint connection. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual async Task> GetElasticSanPrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + return await GetElasticSanPrivateEndpointConnections().GetAsync(privateEndpointConnectionName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the specified private endpoint connection associated with the Elastic San + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnections_Get + /// + /// + /// + /// The name of the Private Endpoint connection. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual Response GetElasticSanPrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + return GetElasticSanPrivateEndpointConnections().Get(privateEndpointConnectionName, cancellationToken); + } + /// /// Get a ElasticSan. /// @@ -228,7 +285,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell try { var response = await _elasticSanRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ElasticSanArmOperation(_elasticSanClientDiagnostics, Pipeline, _elasticSanRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var operation = new ElasticSanArmOperation(_elasticSanClientDiagnostics, Pipeline, _elasticSanRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -262,7 +319,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel try { var response = _elasticSanRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - var operation = new ElasticSanArmOperation(_elasticSanClientDiagnostics, Pipeline, _elasticSanRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var operation = new ElasticSanArmOperation(_elasticSanClientDiagnostics, Pipeline, _elasticSanRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -300,7 +357,7 @@ public virtual async Task> UpdateAsync(WaitUnti try { var response = await _elasticSanRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); - var operation = new ElasticSanArmOperation(new ElasticSanOperationSource(Client), _elasticSanClientDiagnostics, Pipeline, _elasticSanRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var operation = new ElasticSanArmOperation(new ElasticSanOperationSource(Client), _elasticSanClientDiagnostics, Pipeline, _elasticSanRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -338,7 +395,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, Elas try { var response = _elasticSanRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); - var operation = new ElasticSanArmOperation(new ElasticSanOperationSource(Client), _elasticSanClientDiagnostics, Pipeline, _elasticSanRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var operation = new ElasticSanArmOperation(new ElasticSanOperationSource(Client), _elasticSanClientDiagnostics, Pipeline, _elasticSanRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -350,6 +407,48 @@ public virtual ArmOperation Update(WaitUntil waitUntil, Elas } } + /// + /// Gets the private link resources that need to be created for a elastic San. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateLinkResources + /// + /// + /// Operation Id + /// PrivateLinkResources_ListByElasticSan + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetPrivateLinkResourcesAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _privateLinkResourcesRestClient.CreateListByElasticSanRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return PageableHelpers.CreateAsyncPageable(FirstPageRequest, null, ElasticSanPrivateLinkResource.DeserializeElasticSanPrivateLinkResource, _privateLinkResourcesClientDiagnostics, Pipeline, "ElasticSanResource.GetPrivateLinkResources", "value", null, cancellationToken); + } + + /// + /// Gets the private link resources that need to be created for a elastic San. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/privateLinkResources + /// + /// + /// Operation Id + /// PrivateLinkResources_ListByElasticSan + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetPrivateLinkResources(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _privateLinkResourcesRestClient.CreateListByElasticSanRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return PageableHelpers.CreatePageable(FirstPageRequest, null, ElasticSanPrivateLinkResource.DeserializeElasticSanPrivateLinkResource, _privateLinkResourcesClientDiagnostics, Pipeline, "ElasticSanResource.GetPrivateLinkResources", "value", null, cancellationToken); + } + /// /// Add a tag to the current resource. /// diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/ElasticSanVolumeCollection.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/ElasticSanVolumeCollection.cs index 1d62a3ebdc8cb..15e32257eea7d 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/ElasticSanVolumeCollection.cs +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/ElasticSanVolumeCollection.cs @@ -81,7 +81,7 @@ public virtual async Task> CreateOrUpdate try { var response = await _elasticSanVolumeVolumesRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, volumeName, data, cancellationToken).ConfigureAwait(false); - var operation = new ElasticSanArmOperation(new ElasticSanVolumeOperationSource(Client), _elasticSanVolumeVolumesClientDiagnostics, Pipeline, _elasticSanVolumeVolumesRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, volumeName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var operation = new ElasticSanArmOperation(new ElasticSanVolumeOperationSource(Client), _elasticSanVolumeVolumesClientDiagnostics, Pipeline, _elasticSanVolumeVolumesRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, volumeName, data).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -122,7 +122,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil w try { var response = _elasticSanVolumeVolumesRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, volumeName, data, cancellationToken); - var operation = new ElasticSanArmOperation(new ElasticSanVolumeOperationSource(Client), _elasticSanVolumeVolumesClientDiagnostics, Pipeline, _elasticSanVolumeVolumesRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, volumeName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var operation = new ElasticSanArmOperation(new ElasticSanVolumeOperationSource(Client), _elasticSanVolumeVolumesClientDiagnostics, Pipeline, _elasticSanVolumeVolumesRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, volumeName, data).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/ElasticSanVolumeData.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/ElasticSanVolumeData.cs index bb18389867620..1755444191965 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/ElasticSanVolumeData.cs +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/ElasticSanVolumeData.cs @@ -6,7 +6,6 @@ #nullable disable using System; -using System.Collections.Generic; using Azure.Core; using Azure.ResourceManager.ElasticSan.Models; using Azure.ResourceManager.Models; @@ -20,9 +19,10 @@ namespace Azure.ResourceManager.ElasticSan public partial class ElasticSanVolumeData : ResourceData { /// Initializes a new instance of ElasticSanVolumeData. - public ElasticSanVolumeData() + /// Volume size. + public ElasticSanVolumeData(long sizeGiB) { - Tags = new ChangeTrackingDictionary(); + SizeGiB = sizeGiB; } /// Initializes a new instance of ElasticSanVolumeData. @@ -34,14 +34,12 @@ public ElasticSanVolumeData() /// State of the operation on the resource. /// Volume size. /// Storage target information. - /// Azure resource tags. - internal ElasticSanVolumeData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, Guid? volumeId, ElasticSanVolumeDataSourceInfo creationData, long? sizeGiB, IscsiTargetInfo storageTarget, IDictionary tags) : base(id, name, resourceType, systemData) + internal ElasticSanVolumeData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, Guid? volumeId, ElasticSanVolumeDataSourceInfo creationData, long sizeGiB, IscsiTargetInfo storageTarget) : base(id, name, resourceType, systemData) { VolumeId = volumeId; CreationData = creationData; SizeGiB = sizeGiB; StorageTarget = storageTarget; - Tags = tags; } /// Unique Id of the volume in GUID format. @@ -49,10 +47,8 @@ internal ElasticSanVolumeData(ResourceIdentifier id, string name, ResourceType r /// State of the operation on the resource. public ElasticSanVolumeDataSourceInfo CreationData { get; set; } /// Volume size. - public long? SizeGiB { get; set; } + public long SizeGiB { get; set; } /// Storage target information. public IscsiTargetInfo StorageTarget { get; } - /// Azure resource tags. - public IDictionary Tags { get; } } } diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/ElasticSanVolumeGroupCollection.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/ElasticSanVolumeGroupCollection.cs index 8e6454156ef96..e0a173939822b 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/ElasticSanVolumeGroupCollection.cs +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/ElasticSanVolumeGroupCollection.cs @@ -81,7 +81,7 @@ public virtual async Task> CreateOrU try { var response = await _elasticSanVolumeGroupVolumeGroupsRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, volumeGroupName, data, cancellationToken).ConfigureAwait(false); - var operation = new ElasticSanArmOperation(new ElasticSanVolumeGroupOperationSource(Client), _elasticSanVolumeGroupVolumeGroupsClientDiagnostics, Pipeline, _elasticSanVolumeGroupVolumeGroupsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, volumeGroupName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var operation = new ElasticSanArmOperation(new ElasticSanVolumeGroupOperationSource(Client), _elasticSanVolumeGroupVolumeGroupsClientDiagnostics, Pipeline, _elasticSanVolumeGroupVolumeGroupsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, volumeGroupName, data).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -122,7 +122,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUn try { var response = _elasticSanVolumeGroupVolumeGroupsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, volumeGroupName, data, cancellationToken); - var operation = new ElasticSanArmOperation(new ElasticSanVolumeGroupOperationSource(Client), _elasticSanVolumeGroupVolumeGroupsClientDiagnostics, Pipeline, _elasticSanVolumeGroupVolumeGroupsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, volumeGroupName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var operation = new ElasticSanArmOperation(new ElasticSanVolumeGroupOperationSource(Client), _elasticSanVolumeGroupVolumeGroupsClientDiagnostics, Pipeline, _elasticSanVolumeGroupVolumeGroupsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, volumeGroupName, data).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/ElasticSanVolumeGroupData.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/ElasticSanVolumeGroupData.cs index 0791b28770d1e..6344fd39c3ea4 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/ElasticSanVolumeGroupData.cs +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/ElasticSanVolumeGroupData.cs @@ -21,7 +21,7 @@ public partial class ElasticSanVolumeGroupData : ResourceData /// Initializes a new instance of ElasticSanVolumeGroupData. public ElasticSanVolumeGroupData() { - Tags = new ChangeTrackingDictionary(); + PrivateEndpointConnections = new ChangeTrackingList(); } /// Initializes a new instance of ElasticSanVolumeGroupData. @@ -33,14 +33,14 @@ public ElasticSanVolumeGroupData() /// Type of storage target. /// Type of encryption. /// A collection of rules governing the accessibility from specific network locations. - /// Azure resource tags. - internal ElasticSanVolumeGroupData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ElasticSanProvisioningState? provisioningState, StorageTargetType? protocolType, ElasticSanEncryptionType? encryption, NetworkRuleSet networkAcls, IDictionary tags) : base(id, name, resourceType, systemData) + /// The list of Private Endpoint Connections. + internal ElasticSanVolumeGroupData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ElasticSanProvisioningState? provisioningState, StorageTargetType? protocolType, ElasticSanEncryptionType? encryption, NetworkRuleSet networkAcls, IReadOnlyList privateEndpointConnections) : base(id, name, resourceType, systemData) { ProvisioningState = provisioningState; ProtocolType = protocolType; Encryption = encryption; NetworkAcls = networkAcls; - Tags = tags; + PrivateEndpointConnections = privateEndpointConnections; } /// State of the operation on the resource. @@ -62,7 +62,7 @@ public IList VirtualNetworkRules } } - /// Azure resource tags. - public IDictionary Tags { get; } + /// The list of Private Endpoint Connections. + public IReadOnlyList PrivateEndpointConnections { get; } } } diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/ElasticSanVolumeGroupResource.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/ElasticSanVolumeGroupResource.cs index 380c69eaa1eeb..50f065ce9f320 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/ElasticSanVolumeGroupResource.cs +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/ElasticSanVolumeGroupResource.cs @@ -6,7 +6,6 @@ #nullable disable using System; -using System.Collections.Generic; using System.Globalization; using System.Threading; using System.Threading.Tasks; @@ -227,7 +226,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell try { var response = await _elasticSanVolumeGroupVolumeGroupsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ElasticSanArmOperation(_elasticSanVolumeGroupVolumeGroupsClientDiagnostics, Pipeline, _elasticSanVolumeGroupVolumeGroupsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var operation = new ElasticSanArmOperation(_elasticSanVolumeGroupVolumeGroupsClientDiagnostics, Pipeline, _elasticSanVolumeGroupVolumeGroupsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -261,7 +260,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel try { var response = _elasticSanVolumeGroupVolumeGroupsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new ElasticSanArmOperation(_elasticSanVolumeGroupVolumeGroupsClientDiagnostics, Pipeline, _elasticSanVolumeGroupVolumeGroupsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var operation = new ElasticSanArmOperation(_elasticSanVolumeGroupVolumeGroupsClientDiagnostics, Pipeline, _elasticSanVolumeGroupVolumeGroupsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -299,7 +298,7 @@ public virtual async Task> UpdateAsy try { var response = await _elasticSanVolumeGroupVolumeGroupsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); - var operation = new ElasticSanArmOperation(new ElasticSanVolumeGroupOperationSource(Client), _elasticSanVolumeGroupVolumeGroupsClientDiagnostics, Pipeline, _elasticSanVolumeGroupVolumeGroupsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var operation = new ElasticSanArmOperation(new ElasticSanVolumeGroupOperationSource(Client), _elasticSanVolumeGroupVolumeGroupsClientDiagnostics, Pipeline, _elasticSanVolumeGroupVolumeGroupsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -337,7 +336,7 @@ public virtual ArmOperation Update(WaitUntil wait try { var response = _elasticSanVolumeGroupVolumeGroupsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken); - var operation = new ElasticSanArmOperation(new ElasticSanVolumeGroupOperationSource(Client), _elasticSanVolumeGroupVolumeGroupsClientDiagnostics, Pipeline, _elasticSanVolumeGroupVolumeGroupsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var operation = new ElasticSanArmOperation(new ElasticSanVolumeGroupOperationSource(Client), _elasticSanVolumeGroupVolumeGroupsClientDiagnostics, Pipeline, _elasticSanVolumeGroupVolumeGroupsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -348,315 +347,5 @@ public virtual ArmOperation Update(WaitUntil wait throw; } } - - /// - /// Add a tag to the current resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName} - /// - /// - /// Operation Id - /// VolumeGroups_Get - /// - /// - /// - /// The key for the tag. - /// The value for the tag. - /// The cancellation token to use. - /// or is null. - public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - Argument.AssertNotNull(value, nameof(value)); - - using var scope = _elasticSanVolumeGroupVolumeGroupsClientDiagnostics.CreateScope("ElasticSanVolumeGroupResource.AddTag"); - scope.Start(); - try - { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) - { - var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); - originalTags.Value.Data.TagValues[key] = value; - await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _elasticSanVolumeGroupVolumeGroupsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new ElasticSanVolumeGroupResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new ElasticSanVolumeGroupPatch(); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags[key] = value; - var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Add a tag to the current resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName} - /// - /// - /// Operation Id - /// VolumeGroups_Get - /// - /// - /// - /// The key for the tag. - /// The value for the tag. - /// The cancellation token to use. - /// or is null. - public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - Argument.AssertNotNull(value, nameof(value)); - - using var scope = _elasticSanVolumeGroupVolumeGroupsClientDiagnostics.CreateScope("ElasticSanVolumeGroupResource.AddTag"); - scope.Start(); - try - { - if (CanUseTagResource(cancellationToken: cancellationToken)) - { - var originalTags = GetTagResource().Get(cancellationToken); - originalTags.Value.Data.TagValues[key] = value; - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _elasticSanVolumeGroupVolumeGroupsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - return Response.FromValue(new ElasticSanVolumeGroupResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new ElasticSanVolumeGroupPatch(); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags[key] = value; - var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Replace the tags on the resource with the given set. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName} - /// - /// - /// Operation Id - /// VolumeGroups_Get - /// - /// - /// - /// The set of tags to use as replacement. - /// 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 = _elasticSanVolumeGroupVolumeGroupsClientDiagnostics.CreateScope("ElasticSanVolumeGroupResource.SetTags"); - scope.Start(); - try - { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) - { - await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); - originalTags.Value.Data.TagValues.ReplaceWith(tags); - await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _elasticSanVolumeGroupVolumeGroupsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new ElasticSanVolumeGroupResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new ElasticSanVolumeGroupPatch(); - patch.Tags.ReplaceWith(tags); - var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Replace the tags on the resource with the given set. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName} - /// - /// - /// Operation Id - /// VolumeGroups_Get - /// - /// - /// - /// The set of tags to use as replacement. - /// The cancellation token to use. - /// is null. - public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(tags, nameof(tags)); - - using var scope = _elasticSanVolumeGroupVolumeGroupsClientDiagnostics.CreateScope("ElasticSanVolumeGroupResource.SetTags"); - scope.Start(); - try - { - if (CanUseTagResource(cancellationToken: cancellationToken)) - { - GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); - var originalTags = GetTagResource().Get(cancellationToken); - originalTags.Value.Data.TagValues.ReplaceWith(tags); - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _elasticSanVolumeGroupVolumeGroupsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - return Response.FromValue(new ElasticSanVolumeGroupResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new ElasticSanVolumeGroupPatch(); - patch.Tags.ReplaceWith(tags); - var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Removes a tag by key from the resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName} - /// - /// - /// Operation Id - /// VolumeGroups_Get - /// - /// - /// - /// The key for the tag. - /// The cancellation token to use. - /// is null. - public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - - using var scope = _elasticSanVolumeGroupVolumeGroupsClientDiagnostics.CreateScope("ElasticSanVolumeGroupResource.RemoveTag"); - scope.Start(); - try - { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) - { - var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); - originalTags.Value.Data.TagValues.Remove(key); - await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _elasticSanVolumeGroupVolumeGroupsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new ElasticSanVolumeGroupResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new ElasticSanVolumeGroupPatch(); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags.Remove(key); - var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Removes a tag by key from the resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName} - /// - /// - /// Operation Id - /// VolumeGroups_Get - /// - /// - /// - /// The key for the tag. - /// The cancellation token to use. - /// is null. - public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - - using var scope = _elasticSanVolumeGroupVolumeGroupsClientDiagnostics.CreateScope("ElasticSanVolumeGroupResource.RemoveTag"); - scope.Start(); - try - { - if (CanUseTagResource(cancellationToken: cancellationToken)) - { - var originalTags = GetTagResource().Get(cancellationToken); - originalTags.Value.Data.TagValues.Remove(key); - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _elasticSanVolumeGroupVolumeGroupsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - return Response.FromValue(new ElasticSanVolumeGroupResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new ElasticSanVolumeGroupPatch(); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags.Remove(key); - var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } } } diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/ElasticSanVolumeResource.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/ElasticSanVolumeResource.cs index 4555fe2083762..b025f574b74bf 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/ElasticSanVolumeResource.cs +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/ElasticSanVolumeResource.cs @@ -6,7 +6,6 @@ #nullable disable using System; -using System.Collections.Generic; using System.Globalization; using System.Threading; using System.Threading.Tasks; @@ -174,7 +173,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell try { var response = await _elasticSanVolumeVolumesRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ElasticSanArmOperation(_elasticSanVolumeVolumesClientDiagnostics, Pipeline, _elasticSanVolumeVolumesRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var operation = new ElasticSanArmOperation(_elasticSanVolumeVolumesClientDiagnostics, Pipeline, _elasticSanVolumeVolumesRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -208,7 +207,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel try { var response = _elasticSanVolumeVolumesRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new ElasticSanArmOperation(_elasticSanVolumeVolumesClientDiagnostics, Pipeline, _elasticSanVolumeVolumesRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var operation = new ElasticSanArmOperation(_elasticSanVolumeVolumesClientDiagnostics, Pipeline, _elasticSanVolumeVolumesRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -246,7 +245,7 @@ public virtual async Task> UpdateAsync(Wa try { var response = await _elasticSanVolumeVolumesRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); - var operation = new ElasticSanArmOperation(new ElasticSanVolumeOperationSource(Client), _elasticSanVolumeVolumesClientDiagnostics, Pipeline, _elasticSanVolumeVolumesRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var operation = new ElasticSanArmOperation(new ElasticSanVolumeOperationSource(Client), _elasticSanVolumeVolumesClientDiagnostics, Pipeline, _elasticSanVolumeVolumesRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -284,7 +283,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil try { var response = _elasticSanVolumeVolumesRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch, cancellationToken); - var operation = new ElasticSanArmOperation(new ElasticSanVolumeOperationSource(Client), _elasticSanVolumeVolumesClientDiagnostics, Pipeline, _elasticSanVolumeVolumesRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var operation = new ElasticSanArmOperation(new ElasticSanVolumeOperationSource(Client), _elasticSanVolumeVolumesClientDiagnostics, Pipeline, _elasticSanVolumeVolumesRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -295,315 +294,5 @@ public virtual ArmOperation Update(WaitUntil waitUntil throw; } } - - /// - /// Add a tag to the current resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName} - /// - /// - /// Operation Id - /// Volumes_Get - /// - /// - /// - /// The key for the tag. - /// The value for the tag. - /// The cancellation token to use. - /// or is null. - public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - Argument.AssertNotNull(value, nameof(value)); - - using var scope = _elasticSanVolumeVolumesClientDiagnostics.CreateScope("ElasticSanVolumeResource.AddTag"); - scope.Start(); - try - { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) - { - var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); - originalTags.Value.Data.TagValues[key] = value; - await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _elasticSanVolumeVolumesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new ElasticSanVolumeResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new ElasticSanVolumePatch(); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags[key] = value; - var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Add a tag to the current resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName} - /// - /// - /// Operation Id - /// Volumes_Get - /// - /// - /// - /// The key for the tag. - /// The value for the tag. - /// The cancellation token to use. - /// or is null. - public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - Argument.AssertNotNull(value, nameof(value)); - - using var scope = _elasticSanVolumeVolumesClientDiagnostics.CreateScope("ElasticSanVolumeResource.AddTag"); - scope.Start(); - try - { - if (CanUseTagResource(cancellationToken: cancellationToken)) - { - var originalTags = GetTagResource().Get(cancellationToken); - originalTags.Value.Data.TagValues[key] = value; - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _elasticSanVolumeVolumesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); - return Response.FromValue(new ElasticSanVolumeResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new ElasticSanVolumePatch(); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags[key] = value; - var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Replace the tags on the resource with the given set. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName} - /// - /// - /// Operation Id - /// Volumes_Get - /// - /// - /// - /// The set of tags to use as replacement. - /// 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 = _elasticSanVolumeVolumesClientDiagnostics.CreateScope("ElasticSanVolumeResource.SetTags"); - scope.Start(); - try - { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) - { - await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); - originalTags.Value.Data.TagValues.ReplaceWith(tags); - await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _elasticSanVolumeVolumesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new ElasticSanVolumeResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new ElasticSanVolumePatch(); - patch.Tags.ReplaceWith(tags); - var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Replace the tags on the resource with the given set. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName} - /// - /// - /// Operation Id - /// Volumes_Get - /// - /// - /// - /// The set of tags to use as replacement. - /// The cancellation token to use. - /// is null. - public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(tags, nameof(tags)); - - using var scope = _elasticSanVolumeVolumesClientDiagnostics.CreateScope("ElasticSanVolumeResource.SetTags"); - scope.Start(); - try - { - if (CanUseTagResource(cancellationToken: cancellationToken)) - { - GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); - var originalTags = GetTagResource().Get(cancellationToken); - originalTags.Value.Data.TagValues.ReplaceWith(tags); - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _elasticSanVolumeVolumesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); - return Response.FromValue(new ElasticSanVolumeResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new ElasticSanVolumePatch(); - patch.Tags.ReplaceWith(tags); - var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Removes a tag by key from the resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName} - /// - /// - /// Operation Id - /// Volumes_Get - /// - /// - /// - /// The key for the tag. - /// The cancellation token to use. - /// is null. - public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - - using var scope = _elasticSanVolumeVolumesClientDiagnostics.CreateScope("ElasticSanVolumeResource.RemoveTag"); - scope.Start(); - try - { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) - { - var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); - originalTags.Value.Data.TagValues.Remove(key); - await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _elasticSanVolumeVolumesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new ElasticSanVolumeResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new ElasticSanVolumePatch(); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags.Remove(key); - var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Removes a tag by key from the resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ElasticSan/elasticSans/{elasticSanName}/volumegroups/{volumeGroupName}/volumes/{volumeName} - /// - /// - /// Operation Id - /// Volumes_Get - /// - /// - /// - /// The key for the tag. - /// The cancellation token to use. - /// is null. - public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - - using var scope = _elasticSanVolumeVolumesClientDiagnostics.CreateScope("ElasticSanVolumeResource.RemoveTag"); - scope.Start(); - try - { - if (CanUseTagResource(cancellationToken: cancellationToken)) - { - var originalTags = GetTagResource().Get(cancellationToken); - originalTags.Value.Data.TagValues.Remove(key); - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _elasticSanVolumeVolumesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); - return Response.FromValue(new ElasticSanVolumeResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new ElasticSanVolumePatch(); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags.Remove(key); - var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); - return Response.FromValue(result.Value, result.GetRawResponse()); - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } } } diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Extensions/ElasticSanExtensions.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Extensions/ElasticSanExtensions.cs index 147f9fee753dc..46c8d8d790bb2 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Extensions/ElasticSanExtensions.cs +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Extensions/ElasticSanExtensions.cs @@ -107,6 +107,25 @@ public static ElasticSanVolumeResource GetElasticSanVolumeResource(this ArmClien } #endregion + #region ElasticSanPrivateEndpointConnectionResource + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static ElasticSanPrivateEndpointConnectionResource GetElasticSanPrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) + { + return client.GetResourceClient(() => + { + ElasticSanPrivateEndpointConnectionResource.ValidateResourceId(id); + return new ElasticSanPrivateEndpointConnectionResource(client, id); + } + ); + } + #endregion + /// Gets a collection of ElasticSanResources in the ResourceGroupResource. /// The instance the method will execute against. /// An object representing collection of ElasticSanResources and their operations over a ElasticSanResource. diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/LongRunningOperation/ElasticSanPrivateEndpointConnectionOperationSource.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/LongRunningOperation/ElasticSanPrivateEndpointConnectionOperationSource.cs new file mode 100644 index 0000000000000..818ee17347681 --- /dev/null +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/LongRunningOperation/ElasticSanPrivateEndpointConnectionOperationSource.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.ElasticSan +{ + internal class ElasticSanPrivateEndpointConnectionOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal ElasticSanPrivateEndpointConnectionOperationSource(ArmClient client) + { + _client = client; + } + + ElasticSanPrivateEndpointConnectionResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = ElasticSanPrivateEndpointConnectionData.DeserializeElasticSanPrivateEndpointConnectionData(document.RootElement); + return new ElasticSanPrivateEndpointConnectionResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = ElasticSanPrivateEndpointConnectionData.DeserializeElasticSanPrivateEndpointConnectionData(document.RootElement); + return new ElasticSanPrivateEndpointConnectionResource(_client, data); + } + } +} diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanData.Serialization.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanData.Serialization.cs index d1f057d381e30..127b3e93e1c59 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanData.Serialization.cs +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanData.Serialization.cs @@ -75,6 +75,7 @@ internal static ElasticSanData DeserializeElasticSanData(JsonElement element) Optional totalIops = default; Optional totalMbps = default; Optional totalSizeTiB = default; + Optional> privateEndpointConnections = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("tags"u8)) @@ -212,11 +213,25 @@ internal static ElasticSanData DeserializeElasticSanData(JsonElement element) totalSizeTiB = property0.Value.GetInt64(); continue; } + if (property0.NameEquals("privateEndpointConnections"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(ElasticSanPrivateEndpointConnectionData.DeserializeElasticSanPrivateEndpointConnectionData(item)); + } + privateEndpointConnections = array; + continue; + } } continue; } } - return new ElasticSanData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, sku, Optional.ToList(availabilityZones), Optional.ToNullable(provisioningState), baseSizeTiB, extendedCapacitySizeTiB, Optional.ToNullable(totalVolumeSizeGiB), Optional.ToNullable(volumeGroupCount), Optional.ToNullable(totalIops), Optional.ToNullable(totalMbps), Optional.ToNullable(totalSizeTiB)); + return new ElasticSanData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, sku, Optional.ToList(availabilityZones), Optional.ToNullable(provisioningState), baseSizeTiB, extendedCapacitySizeTiB, Optional.ToNullable(totalVolumeSizeGiB), Optional.ToNullable(volumeGroupCount), Optional.ToNullable(totalIops), Optional.ToNullable(totalMbps), Optional.ToNullable(totalSizeTiB), Optional.ToList(privateEndpointConnections)); } } } diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanList.Serialization.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanList.Serialization.cs index e6ee87bba0844..b4e49f0fcd689 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanList.Serialization.cs +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanList.Serialization.cs @@ -20,12 +20,16 @@ internal static ElasticSanList DeserializeElasticSanList(JsonElement element) { return null; } - IReadOnlyList value = default; + Optional> value = default; Optional nextLink = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -40,7 +44,7 @@ internal static ElasticSanList DeserializeElasticSanList(JsonElement element) continue; } } - return new ElasticSanList(value, nextLink.Value); + return new ElasticSanList(Optional.ToList(value), nextLink.Value); } } } diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanList.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanList.cs index 46e2a9802f5b3..a0b87ab5cba1a 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanList.cs +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanList.cs @@ -5,9 +5,7 @@ #nullable disable -using System; using System.Collections.Generic; -using System.Linq; using Azure.Core; using Azure.ResourceManager.ElasticSan; @@ -17,13 +15,9 @@ namespace Azure.ResourceManager.ElasticSan.Models internal partial class ElasticSanList { /// Initializes a new instance of ElasticSanList. - /// An array of Elastic San objects. - /// is null. - internal ElasticSanList(IEnumerable value) + internal ElasticSanList() { - Argument.AssertNotNull(value, nameof(value)); - - Value = value.ToList(); + Value = new ChangeTrackingList(); } /// Initializes a new instance of ElasticSanList. diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanPrivateEndpointConnectionData.Serialization.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanPrivateEndpointConnectionData.Serialization.cs new file mode 100644 index 0000000000000..47e30233d5fc3 --- /dev/null +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanPrivateEndpointConnectionData.Serialization.cs @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.ElasticSan.Models; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.ElasticSan +{ + public partial class ElasticSanPrivateEndpointConnectionData : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(PrivateEndpoint)) + { + writer.WritePropertyName("privateEndpoint"u8); + JsonSerializer.Serialize(writer, PrivateEndpoint); + } + writer.WritePropertyName("privateLinkServiceConnectionState"u8); + writer.WriteObjectValue(ConnectionState); + if (Optional.IsCollectionDefined(GroupIds)) + { + writer.WritePropertyName("groupIds"u8); + writer.WriteStartArray(); + foreach (var item in GroupIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static ElasticSanPrivateEndpointConnectionData DeserializeElasticSanPrivateEndpointConnectionData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + Optional systemData = default; + Optional provisioningState = default; + Optional privateEndpoint = default; + ElasticSanPrivateLinkServiceConnectionState privateLinkServiceConnectionState = default; + Optional> groupIds = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new ElasticSanProvisioningState(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("privateEndpoint"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + privateEndpoint = JsonSerializer.Deserialize(property0.Value.GetRawText()); + continue; + } + if (property0.NameEquals("privateLinkServiceConnectionState"u8)) + { + privateLinkServiceConnectionState = ElasticSanPrivateLinkServiceConnectionState.DeserializeElasticSanPrivateLinkServiceConnectionState(property0.Value); + continue; + } + if (property0.NameEquals("groupIds"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + groupIds = array; + continue; + } + } + continue; + } + } + return new ElasticSanPrivateEndpointConnectionData(id, name, type, systemData.Value, Optional.ToNullable(provisioningState), privateEndpoint, privateLinkServiceConnectionState, Optional.ToList(groupIds)); + } + } +} diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanPrivateEndpointConnectionListResult.Serialization.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanPrivateEndpointConnectionListResult.Serialization.cs new file mode 100644 index 0000000000000..a054b7f33ceb6 --- /dev/null +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanPrivateEndpointConnectionListResult.Serialization.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.ElasticSan; + +namespace Azure.ResourceManager.ElasticSan.Models +{ + internal partial class ElasticSanPrivateEndpointConnectionListResult + { + internal static ElasticSanPrivateEndpointConnectionListResult DeserializeElasticSanPrivateEndpointConnectionListResult(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ElasticSanPrivateEndpointConnectionData.DeserializeElasticSanPrivateEndpointConnectionData(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new ElasticSanPrivateEndpointConnectionListResult(Optional.ToList(value), nextLink.Value); + } + } +} diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanPrivateEndpointConnectionListResult.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanPrivateEndpointConnectionListResult.cs new file mode 100644 index 0000000000000..9a40c288fe2f8 --- /dev/null +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanPrivateEndpointConnectionListResult.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.ElasticSan; + +namespace Azure.ResourceManager.ElasticSan.Models +{ + /// List of private endpoint connections associated with SAN. + internal partial class ElasticSanPrivateEndpointConnectionListResult + { + /// Initializes a new instance of ElasticSanPrivateEndpointConnectionListResult. + internal ElasticSanPrivateEndpointConnectionListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of ElasticSanPrivateEndpointConnectionListResult. + /// Array of private endpoint connections. + /// URI to fetch the next section of the paginated response. + internal ElasticSanPrivateEndpointConnectionListResult(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Array of private endpoint connections. + public IReadOnlyList Value { get; } + /// URI to fetch the next section of the paginated response. + public string NextLink { get; } + } +} diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanPrivateEndpointServiceConnectionStatus.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanPrivateEndpointServiceConnectionStatus.cs new file mode 100644 index 0000000000000..2d021482ce7b4 --- /dev/null +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanPrivateEndpointServiceConnectionStatus.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ElasticSan.Models +{ + /// The private endpoint connection status. + public readonly partial struct ElasticSanPrivateEndpointServiceConnectionStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ElasticSanPrivateEndpointServiceConnectionStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PendingValue = "Pending"; + private const string ApprovedValue = "Approved"; + private const string FailedValue = "Failed"; + private const string RejectedValue = "Rejected"; + + /// Pending. + public static ElasticSanPrivateEndpointServiceConnectionStatus Pending { get; } = new ElasticSanPrivateEndpointServiceConnectionStatus(PendingValue); + /// Approved. + public static ElasticSanPrivateEndpointServiceConnectionStatus Approved { get; } = new ElasticSanPrivateEndpointServiceConnectionStatus(ApprovedValue); + /// Failed. + public static ElasticSanPrivateEndpointServiceConnectionStatus Failed { get; } = new ElasticSanPrivateEndpointServiceConnectionStatus(FailedValue); + /// Rejected. + public static ElasticSanPrivateEndpointServiceConnectionStatus Rejected { get; } = new ElasticSanPrivateEndpointServiceConnectionStatus(RejectedValue); + /// Determines if two values are the same. + public static bool operator ==(ElasticSanPrivateEndpointServiceConnectionStatus left, ElasticSanPrivateEndpointServiceConnectionStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ElasticSanPrivateEndpointServiceConnectionStatus left, ElasticSanPrivateEndpointServiceConnectionStatus right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ElasticSanPrivateEndpointServiceConnectionStatus(string value) => new ElasticSanPrivateEndpointServiceConnectionStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ElasticSanPrivateEndpointServiceConnectionStatus other && Equals(other); + /// + public bool Equals(ElasticSanPrivateEndpointServiceConnectionStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanPrivateLinkResource.Serialization.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanPrivateLinkResource.Serialization.cs new file mode 100644 index 0000000000000..3217e72979dcd --- /dev/null +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanPrivateLinkResource.Serialization.cs @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ElasticSan.Models +{ + public partial class ElasticSanPrivateLinkResource : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(RequiredZoneNames)) + { + writer.WritePropertyName("requiredZoneNames"u8); + writer.WriteStartArray(); + foreach (var item in RequiredZoneNames) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static ElasticSanPrivateLinkResource DeserializeElasticSanPrivateLinkResource(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + Optional systemData = default; + Optional groupId = default; + Optional> requiredMembers = default; + Optional> requiredZoneNames = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("groupId"u8)) + { + groupId = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("requiredMembers"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + requiredMembers = array; + continue; + } + if (property0.NameEquals("requiredZoneNames"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + requiredZoneNames = array; + continue; + } + } + continue; + } + } + return new ElasticSanPrivateLinkResource(id, name, type, systemData.Value, groupId.Value, Optional.ToList(requiredMembers), Optional.ToList(requiredZoneNames)); + } + } +} diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanPrivateLinkResource.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanPrivateLinkResource.cs new file mode 100644 index 0000000000000..72c995cdc3134 --- /dev/null +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanPrivateLinkResource.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ElasticSan.Models +{ + /// A private link resource. + public partial class ElasticSanPrivateLinkResource : ResourceData + { + /// Initializes a new instance of ElasticSanPrivateLinkResource. + public ElasticSanPrivateLinkResource() + { + RequiredMembers = new ChangeTrackingList(); + RequiredZoneNames = new ChangeTrackingList(); + } + + /// Initializes a new instance of ElasticSanPrivateLinkResource. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The private link resource group id. + /// The private link resource required member names. + /// The private link resource Private link DNS zone name. + internal ElasticSanPrivateLinkResource(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string groupId, IReadOnlyList requiredMembers, IList requiredZoneNames) : base(id, name, resourceType, systemData) + { + GroupId = groupId; + RequiredMembers = requiredMembers; + RequiredZoneNames = requiredZoneNames; + } + + /// 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/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanPrivateLinkResourceListResult.Serialization.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanPrivateLinkResourceListResult.Serialization.cs new file mode 100644 index 0000000000000..db1a6632327c6 --- /dev/null +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanPrivateLinkResourceListResult.Serialization.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ElasticSan.Models +{ + internal partial class ElasticSanPrivateLinkResourceListResult + { + internal static ElasticSanPrivateLinkResourceListResult DeserializeElasticSanPrivateLinkResourceListResult(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ElasticSanPrivateLinkResource.DeserializeElasticSanPrivateLinkResource(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new ElasticSanPrivateLinkResourceListResult(Optional.ToList(value), nextLink.Value); + } + } +} diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanPrivateLinkResourceListResult.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanPrivateLinkResourceListResult.cs new file mode 100644 index 0000000000000..0d337ddee8636 --- /dev/null +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanPrivateLinkResourceListResult.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.ElasticSan.Models +{ + /// A list of private link resources. + internal partial class ElasticSanPrivateLinkResourceListResult + { + /// Initializes a new instance of ElasticSanPrivateLinkResourceListResult. + internal ElasticSanPrivateLinkResourceListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of ElasticSanPrivateLinkResourceListResult. + /// Array of private link resources. + /// URI to fetch the next section of the paginated response. + internal ElasticSanPrivateLinkResourceListResult(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Array of private link resources. + public IReadOnlyList Value { get; } + /// URI to fetch the next section of the paginated response. + public string NextLink { get; } + } +} diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanPrivateLinkServiceConnectionState.Serialization.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanPrivateLinkServiceConnectionState.Serialization.cs new file mode 100644 index 0000000000000..0f5b00e769dc4 --- /dev/null +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanPrivateLinkServiceConnectionState.Serialization.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ElasticSan.Models +{ + public partial class ElasticSanPrivateLinkServiceConnectionState : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToString()); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (Optional.IsDefined(ActionsRequired)) + { + writer.WritePropertyName("actionsRequired"u8); + writer.WriteStringValue(ActionsRequired); + } + writer.WriteEndObject(); + } + + internal static ElasticSanPrivateLinkServiceConnectionState DeserializeElasticSanPrivateLinkServiceConnectionState(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional status = default; + Optional description = default; + Optional actionsRequired = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("status"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = new ElasticSanPrivateEndpointServiceConnectionStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("actionsRequired"u8)) + { + actionsRequired = property.Value.GetString(); + continue; + } + } + return new ElasticSanPrivateLinkServiceConnectionState(Optional.ToNullable(status), description.Value, actionsRequired.Value); + } + } +} diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanPrivateLinkServiceConnectionState.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanPrivateLinkServiceConnectionState.cs new file mode 100644 index 0000000000000..d925cd3bb4ec4 --- /dev/null +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanPrivateLinkServiceConnectionState.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.ElasticSan.Models +{ + /// Response for Private Link Service Connection state. + public partial class ElasticSanPrivateLinkServiceConnectionState + { + /// Initializes a new instance of ElasticSanPrivateLinkServiceConnectionState. + public ElasticSanPrivateLinkServiceConnectionState() + { + } + + /// Initializes a new instance of ElasticSanPrivateLinkServiceConnectionState. + /// 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. + internal ElasticSanPrivateLinkServiceConnectionState(ElasticSanPrivateEndpointServiceConnectionStatus? status, string description, string actionsRequired) + { + Status = status; + Description = description; + ActionsRequired = actionsRequired; + } + + /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + public ElasticSanPrivateEndpointServiceConnectionStatus? 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/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanSkuInformationList.Serialization.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanSkuInformationList.Serialization.cs index 24ae049e31608..dcaac97f80e22 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanSkuInformationList.Serialization.cs +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanSkuInformationList.Serialization.cs @@ -20,6 +20,7 @@ internal static ElasticSanSkuInformationList DeserializeElasticSanSkuInformation return null; } Optional> value = default; + Optional nextLink = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) @@ -36,8 +37,13 @@ internal static ElasticSanSkuInformationList DeserializeElasticSanSkuInformation value = array; continue; } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } } - return new ElasticSanSkuInformationList(Optional.ToList(value)); + return new ElasticSanSkuInformationList(Optional.ToList(value), nextLink.Value); } } } diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanSkuInformationList.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanSkuInformationList.cs index 3870f701d42d1..a024127e4ce77 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanSkuInformationList.cs +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanSkuInformationList.cs @@ -21,12 +21,16 @@ internal ElasticSanSkuInformationList() /// Initializes a new instance of ElasticSanSkuInformationList. /// List of ResourceType Sku. - internal ElasticSanSkuInformationList(IReadOnlyList value) + /// URI to fetch the next section of the paginated response. + internal ElasticSanSkuInformationList(IReadOnlyList value, string nextLink) { Value = value; + NextLink = nextLink; } /// List of ResourceType Sku. public IReadOnlyList Value { get; } + /// URI to fetch the next section of the paginated response. + public string NextLink { get; } } } diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanVolumeData.Serialization.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanVolumeData.Serialization.cs index 9509e13562c8d..c53b7701a310f 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanVolumeData.Serialization.cs +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanVolumeData.Serialization.cs @@ -6,7 +6,6 @@ #nullable disable using System; -using System.Collections.Generic; using System.Text.Json; using Azure.Core; using Azure.ResourceManager.ElasticSan.Models; @@ -19,17 +18,6 @@ public partial class ElasticSanVolumeData : IUtf8JsonSerializable void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(CreationData)) @@ -37,11 +25,8 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("creationData"u8); writer.WriteObjectValue(CreationData); } - if (Optional.IsDefined(SizeGiB)) - { - writer.WritePropertyName("sizeGiB"u8); - writer.WriteNumberValue(SizeGiB.Value); - } + writer.WritePropertyName("sizeGiB"u8); + writer.WriteNumberValue(SizeGiB); writer.WriteEndObject(); writer.WriteEndObject(); } @@ -52,31 +37,16 @@ internal static ElasticSanVolumeData DeserializeElasticSanVolumeData(JsonElement { return null; } - Optional> tags = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; Optional systemData = default; Optional volumeId = default; Optional creationData = default; - Optional sizeGiB = default; + long sizeGiB = default; Optional storageTarget = default; foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } if (property.NameEquals("id"u8)) { id = new ResourceIdentifier(property.Value.GetString()); @@ -130,10 +100,6 @@ internal static ElasticSanVolumeData DeserializeElasticSanVolumeData(JsonElement } if (property0.NameEquals("sizeGiB"u8)) { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } sizeGiB = property0.Value.GetInt64(); continue; } @@ -150,7 +116,7 @@ internal static ElasticSanVolumeData DeserializeElasticSanVolumeData(JsonElement continue; } } - return new ElasticSanVolumeData(id, name, type, systemData.Value, Optional.ToNullable(volumeId), creationData.Value, Optional.ToNullable(sizeGiB), storageTarget.Value, Optional.ToDictionary(tags)); + return new ElasticSanVolumeData(id, name, type, systemData.Value, Optional.ToNullable(volumeId), creationData.Value, sizeGiB, storageTarget.Value); } } } diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanVolumeGroupData.Serialization.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanVolumeGroupData.Serialization.cs index 42d7b07683403..e551cb582dce0 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanVolumeGroupData.Serialization.cs +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanVolumeGroupData.Serialization.cs @@ -18,17 +18,6 @@ public partial class ElasticSanVolumeGroupData : IUtf8JsonSerializable void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(ProtocolType)) @@ -56,7 +45,6 @@ internal static ElasticSanVolumeGroupData DeserializeElasticSanVolumeGroupData(J { return null; } - Optional> tags = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; @@ -65,22 +53,9 @@ internal static ElasticSanVolumeGroupData DeserializeElasticSanVolumeGroupData(J Optional protocolType = default; Optional encryption = default; Optional networkAcls = default; + Optional> privateEndpointConnections = default; foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } if (property.NameEquals("id"u8)) { id = new ResourceIdentifier(property.Value.GetString()); @@ -150,11 +125,25 @@ internal static ElasticSanVolumeGroupData DeserializeElasticSanVolumeGroupData(J networkAcls = NetworkRuleSet.DeserializeNetworkRuleSet(property0.Value); continue; } + if (property0.NameEquals("privateEndpointConnections"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(ElasticSanPrivateEndpointConnectionData.DeserializeElasticSanPrivateEndpointConnectionData(item)); + } + privateEndpointConnections = array; + continue; + } } continue; } } - return new ElasticSanVolumeGroupData(id, name, type, systemData.Value, Optional.ToNullable(provisioningState), Optional.ToNullable(protocolType), Optional.ToNullable(encryption), networkAcls.Value, Optional.ToDictionary(tags)); + return new ElasticSanVolumeGroupData(id, name, type, systemData.Value, Optional.ToNullable(provisioningState), Optional.ToNullable(protocolType), Optional.ToNullable(encryption), networkAcls.Value, Optional.ToList(privateEndpointConnections)); } } } diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanVolumeGroupList.Serialization.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanVolumeGroupList.Serialization.cs index f8c4479ed8b54..a0f89d43ec89e 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanVolumeGroupList.Serialization.cs +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanVolumeGroupList.Serialization.cs @@ -20,12 +20,16 @@ internal static ElasticSanVolumeGroupList DeserializeElasticSanVolumeGroupList(J { return null; } - IReadOnlyList value = default; + Optional> value = default; Optional nextLink = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -40,7 +44,7 @@ internal static ElasticSanVolumeGroupList DeserializeElasticSanVolumeGroupList(J continue; } } - return new ElasticSanVolumeGroupList(value, nextLink.Value); + return new ElasticSanVolumeGroupList(Optional.ToList(value), nextLink.Value); } } } diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanVolumeGroupList.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanVolumeGroupList.cs index e4c6c92f13d32..ad53efee656ec 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanVolumeGroupList.cs +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanVolumeGroupList.cs @@ -5,9 +5,7 @@ #nullable disable -using System; using System.Collections.Generic; -using System.Linq; using Azure.Core; using Azure.ResourceManager.ElasticSan; @@ -17,13 +15,9 @@ namespace Azure.ResourceManager.ElasticSan.Models internal partial class ElasticSanVolumeGroupList { /// Initializes a new instance of ElasticSanVolumeGroupList. - /// An array of Volume Groups objects. - /// is null. - internal ElasticSanVolumeGroupList(IEnumerable value) + internal ElasticSanVolumeGroupList() { - Argument.AssertNotNull(value, nameof(value)); - - Value = value.ToList(); + Value = new ChangeTrackingList(); } /// Initializes a new instance of ElasticSanVolumeGroupList. diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanVolumeGroupPatch.Serialization.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanVolumeGroupPatch.Serialization.cs index 94ad03bc1e373..604d329529735 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanVolumeGroupPatch.Serialization.cs +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanVolumeGroupPatch.Serialization.cs @@ -15,17 +15,6 @@ public partial class ElasticSanVolumeGroupPatch : IUtf8JsonSerializable void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(ProtocolType)) diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanVolumeGroupPatch.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanVolumeGroupPatch.cs index b1088eec63c46..6abd0fa60b6a9 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanVolumeGroupPatch.cs +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanVolumeGroupPatch.cs @@ -6,7 +6,6 @@ #nullable disable using System.Collections.Generic; -using Azure.Core; namespace Azure.ResourceManager.ElasticSan.Models { @@ -16,11 +15,8 @@ public partial class ElasticSanVolumeGroupPatch /// Initializes a new instance of ElasticSanVolumeGroupPatch. public ElasticSanVolumeGroupPatch() { - Tags = new ChangeTrackingDictionary(); } - /// Resource tags. - public IDictionary Tags { get; } /// Type of storage target. public StorageTargetType? ProtocolType { get; set; } /// Type of encryption. diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanVolumeList.Serialization.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanVolumeList.Serialization.cs index 6872f723abdcd..714d94f39f430 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanVolumeList.Serialization.cs +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanVolumeList.Serialization.cs @@ -20,12 +20,16 @@ internal static ElasticSanVolumeList DeserializeElasticSanVolumeList(JsonElement { return null; } - IReadOnlyList value = default; + Optional> value = default; Optional nextLink = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -40,7 +44,7 @@ internal static ElasticSanVolumeList DeserializeElasticSanVolumeList(JsonElement continue; } } - return new ElasticSanVolumeList(value, nextLink.Value); + return new ElasticSanVolumeList(Optional.ToList(value), nextLink.Value); } } } diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanVolumeList.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanVolumeList.cs index 2a4f737d48b1b..f83a39b14d290 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanVolumeList.cs +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanVolumeList.cs @@ -5,9 +5,7 @@ #nullable disable -using System; using System.Collections.Generic; -using System.Linq; using Azure.Core; using Azure.ResourceManager.ElasticSan; @@ -17,13 +15,9 @@ namespace Azure.ResourceManager.ElasticSan.Models internal partial class ElasticSanVolumeList { /// Initializes a new instance of ElasticSanVolumeList. - /// An array of Volume objects. - /// is null. - internal ElasticSanVolumeList(IEnumerable value) + internal ElasticSanVolumeList() { - Argument.AssertNotNull(value, nameof(value)); - - Value = value.ToList(); + Value = new ChangeTrackingList(); } /// Initializes a new instance of ElasticSanVolumeList. diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanVolumePatch.Serialization.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanVolumePatch.Serialization.cs index a368aac087e18..697acc6bec9e1 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanVolumePatch.Serialization.cs +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanVolumePatch.Serialization.cs @@ -15,17 +15,6 @@ public partial class ElasticSanVolumePatch : IUtf8JsonSerializable void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(SizeGiB)) diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanVolumePatch.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanVolumePatch.cs index 8d61ef4d591b8..38d6f7472c45a 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanVolumePatch.cs +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanVolumePatch.cs @@ -5,9 +5,6 @@ #nullable disable -using System.Collections.Generic; -using Azure.Core; - namespace Azure.ResourceManager.ElasticSan.Models { /// Response for Volume request. @@ -16,11 +13,8 @@ public partial class ElasticSanVolumePatch /// Initializes a new instance of ElasticSanVolumePatch. public ElasticSanVolumePatch() { - Tags = new ChangeTrackingDictionary(); } - /// Resource tags. - public IDictionary Tags { get; } /// Volume size. public long? SizeGiB { get; set; } } diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/RestOperations/ElasticSansRestOperations.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/RestOperations/ElasticSansRestOperations.cs index f689cff100ff9..2076dabe041cd 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/RestOperations/ElasticSansRestOperations.cs +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/RestOperations/ElasticSansRestOperations.cs @@ -33,7 +33,7 @@ public ElasticSansRestOperations(HttpPipeline pipeline, string applicationId, Ur { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-11-20-preview"; + _apiVersion = apiVersion ?? "2022-12-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -221,7 +221,7 @@ public async Task CreateAsync(string subscriptionId, string resourceGr switch (message.Response.Status) { case 200: - case 202: + case 201: return message.Response; default: throw new RequestFailedException(message.Response); @@ -248,7 +248,7 @@ public Response Create(string subscriptionId, string resourceGroupName, string e switch (message.Response.Status) { case 200: - case 202: + case 201: return message.Response; default: throw new RequestFailedException(message.Response); diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs new file mode 100644 index 0000000000000..51cbca844db43 --- /dev/null +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs @@ -0,0 +1,369 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.ElasticSan.Models; + +namespace Azure.ResourceManager.ElasticSan +{ + internal partial class PrivateEndpointConnectionsRestOperations + { + 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. + /// server parameter. + /// Api Version. + /// 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 ?? "2022-12-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string elasticSanName, string privateEndpointConnectionName, ElasticSanPrivateEndpointConnectionData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + 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.ElasticSan/elasticSans/", false); + uri.AppendPath(elasticSanName, true); + uri.AppendPath("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Update the state of specified private endpoint connection associated with the Elastic San. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the ElasticSan. + /// The name of the Private Endpoint connection. + /// Private Endpoint Connection Approval object. + /// 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 elasticSanName, string privateEndpointConnectionName, ElasticSanPrivateEndpointConnectionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(elasticSanName, nameof(elasticSanName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, elasticSanName, privateEndpointConnectionName, 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); + } + } + + /// Update the state of specified private endpoint connection associated with the Elastic San. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the ElasticSan. + /// The name of the Private Endpoint connection. + /// Private Endpoint Connection Approval object. + /// 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 elasticSanName, string privateEndpointConnectionName, ElasticSanPrivateEndpointConnectionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(elasticSanName, nameof(elasticSanName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, elasticSanName, privateEndpointConnectionName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string elasticSanName, string privateEndpointConnectionName) + { + 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.ElasticSan/elasticSans/", false); + uri.AppendPath(elasticSanName, true); + uri.AppendPath("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the specified private endpoint connection associated with the Elastic San. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the ElasticSan. + /// The name of the Private Endpoint connection. + /// 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 elasticSanName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(elasticSanName, nameof(elasticSanName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, elasticSanName, privateEndpointConnectionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ElasticSanPrivateEndpointConnectionData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ElasticSanPrivateEndpointConnectionData.DeserializeElasticSanPrivateEndpointConnectionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ElasticSanPrivateEndpointConnectionData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the specified private endpoint connection associated with the Elastic San. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the ElasticSan. + /// The name of the Private Endpoint connection. + /// 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 elasticSanName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(elasticSanName, nameof(elasticSanName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, elasticSanName, privateEndpointConnectionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ElasticSanPrivateEndpointConnectionData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ElasticSanPrivateEndpointConnectionData.DeserializeElasticSanPrivateEndpointConnectionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ElasticSanPrivateEndpointConnectionData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string elasticSanName, string privateEndpointConnectionName) + { + 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("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ElasticSan/elasticSans/", false); + uri.AppendPath(elasticSanName, true); + uri.AppendPath("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes the specified private endpoint connection associated with the Elastic San. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the ElasticSan. + /// The name of the Private Endpoint connection. + /// 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 elasticSanName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(elasticSanName, nameof(elasticSanName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, elasticSanName, privateEndpointConnectionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes the specified private endpoint connection associated with the Elastic San. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the ElasticSan. + /// The name of the Private Endpoint connection. + /// 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 elasticSanName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(elasticSanName, nameof(elasticSanName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, elasticSanName, privateEndpointConnectionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string elasticSanName) + { + 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.ElasticSan/elasticSans/", false); + uri.AppendPath(elasticSanName, true); + uri.AppendPath("/privateEndpointConnections", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List all Private Endpoint Connections associated with the Elastic San. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the ElasticSan. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string elasticSanName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(elasticSanName, nameof(elasticSanName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, elasticSanName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ElasticSanPrivateEndpointConnectionListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ElasticSanPrivateEndpointConnectionListResult.DeserializeElasticSanPrivateEndpointConnectionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List all Private Endpoint Connections associated with the Elastic San. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the ElasticSan. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string elasticSanName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(elasticSanName, nameof(elasticSanName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, elasticSanName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ElasticSanPrivateEndpointConnectionListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ElasticSanPrivateEndpointConnectionListResult.DeserializeElasticSanPrivateEndpointConnectionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs new file mode 100644 index 0000000000000..60b10d3b92ead --- /dev/null +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.ElasticSan.Models; + +namespace Azure.ResourceManager.ElasticSan +{ + internal partial class PrivateLinkResourcesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of PrivateLinkResourcesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public PrivateLinkResourcesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2022-12-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal HttpMessage CreateListByElasticSanRequest(string subscriptionId, string resourceGroupName, string elasticSanName) + { + 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.ElasticSan/elasticSans/", false); + uri.AppendPath(elasticSanName, true); + uri.AppendPath("/privateLinkResources", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the private link resources that need to be created for a elastic San. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the ElasticSan. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByElasticSanAsync(string subscriptionId, string resourceGroupName, string elasticSanName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(elasticSanName, nameof(elasticSanName)); + + using var message = CreateListByElasticSanRequest(subscriptionId, resourceGroupName, elasticSanName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ElasticSanPrivateLinkResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ElasticSanPrivateLinkResourceListResult.DeserializeElasticSanPrivateLinkResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the private link resources that need to be created for a elastic San. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the ElasticSan. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByElasticSan(string subscriptionId, string resourceGroupName, string elasticSanName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(elasticSanName, nameof(elasticSanName)); + + using var message = CreateListByElasticSanRequest(subscriptionId, resourceGroupName, elasticSanName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ElasticSanPrivateLinkResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ElasticSanPrivateLinkResourceListResult.DeserializeElasticSanPrivateLinkResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/RestOperations/SkusRestOperations.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/RestOperations/SkusRestOperations.cs index 628cdc08e13bc..9b1843f114dde 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/RestOperations/SkusRestOperations.cs +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/RestOperations/SkusRestOperations.cs @@ -33,7 +33,7 @@ public SkusRestOperations(HttpPipeline pipeline, string applicationId, Uri endpo { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-11-20-preview"; + _apiVersion = apiVersion ?? "2022-12-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/RestOperations/VolumeGroupsRestOperations.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/RestOperations/VolumeGroupsRestOperations.cs index 974b334353a18..9d860c2d7278d 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/RestOperations/VolumeGroupsRestOperations.cs +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/RestOperations/VolumeGroupsRestOperations.cs @@ -33,7 +33,7 @@ public VolumeGroupsRestOperations(HttpPipeline pipeline, string applicationId, U { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-11-20-preview"; + _apiVersion = apiVersion ?? "2022-12-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -164,7 +164,7 @@ public async Task CreateAsync(string subscriptionId, string resourceGr switch (message.Response.Status) { case 200: - case 202: + case 201: return message.Response; default: throw new RequestFailedException(message.Response); @@ -193,7 +193,7 @@ public Response Create(string subscriptionId, string resourceGroupName, string e switch (message.Response.Status) { case 200: - case 202: + case 201: return message.Response; default: throw new RequestFailedException(message.Response); diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/RestOperations/VolumesRestOperations.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/RestOperations/VolumesRestOperations.cs index 7e434e78f713b..83ba2cb1df2c9 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/RestOperations/VolumesRestOperations.cs +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/RestOperations/VolumesRestOperations.cs @@ -33,7 +33,7 @@ public VolumesRestOperations(HttpPipeline pipeline, string applicationId, Uri en { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-11-20-preview"; + _apiVersion = apiVersion ?? "2022-12-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -89,7 +89,7 @@ public async Task CreateAsync(string subscriptionId, string resourceGr switch (message.Response.Status) { case 200: - case 202: + case 201: return message.Response; default: throw new RequestFailedException(message.Response); @@ -120,7 +120,7 @@ public Response Create(string subscriptionId, string resourceGroupName, string e switch (message.Response.Status) { case 200: - case 202: + case 201: return message.Response; default: throw new RequestFailedException(message.Response); diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/autorest.md b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/autorest.md index 2c77d394a089b..cbcc2d414021a 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/autorest.md +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/autorest.md @@ -9,7 +9,7 @@ csharp: true library-name: ElasticSan namespace: Azure.ResourceManager.ElasticSan # default tag is a preview version -require: https://github.com/Azure/azure-rest-api-specs/blob/8ff0e3b8dc12cd793f4f2208d76f9f3a7f51176c/specification/elasticsan/resource-manager/readme.md +require: https://github.com/Azure/azure-rest-api-specs/blob/1af2861030243b06ee35172c95899f4809eedfc7/specification/elasticsan/resource-manager/readme.md output-folder: $(this-folder)/Generated clear-output-folder: true skip-csproj: true diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/tests/ElasticSanTestBase.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/tests/ElasticSanTestBase.cs index 440779d34e7f6..4a168fb19a4e9 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/tests/ElasticSanTestBase.cs +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/tests/ElasticSanTestBase.cs @@ -31,7 +31,7 @@ public ElasticSanTestBase(bool isAsync, RecordedTestMode mode) : base(isAsync, m protected readonly string ResourceGroupName = "testelasticsan"; protected readonly string ElasticSanName = "testsan1"; - protected AzureLocation TestLocation = new("southcentralusstg"); + protected AzureLocation TestLocation = new("eastus2euap"); [SetUp] public async Task CreateCommonClient() @@ -52,10 +52,7 @@ public static ElasticSanData GetDefaultElasticSanParameters(string location = nu public static ElasticSanVolumeData GetDefaultElasticSanVolumeData() { - ElasticSanVolumeData parameters = new ElasticSanVolumeData() - { - SizeGiB = 100 - }; + ElasticSanVolumeData parameters = new ElasticSanVolumeData(100); return parameters; } diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/tests/Scenario/ElasticSanCollectionTests.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/tests/Scenario/ElasticSanCollectionTests.cs index 97779519269e3..57e7f240273c5 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/tests/Scenario/ElasticSanCollectionTests.cs +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/tests/Scenario/ElasticSanCollectionTests.cs @@ -34,7 +34,6 @@ public async Task CreateOrUpdate() ElasticSanData data = GetDefaultElasticSanParameters(TestLocation); data.Tags.Add("tag1", "value1"); - data.AvailabilityZones.Add("zone1"); string elasticSanName = Recording.GenerateAssetName("testsan-"); ElasticSanResource elasticSan1 = (await elasticSanCollection.CreateOrUpdateAsync(WaitUntil.Completed, elasticSanName, data)).Value; @@ -44,8 +43,6 @@ public async Task CreateOrUpdate() Assert.IsTrue(elasticSan1.Data.Tags.ContainsKey("tag1")); Assert.AreEqual("value1", elasticSan1.Data.Tags["tag1"]); // Skip the validation for AvailabilityZone as the server won't return the property - //Assert.GreaterOrEqual(elasticSan1.Data.AvailabilityZones.Count, 1); - //Assert.IsTrue(elasticSan1.Data.AvailabilityZones.Contains("zone1")); elasticSan1 = (await elasticSanCollection.CreateOrUpdateAsync(WaitUntil.Completed, elasticSanName, GetDefaultElasticSanParameters(TestLocation, 7, 2))).Value; Assert.AreEqual(elasticSanName, elasticSan1.Id.Name); @@ -64,6 +61,20 @@ public async Task Get() Assert.AreEqual(ElasticSanName, elasticSan1.Id.Name); Assert.AreEqual(1, elasticSan1.Data.BaseSizeTiB); Assert.AreEqual(6, elasticSan1.Data.ExtendedCapacitySizeTiB); + + // Test for ElasticSan PE properties + elasticSanCollection = (await GetResourceGroupAsync("yifanz1")).GetElasticSans(); + elasticSan1 = (await elasticSanCollection.GetAsync("testpreviewes2")).Value; + Assert.AreEqual(3, elasticSan1.Data.PrivateEndpointConnections.Count); + Assert.IsNotEmpty(elasticSan1.Data.PrivateEndpointConnections[0].Name); + Assert.IsNotEmpty(elasticSan1.Data.PrivateEndpointConnections[0].PrivateEndpointId); + Assert.AreEqual("Approved", elasticSan1.Data.PrivateEndpointConnections[0].ConnectionState.Status.ToString()); + Assert.IsNotEmpty(elasticSan1.Data.PrivateEndpointConnections[1].Name); + Assert.AreEqual("Approved", elasticSan1.Data.PrivateEndpointConnections[1].ConnectionState.Status.ToString()); + Assert.IsNotEmpty(elasticSan1.Data.PrivateEndpointConnections[1].PrivateEndpointId); + Assert.IsNotEmpty(elasticSan1.Data.PrivateEndpointConnections[2].Name); + Assert.AreEqual("Pending", elasticSan1.Data.PrivateEndpointConnections[2].ConnectionState.Status.ToString()); + Assert.IsNotEmpty(elasticSan1.Data.PrivateEndpointConnections[2].PrivateEndpointId); } [Test] diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/tests/Scenario/ElasticSanVolumeCollectionTests.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/tests/Scenario/ElasticSanVolumeCollectionTests.cs index f7024c03333dc..d70567826d462 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/tests/Scenario/ElasticSanVolumeCollectionTests.cs +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/tests/Scenario/ElasticSanVolumeCollectionTests.cs @@ -40,21 +40,14 @@ public async Task CreateOrUpdate() _collection = await GetVolumeCollection(); string volumeName = Recording.GenerateAssetName("testvolume-"); - ElasticSanVolumeData volumeData = new ElasticSanVolumeData() + ElasticSanVolumeData volumeData = new ElasticSanVolumeData(100) { - SizeGiB = 100, CreationData = new Models.ElasticSanVolumeDataSourceInfo() }; - volumeData.CreationData.SourceUri = new Uri("http://abc.com"); - volumeData.Tags.Add("tag1", "value1"); - volumeData.Tags.Add("tag2", "value2"); ElasticSanVolumeResource volume = (await _collection.CreateOrUpdateAsync(WaitUntil.Completed, volumeName, volumeData)).Value; Assert.AreEqual(volume.Id.Name, volumeName); Assert.AreEqual(100, volume.Data.SizeGiB); Assert.AreEqual(ElasticSanVolumeCreateOption.None, volume.Data.CreationData.CreateSource); - Assert.AreEqual("http://abc.com/", volume.Data.CreationData.SourceUri.ToString()); - Assert.GreaterOrEqual(volume.Data.Tags.Count, 2); - Assert.AreEqual("value1", volume.Data.Tags["tag1"]); } [Test] @@ -64,18 +57,13 @@ public async Task Get() _collection = await GetVolumeCollection(); string volumeName = Recording.GenerateAssetName("testvolume-"); - ElasticSanVolumeData volumeData = new ElasticSanVolumeData() - { - SizeGiB = 100, - }; - volumeData.Tags.Add("tag1", "value1"); + ElasticSanVolumeData volumeData = new ElasticSanVolumeData(100); ElasticSanVolumeResource volume1 = (await _collection.CreateOrUpdateAsync(WaitUntil.Completed, volumeName, volumeData)).Value; ElasticSanVolumeResource volume2 = (await _collection.GetAsync(volumeName)).Value; Assert.AreEqual(volume2.Id.Name, volume1.Id.Name); Assert.AreEqual(100, volume1.Data.SizeGiB); Assert.AreEqual(ElasticSanVolumeCreateOption.None, volume1.Data.CreationData.CreateSource); Assert.IsNull(volume1.Data.CreationData.SourceUri); - Assert.AreEqual("value1", volume1.Data.Tags["tag1"]); } [Test] @@ -86,10 +74,7 @@ public async Task GetAll() string volumeName1 = Recording.GenerateAssetName("testvolume-"); string volumeName2 = Recording.GenerateAssetName("testvolume-"); - ElasticSanVolumeData volumeData = new ElasticSanVolumeData() - { - SizeGiB = 100 - }; + ElasticSanVolumeData volumeData = new ElasticSanVolumeData(100); _ = (await _collection.CreateOrUpdateAsync(WaitUntil.Completed, volumeName1, volumeData)).Value; _ = (await _collection.CreateOrUpdateAsync(WaitUntil.Completed, volumeName2, volumeData)).Value; @@ -108,10 +93,7 @@ public async Task Exists() _collection = await GetVolumeCollection(); string volumeName = Recording.GenerateAssetName("testvolume-"); - ElasticSanVolumeData volumeData = new ElasticSanVolumeData() - { - SizeGiB = 100 - }; + ElasticSanVolumeData volumeData = new ElasticSanVolumeData(100); _ = (await _collection.CreateOrUpdateAsync(WaitUntil.Completed, volumeName, volumeData)).Value; Assert.IsTrue(await _collection.ExistsAsync(volumeName)); Assert.IsFalse(await _collection.ExistsAsync(volumeName + "111")); diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/tests/Scenario/ElasticSanVolumeGroupCollectionTests.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/tests/Scenario/ElasticSanVolumeGroupCollectionTests.cs index 03f76988c11fe..38f04e8878710 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/tests/Scenario/ElasticSanVolumeGroupCollectionTests.cs +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/tests/Scenario/ElasticSanVolumeGroupCollectionTests.cs @@ -36,7 +36,6 @@ public async Task CreateOrUpdate() ProtocolType = StorageTargetType.Iscsi, Encryption = ElasticSanEncryptionType.EncryptionAtRestWithPlatformKey }; - volumeGroupData.Tags.Add("tag1", "value1"); // vnet resource id is created by following instructions in https://docs.microsoft.com/en-us/azure/storage/common/storage-network-security?tabs=azure-portal var vnetResourceId = new ResourceIdentifier("/subscriptions/" + DefaultSubscription.Data.Id.Name + "/resourceGroups/" + ResourceGroupName + "/providers/Microsoft.Network/virtualNetworks/testvnet/subnets/subnet1"); volumeGroupData.VirtualNetworkRules.Add(new ElasticSanVirtualNetworkRule(vnetResourceId)); @@ -45,8 +44,6 @@ public async Task CreateOrUpdate() Assert.AreEqual(volumeGroupResource.Id.Name, volumeGroupName); Assert.AreEqual(ElasticSanEncryptionType.EncryptionAtRestWithPlatformKey, volumeGroupResource.Data.Encryption); Assert.AreEqual(StorageTargetType.Iscsi, volumeGroupResource.Data.ProtocolType); - Assert.IsTrue(volumeGroupResource.Data.Tags.ContainsKey("tag1")); - Assert.AreEqual("value1", volumeGroupResource.Data.Tags["tag1"]); Assert.GreaterOrEqual(volumeGroupResource.Data.VirtualNetworkRules.Count, 1); Assert.AreEqual(vnetResourceId, volumeGroupResource.Data.VirtualNetworkRules[0].VirtualNetworkResourceId); } @@ -62,7 +59,6 @@ public async Task Get() _ = (await collection.CreateOrUpdateAsync(WaitUntil.Completed, volumeGroupName, new ElasticSanVolumeGroupData())).Value; ElasticSanVolumeGroupResource volumeGroup = (await collection.GetAsync(volumeGroupName)).Value; Assert.AreEqual(volumeGroup.Id.Name, volumeGroupName); - Assert.IsEmpty(volumeGroup.Data.Tags); Assert.IsEmpty(volumeGroup.Data.VirtualNetworkRules); Assert.AreEqual(StorageTargetType.Iscsi, volumeGroup.Data.ProtocolType); Assert.AreEqual(ElasticSanEncryptionType.EncryptionAtRestWithPlatformKey, volumeGroup.Data.Encryption); diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/tests/Scenario/ElasticSanVolumeGroupResourceTests.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/tests/Scenario/ElasticSanVolumeGroupResourceTests.cs index 9e5efacacc861..ead5f21704b0d 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/tests/Scenario/ElasticSanVolumeGroupResourceTests.cs +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/tests/Scenario/ElasticSanVolumeGroupResourceTests.cs @@ -40,7 +40,6 @@ public async Task Get() ElasticSanVolumeGroupResource volumeGroup = (await _collection.CreateOrUpdateAsync(WaitUntil.Completed, volumeGroupName, new ElasticSanVolumeGroupData())).Value; ElasticSanVolumeGroupResource volumeGroup1 = (await volumeGroup.GetAsync()).Value; Assert.AreEqual(volumeGroupName, volumeGroup1.Id.Name); - Assert.IsEmpty(volumeGroup1.Data.Tags); Assert.IsEmpty(volumeGroup1.Data.VirtualNetworkRules); Assert.AreEqual(StorageTargetType.Iscsi, volumeGroup1.Data.ProtocolType); Assert.AreEqual(ElasticSanEncryptionType.EncryptionAtRestWithPlatformKey, volumeGroup1.Data.Encryption); @@ -70,7 +69,6 @@ public async Task Update() ProtocolType = StorageTargetType.Iscsi, Encryption = ElasticSanEncryptionType.EncryptionAtRestWithPlatformKey }; - patch.Tags.Add("tag1", "value1"); var vnetResourceId = new ResourceIdentifier("/subscriptions/" + DefaultSubscription.Data.Id.Name + "/resourceGroups/" + ResourceGroupName + "/providers/Microsoft.Network/virtualNetworks/testvnet/subnets/subnet1"); patch.VirtualNetworkRules.Add(new ElasticSanVirtualNetworkRule(vnetResourceId)); @@ -79,7 +77,6 @@ public async Task Update() Assert.AreEqual(StorageTargetType.Iscsi, volGroup1.Data.ProtocolType); Assert.AreEqual(ElasticSanEncryptionType.EncryptionAtRestWithPlatformKey, volGroup1.Data.Encryption); Assert.AreEqual(vnetResourceId, volGroup1.Data.VirtualNetworkRules[0].VirtualNetworkResourceId); - Assert.AreEqual("value1", volGroup1.Data.Tags["tag1"]); } } } diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/tests/Scenario/ElasticSanVolumeResourceTests.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/tests/Scenario/ElasticSanVolumeResourceTests.cs index cfc08153d5668..7af83e3aca23b 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/tests/Scenario/ElasticSanVolumeResourceTests.cs +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/tests/Scenario/ElasticSanVolumeResourceTests.cs @@ -39,15 +39,11 @@ public async Task Get() { _collection = await GetVolumeCollection(); string volumeName = Recording.GenerateAssetName("testvolume-"); - ElasticSanVolumeData data = new ElasticSanVolumeData() - { - SizeGiB = 100 - }; + ElasticSanVolumeData data = new ElasticSanVolumeData(100); ElasticSanVolumeResource volume1 = (await _collection.CreateOrUpdateAsync(WaitUntil.Completed, volumeName, data)).Value; ElasticSanVolumeResource volume2 = await volume1.GetAsync(); Assert.AreEqual(volume1.Id.Name, volume2.Id.Name); Assert.AreEqual(100, volume2.Data.SizeGiB); - Assert.IsEmpty(volume2.Data.Tags); Assert.IsNull(volume2.Data.CreationData.SourceUri); Assert.AreEqual(ElasticSanVolumeCreateOption.None, volume1.Data.CreationData.CreateSource); } @@ -74,11 +70,8 @@ public async Task Update() { SizeGiB = 200 }; - patch.Tags.Add("tag1", "value1"); ElasticSanVolumeResource volume2 = (await volume1.UpdateAsync(WaitUntil.Completed, patch)).Value; Assert.AreEqual(200, volume2.Data.SizeGiB); - Assert.GreaterOrEqual(volume2.Data.Tags.Count, 1); - Assert.AreEqual("value1", volume2.Data.Tags["tag1"]); } } }