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 c68581023629a..123f4aaf2e61b 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 @@ -17,11 +17,11 @@ protected ElasticSanCollection() { } } public partial class ElasticSanData : Azure.ResourceManager.Models.TrackedResourceData { - public ElasticSanData(Azure.Core.AzureLocation location) : base (default(Azure.Core.AzureLocation)) { } + public ElasticSanData(Azure.Core.AzureLocation location, Azure.ResourceManager.ElasticSan.Models.ElasticSanSku sku, long baseSizeTiB, long extendedCapacitySizeTiB) : base (default(Azure.Core.AzureLocation)) { } public System.Collections.Generic.IList AvailabilityZones { get { throw null; } } - public long? BaseSizeTiB { get { throw null; } set { } } + public long BaseSizeTiB { get { throw null; } set { } } public long? ElasticSanVolumeGroupCount { get { throw null; } } - public long? ExtendedCapacitySizeTiB { get { throw null; } set { } } + public long ExtendedCapacitySizeTiB { get { throw null; } set { } } public Azure.ResourceManager.ElasticSan.Models.ProvisioningState? ProvisioningState { get { throw null; } } public Azure.ResourceManager.ElasticSan.Models.ElasticSanSku Sku { get { throw null; } set { } } public long? TotalElasticSanVolumeSizeGiB { get { throw null; } } @@ -39,8 +39,8 @@ public static partial class ElasticSanExtensions public static Azure.AsyncPageable GetElasticSansAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.ElasticSan.ElasticSanVolumeGroupResource GetElasticSanVolumeGroupResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.ElasticSan.ElasticSanVolumeResource GetElasticSanVolumeResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } - public static Azure.Pageable GetSkus(this Azure.ResourceManager.Resources.TenantResource tenantResource, string filter = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.AsyncPageable GetSkusAsync(this Azure.ResourceManager.Resources.TenantResource tenantResource, string filter = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + 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 ElasticSanResource : Azure.ResourceManager.ArmResource { @@ -199,9 +199,19 @@ public ElasticSanPatch() { } } public partial class ElasticSanSku { - public ElasticSanSku() { } - public Azure.ResourceManager.ElasticSan.Models.ElasticSanSkuName? Name { get { throw null; } set { } } - public Azure.ResourceManager.ElasticSan.Models.ElasticSanTier? Tier { get { throw null; } set { } } + public ElasticSanSku(Azure.ResourceManager.ElasticSan.Models.ElasticSanSkuName name) { } + public Azure.ResourceManager.ElasticSan.Models.ElasticSanSkuName Name { get { throw null; } set { } } + public Azure.ResourceManager.ElasticSan.Models.ElasticSanSkuTier? Tier { get { throw null; } set { } } + } + public partial class ElasticSanSkuInformation + { + internal ElasticSanSkuInformation() { } + public System.Collections.Generic.IReadOnlyList Capabilities { get { throw null; } } + public System.Collections.Generic.IReadOnlyList LocationInfo { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Locations { get { throw null; } } + public Azure.ResourceManager.ElasticSan.Models.ElasticSanSkuName Name { get { throw null; } } + public string ResourceType { get { throw null; } } + public Azure.ResourceManager.ElasticSan.Models.ElasticSanSkuTier? Tier { get { throw null; } } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct ElasticSanSkuName : System.IEquatable @@ -222,20 +232,20 @@ public ElasticSanSku() { } public override string ToString() { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct ElasticSanTier : System.IEquatable + public readonly partial struct ElasticSanSkuTier : System.IEquatable { private readonly object _dummy; private readonly int _dummyPrimitive; - public ElasticSanTier(string value) { throw null; } - public static Azure.ResourceManager.ElasticSan.Models.ElasticSanTier Premium { get { throw null; } } - public bool Equals(Azure.ResourceManager.ElasticSan.Models.ElasticSanTier other) { throw null; } + public ElasticSanSkuTier(string value) { throw null; } + public static Azure.ResourceManager.ElasticSan.Models.ElasticSanSkuTier Premium { get { throw null; } } + public bool Equals(Azure.ResourceManager.ElasticSan.Models.ElasticSanSkuTier 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.ElasticSanTier left, Azure.ResourceManager.ElasticSan.Models.ElasticSanTier right) { throw null; } - public static implicit operator Azure.ResourceManager.ElasticSan.Models.ElasticSanTier (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.ElasticSan.Models.ElasticSanTier left, Azure.ResourceManager.ElasticSan.Models.ElasticSanTier right) { throw null; } + public static bool operator ==(Azure.ResourceManager.ElasticSan.Models.ElasticSanSkuTier left, Azure.ResourceManager.ElasticSan.Models.ElasticSanSkuTier right) { throw null; } + public static implicit operator Azure.ResourceManager.ElasticSan.Models.ElasticSanSkuTier (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ElasticSan.Models.ElasticSanSkuTier left, Azure.ResourceManager.ElasticSan.Models.ElasticSanSkuTier right) { throw null; } public override string ToString() { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] @@ -255,16 +265,6 @@ public ElasticSanSku() { } public static bool operator !=(Azure.ResourceManager.ElasticSan.Models.ElasticSanVolumeCreateOption left, Azure.ResourceManager.ElasticSan.Models.ElasticSanVolumeCreateOption right) { throw null; } public override string ToString() { throw null; } } - public partial class ElasticSanVolumeTierInfo - { - internal ElasticSanVolumeTierInfo() { } - public long? IopsPerBaseGiB { get { throw null; } } - public long? MaxIops { get { throw null; } } - public long? MaxMbps { get { throw null; } } - public long? MaxSizeGiB { get { throw null; } } - public long? MinIncrementSizeGiB { get { throw null; } } - public long? MinSizeGiB { get { throw null; } } - } public partial class IscsiTargetInfo { internal IscsiTargetInfo() { } @@ -322,25 +322,11 @@ internal IscsiTargetInfo() { } public static bool operator !=(Azure.ResourceManager.ElasticSan.Models.ProvisioningState left, Azure.ResourceManager.ElasticSan.Models.ProvisioningState right) { throw null; } public override string ToString() { throw null; } } - public partial class ResourceTypeSku - { - internal ResourceTypeSku() { } - public Azure.ResourceManager.ElasticSan.Models.SanTierInfo ElasticSan { get { throw null; } } - public Azure.ResourceManager.ElasticSan.Models.ElasticSanVolumeTierInfo ElasticSanVolume { get { throw null; } } - public System.Collections.Generic.IReadOnlyList LocationInfo { get { throw null; } } - public long? MaxElasticSanVolumeCount { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Sku { get { throw null; } } - } - public partial class SanTierInfo + public partial class SKUCapability { - internal SanTierInfo() { } - public long? IopsPerBaseTiB { get { throw null; } } - public long? MaxElasticSanVolumeGroupCount { get { throw null; } } - public long? MaxMbps { get { throw null; } } - public long? MaxSizeTiB { get { throw null; } } - public long? MbpsPerBaseTiB { get { throw null; } } - public long? MinIncrementSizeTiB { get { throw null; } } - public long? MinSizeTiB { get { throw null; } } + internal SKUCapability() { } + public string Name { get { throw null; } } + public string Value { get { throw null; } } } public partial class SkuLocationInfo { @@ -351,7 +337,7 @@ internal SkuLocationInfo() { } public partial class SourceCreationData { public SourceCreationData() { } - public Azure.ResourceManager.ElasticSan.Models.ElasticSanVolumeCreateOption CreateSource { get { throw null; } set { } } + public Azure.ResourceManager.ElasticSan.Models.ElasticSanVolumeCreateOption? CreateSource { get { throw null; } set { } } public System.Uri SourceUri { get { throw null; } set { } } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/ElasticSanData.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/ElasticSanData.cs index 45bf24ae1236a..193a8e5de01a5 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/ElasticSanData.cs +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/ElasticSanData.cs @@ -5,6 +5,7 @@ #nullable disable +using System; using System.Collections.Generic; using Azure.Core; using Azure.ResourceManager.ElasticSan.Models; @@ -17,9 +18,21 @@ public partial class ElasticSanData : TrackedResourceData { /// Initializes a new instance of ElasticSanData. /// The location. - public ElasticSanData(AzureLocation location) : base(location) + /// resource sku. + /// Base size of the Elastic San appliance in TiB. + /// Extended size of the Elastic San appliance in TiB. + /// is null. + public ElasticSanData(AzureLocation location, ElasticSanSku sku, long baseSizeTiB, long extendedCapacitySizeTiB) : base(location) { + if (sku == null) + { + throw new ArgumentNullException(nameof(sku)); + } + + Sku = sku; AvailabilityZones = new ChangeTrackingList(); + BaseSizeTiB = baseSizeTiB; + ExtendedCapacitySizeTiB = extendedCapacitySizeTiB; } /// Initializes a new instance of ElasticSanData. @@ -39,7 +52,7 @@ public ElasticSanData(AzureLocation location) : base(location) /// 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, ProvisioningState? provisioningState, long? baseSizeTiB, long? extendedCapacitySizeTiB, long? totalElasticSanVolumeSizeGiB, long? elasticSanVolumeGroupCount, long? totalIops, long? totalMbps, long? totalSizeTiB) : base(id, name, resourceType, systemData, tags, location) + internal ElasticSanData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ElasticSanSku sku, IList availabilityZones, ProvisioningState? provisioningState, long baseSizeTiB, long extendedCapacitySizeTiB, long? totalElasticSanVolumeSizeGiB, long? elasticSanVolumeGroupCount, long? totalIops, long? totalMbps, long? totalSizeTiB) : base(id, name, resourceType, systemData, tags, location) { Sku = sku; AvailabilityZones = availabilityZones; @@ -60,9 +73,9 @@ internal ElasticSanData(ResourceIdentifier id, string name, ResourceType resourc /// State of the operation on the resource. public ProvisioningState? ProvisioningState { get; } /// Base size of the Elastic San appliance in TiB. - public long? BaseSizeTiB { get; set; } + public long BaseSizeTiB { get; set; } /// Extended size of the Elastic San appliance in TiB. - public long? ExtendedCapacitySizeTiB { get; set; } + public long ExtendedCapacitySizeTiB { get; set; } /// Total size of the provisioned Volumes in GiB. public long? TotalElasticSanVolumeSizeGiB { get; } /// Total number of volume groups in this Elastic San appliance. 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 9a61acc301491..a5e77dd9499a2 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Extensions/ElasticSanExtensions.cs +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Extensions/ElasticSanExtensions.cs @@ -19,50 +19,41 @@ namespace Azure.ResourceManager.ElasticSan /// A class to add extension methods to Azure.ResourceManager.ElasticSan. public static partial class ElasticSanExtensions { - private static TenantResourceExtensionClient GetExtensionClient(TenantResource tenantResource) + private static SubscriptionResourceExtensionClient GetExtensionClient(SubscriptionResource subscriptionResource) { - return tenantResource.GetCachedClient((client) => + return subscriptionResource.GetCachedClient((client) => { - return new TenantResourceExtensionClient(client, tenantResource.Id); + return new SubscriptionResourceExtensionClient(client, subscriptionResource.Id); } ); } /// /// List all the available Skus in the region and information related to them - /// Request Path: /providers/Microsoft.ElasticSan/skus + /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.ElasticSan/skus /// Operation Id: Skus_List /// - /// The instance the method will execute against. + /// The instance the method will execute against. /// Specify $filter='location eq <location>' to filter on location. /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetSkusAsync(this TenantResource tenantResource, string filter = null, CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetSkusAsync(this SubscriptionResource subscriptionResource, string filter = null, CancellationToken cancellationToken = default) { - return GetExtensionClient(tenantResource).GetSkusAsync(filter, cancellationToken); + return GetExtensionClient(subscriptionResource).GetSkusAsync(filter, cancellationToken); } /// /// List all the available Skus in the region and information related to them - /// Request Path: /providers/Microsoft.ElasticSan/skus + /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.ElasticSan/skus /// Operation Id: Skus_List /// - /// The instance the method will execute against. + /// The instance the method will execute against. /// Specify $filter='location eq <location>' to filter on location. /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetSkus(this TenantResource tenantResource, string filter = null, CancellationToken cancellationToken = default) - { - return GetExtensionClient(tenantResource).GetSkus(filter, cancellationToken); - } - - private static SubscriptionResourceExtensionClient GetExtensionClient(SubscriptionResource subscriptionResource) + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetSkus(this SubscriptionResource subscriptionResource, string filter = null, CancellationToken cancellationToken = default) { - return subscriptionResource.GetCachedClient((client) => - { - return new SubscriptionResourceExtensionClient(client, subscriptionResource.Id); - } - ); + return GetExtensionClient(subscriptionResource).GetSkus(filter, cancellationToken); } /// diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs index 4646ed4312c0e..a52b0ce932a5b 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs @@ -13,12 +13,15 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.ElasticSan.Models; namespace Azure.ResourceManager.ElasticSan { /// A class to add extension methods to SubscriptionResource. internal partial class SubscriptionResourceExtensionClient : ArmResource { + private ClientDiagnostics _skusClientDiagnostics; + private SkusRestOperations _skusRestClient; private ClientDiagnostics _elasticSanClientDiagnostics; private ElasticSansRestOperations _elasticSanRestClient; @@ -34,6 +37,8 @@ internal SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifie { } + private ClientDiagnostics SkusClientDiagnostics => _skusClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.ElasticSan", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private SkusRestOperations SkusRestClient => _skusRestClient ??= new SkusRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); private ClientDiagnostics ElasticSanClientDiagnostics => _elasticSanClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.ElasticSan", ElasticSanResource.ResourceType.Namespace, Diagnostics); private ElasticSansRestOperations ElasticSanRestClient => _elasticSanRestClient ??= new ElasticSansRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(ElasticSanResource.ResourceType)); @@ -43,6 +48,62 @@ private string GetApiVersionOrNull(ResourceType resourceType) return apiVersion; } + /// + /// List all the available Skus in the region and information related to them + /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.ElasticSan/skus + /// Operation Id: Skus_List + /// + /// Specify $filter='location eq <location>' to filter on location. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetSkusAsync(string filter = null, CancellationToken cancellationToken = default) + { + async Task> FirstPageFunc(int? pageSizeHint) + { + using var scope = SkusClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetSkus"); + scope.Start(); + try + { + var response = await SkusRestClient.ListAsync(Id.SubscriptionId, filter, cancellationToken: cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value, null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, null); + } + + /// + /// List all the available Skus in the region and information related to them + /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.ElasticSan/skus + /// Operation Id: Skus_List + /// + /// Specify $filter='location eq <location>' to filter on location. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetSkus(string filter = null, CancellationToken cancellationToken = default) + { + Page FirstPageFunc(int? pageSizeHint) + { + using var scope = SkusClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetSkus"); + scope.Start(); + try + { + var response = SkusRestClient.List(Id.SubscriptionId, filter, cancellationToken: cancellationToken); + return Page.FromValues(response.Value.Value, null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateEnumerable(FirstPageFunc, null); + } + /// /// Gets a list of ElasticSans in a subscription /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.ElasticSan/elasticSans diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Extensions/TenantResourceExtensionClient.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Extensions/TenantResourceExtensionClient.cs deleted file mode 100644 index f5bd9ceb9b065..0000000000000 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Extensions/TenantResourceExtensionClient.cs +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.ElasticSan.Models; - -namespace Azure.ResourceManager.ElasticSan -{ - /// A class to add extension methods to TenantResource. - internal partial class TenantResourceExtensionClient : ArmResource - { - private ClientDiagnostics _skusClientDiagnostics; - private SkusRestOperations _skusRestClient; - - /// Initializes a new instance of the class for mocking. - protected TenantResourceExtensionClient() - { - } - - /// 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 TenantResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private ClientDiagnostics SkusClientDiagnostics => _skusClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.ElasticSan", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private SkusRestOperations SkusRestClient => _skusRestClient ??= new SkusRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// - /// List all the available Skus in the region and information related to them - /// Request Path: /providers/Microsoft.ElasticSan/skus - /// Operation Id: Skus_List - /// - /// Specify $filter='location eq <location>' to filter on location. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetSkusAsync(string filter = null, CancellationToken cancellationToken = default) - { - async Task> FirstPageFunc(int? pageSizeHint) - { - using var scope = SkusClientDiagnostics.CreateScope("TenantResourceExtensionClient.GetSkus"); - scope.Start(); - try - { - var response = await SkusRestClient.ListAsync(filter, cancellationToken: cancellationToken).ConfigureAwait(false); - return Page.FromValues(response.Value.Value, null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, null); - } - - /// - /// List all the available Skus in the region and information related to them - /// Request Path: /providers/Microsoft.ElasticSan/skus - /// Operation Id: Skus_List - /// - /// Specify $filter='location eq <location>' to filter on location. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetSkus(string filter = null, CancellationToken cancellationToken = default) - { - Page FirstPageFunc(int? pageSizeHint) - { - using var scope = SkusClientDiagnostics.CreateScope("TenantResourceExtensionClient.GetSkus"); - scope.Start(); - try - { - var response = SkusRestClient.List(filter, cancellationToken: cancellationToken); - return Page.FromValues(response.Value.Value, null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - return PageableHelpers.CreateEnumerable(FirstPageFunc, null); - } - } -} 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 91e544be5c067..4a9878382fe12 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 @@ -33,11 +33,8 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteStringValue(Location); writer.WritePropertyName("properties"); writer.WriteStartObject(); - if (Optional.IsDefined(Sku)) - { - writer.WritePropertyName("sku"); - writer.WriteObjectValue(Sku); - } + writer.WritePropertyName("sku"); + writer.WriteObjectValue(Sku); if (Optional.IsCollectionDefined(AvailabilityZones)) { writer.WritePropertyName("availabilityZones"); @@ -48,16 +45,10 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) } writer.WriteEndArray(); } - if (Optional.IsDefined(BaseSizeTiB)) - { - writer.WritePropertyName("baseSizeTiB"); - writer.WriteNumberValue(BaseSizeTiB.Value); - } - if (Optional.IsDefined(ExtendedCapacitySizeTiB)) - { - writer.WritePropertyName("extendedCapacitySizeTiB"); - writer.WriteNumberValue(ExtendedCapacitySizeTiB.Value); - } + writer.WritePropertyName("baseSizeTiB"); + writer.WriteNumberValue(BaseSizeTiB); + writer.WritePropertyName("extendedCapacitySizeTiB"); + writer.WriteNumberValue(ExtendedCapacitySizeTiB); writer.WriteEndObject(); writer.WriteEndObject(); } @@ -70,11 +61,11 @@ internal static ElasticSanData DeserializeElasticSanData(JsonElement element) string name = default; ResourceType type = default; Optional systemData = default; - Optional sku = default; + ElasticSanSku sku = default; Optional> availabilityZones = default; Optional provisioningState = default; - Optional baseSizeTiB = default; - Optional extendedCapacitySizeTiB = default; + long baseSizeTiB = default; + long extendedCapacitySizeTiB = default; Optional totalElasticSanVolumeSizeGiB = default; Optional elasticSanVolumeGroupCount = default; Optional totalIops = default; @@ -138,11 +129,6 @@ internal static ElasticSanData DeserializeElasticSanData(JsonElement element) { if (property0.NameEquals("sku")) { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } sku = ElasticSanSku.DeserializeElasticSanSku(property0.Value); continue; } @@ -173,21 +159,11 @@ internal static ElasticSanData DeserializeElasticSanData(JsonElement element) } if (property0.NameEquals("baseSizeTiB")) { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } baseSizeTiB = property0.Value.GetInt64(); continue; } if (property0.NameEquals("extendedCapacitySizeTiB")) { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } extendedCapacitySizeTiB = property0.Value.GetInt64(); continue; } @@ -245,7 +221,7 @@ internal static ElasticSanData DeserializeElasticSanData(JsonElement element) continue; } } - return new ElasticSanData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, sku.Value, Optional.ToList(availabilityZones), Optional.ToNullable(provisioningState), Optional.ToNullable(baseSizeTiB), Optional.ToNullable(extendedCapacitySizeTiB), Optional.ToNullable(totalElasticSanVolumeSizeGiB), Optional.ToNullable(elasticSanVolumeGroupCount), 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(totalElasticSanVolumeSizeGiB), Optional.ToNullable(elasticSanVolumeGroupCount), Optional.ToNullable(totalIops), Optional.ToNullable(totalMbps), Optional.ToNullable(totalSizeTiB)); } } } diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanSku.Serialization.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanSku.Serialization.cs index 564c2113e01ca..5103e2a93feee 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanSku.Serialization.cs +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanSku.Serialization.cs @@ -15,11 +15,8 @@ public partial class ElasticSanSku : IUtf8JsonSerializable void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); - if (Optional.IsDefined(Name)) - { - writer.WritePropertyName("name"); - writer.WriteStringValue(Name.Value.ToString()); - } + writer.WritePropertyName("name"); + writer.WriteStringValue(Name.ToString()); if (Optional.IsDefined(Tier)) { writer.WritePropertyName("tier"); @@ -30,17 +27,12 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) internal static ElasticSanSku DeserializeElasticSanSku(JsonElement element) { - Optional name = default; - Optional tier = default; + ElasticSanSkuName name = default; + Optional tier = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("name")) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } name = new ElasticSanSkuName(property.Value.GetString()); continue; } @@ -51,11 +43,11 @@ internal static ElasticSanSku DeserializeElasticSanSku(JsonElement element) property.ThrowNonNullablePropertyIsNull(); continue; } - tier = new ElasticSanTier(property.Value.GetString()); + tier = new ElasticSanSkuTier(property.Value.GetString()); continue; } } - return new ElasticSanSku(Optional.ToNullable(name), Optional.ToNullable(tier)); + return new ElasticSanSku(name, Optional.ToNullable(tier)); } } } diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanSku.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanSku.cs index 2f605a31b0940..373d198aa319f 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanSku.cs +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanSku.cs @@ -11,22 +11,24 @@ namespace Azure.ResourceManager.ElasticSan.Models public partial class ElasticSanSku { /// Initializes a new instance of ElasticSanSku. - public ElasticSanSku() + /// The sku name. + public ElasticSanSku(ElasticSanSkuName name) { + Name = name; } /// Initializes a new instance of ElasticSanSku. /// The sku name. /// The sku tier. - internal ElasticSanSku(ElasticSanSkuName? name, ElasticSanTier? tier) + internal ElasticSanSku(ElasticSanSkuName name, ElasticSanSkuTier? tier) { Name = name; Tier = tier; } /// The sku name. - public ElasticSanSkuName? Name { get; set; } + public ElasticSanSkuName Name { get; set; } /// The sku tier. - public ElasticSanTier? Tier { get; set; } + public ElasticSanSkuTier? Tier { get; set; } } } diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ResourceTypeSku.Serialization.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanSkuInformation.Serialization.cs similarity index 58% rename from sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ResourceTypeSku.Serialization.cs rename to sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanSkuInformation.Serialization.cs index 4bbacb4db0cdf..7d6f61f24586f 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ResourceTypeSku.Serialization.cs +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanSkuInformation.Serialization.cs @@ -11,79 +11,85 @@ namespace Azure.ResourceManager.ElasticSan.Models { - public partial class ResourceTypeSku + public partial class ElasticSanSkuInformation { - internal static ResourceTypeSku DeserializeResourceTypeSku(JsonElement element) + internal static ElasticSanSkuInformation DeserializeElasticSanSkuInformation(JsonElement element) { - Optional> sku = default; + ElasticSanSkuName name = default; + Optional tier = default; + Optional resourceType = default; + Optional> locations = default; Optional> locationInfo = default; - Optional elasticSan = default; - Optional elasticSanVolumeGroup = default; - Optional elasticSanVolume = default; + Optional> capabilities = default; foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("sku")) + if (property.NameEquals("name")) + { + name = new ElasticSanSkuName(property.Value.GetString()); + continue; + } + if (property.NameEquals("tier")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(ElasticSanSku.DeserializeElasticSanSku(item)); - } - sku = array; + tier = new ElasticSanSkuTier(property.Value.GetString()); continue; } - if (property.NameEquals("locationInfo")) + if (property.NameEquals("resourceType")) + { + resourceType = property.Value.GetString(); + continue; + } + if (property.NameEquals("locations")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(SkuLocationInfo.DeserializeSkuLocationInfo(item)); + array.Add(item.GetString()); } - locationInfo = array; + locations = array; continue; } - if (property.NameEquals("elasticSan")) + if (property.NameEquals("locationInfo")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } - elasticSan = SanTierInfo.DeserializeSanTierInfo(property.Value); - continue; - } - if (property.NameEquals("volumeGroup")) - { - if (property.Value.ValueKind == JsonValueKind.Null) + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) { - property.ThrowNonNullablePropertyIsNull(); - continue; + array.Add(SkuLocationInfo.DeserializeSkuLocationInfo(item)); } - elasticSanVolumeGroup = ElasticSanVolumeGroupTierInfo.DeserializeElasticSanVolumeGroupTierInfo(property.Value); + locationInfo = array; continue; } - if (property.NameEquals("volume")) + if (property.NameEquals("capabilities")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } - elasticSanVolume = ElasticSanVolumeTierInfo.DeserializeElasticSanVolumeTierInfo(property.Value); + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SKUCapability.DeserializeSKUCapability(item)); + } + capabilities = array; continue; } } - return new ResourceTypeSku(Optional.ToList(sku), Optional.ToList(locationInfo), elasticSan.Value, elasticSanVolumeGroup.Value, elasticSanVolume.Value); + return new ElasticSanSkuInformation(name, Optional.ToNullable(tier), resourceType.Value, Optional.ToList(locations), Optional.ToList(locationInfo), Optional.ToList(capabilities)); } } } diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanSkuInformation.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanSkuInformation.cs new file mode 100644 index 0000000000000..5a355baa5390c --- /dev/null +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanSkuInformation.cs @@ -0,0 +1,56 @@ +// 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 +{ + /// ElasticSAN SKU and its properties. + public partial class ElasticSanSkuInformation + { + /// Initializes a new instance of ElasticSanSkuInformation. + /// Sku Name. + internal ElasticSanSkuInformation(ElasticSanSkuName name) + { + Name = name; + Locations = new ChangeTrackingList(); + LocationInfo = new ChangeTrackingList(); + Capabilities = new ChangeTrackingList(); + } + + /// Initializes a new instance of ElasticSanSkuInformation. + /// Sku Name. + /// Sku Tier. + /// The type of the resource. + /// The set of locations that the SKU is available. This will be supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). + /// Availability of the SKU for the location/zone. + /// The capability information in the specified SKU. + internal ElasticSanSkuInformation(ElasticSanSkuName name, ElasticSanSkuTier? tier, string resourceType, IReadOnlyList locations, IReadOnlyList locationInfo, IReadOnlyList capabilities) + { + Name = name; + Tier = tier; + ResourceType = resourceType; + Locations = locations; + LocationInfo = locationInfo; + Capabilities = capabilities; + } + + /// Sku Name. + public ElasticSanSkuName Name { get; } + /// Sku Tier. + public ElasticSanSkuTier? Tier { get; } + /// The type of the resource. + public string ResourceType { get; } + /// The set of locations that the SKU is available. This will be supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). + public IReadOnlyList Locations { get; } + /// Availability of the SKU for the location/zone. + public IReadOnlyList LocationInfo { get; } + /// The capability information in the specified SKU. + public IReadOnlyList Capabilities { get; } + } +} diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanTier.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanSkuTier.cs similarity index 53% rename from sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanTier.cs rename to sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanSkuTier.cs index 71a97506fa68d..92cdc4165ff7e 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanTier.cs +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanSkuTier.cs @@ -11,13 +11,13 @@ namespace Azure.ResourceManager.ElasticSan.Models { /// The sku tier. - public readonly partial struct ElasticSanTier : IEquatable + public readonly partial struct ElasticSanSkuTier : IEquatable { private readonly string _value; - /// Initializes a new instance of . + /// Initializes a new instance of . /// is null. - public ElasticSanTier(string value) + public ElasticSanSkuTier(string value) { _value = value ?? throw new ArgumentNullException(nameof(value)); } @@ -25,19 +25,19 @@ public ElasticSanTier(string value) private const string PremiumValue = "Premium"; /// Premium Tier. - public static ElasticSanTier Premium { get; } = new ElasticSanTier(PremiumValue); - /// Determines if two values are the same. - public static bool operator ==(ElasticSanTier left, ElasticSanTier right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ElasticSanTier left, ElasticSanTier right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ElasticSanTier(string value) => new ElasticSanTier(value); + public static ElasticSanSkuTier Premium { get; } = new ElasticSanSkuTier(PremiumValue); + /// Determines if two values are the same. + public static bool operator ==(ElasticSanSkuTier left, ElasticSanSkuTier right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ElasticSanSkuTier left, ElasticSanSkuTier right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ElasticSanSkuTier(string value) => new ElasticSanSkuTier(value); /// [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ElasticSanTier other && Equals(other); + public override bool Equals(object obj) => obj is ElasticSanSkuTier other && Equals(other); /// - public bool Equals(ElasticSanTier other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + public bool Equals(ElasticSanSkuTier other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); /// [EditorBrowsable(EditorBrowsableState.Never)] diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanVolumeGroupTierInfo.Serialization.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanVolumeGroupTierInfo.Serialization.cs deleted file mode 100644 index 8ad0c3bfa772c..0000000000000 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanVolumeGroupTierInfo.Serialization.cs +++ /dev/null @@ -1,34 +0,0 @@ -// 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 -{ - internal partial class ElasticSanVolumeGroupTierInfo - { - internal static ElasticSanVolumeGroupTierInfo DeserializeElasticSanVolumeGroupTierInfo(JsonElement element) - { - Optional maxElasticSanVolumeCount = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("maxVolumeCount")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - maxElasticSanVolumeCount = property.Value.GetInt64(); - continue; - } - } - return new ElasticSanVolumeGroupTierInfo(Optional.ToNullable(maxElasticSanVolumeCount)); - } - } -} diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanVolumeGroupTierInfo.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanVolumeGroupTierInfo.cs deleted file mode 100644 index aaadd50bee69b..0000000000000 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanVolumeGroupTierInfo.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.ElasticSan.Models -{ - /// Volume Group scalability target. - internal partial class ElasticSanVolumeGroupTierInfo - { - /// Initializes a new instance of ElasticSanVolumeGroupTierInfo. - internal ElasticSanVolumeGroupTierInfo() - { - } - - /// Initializes a new instance of ElasticSanVolumeGroupTierInfo. - /// Maximum number of Volumes per Volume Groups per San account. - internal ElasticSanVolumeGroupTierInfo(long? maxElasticSanVolumeCount) - { - MaxElasticSanVolumeCount = maxElasticSanVolumeCount; - } - - /// Maximum number of Volumes per Volume Groups per San account. - public long? MaxElasticSanVolumeCount { get; } - } -} diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanVolumeTierInfo.Serialization.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanVolumeTierInfo.Serialization.cs deleted file mode 100644 index 80ab251d78b1f..0000000000000 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanVolumeTierInfo.Serialization.cs +++ /dev/null @@ -1,89 +0,0 @@ -// 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 ElasticSanVolumeTierInfo - { - internal static ElasticSanVolumeTierInfo DeserializeElasticSanVolumeTierInfo(JsonElement element) - { - Optional maxSizeGiB = default; - Optional minSizeGiB = default; - Optional minIncrementSizeGiB = default; - Optional iopsPerBaseGiB = default; - Optional maxIops = default; - Optional maxMbps = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("maxSizeGiB")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - maxSizeGiB = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("minSizeGiB")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - minSizeGiB = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("minIncrementSizeGiB")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - minIncrementSizeGiB = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("iopsPerBaseGiB")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - iopsPerBaseGiB = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("maxIops")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - maxIops = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("maxMBps")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - maxMbps = property.Value.GetInt64(); - continue; - } - } - return new ElasticSanVolumeTierInfo(Optional.ToNullable(maxSizeGiB), Optional.ToNullable(minSizeGiB), Optional.ToNullable(minIncrementSizeGiB), Optional.ToNullable(iopsPerBaseGiB), Optional.ToNullable(maxIops), Optional.ToNullable(maxMbps)); - } - } -} diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanVolumeTierInfo.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanVolumeTierInfo.cs deleted file mode 100644 index fd4f967c6f21d..0000000000000 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ElasticSanVolumeTierInfo.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.ElasticSan.Models -{ - /// Volume scalability target. - public partial class ElasticSanVolumeTierInfo - { - /// Initializes a new instance of ElasticSanVolumeTierInfo. - internal ElasticSanVolumeTierInfo() - { - } - - /// Initializes a new instance of ElasticSanVolumeTierInfo. - /// Maximum volume capacity in GiB. - /// Minimum volume capacity in GiB. - /// Increment volume capacity in GiB. - /// Maximum IOPS per GiB. - /// Maximum IOPS. - /// Maximum MBps. - internal ElasticSanVolumeTierInfo(long? maxSizeGiB, long? minSizeGiB, long? minIncrementSizeGiB, long? iopsPerBaseGiB, long? maxIops, long? maxMbps) - { - MaxSizeGiB = maxSizeGiB; - MinSizeGiB = minSizeGiB; - MinIncrementSizeGiB = minIncrementSizeGiB; - IopsPerBaseGiB = iopsPerBaseGiB; - MaxIops = maxIops; - MaxMbps = maxMbps; - } - - /// Maximum volume capacity in GiB. - public long? MaxSizeGiB { get; } - /// Minimum volume capacity in GiB. - public long? MinSizeGiB { get; } - /// Increment volume capacity in GiB. - public long? MinIncrementSizeGiB { get; } - /// Maximum IOPS per GiB. - public long? IopsPerBaseGiB { get; } - /// Maximum IOPS. - public long? MaxIops { get; } - /// Maximum MBps. - public long? MaxMbps { get; } - } -} diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ResourceTypeSku.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ResourceTypeSku.cs deleted file mode 100644 index 625015f4f4ac8..0000000000000 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/ResourceTypeSku.cs +++ /dev/null @@ -1,55 +0,0 @@ -// 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 -{ - /// SkuInformation object. - public partial class ResourceTypeSku - { - /// Initializes a new instance of ResourceTypeSku. - internal ResourceTypeSku() - { - Sku = new ChangeTrackingList(); - LocationInfo = new ChangeTrackingList(); - } - - /// Initializes a new instance of ResourceTypeSku. - /// The Sku tier. - /// Availability of the SKU for the location/zone. - /// Scalability targets for the San account for a given tier. - /// Volume Group targets for the San account for a given tier. - /// Volume targets for the San account for a given tier. - internal ResourceTypeSku(IReadOnlyList sku, IReadOnlyList locationInfo, SanTierInfo elasticSan, ElasticSanVolumeGroupTierInfo elasticSanVolumeGroup, ElasticSanVolumeTierInfo elasticSanVolume) - { - Sku = sku; - LocationInfo = locationInfo; - ElasticSan = elasticSan; - ElasticSanVolumeGroup = elasticSanVolumeGroup; - ElasticSanVolume = elasticSanVolume; - } - - /// The Sku tier. - public IReadOnlyList Sku { get; } - /// Availability of the SKU for the location/zone. - public IReadOnlyList LocationInfo { get; } - /// Scalability targets for the San account for a given tier. - public SanTierInfo ElasticSan { get; } - /// Volume Group targets for the San account for a given tier. - internal ElasticSanVolumeGroupTierInfo ElasticSanVolumeGroup { get; } - /// Maximum number of Volumes per Volume Groups per San account. - public long? MaxElasticSanVolumeCount - { - get => ElasticSanVolumeGroup?.MaxElasticSanVolumeCount; - } - - /// Volume targets for the San account for a given tier. - public ElasticSanVolumeTierInfo ElasticSanVolume { get; } - } -} diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/SKUCapability.Serialization.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/SKUCapability.Serialization.cs new file mode 100644 index 0000000000000..1f5c55a77c6b9 --- /dev/null +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/SKUCapability.Serialization.cs @@ -0,0 +1,35 @@ +// 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 SKUCapability + { + internal static SKUCapability DeserializeSKUCapability(JsonElement element) + { + Optional name = default; + Optional value = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name")) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("value")) + { + value = property.Value.GetString(); + continue; + } + } + return new SKUCapability(name.Value, value.Value); + } + } +} diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/SKUCapability.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/SKUCapability.cs new file mode 100644 index 0000000000000..6d5f441c60f31 --- /dev/null +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/SKUCapability.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.ElasticSan.Models +{ + /// The capability information in the specified SKU. + public partial class SKUCapability + { + /// Initializes a new instance of SKUCapability. + internal SKUCapability() + { + } + + /// Initializes a new instance of SKUCapability. + /// The name of capability. + /// A string value to indicate states of given capability. + internal SKUCapability(string name, string value) + { + Name = name; + Value = value; + } + + /// The name of capability. + public string Name { get; } + /// A string value to indicate states of given capability. + public string Value { get; } + } +} diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/SanTierInfo.Serialization.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/SanTierInfo.Serialization.cs deleted file mode 100644 index 516ab8fbac48f..0000000000000 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/SanTierInfo.Serialization.cs +++ /dev/null @@ -1,100 +0,0 @@ -// 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 SanTierInfo - { - internal static SanTierInfo DeserializeSanTierInfo(JsonElement element) - { - Optional maxSizeTiB = default; - Optional minSizeTiB = default; - Optional minIncrementSizeTiB = default; - Optional iopsPerBaseTiB = default; - Optional mbpsPerBaseTiB = default; - Optional maxMbps = default; - Optional maxElasticSanVolumeGroupCount = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("maxSizeTiB")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - maxSizeTiB = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("minSizeTiB")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - minSizeTiB = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("minIncrementSizeTiB")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - minIncrementSizeTiB = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("iopsPerBaseTiB")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - iopsPerBaseTiB = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("mbpsPerBaseTiB")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - mbpsPerBaseTiB = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("maxMBps")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - maxMbps = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("maxVolumeGroupCount")) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - maxElasticSanVolumeGroupCount = property.Value.GetInt64(); - continue; - } - } - return new SanTierInfo(Optional.ToNullable(maxSizeTiB), Optional.ToNullable(minSizeTiB), Optional.ToNullable(minIncrementSizeTiB), Optional.ToNullable(iopsPerBaseTiB), Optional.ToNullable(mbpsPerBaseTiB), Optional.ToNullable(maxMbps), Optional.ToNullable(maxElasticSanVolumeGroupCount)); - } - } -} diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/SanTierInfo.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/SanTierInfo.cs deleted file mode 100644 index 66b7dead691c9..0000000000000 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/SanTierInfo.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.ElasticSan.Models -{ - /// San scalability target. - public partial class SanTierInfo - { - /// Initializes a new instance of SanTierInfo. - internal SanTierInfo() - { - } - - /// Initializes a new instance of SanTierInfo. - /// Maximum San account capacity in TiB. - /// Minimum San account capacity in TiB. - /// Increment the San capacity in TiB. - /// Maximum IOPS per BaseTiB. - /// Maximum MBps per BaseTiB. - /// Maximum MBps. - /// Maximum number of volume groups per San account. - internal SanTierInfo(long? maxSizeTiB, long? minSizeTiB, long? minIncrementSizeTiB, long? iopsPerBaseTiB, long? mbpsPerBaseTiB, long? maxMbps, long? maxElasticSanVolumeGroupCount) - { - MaxSizeTiB = maxSizeTiB; - MinSizeTiB = minSizeTiB; - MinIncrementSizeTiB = minIncrementSizeTiB; - IopsPerBaseTiB = iopsPerBaseTiB; - MbpsPerBaseTiB = mbpsPerBaseTiB; - MaxMbps = maxMbps; - MaxElasticSanVolumeGroupCount = maxElasticSanVolumeGroupCount; - } - - /// Maximum San account capacity in TiB. - public long? MaxSizeTiB { get; } - /// Minimum San account capacity in TiB. - public long? MinSizeTiB { get; } - /// Increment the San capacity in TiB. - public long? MinIncrementSizeTiB { get; } - /// Maximum IOPS per BaseTiB. - public long? IopsPerBaseTiB { get; } - /// Maximum MBps per BaseTiB. - public long? MbpsPerBaseTiB { get; } - /// Maximum MBps. - public long? MaxMbps { get; } - /// Maximum number of volume groups per San account. - public long? MaxElasticSanVolumeGroupCount { get; } - } -} diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/SkuInformationList.Serialization.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/SkuInformationList.Serialization.cs index 856cf2a39cac5..e2d79c46be43d 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/SkuInformationList.Serialization.cs +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/SkuInformationList.Serialization.cs @@ -15,8 +15,7 @@ internal partial class SkuInformationList { internal static SkuInformationList DeserializeSkuInformationList(JsonElement element) { - Optional> value = default; - Optional nextLink = default; + Optional> value = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value")) @@ -26,21 +25,16 @@ internal static SkuInformationList DeserializeSkuInformationList(JsonElement ele property.ThrowNonNullablePropertyIsNull(); continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(ResourceTypeSku.DeserializeResourceTypeSku(item)); + array.Add(ElasticSanSkuInformation.DeserializeElasticSanSkuInformation(item)); } value = array; continue; } - if (property.NameEquals("nextLink")) - { - nextLink = property.Value.GetString(); - continue; - } } - return new SkuInformationList(Optional.ToList(value), nextLink.Value); + return new SkuInformationList(Optional.ToList(value)); } } } diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/SkuInformationList.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/SkuInformationList.cs index 0d91419f7ecae..4295de3e063d4 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/SkuInformationList.cs +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/SkuInformationList.cs @@ -16,21 +16,17 @@ internal partial class SkuInformationList /// Initializes a new instance of SkuInformationList. internal SkuInformationList() { - Value = new ChangeTrackingList(); + Value = new ChangeTrackingList(); } /// Initializes a new instance of SkuInformationList. /// List of ResourceType Sku. - /// Links to the next set of results. - internal SkuInformationList(IReadOnlyList value, string nextLink) + internal SkuInformationList(IReadOnlyList value) { Value = value; - NextLink = nextLink; } /// List of ResourceType Sku. - public IReadOnlyList Value { get; } - /// Links to the next set of results. - public string NextLink { get; } + public IReadOnlyList Value { get; } } } diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/SourceCreationData.Serialization.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/SourceCreationData.Serialization.cs index 228339a7acab7..3c6241a40f887 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/SourceCreationData.Serialization.cs +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/SourceCreationData.Serialization.cs @@ -16,8 +16,11 @@ public partial class SourceCreationData : IUtf8JsonSerializable void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); - writer.WritePropertyName("createSource"); - writer.WriteStringValue(CreateSource.ToString()); + if (Optional.IsDefined(CreateSource)) + { + writer.WritePropertyName("createSource"); + writer.WriteStringValue(CreateSource.Value.ToString()); + } if (Optional.IsDefined(SourceUri)) { writer.WritePropertyName("sourceUri"); @@ -28,12 +31,17 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) internal static SourceCreationData DeserializeSourceCreationData(JsonElement element) { - ElasticSanVolumeCreateOption createSource = default; + Optional createSource = default; Optional sourceUri = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("createSource")) { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } createSource = new ElasticSanVolumeCreateOption(property.Value.GetString()); continue; } @@ -48,7 +56,7 @@ internal static SourceCreationData DeserializeSourceCreationData(JsonElement ele continue; } } - return new SourceCreationData(createSource, sourceUri.Value); + return new SourceCreationData(Optional.ToNullable(createSource), sourceUri.Value); } } } diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/SourceCreationData.cs b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/SourceCreationData.cs index 34adbbed3b702..71646db1d3a38 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/SourceCreationData.cs +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/Models/SourceCreationData.cs @@ -15,20 +15,19 @@ public partial class SourceCreationData /// Initializes a new instance of SourceCreationData. public SourceCreationData() { - CreateSource = ElasticSanVolumeCreateOption.None; } /// Initializes a new instance of SourceCreationData. /// This enumerates the possible sources of a volume creation. /// If createOption is Copy, this is the ARM id of the source snapshot or disk. If createOption is Restore, this is the ARM-like id of the source disk restore point. - internal SourceCreationData(ElasticSanVolumeCreateOption createSource, Uri sourceUri) + internal SourceCreationData(ElasticSanVolumeCreateOption? createSource, Uri sourceUri) { CreateSource = createSource; SourceUri = sourceUri; } /// This enumerates the possible sources of a volume creation. - public ElasticSanVolumeCreateOption CreateSource { get; set; } + public ElasticSanVolumeCreateOption? CreateSource { get; set; } /// If createOption is Copy, this is the ARM id of the source snapshot or disk. If createOption is Restore, this is the ARM-like id of the source disk restore point. public Uri SourceUri { get; set; } } 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 95c8b604cd883..d59a0a24b1cf9 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/RestOperations/SkusRestOperations.cs +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/Generated/RestOperations/SkusRestOperations.cs @@ -37,13 +37,15 @@ public SkusRestOperations(HttpPipeline pipeline, string applicationId, Uri endpo _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal HttpMessage CreateListRequest(string filter) + internal HttpMessage CreateListRequest(string subscriptionId, string filter) { var message = _pipeline.CreateMessage(); var request = message.Request; request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); uri.AppendPath("/providers/Microsoft.ElasticSan/skus", false); uri.AppendQuery("api-version", _apiVersion, true); if (filter != null) @@ -57,11 +59,16 @@ internal HttpMessage CreateListRequest(string filter) } /// List all the available Skus in the region and information related to them. + /// The ID of the target subscription. /// Specify $filter='location eq <location>' to filter on location. /// The cancellation token to use. - public async Task> ListAsync(string filter = null, CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string filter = null, CancellationToken cancellationToken = default) { - using var message = CreateListRequest(filter); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListRequest(subscriptionId, filter); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -78,11 +85,16 @@ public async Task> ListAsync(string filter = null, } /// List all the available Skus in the region and information related to them. + /// The ID of the target subscription. /// Specify $filter='location eq <location>' to filter on location. /// The cancellation token to use. - public Response List(string filter = null, CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string filter = null, CancellationToken cancellationToken = default) { - using var message = CreateListRequest(filter); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListRequest(subscriptionId, filter); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { diff --git a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/autorest.md b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/autorest.md index b28bef3f4082c..3469eb0cb0b92 100644 --- a/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/autorest.md +++ b/sdk/elasticsan/Azure.ResourceManager.ElasticSan/src/autorest.md @@ -8,7 +8,7 @@ azure-arm: true csharp: true library-name: ElasticSan namespace: Azure.ResourceManager.ElasticSan -require: https://github.com/Azure/azure-rest-api-specs/blob/7f80a452b284a2cbc57c65ecc6e8224360d72657/specification/elasticsan/resource-manager/readme.md +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/elasticsan/resource-manager/readme.md tag: package-2021-11-20-preview output-folder: $(this-folder)/Generated clear-output-folder: true