From f32af5a77f85c75a676dd17ffd50e9f5bb503935 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 28 Oct 2022 10:17:40 +0000 Subject: [PATCH] CodeGen from PR 21241 in Azure/azure-rest-api-specs Migrate to net track2 for some resource-manager readmes batch 3 (#21241) * migrate to track 2 * revert configs for machinelearning and managementgroups * resolve Go SDK automation failure Co-authored-by: Chenjie Shi --- ...Manager.AlertsManagement.netstandard2.0.cs | 9 +++++-- .../Models/Comments.Serialization.cs | 26 +++++++++++++++++++ .../src/Generated/Models/Comments.cs | 21 +++++++++++++++ .../RestOperations/AlertsRestOperations.cs | 8 +++--- .../src/Generated/ServiceAlertResource.cs | 4 +-- .../src/autorest.md | 2 +- 6 files changed, 61 insertions(+), 9 deletions(-) create mode 100644 sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/src/Generated/Models/Comments.Serialization.cs create mode 100644 sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/src/Generated/Models/Comments.cs diff --git a/sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/api/Azure.ResourceManager.AlertsManagement.netstandard2.0.cs b/sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/api/Azure.ResourceManager.AlertsManagement.netstandard2.0.cs index d97e2de85ea1f..9989968a577a5 100644 --- a/sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/api/Azure.ResourceManager.AlertsManagement.netstandard2.0.cs +++ b/sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/api/Azure.ResourceManager.AlertsManagement.netstandard2.0.cs @@ -85,8 +85,8 @@ public partial class ServiceAlertResource : Azure.ResourceManager.ArmResource protected ServiceAlertResource() { } public virtual Azure.ResourceManager.AlertsManagement.ServiceAlertData Data { get { throw null; } } public virtual bool HasData { get { throw null; } } - public virtual Azure.Response ChangeState(Azure.ResourceManager.AlertsManagement.Models.ServiceAlertState newState, string comment = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> ChangeStateAsync(Azure.ResourceManager.AlertsManagement.Models.ServiceAlertState newState, string comment = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response ChangeState(Azure.ResourceManager.AlertsManagement.Models.ServiceAlertState newState, Azure.ResourceManager.AlertsManagement.Models.Comments comment = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ChangeStateAsync(Azure.ResourceManager.AlertsManagement.Models.ServiceAlertState newState, Azure.ResourceManager.AlertsManagement.Models.Comments comment = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, System.Guid alertId) { throw null; } public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -311,6 +311,11 @@ public AlertProcessingRuleWeeklyRecurrence(System.Collections.Generic.IEnumerabl public static bool operator !=(Azure.ResourceManager.AlertsManagement.Models.AlertsSummaryGroupByField left, Azure.ResourceManager.AlertsManagement.Models.AlertsSummaryGroupByField right) { throw null; } public override string ToString() { throw null; } } + public partial class Comments + { + public Comments() { } + public string CommentsValue { get { throw null; } set { } } + } public partial class DailyRecurrence : Azure.ResourceManager.AlertsManagement.Models.AlertProcessingRuleRecurrence { public DailyRecurrence() { } diff --git a/sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/src/Generated/Models/Comments.Serialization.cs b/sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/src/Generated/Models/Comments.Serialization.cs new file mode 100644 index 0000000000000..e37f0155f3f46 --- /dev/null +++ b/sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/src/Generated/Models/Comments.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.AlertsManagement.Models +{ + public partial class Comments : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(CommentsValue)) + { + writer.WritePropertyName("comments"); + writer.WriteStringValue(CommentsValue); + } + writer.WriteEndObject(); + } + } +} diff --git a/sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/src/Generated/Models/Comments.cs b/sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/src/Generated/Models/Comments.cs new file mode 100644 index 0000000000000..7b2e356e444ae --- /dev/null +++ b/sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/src/Generated/Models/Comments.cs @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.AlertsManagement.Models +{ + /// Change alert state reason. + public partial class Comments + { + /// Initializes a new instance of Comments. + public Comments() + { + } + + /// Gets or sets the comments value. + public string CommentsValue { get; set; } + } +} diff --git a/sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/src/Generated/RestOperations/AlertsRestOperations.cs b/sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/src/Generated/RestOperations/AlertsRestOperations.cs index 7101b2a3e7238..4f09ff48b709e 100644 --- a/sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/src/Generated/RestOperations/AlertsRestOperations.cs +++ b/sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/src/Generated/RestOperations/AlertsRestOperations.cs @@ -338,7 +338,7 @@ public Response GetById(string subscriptionId, Guid alertId, C } } - internal HttpMessage CreateChangeStateRequest(string subscriptionId, Guid alertId, ServiceAlertState newState, string comment) + internal HttpMessage CreateChangeStateRequest(string subscriptionId, Guid alertId, ServiceAlertState newState, Comments comment) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -358,7 +358,7 @@ internal HttpMessage CreateChangeStateRequest(string subscriptionId, Guid alertI { request.Headers.Add("Content-Type", "application/json"); var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteStringValue(comment); + content.JsonWriter.WriteObjectValue(comment); request.Content = content; } _userAgent.Apply(message); @@ -373,7 +373,7 @@ internal HttpMessage CreateChangeStateRequest(string subscriptionId, Guid alertI /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. - public async Task> ChangeStateAsync(string subscriptionId, Guid alertId, ServiceAlertState newState, string comment = null, CancellationToken cancellationToken = default) + public async Task> ChangeStateAsync(string subscriptionId, Guid alertId, ServiceAlertState newState, Comments comment = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -401,7 +401,7 @@ public async Task> ChangeStateAsync(string subscripti /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. - public Response ChangeState(string subscriptionId, Guid alertId, ServiceAlertState newState, string comment = null, CancellationToken cancellationToken = default) + public Response ChangeState(string subscriptionId, Guid alertId, ServiceAlertState newState, Comments comment = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); diff --git a/sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/src/Generated/ServiceAlertResource.cs b/sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/src/Generated/ServiceAlertResource.cs index 3f6fab132d36f..6ba42f4823ce5 100644 --- a/sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/src/Generated/ServiceAlertResource.cs +++ b/sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/src/Generated/ServiceAlertResource.cs @@ -144,7 +144,7 @@ public virtual Response Get(CancellationToken cancellation /// New state of the alert. /// reason of change alert state. /// The cancellation token to use. - public virtual async Task> ChangeStateAsync(ServiceAlertState newState, string comment = null, CancellationToken cancellationToken = default) + public virtual async Task> ChangeStateAsync(ServiceAlertState newState, Comments comment = null, CancellationToken cancellationToken = default) { using var scope = _serviceAlertAlertsClientDiagnostics.CreateScope("ServiceAlertResource.ChangeState"); scope.Start(); @@ -168,7 +168,7 @@ public virtual async Task> ChangeStateAsync(Servi /// New state of the alert. /// reason of change alert state. /// The cancellation token to use. - public virtual Response ChangeState(ServiceAlertState newState, string comment = null, CancellationToken cancellationToken = default) + public virtual Response ChangeState(ServiceAlertState newState, Comments comment = null, CancellationToken cancellationToken = default) { using var scope = _serviceAlertAlertsClientDiagnostics.CreateScope("ServiceAlertResource.ChangeState"); scope.Start(); diff --git a/sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/src/autorest.md b/sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/src/autorest.md index 0bd97d39e6734..040c59321395a 100644 --- a/sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/src/autorest.md +++ b/sdk/alertsmanagement/Azure.ResourceManager.AlertsManagement/src/autorest.md @@ -8,7 +8,7 @@ azure-arm: true csharp: true library-name: AlertsManagement namespace: Azure.ResourceManager.AlertsManagement -require: https://github.com/Azure/azure-rest-api-specs/blob/0077b4a8c5071d3ab33fd9f9ba013581c9a66b8f/specification/alertsmanagement/resource-manager/readme.md +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/alertsmanagement/resource-manager/readme.md output-folder: $(this-folder)/Generated clear-output-folder: true skip-csproj: true