Files
Dan Moseley 042a9d2b2c Reorganize plugins into domain-specific groupings (#274)
* Reorganize plugins per agreed structure (#271)

Split the dotnet plugin into domain-specific plugins per discussion
in #271:

- dotnet: narrowed to common everyday C#/.NET coding tasks
- dotnet-diag: perf investigations, debugging, incident analysis
- dotnet-data: data access and Entity Framework
- dotnet-aspnet, dotnet-wpf, dotnet-winforms, dotnet-maui: scaffolded
  empty to convey intent for future framework-specific skills

Moved skills, tests, and CODEOWNERS entries accordingly.
No file content was changed; all skill/test moves are pure renames.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Improve dotnet-diag and dotnet-winforms descriptions

- dotnet-diag: add '.NET' qualifier to clarify scope
- dotnet-winforms: use official 'Windows Forms (WinForms)' name

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Add .NET qualifier to dotnet-data description

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Remove empty plugins; list them in CONTRIBUTING.md as future options

Remove the four empty placeholder plugins (dotnet-aspnet, dotnet-wpf,
dotnet-winforms, dotnet-maui) that had only plugin.json and no skills.

Add a 'Plugin organization' section to CONTRIBUTING.md that describes the
domain-specific plugin groupings introduced in this PR and lists the four
removed plugin names as reserved candidates for future contributions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Create dotnet-upgrade plugin with migration/upgrade skills

Move migrate-nullable-references, thread-abort-migration, and
dotnet-aot-compat from dotnet to the new dotnet-upgrade plugin.

Update CODEOWNERS paths (same owners), CONTRIBUTING.md plugin table,
and fix the thread-abort-migration SKILL.md link in CONTRIBUTING.md.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-06 21:01:52 -08:00

384 lines
15 KiB
C#

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
using System;
using System.ClientModel.Primitives;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.Json;
using Azure.Core;
using Azure.ResourceManager.ManagementGroups.Models;
using Azure.ResourceManager.Models;
namespace Azure.ResourceManager.ManagementGroups
{
public partial class ManagementGroupData : IUtf8JsonSerializable, IJsonModel<ManagementGroupData>
{
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel<ManagementGroupData>)this).Write(writer, ModelSerializationExtensions.WireOptions);
void IJsonModel<ManagementGroupData>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
{
writer.WriteStartObject();
JsonModelWriteCore(writer, options);
writer.WriteEndObject();
}
/// <param name="writer"> The JSON writer. </param>
/// <param name="options"> The client options for reading and writing models. </param>
protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
{
var format = options.Format == "W" ? ((IPersistableModel<ManagementGroupData>)this).GetFormatFromOptions(options) : options.Format;
if (format != "J")
{
throw new FormatException($"The model {nameof(ManagementGroupData)} does not support writing '{format}' format.");
}
base.JsonModelWriteCore(writer, options);
writer.WritePropertyName("properties"u8);
writer.WriteStartObject();
if (Optional.IsDefined(TenantId))
{
writer.WritePropertyName("tenantId"u8);
writer.WriteStringValue(TenantId.Value);
}
if (Optional.IsDefined(DisplayName))
{
writer.WritePropertyName("displayName"u8);
writer.WriteStringValue(DisplayName);
}
if (Optional.IsDefined(Details))
{
writer.WritePropertyName("details"u8);
writer.WriteObjectValue(Details, options);
}
if (Optional.IsCollectionDefined(Children))
{
if (Children != null)
{
writer.WritePropertyName("children"u8);
writer.WriteStartArray();
foreach (var item in Children)
{
writer.WriteObjectValue(item, options);
}
writer.WriteEndArray();
}
else
{
writer.WriteNull("children");
}
}
writer.WriteEndObject();
}
ManagementGroupData IJsonModel<ManagementGroupData>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
{
var format = options.Format == "W" ? ((IPersistableModel<ManagementGroupData>)this).GetFormatFromOptions(options) : options.Format;
if (format != "J")
{
throw new FormatException($"The model {nameof(ManagementGroupData)} does not support reading '{format}' format.");
}
using JsonDocument document = JsonDocument.ParseValue(ref reader);
return DeserializeManagementGroupData(document.RootElement, options);
}
internal static ManagementGroupData DeserializeManagementGroupData(JsonElement element, ModelReaderWriterOptions options = null)
{
options ??= ModelSerializationExtensions.WireOptions;
if (element.ValueKind == JsonValueKind.Null)
{
return null;
}
ResourceIdentifier id = default;
string name = default;
ResourceType type = default;
SystemData systemData = default;
Guid? tenantId = default;
string displayName = default;
ManagementGroupInfo details = default;
IReadOnlyList<ManagementGroupChildInfo> children = default;
IDictionary<string, BinaryData> serializedAdditionalRawData = default;
Dictionary<string, BinaryData> rawDataDictionary = new Dictionary<string, BinaryData>();
foreach (var property in element.EnumerateObject())
{
if (property.NameEquals("id"u8))
{
id = new ResourceIdentifier(property.Value.GetString());
continue;
}
if (property.NameEquals("name"u8))
{
name = property.Value.GetString();
continue;
}
if (property.NameEquals("type"u8))
{
type = new ResourceType(property.Value.GetString());
continue;
}
if (property.NameEquals("systemData"u8))
{
if (property.Value.ValueKind == JsonValueKind.Null)
{
continue;
}
systemData = JsonSerializer.Deserialize<SystemData>(property.Value.GetRawText());
continue;
}
if (property.NameEquals("properties"u8))
{
if (property.Value.ValueKind == JsonValueKind.Null)
{
property.ThrowNonNullablePropertyIsNull();
continue;
}
foreach (var property0 in property.Value.EnumerateObject())
{
if (property0.NameEquals("tenantId"u8))
{
if (property0.Value.ValueKind == JsonValueKind.Null)
{
continue;
}
tenantId = property0.Value.GetGuid();
continue;
}
if (property0.NameEquals("displayName"u8))
{
displayName = property0.Value.GetString();
continue;
}
if (property0.NameEquals("details"u8))
{
if (property0.Value.ValueKind == JsonValueKind.Null)
{
continue;
}
details = ManagementGroupInfo.DeserializeManagementGroupInfo(property0.Value, options);
continue;
}
if (property0.NameEquals("children"u8))
{
if (property0.Value.ValueKind == JsonValueKind.Null)
{
children = null;
continue;
}
List<ManagementGroupChildInfo> array = new List<ManagementGroupChildInfo>();
foreach (var item in property0.Value.EnumerateArray())
{
array.Add(ManagementGroupChildInfo.DeserializeManagementGroupChildInfo(item, options));
}
children = array;
continue;
}
}
continue;
}
if (options.Format != "W")
{
rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
}
}
serializedAdditionalRawData = rawDataDictionary;
return new ManagementGroupData(
id,
name,
type,
systemData,
tenantId,
displayName,
details,
children ?? new ChangeTrackingList<ManagementGroupChildInfo>(),
serializedAdditionalRawData);
}
private BinaryData SerializeBicep(ModelReaderWriterOptions options)
{
StringBuilder builder = new StringBuilder();
BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions;
IDictionary<string, string> propertyOverrides = null;
bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides);
bool hasPropertyOverride = false;
string propertyOverride = null;
builder.AppendLine("{");
hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride);
if (hasPropertyOverride)
{
builder.Append(" name: ");
builder.AppendLine(propertyOverride);
}
else
{
if (Optional.IsDefined(Name))
{
builder.Append(" name: ");
if (Name.Contains(Environment.NewLine))
{
builder.AppendLine("'''");
builder.AppendLine($"{Name}'''");
}
else
{
builder.AppendLine($"'{Name}'");
}
}
}
hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride);
if (hasPropertyOverride)
{
builder.Append(" id: ");
builder.AppendLine(propertyOverride);
}
else
{
if (Optional.IsDefined(Id))
{
builder.Append(" id: ");
builder.AppendLine($"'{Id.ToString()}'");
}
}
hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride);
if (hasPropertyOverride)
{
builder.Append(" systemData: ");
builder.AppendLine(propertyOverride);
}
else
{
if (Optional.IsDefined(SystemData))
{
builder.Append(" systemData: ");
builder.AppendLine($"'{SystemData.ToString()}'");
}
}
builder.Append(" properties:");
builder.AppendLine(" {");
hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TenantId), out propertyOverride);
if (hasPropertyOverride)
{
builder.Append(" tenantId: ");
builder.AppendLine(propertyOverride);
}
else
{
if (Optional.IsDefined(TenantId))
{
builder.Append(" tenantId: ");
builder.AppendLine($"'{TenantId.Value.ToString()}'");
}
}
hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DisplayName), out propertyOverride);
if (hasPropertyOverride)
{
builder.Append(" displayName: ");
builder.AppendLine(propertyOverride);
}
else
{
if (Optional.IsDefined(DisplayName))
{
builder.Append(" displayName: ");
if (DisplayName.Contains(Environment.NewLine))
{
builder.AppendLine("'''");
builder.AppendLine($"{DisplayName}'''");
}
else
{
builder.AppendLine($"'{DisplayName}'");
}
}
}
hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Details), out propertyOverride);
if (hasPropertyOverride)
{
builder.Append(" details: ");
builder.AppendLine(propertyOverride);
}
else
{
if (Optional.IsDefined(Details))
{
builder.Append(" details: ");
BicepSerializationHelpers.AppendChildObject(builder, Details, options, 4, false, " details: ");
}
}
hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Children), out propertyOverride);
if (hasPropertyOverride)
{
builder.Append(" children: ");
builder.AppendLine(propertyOverride);
}
else
{
if (Optional.IsCollectionDefined(Children))
{
if (Children.Any())
{
builder.Append(" children: ");
builder.AppendLine("[");
foreach (var item in Children)
{
BicepSerializationHelpers.AppendChildObject(builder, item, options, 6, true, " children: ");
}
builder.AppendLine(" ]");
}
}
}
builder.AppendLine(" }");
builder.AppendLine("}");
return BinaryData.FromString(builder.ToString());
}
BinaryData IPersistableModel<ManagementGroupData>.Write(ModelReaderWriterOptions options)
{
var format = options.Format == "W" ? ((IPersistableModel<ManagementGroupData>)this).GetFormatFromOptions(options) : options.Format;
switch (format)
{
case "J":
return ModelReaderWriter.Write(this, options, AzureResourceManagerContext.Default);
case "bicep":
return SerializeBicep(options);
default:
throw new FormatException($"The model {nameof(ManagementGroupData)} does not support writing '{options.Format}' format.");
}
}
ManagementGroupData IPersistableModel<ManagementGroupData>.Create(BinaryData data, ModelReaderWriterOptions options)
{
var format = options.Format == "W" ? ((IPersistableModel<ManagementGroupData>)this).GetFormatFromOptions(options) : options.Format;
switch (format)
{
case "J":
{
using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions);
return DeserializeManagementGroupData(document.RootElement, options);
}
default:
throw new FormatException($"The model {nameof(ManagementGroupData)} does not support reading '{options.Format}' format.");
}
}
string IPersistableModel<ManagementGroupData>.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
}
}