From 2fc3d6e9bae0e4ee57eb86d40f27177be807f113 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 6 Dec 2022 23:13:51 +0000 Subject: [PATCH] CodeGen from PR 21433 in Azure/azure-rest-api-specs Merge fd1cb7239a9fb90502802deb132f2e2f811f0f95 into dcec109c164e69f0f122ff74fc551108da8af20e --- ....ResourceManager.Advisor.netstandard2.0.cs | 20 ------- ...rceRecommendationBaseData.Serialization.cs | 18 +------ .../src/Generated/Models/Risk.cs | 54 ------------------- .../src/Generated/Models/ShortDescription.cs | 8 +-- .../ResourceRecommendationBaseData.cs | 6 +-- .../src/autorest.md | 4 +- 6 files changed, 8 insertions(+), 102 deletions(-) delete mode 100644 sdk/advisor/Azure.ResourceManager.Advisor/src/Generated/Models/Risk.cs diff --git a/sdk/advisor/Azure.ResourceManager.Advisor/api/Azure.ResourceManager.Advisor.netstandard2.0.cs b/sdk/advisor/Azure.ResourceManager.Advisor/api/Azure.ResourceManager.Advisor.netstandard2.0.cs index 47b6aea1377f..5ab7bc4c6202 100644 --- a/sdk/advisor/Azure.ResourceManager.Advisor/api/Azure.ResourceManager.Advisor.netstandard2.0.cs +++ b/sdk/advisor/Azure.ResourceManager.Advisor/api/Azure.ResourceManager.Advisor.netstandard2.0.cs @@ -89,7 +89,6 @@ public ResourceRecommendationBaseData() { } public string RecommendationTypeId { get { throw null; } set { } } public System.Collections.Generic.IDictionary Remediation { get { throw null; } } public Azure.ResourceManager.Advisor.Models.ResourceMetadata ResourceMetadata { get { throw null; } set { } } - public Azure.ResourceManager.Advisor.Models.Risk? Risk { get { throw null; } set { } } public Azure.ResourceManager.Advisor.Models.ShortDescription ShortDescription { get { throw null; } set { } } public System.Collections.Generic.IList SuppressionIds { get { throw null; } } } @@ -268,25 +267,6 @@ public ResourceMetadata() { } public string Source { get { throw null; } set { } } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct Risk : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public Risk(string value) { throw null; } - public static Azure.ResourceManager.Advisor.Models.Risk Error { get { throw null; } } - public static Azure.ResourceManager.Advisor.Models.Risk None { get { throw null; } } - public static Azure.ResourceManager.Advisor.Models.Risk Warning { get { throw null; } } - public bool Equals(Azure.ResourceManager.Advisor.Models.Risk 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.Advisor.Models.Risk left, Azure.ResourceManager.Advisor.Models.Risk right) { throw null; } - public static implicit operator Azure.ResourceManager.Advisor.Models.Risk (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.Advisor.Models.Risk left, Azure.ResourceManager.Advisor.Models.Risk right) { throw null; } - public override string ToString() { throw null; } - } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct Scenario : System.IEquatable { private readonly object _dummy; diff --git a/sdk/advisor/Azure.ResourceManager.Advisor/src/Generated/Models/ResourceRecommendationBaseData.Serialization.cs b/sdk/advisor/Azure.ResourceManager.Advisor/src/Generated/Models/ResourceRecommendationBaseData.Serialization.cs index 326c259b398f..ef4167a3e6b0 100644 --- a/sdk/advisor/Azure.ResourceManager.Advisor/src/Generated/Models/ResourceRecommendationBaseData.Serialization.cs +++ b/sdk/advisor/Azure.ResourceManager.Advisor/src/Generated/Models/ResourceRecommendationBaseData.Serialization.cs @@ -66,11 +66,6 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("recommendationTypeId"); writer.WriteStringValue(RecommendationTypeId); } - if (Optional.IsDefined(Risk)) - { - writer.WritePropertyName("risk"); - writer.WriteStringValue(Risk.Value.ToString()); - } if (Optional.IsDefined(ShortDescription)) { writer.WritePropertyName("shortDescription"); @@ -189,7 +184,6 @@ internal static ResourceRecommendationBaseData DeserializeResourceRecommendation Optional lastUpdated = default; Optional> metadata = default; Optional recommendationTypeId = default; - Optional risk = default; Optional shortDescription = default; Optional> suppressionIds = default; Optional> extendedProperties = default; @@ -297,16 +291,6 @@ internal static ResourceRecommendationBaseData DeserializeResourceRecommendation recommendationTypeId = property0.Value.GetString(); continue; } - if (property0.NameEquals("risk")) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - risk = new Risk(property0.Value.GetString()); - continue; - } if (property0.NameEquals("shortDescription")) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -431,7 +415,7 @@ internal static ResourceRecommendationBaseData DeserializeResourceRecommendation continue; } } - return new ResourceRecommendationBaseData(id, name, type, systemData.Value, Optional.ToNullable(category), Optional.ToNullable(impact), impactedField.Value, impactedValue.Value, Optional.ToNullable(lastUpdated), Optional.ToDictionary(metadata), recommendationTypeId.Value, Optional.ToNullable(risk), shortDescription.Value, Optional.ToList(suppressionIds), Optional.ToDictionary(extendedProperties), resourceMetadata.Value, description.Value, label.Value, learnMoreLink.Value, potentialBenefits.Value, Optional.ToList(actions), Optional.ToDictionary(remediation), Optional.ToDictionary(exposedMetadataProperties)); + return new ResourceRecommendationBaseData(id, name, type, systemData.Value, Optional.ToNullable(category), Optional.ToNullable(impact), impactedField.Value, impactedValue.Value, Optional.ToNullable(lastUpdated), Optional.ToDictionary(metadata), recommendationTypeId.Value, shortDescription.Value, Optional.ToList(suppressionIds), Optional.ToDictionary(extendedProperties), resourceMetadata.Value, description.Value, label.Value, learnMoreLink.Value, potentialBenefits.Value, Optional.ToList(actions), Optional.ToDictionary(remediation), Optional.ToDictionary(exposedMetadataProperties)); } } } diff --git a/sdk/advisor/Azure.ResourceManager.Advisor/src/Generated/Models/Risk.cs b/sdk/advisor/Azure.ResourceManager.Advisor/src/Generated/Models/Risk.cs deleted file mode 100644 index a560bba72c27..000000000000 --- a/sdk/advisor/Azure.ResourceManager.Advisor/src/Generated/Models/Risk.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.Advisor.Models -{ - /// The potential risk of not implementing the recommendation. - public readonly partial struct Risk : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public Risk(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string ErrorValue = "Error"; - private const string WarningValue = "Warning"; - private const string NoneValue = "None"; - - /// Error. - public static Risk Error { get; } = new Risk(ErrorValue); - /// Warning. - public static Risk Warning { get; } = new Risk(WarningValue); - /// None. - public static Risk None { get; } = new Risk(NoneValue); - /// Determines if two values are the same. - public static bool operator ==(Risk left, Risk right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(Risk left, Risk right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator Risk(string value) => new Risk(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is Risk other && Equals(other); - /// - public bool Equals(Risk other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/advisor/Azure.ResourceManager.Advisor/src/Generated/Models/ShortDescription.cs b/sdk/advisor/Azure.ResourceManager.Advisor/src/Generated/Models/ShortDescription.cs index 10fbf39af33d..00da962b88da 100644 --- a/sdk/advisor/Azure.ResourceManager.Advisor/src/Generated/Models/ShortDescription.cs +++ b/sdk/advisor/Azure.ResourceManager.Advisor/src/Generated/Models/ShortDescription.cs @@ -16,17 +16,17 @@ public ShortDescription() } /// Initializes a new instance of ShortDescription. - /// The issue or opportunity identified by the recommendation. - /// The remediation action suggested by the recommendation. + /// The issue or opportunity identified by the recommendation and proposed solution. + /// The issue or opportunity identified by the recommendation and proposed solution. internal ShortDescription(string problem, string solution) { Problem = problem; Solution = solution; } - /// The issue or opportunity identified by the recommendation. + /// The issue or opportunity identified by the recommendation and proposed solution. public string Problem { get; set; } - /// The remediation action suggested by the recommendation. + /// The issue or opportunity identified by the recommendation and proposed solution. public string Solution { get; set; } } } diff --git a/sdk/advisor/Azure.ResourceManager.Advisor/src/Generated/ResourceRecommendationBaseData.cs b/sdk/advisor/Azure.ResourceManager.Advisor/src/Generated/ResourceRecommendationBaseData.cs index 841216d63545..02943cd3b9e7 100644 --- a/sdk/advisor/Azure.ResourceManager.Advisor/src/Generated/ResourceRecommendationBaseData.cs +++ b/sdk/advisor/Azure.ResourceManager.Advisor/src/Generated/ResourceRecommendationBaseData.cs @@ -39,7 +39,6 @@ public ResourceRecommendationBaseData() /// The most recent time that Advisor checked the validity of the recommendation. /// The recommendation metadata. /// The recommendation-type GUID. - /// The potential risk of not implementing the recommendation. /// A summary of the recommendation. /// The list of snoozed and dismissed rules for the recommendation. /// Extended properties. @@ -51,7 +50,7 @@ public ResourceRecommendationBaseData() /// The list of recommended actions to implement recommendation. /// The automated way to apply recommendation. /// The recommendation metadata properties exposed to customer to provide additional information. - internal ResourceRecommendationBaseData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, Category? category, Impact? impact, string impactedField, string impactedValue, DateTimeOffset? lastUpdated, IDictionary metadata, string recommendationTypeId, Risk? risk, ShortDescription shortDescription, IList suppressionIds, IDictionary extendedProperties, ResourceMetadata resourceMetadata, string description, string label, string learnMoreLink, string potentialBenefits, IList> actions, IDictionary remediation, IDictionary exposedMetadataProperties) : base(id, name, resourceType, systemData) + internal ResourceRecommendationBaseData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, Category? category, Impact? impact, string impactedField, string impactedValue, DateTimeOffset? lastUpdated, IDictionary metadata, string recommendationTypeId, ShortDescription shortDescription, IList suppressionIds, IDictionary extendedProperties, ResourceMetadata resourceMetadata, string description, string label, string learnMoreLink, string potentialBenefits, IList> actions, IDictionary remediation, IDictionary exposedMetadataProperties) : base(id, name, resourceType, systemData) { Category = category; Impact = impact; @@ -60,7 +59,6 @@ internal ResourceRecommendationBaseData(ResourceIdentifier id, string name, Reso LastUpdated = lastUpdated; Metadata = metadata; RecommendationTypeId = recommendationTypeId; - Risk = risk; ShortDescription = shortDescription; SuppressionIds = suppressionIds; ExtendedProperties = extendedProperties; @@ -117,8 +115,6 @@ internal ResourceRecommendationBaseData(ResourceIdentifier id, string name, Reso public IDictionary Metadata { get; } /// The recommendation-type GUID. public string RecommendationTypeId { get; set; } - /// The potential risk of not implementing the recommendation. - public Risk? Risk { get; set; } /// A summary of the recommendation. public ShortDescription ShortDescription { get; set; } /// The list of snoozed and dismissed rules for the recommendation. diff --git a/sdk/advisor/Azure.ResourceManager.Advisor/src/autorest.md b/sdk/advisor/Azure.ResourceManager.Advisor/src/autorest.md index 7cae835c1622..a6b75d25ebd7 100644 --- a/sdk/advisor/Azure.ResourceManager.Advisor/src/autorest.md +++ b/sdk/advisor/Azure.ResourceManager.Advisor/src/autorest.md @@ -8,7 +8,7 @@ azure-arm: true csharp: true library-name: Advisor namespace: Azure.ResourceManager.Advisor -require: https://github.com/Azure/azure-rest-api-specs/blob/db6d33733cd1eb939b863a6cdbcb9de12ac002e1/specification/advisor/resource-manager/readme.md +require: https://github.com/Azure/azure-rest-api-specs/blob/a649865f9b9943d400db80dc3020ba7d037e95ed/specification/advisor/resource-manager/readme.md output-folder: $(this-folder)/Generated clear-output-folder: true skip-csproj: true @@ -62,4 +62,4 @@ directive: transform: > $['x-ms-skip-url-encoding'] = true; -``` \ No newline at end of file +```