From 6208232c84ec17fbb21d60a986ecdb919c29af8b Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 9 Sep 2021 15:36:44 +0000 Subject: [PATCH] CodeGen from PR 15850 in Azure/azure-rest-api-specs Merge 92d4fb03b8c76f4769cf89c488f6d9ac22248f4e into a2ff0f70f7f9de671145d948524d9bd806536cdf --- .../AzureNetAppFilesManagementClient.cs | 6 + .../IAzureNetAppFilesManagementClient.cs | 5 + .../INetAppResourceQuotaLimitsOperations.cs | 80 +++ .../Generated/Models/AzureEntityResource.cs | 62 +++ .../src/Generated/Models/CapacityPoolPatch.cs | 15 +- .../src/Generated/Models/LogSpecification.cs | 55 +++ .../Generated/Models/MetricSpecification.cs | 20 +- .../src/Generated/Models/NetworkFeatures.cs | 28 ++ .../src/Generated/Models/ProxyResource.cs | 53 ++ .../src/Generated/Models/ReplicationObject.cs | 10 +- .../src/Generated/Models/Resource.cs | 79 +++ .../Generated/Models/ServiceSpecification.cs | 8 +- .../Generated/Models/SubscriptionQuotaItem.cs | 86 ++++ .../src/Generated/Models/TrackedResource.cs | 87 ++++ .../src/Generated/Models/Volume.cs | 91 +++- .../src/Generated/Models/VolumePatch.cs | 30 +- .../Models/VolumeStorageToNetworkProximity.cs | 32 ++ .../NetAppResourceQuotaLimitsOperations.cs | 457 ++++++++++++++++++ ...ResourceQuotaLimitsOperationsExtensions.cs | 113 +++++ .../SdkInfo_NetAppManagementClient.cs | 12 +- 20 files changed, 1261 insertions(+), 68 deletions(-) create mode 100644 sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/INetAppResourceQuotaLimitsOperations.cs create mode 100644 sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/AzureEntityResource.cs create mode 100644 sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/LogSpecification.cs create mode 100644 sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/NetworkFeatures.cs create mode 100644 sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/ProxyResource.cs create mode 100644 sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/Resource.cs create mode 100644 sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/SubscriptionQuotaItem.cs create mode 100644 sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/TrackedResource.cs create mode 100644 sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/VolumeStorageToNetworkProximity.cs create mode 100644 sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/NetAppResourceQuotaLimitsOperations.cs create mode 100644 sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/NetAppResourceQuotaLimitsOperationsExtensions.cs diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/AzureNetAppFilesManagementClient.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/AzureNetAppFilesManagementClient.cs index 929f17078ce4..d04a890e0bea 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/AzureNetAppFilesManagementClient.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/AzureNetAppFilesManagementClient.cs @@ -86,6 +86,11 @@ public partial class AzureNetAppFilesManagementClient : ServiceClient public virtual INetAppResourceOperations NetAppResource { get; private set; } + /// + /// Gets the INetAppResourceQuotaLimitsOperations. + /// + public virtual INetAppResourceQuotaLimitsOperations NetAppResourceQuotaLimits { get; private set; } + /// /// Gets the IAccountsOperations. /// @@ -374,6 +379,7 @@ private void Initialize() { Operations = new Operations(this); NetAppResource = new NetAppResourceOperations(this); + NetAppResourceQuotaLimits = new NetAppResourceQuotaLimitsOperations(this); Accounts = new AccountsOperations(this); Pools = new PoolsOperations(this); Volumes = new VolumesOperations(this); diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IAzureNetAppFilesManagementClient.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IAzureNetAppFilesManagementClient.cs index d5dfac40cbe6..a712fdb0abbc 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IAzureNetAppFilesManagementClient.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IAzureNetAppFilesManagementClient.cs @@ -81,6 +81,11 @@ public partial interface IAzureNetAppFilesManagementClient : System.IDisposable /// INetAppResourceOperations NetAppResource { get; } + /// + /// Gets the INetAppResourceQuotaLimitsOperations. + /// + INetAppResourceQuotaLimitsOperations NetAppResourceQuotaLimits { get; } + /// /// Gets the IAccountsOperations. /// diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/INetAppResourceQuotaLimitsOperations.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/INetAppResourceQuotaLimitsOperations.cs new file mode 100644 index 000000000000..d22a85f07ad3 --- /dev/null +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/INetAppResourceQuotaLimitsOperations.cs @@ -0,0 +1,80 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.NetApp +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// NetAppResourceQuotaLimitsOperations operations. + /// + public partial interface INetAppResourceQuotaLimitsOperations + { + /// + /// Get quota limits + /// + /// + /// Get the default and current limits for quotas + /// + /// + /// The location + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get quota limits + /// + /// + /// Get the default and current subscription quota limit + /// + /// + /// The location + /// + /// + /// The name of the Quota Limit + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string location, string quotaLimitName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/AzureEntityResource.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/AzureEntityResource.cs new file mode 100644 index 000000000000..b58bedc7951b --- /dev/null +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/AzureEntityResource.cs @@ -0,0 +1,62 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.NetApp.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Entity Resource + /// + /// + /// The resource model definition for an Azure Resource Manager resource + /// with an etag. + /// + public partial class AzureEntityResource : Resource + { + /// + /// Initializes a new instance of the AzureEntityResource class. + /// + public AzureEntityResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureEntityResource class. + /// + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Resource Etag. + public AzureEntityResource(string id = default(string), string name = default(string), string type = default(string), string etag = default(string)) + : base(id, name, type) + { + Etag = etag; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets resource Etag. + /// + [JsonProperty(PropertyName = "etag")] + public string Etag { get; private set; } + + } +} diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/CapacityPoolPatch.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/CapacityPoolPatch.cs index b4113f746648..a1824484d4bf 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/CapacityPoolPatch.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/CapacityPoolPatch.cs @@ -116,16 +116,13 @@ public CapacityPoolPatch() /// public virtual void Validate() { - if (Size != null) + if (Size > 549755813888000) { - if (Size > 549755813888000) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Size", 549755813888000); - } - if (Size < 4398046511104) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Size", 4398046511104); - } + throw new ValidationException(ValidationRules.InclusiveMaximum, "Size", 549755813888000); + } + if (Size < 4398046511104) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "Size", 4398046511104); } } } diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/LogSpecification.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/LogSpecification.cs new file mode 100644 index 000000000000..3fbd0d051cf8 --- /dev/null +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/LogSpecification.cs @@ -0,0 +1,55 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.NetApp.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Log Definition of a single resource metric. + /// + public partial class LogSpecification + { + /// + /// Initializes a new instance of the LogSpecification class. + /// + public LogSpecification() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the LogSpecification class. + /// + public LogSpecification(string name = default(string), string displayName = default(string)) + { + Name = name; + DisplayName = displayName; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// + [JsonProperty(PropertyName = "displayName")] + public string DisplayName { get; set; } + + } +} diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/MetricSpecification.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/MetricSpecification.cs index 1f2361becbc5..2fef0116ee13 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/MetricSpecification.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/MetricSpecification.cs @@ -42,6 +42,8 @@ public MetricSpecification() /// The supported time grain /// types for the metrics. /// The internal metric name. + /// Whether or not the service + /// is using regional MDM accounts. /// The source MDM account. /// The source MDM namespace. /// Dimensions of blobs, including blob type @@ -54,7 +56,8 @@ public MetricSpecification() /// belong to, could be Capacity. /// Account Resource /// Id. - public MetricSpecification(string name = default(string), string displayName = default(string), string displayDescription = default(string), string unit = default(string), IList supportedAggregationTypes = default(IList), IList supportedTimeGrainTypes = default(IList), string internalMetricName = default(string), string sourceMdmAccount = default(string), string sourceMdmNamespace = default(string), IList dimensions = default(IList), string aggregationType = default(string), bool? fillGapWithZero = default(bool?), string category = default(string), string resourceIdDimensionNameOverride = default(string)) + /// Whether the metric is internal. + public MetricSpecification(string name = default(string), string displayName = default(string), string displayDescription = default(string), string unit = default(string), IList supportedAggregationTypes = default(IList), IList supportedTimeGrainTypes = default(IList), string internalMetricName = default(string), bool? enableRegionalMdmAccount = default(bool?), string sourceMdmAccount = default(string), string sourceMdmNamespace = default(string), IList dimensions = default(IList), string aggregationType = default(string), bool? fillGapWithZero = default(bool?), string category = default(string), string resourceIdDimensionNameOverride = default(string), bool? isInternal = default(bool?)) { Name = name; DisplayName = displayName; @@ -63,6 +66,7 @@ public MetricSpecification() SupportedAggregationTypes = supportedAggregationTypes; SupportedTimeGrainTypes = supportedTimeGrainTypes; InternalMetricName = internalMetricName; + EnableRegionalMdmAccount = enableRegionalMdmAccount; SourceMdmAccount = sourceMdmAccount; SourceMdmNamespace = sourceMdmNamespace; Dimensions = dimensions; @@ -70,6 +74,7 @@ public MetricSpecification() FillGapWithZero = fillGapWithZero; Category = category; ResourceIdDimensionNameOverride = resourceIdDimensionNameOverride; + IsInternal = isInternal; CustomInit(); } @@ -120,6 +125,13 @@ public MetricSpecification() [JsonProperty(PropertyName = "internalMetricName")] public string InternalMetricName { get; set; } + /// + /// Gets or sets whether or not the service is using regional MDM + /// accounts. + /// + [JsonProperty(PropertyName = "enableRegionalMdmAccount")] + public bool? EnableRegionalMdmAccount { get; set; } + /// /// Gets or sets the source MDM account. /// @@ -164,5 +176,11 @@ public MetricSpecification() [JsonProperty(PropertyName = "resourceIdDimensionNameOverride")] public string ResourceIdDimensionNameOverride { get; set; } + /// + /// Gets or sets whether the metric is internal. + /// + [JsonProperty(PropertyName = "isInternal")] + public bool? IsInternal { get; set; } + } } diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/NetworkFeatures.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/NetworkFeatures.cs new file mode 100644 index 000000000000..b48f1ecee077 --- /dev/null +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/NetworkFeatures.cs @@ -0,0 +1,28 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.NetApp.Models +{ + + /// + /// Defines values for NetworkFeatures. + /// + public static class NetworkFeatures + { + /// + /// Basic network feature. + /// + public const string Basic = "Basic"; + /// + /// Standard network feature. + /// + public const string Standard = "Standard"; + } +} diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/ProxyResource.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/ProxyResource.cs new file mode 100644 index 000000000000..478ee21867b8 --- /dev/null +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/ProxyResource.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.NetApp.Models +{ + using System.Linq; + + /// + /// Proxy Resource + /// + /// + /// The resource model definition for a Azure Resource Manager proxy + /// resource. It will not have tags and a location + /// + public partial class ProxyResource : Resource + { + /// + /// Initializes a new instance of the ProxyResource class. + /// + public ProxyResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ProxyResource class. + /// + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + public ProxyResource(string id = default(string), string name = default(string), string type = default(string)) + : base(id, name, type) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/ReplicationObject.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/ReplicationObject.cs index ccd31a9f94fc..24119a785e89 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/ReplicationObject.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/ReplicationObject.cs @@ -30,17 +30,17 @@ public ReplicationObject() /// /// Initializes a new instance of the ReplicationObject class. /// - /// Schedule. Possible values - /// include: '_10minutely', 'hourly', 'daily' /// The resource ID of the remote /// volume. /// Id /// Indicates whether the local volume is /// the source or destination for the Volume Replication. Possible /// values include: 'src', 'dst' + /// Schedule. Possible values + /// include: '_10minutely', 'hourly', 'daily' /// The remote region for the other /// end of the Volume Replication. - public ReplicationObject(string replicationSchedule, string remoteVolumeResourceId, string replicationId = default(string), string endpointType = default(string), string remoteVolumeRegion = default(string)) + public ReplicationObject(string remoteVolumeResourceId, string replicationId = default(string), string endpointType = default(string), string replicationSchedule = default(string), string remoteVolumeRegion = default(string)) { ReplicationId = replicationId; EndpointType = endpointType; @@ -97,10 +97,6 @@ public ReplicationObject() /// public virtual void Validate() { - if (ReplicationSchedule == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "ReplicationSchedule"); - } if (RemoteVolumeResourceId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "RemoteVolumeResourceId"); diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/Resource.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/Resource.cs new file mode 100644 index 000000000000..1be9bf578ed8 --- /dev/null +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/Resource.cs @@ -0,0 +1,79 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.NetApp.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Resource + /// + /// + /// Common fields that are returned in the response for all Azure Resource + /// Manager resources + /// + public partial class Resource : IResource + { + /// + /// Initializes a new instance of the Resource class. + /// + public Resource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Resource class. + /// + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + public Resource(string id = default(string), string name = default(string), string type = default(string)) + { + Id = id; + Name = name; + Type = type; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets the name of the resource + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets the type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + } +} diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/ServiceSpecification.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/ServiceSpecification.cs index a2635ec2e841..a6ae379bd969 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/ServiceSpecification.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/ServiceSpecification.cs @@ -33,9 +33,10 @@ public ServiceSpecification() /// /// Metric specifications of /// operation. - public ServiceSpecification(IList metricSpecifications = default(IList)) + public ServiceSpecification(IList metricSpecifications = default(IList), IList logSpecifications = default(IList)) { MetricSpecifications = metricSpecifications; + LogSpecifications = logSpecifications; CustomInit(); } @@ -50,5 +51,10 @@ public ServiceSpecification() [JsonProperty(PropertyName = "metricSpecifications")] public IList MetricSpecifications { get; set; } + /// + /// + [JsonProperty(PropertyName = "logSpecifications")] + public IList LogSpecifications { get; set; } + } } diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/SubscriptionQuotaItem.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/SubscriptionQuotaItem.cs new file mode 100644 index 000000000000..c31006ec1c61 --- /dev/null +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/SubscriptionQuotaItem.cs @@ -0,0 +1,86 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.NetApp.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Information regarding Subscription Quota Item. + /// + [Rest.Serialization.JsonTransformation] + public partial class SubscriptionQuotaItem : ProxyResource + { + /// + /// Initializes a new instance of the SubscriptionQuotaItem class. + /// + public SubscriptionQuotaItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SubscriptionQuotaItem class. + /// + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Quota Item name + /// The current quota value. + /// The default quota value. + /// The system meta data relating to this + /// resource. + public SubscriptionQuotaItem(string id = default(string), string name = default(string), string type = default(string), string subscriptionQuotaItemName = default(string), int? current = default(int?), int? defaultProperty = default(int?), SystemData systemData = default(SystemData)) + : base(id, name, type) + { + SubscriptionQuotaItemName = subscriptionQuotaItemName; + Current = current; + DefaultProperty = defaultProperty; + SystemData = systemData; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets quota Item name + /// + [JsonProperty(PropertyName = "properties.name")] + public string SubscriptionQuotaItemName { get; private set; } + + /// + /// Gets the current quota value. + /// + [JsonProperty(PropertyName = "properties.current")] + public int? Current { get; private set; } + + /// + /// Gets the default quota value. + /// + [JsonProperty(PropertyName = "properties.default")] + public int? DefaultProperty { get; private set; } + + /// + /// Gets the system meta data relating to this resource. + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + + } +} diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/TrackedResource.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/TrackedResource.cs new file mode 100644 index 000000000000..635439329179 --- /dev/null +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/TrackedResource.cs @@ -0,0 +1,87 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.NetApp.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Tracked Resource + /// + /// + /// The resource model definition for an Azure Resource Manager tracked top + /// level resource which has 'tags' and a 'location' + /// + public partial class TrackedResource : Resource + { + /// + /// Initializes a new instance of the TrackedResource class. + /// + public TrackedResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the TrackedResource class. + /// + /// The geo-location where the resource + /// lives + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Resource tags. + public TrackedResource(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary)) + : base(id, name, type) + { + Tags = tags; + Location = location; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets resource tags. + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + /// + /// Gets or sets the geo-location where the resource lives + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Location"); + } + } + } +} diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/Volume.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/Volume.cs index 47242ca3a367..8a8bc65250b8 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/Volume.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/Volume.cs @@ -54,8 +54,14 @@ public Volume() /// Snapshot ID /// Backup ID /// Baremetal Tenant ID + /// Network features + /// Network Sibling Set ID + /// Storage to Network + /// Proximity /// mountTargets - /// What type of volume is this + /// What type of volume is this. For + /// destination volumes in Cross Region Replication, set type to + /// DataProtection /// DataProtection /// Restoring /// If enabled (true) the volume @@ -105,7 +111,7 @@ public Volume() /// Default group quota for /// volume in KiBs. If isDefaultQuotaEnabled is set, the minimum value /// of 4 KiBs applies. - public Volume(string location, string creationToken, long usageThreshold, string subnetId, string id = default(string), string name = default(string), string etag = default(string), string type = default(string), IDictionary tags = default(IDictionary), string fileSystemId = default(string), string serviceLevel = default(string), VolumePropertiesExportPolicy exportPolicy = default(VolumePropertiesExportPolicy), IList protocolTypes = default(IList), string provisioningState = default(string), string snapshotId = default(string), string backupId = default(string), string baremetalTenantId = default(string), IList mountTargets = default(IList), string volumeType = default(string), VolumePropertiesDataProtection dataProtection = default(VolumePropertiesDataProtection), bool? isRestoring = default(bool?), bool? snapshotDirectoryVisible = default(bool?), bool? kerberosEnabled = default(bool?), string securityStyle = default(string), bool? smbEncryption = default(bool?), bool? smbContinuouslyAvailable = default(bool?), double? throughputMibps = default(double?), string encryptionKeySource = default(string), bool? ldapEnabled = default(bool?), bool? coolAccess = default(bool?), int? coolnessPeriod = default(int?), string unixPermissions = default(string), int? cloneProgress = default(int?), string avsDataStore = default(string), bool? isDefaultQuotaEnabled = default(bool?), long? defaultUserQuotaInKiBs = default(long?), long? defaultGroupQuotaInKiBs = default(long?)) + public Volume(string location, string creationToken, long usageThreshold, string subnetId, string id = default(string), string name = default(string), string etag = default(string), string type = default(string), IDictionary tags = default(IDictionary), string fileSystemId = default(string), string serviceLevel = default(string), VolumePropertiesExportPolicy exportPolicy = default(VolumePropertiesExportPolicy), IList protocolTypes = default(IList), string provisioningState = default(string), string snapshotId = default(string), string backupId = default(string), string baremetalTenantId = default(string), string networkFeatures = default(string), string networkSiblingSetId = default(string), string storageToNetworkProximity = default(string), IList mountTargets = default(IList), string volumeType = default(string), VolumePropertiesDataProtection dataProtection = default(VolumePropertiesDataProtection), bool? isRestoring = default(bool?), bool? snapshotDirectoryVisible = default(bool?), bool? kerberosEnabled = default(bool?), string securityStyle = default(string), bool? smbEncryption = default(bool?), bool? smbContinuouslyAvailable = default(bool?), double? throughputMibps = default(double?), string encryptionKeySource = default(string), bool? ldapEnabled = default(bool?), bool? coolAccess = default(bool?), int? coolnessPeriod = default(int?), string unixPermissions = default(string), int? cloneProgress = default(int?), string avsDataStore = default(string), bool? isDefaultQuotaEnabled = default(bool?), long? defaultUserQuotaInKiBs = default(long?), long? defaultGroupQuotaInKiBs = default(long?)) { Location = location; Id = id; @@ -124,6 +130,9 @@ public Volume() BackupId = backupId; BaremetalTenantId = baremetalTenantId; SubnetId = subnetId; + NetworkFeatures = networkFeatures; + NetworkSiblingSetId = networkSiblingSetId; + StorageToNetworkProximity = storageToNetworkProximity; MountTargets = mountTargets; VolumeType = volumeType; DataProtection = dataProtection; @@ -286,6 +295,36 @@ public Volume() [JsonProperty(PropertyName = "properties.subnetId")] public string SubnetId { get; set; } + /// + /// Gets or sets network features + /// + /// + /// Basic network, or Standard features available to the volume. + /// Possible values include: 'Basic', 'Standard' + /// + [JsonProperty(PropertyName = "properties.networkFeatures")] + public string NetworkFeatures { get; set; } + + /// + /// Gets network Sibling Set ID + /// + /// + /// Network Sibling Set ID for the the group of volumes sharing + /// networking resources. + /// + [JsonProperty(PropertyName = "properties.networkSiblingSetId")] + public string NetworkSiblingSetId { get; private set; } + + /// + /// Gets storage to Network Proximity + /// + /// + /// Provides storage to network proximity information for the volume. + /// Possible values include: 'Default', 'T1', 'T2' + /// + [JsonProperty(PropertyName = "properties.storageToNetworkProximity")] + public string StorageToNetworkProximity { get; private set; } + /// /// Gets mountTargets /// @@ -296,7 +335,8 @@ public Volume() public IList MountTargets { get; private set; } /// - /// Gets or sets what type of volume is this + /// Gets or sets what type of volume is this. For destination volumes + /// in Cross Region Replication, set type to DataProtection /// [JsonProperty(PropertyName = "properties.volumeType")] public string VolumeType { get; set; } @@ -531,6 +571,21 @@ public virtual void Validate() throw new ValidationException(ValidationRules.Pattern, "BackupId", "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}|(\\\\?([^\\/]*[\\/])*)([^\\/]+)$"); } } + if (NetworkSiblingSetId != null) + { + if (NetworkSiblingSetId.Length > 36) + { + throw new ValidationException(ValidationRules.MaxLength, "NetworkSiblingSetId", 36); + } + if (NetworkSiblingSetId.Length < 36) + { + throw new ValidationException(ValidationRules.MinLength, "NetworkSiblingSetId", 36); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(NetworkSiblingSetId, "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$")) + { + throw new ValidationException(ValidationRules.Pattern, "NetworkSiblingSetId", "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"); + } + } if (MountTargets != null) { foreach (var element in MountTargets) @@ -545,27 +600,21 @@ public virtual void Validate() { DataProtection.Validate(); } - if (ThroughputMibps != null) + if (ThroughputMibps > 4500) { - if (ThroughputMibps > 4500) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "ThroughputMibps", 4500); - } - if (ThroughputMibps < 0) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "ThroughputMibps", 0); - } + throw new ValidationException(ValidationRules.InclusiveMaximum, "ThroughputMibps", 4500); } - if (CoolnessPeriod != null) + if (ThroughputMibps < 0) { - if (CoolnessPeriod > 63) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "CoolnessPeriod", 63); - } - if (CoolnessPeriod < 7) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "CoolnessPeriod", 7); - } + throw new ValidationException(ValidationRules.InclusiveMinimum, "ThroughputMibps", 0); + } + if (CoolnessPeriod > 63) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "CoolnessPeriod", 63); + } + if (CoolnessPeriod < 7) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "CoolnessPeriod", 7); } if (UnixPermissions != null) { diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/VolumePatch.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/VolumePatch.cs index 6261d0dcdaa9..f097ba32c7df 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/VolumePatch.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/VolumePatch.cs @@ -182,27 +182,21 @@ public VolumePatch() /// public virtual void Validate() { - if (UsageThreshold != null) + if (UsageThreshold > 109951162777600) { - if (UsageThreshold > 109951162777600) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "UsageThreshold", 109951162777600); - } - if (UsageThreshold < 107374182400) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "UsageThreshold", 107374182400); - } + throw new ValidationException(ValidationRules.InclusiveMaximum, "UsageThreshold", 109951162777600); } - if (ThroughputMibps != null) + if (UsageThreshold < 107374182400) { - if (ThroughputMibps > 4500) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "ThroughputMibps", 4500); - } - if (ThroughputMibps < 1) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "ThroughputMibps", 1); - } + throw new ValidationException(ValidationRules.InclusiveMinimum, "UsageThreshold", 107374182400); + } + if (ThroughputMibps > 4500) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "ThroughputMibps", 4500); + } + if (ThroughputMibps < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "ThroughputMibps", 1); } } } diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/VolumeStorageToNetworkProximity.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/VolumeStorageToNetworkProximity.cs new file mode 100644 index 000000000000..e326e41c1d8f --- /dev/null +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/VolumeStorageToNetworkProximity.cs @@ -0,0 +1,32 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.NetApp.Models +{ + + /// + /// Defines values for VolumeStorageToNetworkProximity. + /// + public static class VolumeStorageToNetworkProximity + { + /// + /// Basic storage to network connectivity. + /// + public const string Default = "Default"; + /// + /// Standard T1 storage to network connectivity. + /// + public const string T1 = "T1"; + /// + /// Standard T2 storage to network connectivity. + /// + public const string T2 = "T2"; + } +} diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/NetAppResourceQuotaLimitsOperations.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/NetAppResourceQuotaLimitsOperations.cs new file mode 100644 index 000000000000..399310164540 --- /dev/null +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/NetAppResourceQuotaLimitsOperations.cs @@ -0,0 +1,457 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.NetApp +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// NetAppResourceQuotaLimitsOperations operations. + /// + internal partial class NetAppResourceQuotaLimitsOperations : IServiceOperations, INetAppResourceQuotaLimitsOperations + { + /// + /// Initializes a new instance of the NetAppResourceQuotaLimitsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal NetAppResourceQuotaLimitsOperations(AzureNetAppFilesManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the AzureNetAppFilesManagementClient + /// + public AzureNetAppFilesManagementClient Client { get; private set; } + + /// + /// Get quota limits + /// + /// + /// Get the default and current limits for quotas + /// + /// + /// The location + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "location"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("location", location); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/quotaLimits").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Get quota limits + /// + /// + /// Get the default and current subscription quota limit + /// + /// + /// The location + /// + /// + /// The name of the Quota Limit + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string location, string quotaLimitName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "location"); + } + if (quotaLimitName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "quotaLimitName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("location", location); + tracingParameters.Add("quotaLimitName", quotaLimitName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/quotaLimits/{quotaLimitName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + _url = _url.Replace("{quotaLimitName}", System.Uri.EscapeDataString(quotaLimitName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/NetAppResourceQuotaLimitsOperationsExtensions.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/NetAppResourceQuotaLimitsOperationsExtensions.cs new file mode 100644 index 000000000000..ebd5e4d31030 --- /dev/null +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/NetAppResourceQuotaLimitsOperationsExtensions.cs @@ -0,0 +1,113 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.NetApp +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for NetAppResourceQuotaLimitsOperations. + /// + public static partial class NetAppResourceQuotaLimitsOperationsExtensions + { + /// + /// Get quota limits + /// + /// + /// Get the default and current limits for quotas + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location + /// + public static IEnumerable List(this INetAppResourceQuotaLimitsOperations operations, string location) + { + return operations.ListAsync(location).GetAwaiter().GetResult(); + } + + /// + /// Get quota limits + /// + /// + /// Get the default and current limits for quotas + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this INetAppResourceQuotaLimitsOperations operations, string location, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(location, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get quota limits + /// + /// + /// Get the default and current subscription quota limit + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location + /// + /// + /// The name of the Quota Limit + /// + public static SubscriptionQuotaItem Get(this INetAppResourceQuotaLimitsOperations operations, string location, string quotaLimitName) + { + return operations.GetAsync(location, quotaLimitName).GetAwaiter().GetResult(); + } + + /// + /// Get quota limits + /// + /// + /// Get the default and current subscription quota limit + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location + /// + /// + /// The name of the Quota Limit + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this INetAppResourceQuotaLimitsOperations operations, string location, string quotaLimitName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(location, quotaLimitName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/SdkInfo_NetAppManagementClient.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/SdkInfo_NetAppManagementClient.cs index 6d3ded55c2f5..682a44348b61 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/SdkInfo_NetAppManagementClient.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/SdkInfo_NetAppManagementClient.cs @@ -24,6 +24,7 @@ public static IEnumerable> ApiInfo_NetAppManagemen new Tuple("NetApp", "BackupPolicies", "2021-06-01"), new Tuple("NetApp", "Backups", "2021-06-01"), new Tuple("NetApp", "NetAppResource", "2021-06-01"), + new Tuple("NetApp", "NetAppResourceQuotaLimits", "2021-06-01"), new Tuple("NetApp", "Operations", "2021-06-01"), new Tuple("NetApp", "Pools", "2021-06-01"), new Tuple("NetApp", "SnapshotPolicies", "2021-06-01"), @@ -33,16 +34,5 @@ public static IEnumerable> ApiInfo_NetAppManagemen }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "v2"; - public static readonly String AutoRestBootStrapperVersion = "autorest@1.9.1"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/main/specification/netapp/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --use:@microsoft.azure/autorest.csharp@2.3.90 --csharp-sdks-folder=C:\\Users\\audunn\\Source\\repos\\azure\\azure-sdk-for-net\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "main"; - public static readonly String GithubCommidId = "1a5e9c6601a9611ac23c58bc9857693dcd9884f3"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } -