From 25c37f98d7d8558d9386b6b9f49a51431393cecd Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 28 Oct 2022 10:21:10 +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 --- ....ResourceManager.DataBox.netstandard2.0.cs | 13 +++++ ...iskGranularCopyLogDetails.Serialization.cs | 58 +++++++++++++++++++ .../DataBoxDiskGranularCopyLogDetails.cs | 45 ++++++++++++++ .../DataBoxDiskJobDetails.Serialization.cs | 18 +++++- .../Generated/Models/DataBoxDiskJobDetails.cs | 7 ++- .../GranularCopyLogDetails.Serialization.cs | 36 ++++++++++++ .../Models/GranularCopyLogDetails.cs | 32 ++++++++++ ...ownGranularCopyLogDetails.Serialization.cs | 37 ++++++++++++ .../Models/UnknownGranularCopyLogDetails.cs | 20 +++++++ .../src/autorest.md | 2 +- 10 files changed, 265 insertions(+), 3 deletions(-) create mode 100644 sdk/databox/Azure.ResourceManager.DataBox/src/Generated/Models/DataBoxDiskGranularCopyLogDetails.Serialization.cs create mode 100644 sdk/databox/Azure.ResourceManager.DataBox/src/Generated/Models/DataBoxDiskGranularCopyLogDetails.cs create mode 100644 sdk/databox/Azure.ResourceManager.DataBox/src/Generated/Models/GranularCopyLogDetails.Serialization.cs create mode 100644 sdk/databox/Azure.ResourceManager.DataBox/src/Generated/Models/GranularCopyLogDetails.cs create mode 100644 sdk/databox/Azure.ResourceManager.DataBox/src/Generated/Models/UnknownGranularCopyLogDetails.Serialization.cs create mode 100644 sdk/databox/Azure.ResourceManager.DataBox/src/Generated/Models/UnknownGranularCopyLogDetails.cs diff --git a/sdk/databox/Azure.ResourceManager.DataBox/api/Azure.ResourceManager.DataBox.netstandard2.0.cs b/sdk/databox/Azure.ResourceManager.DataBox/api/Azure.ResourceManager.DataBox.netstandard2.0.cs index 4b5506193720..95fd6d723585 100644 --- a/sdk/databox/Azure.ResourceManager.DataBox/api/Azure.ResourceManager.DataBox.netstandard2.0.cs +++ b/sdk/databox/Azure.ResourceManager.DataBox/api/Azure.ResourceManager.DataBox.netstandard2.0.cs @@ -320,6 +320,14 @@ internal DataBoxDiskCopyProgress() { } public string SerialNumber { get { throw null; } } public Azure.ResourceManager.DataBox.Models.DataBoxCopyStatus? Status { get { throw null; } } } + public partial class DataBoxDiskGranularCopyLogDetails : Azure.ResourceManager.DataBox.Models.GranularCopyLogDetails + { + internal DataBoxDiskGranularCopyLogDetails() { } + public Azure.Core.ResourceIdentifier AccountId { get { throw null; } } + public string ErrorLogLink { get { throw null; } } + public string SerialNumber { get { throw null; } } + public string VerboseLogLink { get { throw null; } } + } public partial class DataBoxDiskGranularCopyProgress : Azure.ResourceManager.DataBox.Models.GranularCopyProgress { internal DataBoxDiskGranularCopyProgress() { } @@ -331,6 +339,7 @@ public partial class DataBoxDiskJobDetails : Azure.ResourceManager.DataBox.Model public DataBoxDiskJobDetails(Azure.ResourceManager.DataBox.Models.DataBoxContactDetails contactDetails) : base (default(Azure.ResourceManager.DataBox.Models.DataBoxContactDetails)) { } public System.Collections.Generic.IReadOnlyList CopyProgress { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary DisksAndSizeDetails { get { throw null; } } + public System.Collections.Generic.IReadOnlyList GranularCopyLogDetails { get { throw null; } } public System.Collections.Generic.IReadOnlyList GranularCopyProgress { get { throw null; } } public string Passkey { get { throw null; } set { } } public System.Collections.Generic.IDictionary PreferredDisks { get { throw null; } } @@ -790,6 +799,10 @@ public enum FilterFileType AzureBlob = 0, AzureFile = 1, } + public abstract partial class GranularCopyLogDetails + { + protected GranularCopyLogDetails() { } + } public partial class GranularCopyProgress { internal GranularCopyProgress() { } diff --git a/sdk/databox/Azure.ResourceManager.DataBox/src/Generated/Models/DataBoxDiskGranularCopyLogDetails.Serialization.cs b/sdk/databox/Azure.ResourceManager.DataBox/src/Generated/Models/DataBoxDiskGranularCopyLogDetails.Serialization.cs new file mode 100644 index 000000000000..67fe14814e59 --- /dev/null +++ b/sdk/databox/Azure.ResourceManager.DataBox/src/Generated/Models/DataBoxDiskGranularCopyLogDetails.Serialization.cs @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DataBox.Models +{ + public partial class DataBoxDiskGranularCopyLogDetails + { + internal static DataBoxDiskGranularCopyLogDetails DeserializeDataBoxDiskGranularCopyLogDetails(JsonElement element) + { + Optional serialNumber = default; + Optional accountId = default; + Optional errorLogLink = default; + Optional verboseLogLink = default; + DataBoxOrderType copyLogDetailsType = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("serialNumber")) + { + serialNumber = property.Value.GetString(); + continue; + } + if (property.NameEquals("accountId")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + accountId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("errorLogLink")) + { + errorLogLink = property.Value.GetString(); + continue; + } + if (property.NameEquals("verboseLogLink")) + { + verboseLogLink = property.Value.GetString(); + continue; + } + if (property.NameEquals("copyLogDetailsType")) + { + copyLogDetailsType = property.Value.GetString().ToDataBoxOrderType(); + continue; + } + } + return new DataBoxDiskGranularCopyLogDetails(copyLogDetailsType, serialNumber.Value, accountId.Value, errorLogLink.Value, verboseLogLink.Value); + } + } +} diff --git a/sdk/databox/Azure.ResourceManager.DataBox/src/Generated/Models/DataBoxDiskGranularCopyLogDetails.cs b/sdk/databox/Azure.ResourceManager.DataBox/src/Generated/Models/DataBoxDiskGranularCopyLogDetails.cs new file mode 100644 index 000000000000..e1f0f77bfa30 --- /dev/null +++ b/sdk/databox/Azure.ResourceManager.DataBox/src/Generated/Models/DataBoxDiskGranularCopyLogDetails.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace Azure.ResourceManager.DataBox.Models +{ + /// Granular Copy Log Details for customer disk. + public partial class DataBoxDiskGranularCopyLogDetails : GranularCopyLogDetails + { + /// Initializes a new instance of DataBoxDiskGranularCopyLogDetails. + internal DataBoxDiskGranularCopyLogDetails() + { + CopyLogDetailsType = DataBoxOrderType.DataBoxCustomerDisk; + } + + /// Initializes a new instance of DataBoxDiskGranularCopyLogDetails. + /// Indicates the type of job details. + /// Disk Serial Number. + /// Account id. + /// Link for copy error logs. + /// Link for copy verbose logs. + internal DataBoxDiskGranularCopyLogDetails(DataBoxOrderType copyLogDetailsType, string serialNumber, ResourceIdentifier accountId, string errorLogLink, string verboseLogLink) : base(copyLogDetailsType) + { + SerialNumber = serialNumber; + AccountId = accountId; + ErrorLogLink = errorLogLink; + VerboseLogLink = verboseLogLink; + CopyLogDetailsType = copyLogDetailsType; + } + + /// Disk Serial Number. + public string SerialNumber { get; } + /// Account id. + public ResourceIdentifier AccountId { get; } + /// Link for copy error logs. + public string ErrorLogLink { get; } + /// Link for copy verbose logs. + public string VerboseLogLink { get; } + } +} diff --git a/sdk/databox/Azure.ResourceManager.DataBox/src/Generated/Models/DataBoxDiskJobDetails.Serialization.cs b/sdk/databox/Azure.ResourceManager.DataBox/src/Generated/Models/DataBoxDiskJobDetails.Serialization.cs index 73115a5a8826..b6befb1fb2ba 100644 --- a/sdk/databox/Azure.ResourceManager.DataBox/src/Generated/Models/DataBoxDiskJobDetails.Serialization.cs +++ b/sdk/databox/Azure.ResourceManager.DataBox/src/Generated/Models/DataBoxDiskJobDetails.Serialization.cs @@ -84,6 +84,7 @@ internal static DataBoxDiskJobDetails DeserializeDataBoxDiskJobDetails(JsonEleme Optional> preferredDisks = default; Optional> copyProgress = default; Optional> granularCopyProgress = default; + Optional> granularCopyLogDetails = default; Optional> disksAndSizeDetails = default; Optional passkey = default; Optional> jobStages = default; @@ -152,6 +153,21 @@ internal static DataBoxDiskJobDetails DeserializeDataBoxDiskJobDetails(JsonEleme granularCopyProgress = array; continue; } + if (property.NameEquals("granularCopyLogDetails")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataBoxDiskGranularCopyLogDetails.DeserializeDataBoxDiskGranularCopyLogDetails(item)); + } + granularCopyLogDetails = array; + continue; + } if (property.NameEquals("disksAndSizeDetails")) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -368,7 +384,7 @@ internal static DataBoxDiskJobDetails DeserializeDataBoxDiskJobDetails(JsonEleme continue; } } - return new DataBoxDiskJobDetails(Optional.ToList(jobStages), contactDetails, shippingAddress.Value, deliveryPackage.Value, returnPackage.Value, Optional.ToList(dataImportDetails), Optional.ToList(dataExportDetails), jobDetailsType, preferences.Value, Optional.ToList(copyLogDetails), reverseShipmentLabelSasKey.Value, chainOfCustodySasKey.Value, deviceErasureDetails.Value, keyEncryptionKey.Value, Optional.ToNullable(expectedDataSizeInTerabytes), Optional.ToList(actions), lastMitigationActionOnJob.Value, dataCenterAddress.Value, Optional.ToNullable(dataCenterCode), Optional.ToDictionary(preferredDisks), Optional.ToList(copyProgress), Optional.ToList(granularCopyProgress), Optional.ToDictionary(disksAndSizeDetails), passkey.Value); + return new DataBoxDiskJobDetails(Optional.ToList(jobStages), contactDetails, shippingAddress.Value, deliveryPackage.Value, returnPackage.Value, Optional.ToList(dataImportDetails), Optional.ToList(dataExportDetails), jobDetailsType, preferences.Value, Optional.ToList(copyLogDetails), reverseShipmentLabelSasKey.Value, chainOfCustodySasKey.Value, deviceErasureDetails.Value, keyEncryptionKey.Value, Optional.ToNullable(expectedDataSizeInTerabytes), Optional.ToList(actions), lastMitigationActionOnJob.Value, dataCenterAddress.Value, Optional.ToNullable(dataCenterCode), Optional.ToDictionary(preferredDisks), Optional.ToList(copyProgress), Optional.ToList(granularCopyProgress), Optional.ToList(granularCopyLogDetails), Optional.ToDictionary(disksAndSizeDetails), passkey.Value); } } } diff --git a/sdk/databox/Azure.ResourceManager.DataBox/src/Generated/Models/DataBoxDiskJobDetails.cs b/sdk/databox/Azure.ResourceManager.DataBox/src/Generated/Models/DataBoxDiskJobDetails.cs index c065aa759482..2feb1488637b 100644 --- a/sdk/databox/Azure.ResourceManager.DataBox/src/Generated/Models/DataBoxDiskJobDetails.cs +++ b/sdk/databox/Azure.ResourceManager.DataBox/src/Generated/Models/DataBoxDiskJobDetails.cs @@ -24,6 +24,7 @@ public DataBoxDiskJobDetails(DataBoxContactDetails contactDetails) : base(contac PreferredDisks = new ChangeTrackingDictionary(); CopyProgress = new ChangeTrackingList(); GranularCopyProgress = new ChangeTrackingList(); + GranularCopyLogDetails = new ChangeTrackingList(); DisksAndSizeDetails = new ChangeTrackingDictionary(); JobDetailsType = DataBoxOrderType.DataBoxDisk; } @@ -59,13 +60,15 @@ public DataBoxDiskJobDetails(DataBoxContactDetails contactDetails) : base(contac /// User preference on what size disks are needed for the job. The map is from the disk size in TB to the count. Eg. {2,5} means 5 disks of 2 TB size. Key is string but will be checked against an int. /// Copy progress per disk. /// Copy progress per disk. + /// Copy progress per disk. /// Contains the map of disk serial number to the disk size being used for the job. Is returned only after the disks are shipped to the customer. /// User entered passkey for DataBox Disk job. - internal DataBoxDiskJobDetails(IReadOnlyList jobStages, DataBoxContactDetails contactDetails, DataBoxShippingAddress shippingAddress, PackageShippingDetails deliveryPackage, PackageShippingDetails returnPackage, IList dataImportDetails, IList dataExportDetails, DataBoxOrderType jobDetailsType, DataBoxOrderPreferences preferences, IReadOnlyList copyLogDetails, string reverseShipmentLabelSasKey, string chainOfCustodySasKey, DeviceErasureDetails deviceErasureDetails, DataBoxKeyEncryptionKey keyEncryptionKey, int? expectedDataSizeInTerabytes, IReadOnlyList actions, LastMitigationActionOnJob lastMitigationActionOnJob, DataCenterAddressResult dataCenterAddress, DataCenterCode? dataCenterCode, IDictionary preferredDisks, IReadOnlyList copyProgress, IReadOnlyList granularCopyProgress, IReadOnlyDictionary disksAndSizeDetails, string passkey) : base(jobStages, contactDetails, shippingAddress, deliveryPackage, returnPackage, dataImportDetails, dataExportDetails, jobDetailsType, preferences, copyLogDetails, reverseShipmentLabelSasKey, chainOfCustodySasKey, deviceErasureDetails, keyEncryptionKey, expectedDataSizeInTerabytes, actions, lastMitigationActionOnJob, dataCenterAddress, dataCenterCode) + internal DataBoxDiskJobDetails(IReadOnlyList jobStages, DataBoxContactDetails contactDetails, DataBoxShippingAddress shippingAddress, PackageShippingDetails deliveryPackage, PackageShippingDetails returnPackage, IList dataImportDetails, IList dataExportDetails, DataBoxOrderType jobDetailsType, DataBoxOrderPreferences preferences, IReadOnlyList copyLogDetails, string reverseShipmentLabelSasKey, string chainOfCustodySasKey, DeviceErasureDetails deviceErasureDetails, DataBoxKeyEncryptionKey keyEncryptionKey, int? expectedDataSizeInTerabytes, IReadOnlyList actions, LastMitigationActionOnJob lastMitigationActionOnJob, DataCenterAddressResult dataCenterAddress, DataCenterCode? dataCenterCode, IDictionary preferredDisks, IReadOnlyList copyProgress, IReadOnlyList granularCopyProgress, IReadOnlyList granularCopyLogDetails, IReadOnlyDictionary disksAndSizeDetails, string passkey) : base(jobStages, contactDetails, shippingAddress, deliveryPackage, returnPackage, dataImportDetails, dataExportDetails, jobDetailsType, preferences, copyLogDetails, reverseShipmentLabelSasKey, chainOfCustodySasKey, deviceErasureDetails, keyEncryptionKey, expectedDataSizeInTerabytes, actions, lastMitigationActionOnJob, dataCenterAddress, dataCenterCode) { PreferredDisks = preferredDisks; CopyProgress = copyProgress; GranularCopyProgress = granularCopyProgress; + GranularCopyLogDetails = granularCopyLogDetails; DisksAndSizeDetails = disksAndSizeDetails; Passkey = passkey; JobDetailsType = jobDetailsType; @@ -77,6 +80,8 @@ internal DataBoxDiskJobDetails(IReadOnlyList jobStages, DataBox public IReadOnlyList CopyProgress { get; } /// Copy progress per disk. public IReadOnlyList GranularCopyProgress { get; } + /// Copy progress per disk. + public IReadOnlyList GranularCopyLogDetails { get; } /// Contains the map of disk serial number to the disk size being used for the job. Is returned only after the disks are shipped to the customer. public IReadOnlyDictionary DisksAndSizeDetails { get; } /// User entered passkey for DataBox Disk job. diff --git a/sdk/databox/Azure.ResourceManager.DataBox/src/Generated/Models/GranularCopyLogDetails.Serialization.cs b/sdk/databox/Azure.ResourceManager.DataBox/src/Generated/Models/GranularCopyLogDetails.Serialization.cs new file mode 100644 index 000000000000..38ea279fe217 --- /dev/null +++ b/sdk/databox/Azure.ResourceManager.DataBox/src/Generated/Models/GranularCopyLogDetails.Serialization.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DataBox.Models +{ + public partial class GranularCopyLogDetails + { + internal static GranularCopyLogDetails DeserializeGranularCopyLogDetails(JsonElement element) + { + if (element.TryGetProperty("copyLogDetailsType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "DataBoxCustomerDisk": return DataBoxDiskGranularCopyLogDetails.DeserializeDataBoxDiskGranularCopyLogDetails(element); + } + } + DataBoxOrderType copyLogDetailsType = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("copyLogDetailsType")) + { + copyLogDetailsType = property.Value.GetString().ToDataBoxOrderType(); + continue; + } + } + return new UnknownGranularCopyLogDetails(copyLogDetailsType); + } + } +} diff --git a/sdk/databox/Azure.ResourceManager.DataBox/src/Generated/Models/GranularCopyLogDetails.cs b/sdk/databox/Azure.ResourceManager.DataBox/src/Generated/Models/GranularCopyLogDetails.cs new file mode 100644 index 000000000000..91feb67d2279 --- /dev/null +++ b/sdk/databox/Azure.ResourceManager.DataBox/src/Generated/Models/GranularCopyLogDetails.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.DataBox.Models +{ + /// + /// Granular Details for log generated during copy. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include . + /// + public abstract partial class GranularCopyLogDetails + { + /// Initializes a new instance of GranularCopyLogDetails. + protected GranularCopyLogDetails() + { + } + + /// Initializes a new instance of GranularCopyLogDetails. + /// Indicates the type of job details. + internal GranularCopyLogDetails(DataBoxOrderType copyLogDetailsType) + { + CopyLogDetailsType = copyLogDetailsType; + } + + /// Indicates the type of job details. + internal DataBoxOrderType CopyLogDetailsType { get; set; } + } +} diff --git a/sdk/databox/Azure.ResourceManager.DataBox/src/Generated/Models/UnknownGranularCopyLogDetails.Serialization.cs b/sdk/databox/Azure.ResourceManager.DataBox/src/Generated/Models/UnknownGranularCopyLogDetails.Serialization.cs new file mode 100644 index 000000000000..976476800cbd --- /dev/null +++ b/sdk/databox/Azure.ResourceManager.DataBox/src/Generated/Models/UnknownGranularCopyLogDetails.Serialization.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DataBox.Models +{ + internal partial class UnknownGranularCopyLogDetails : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("copyLogDetailsType"); + writer.WriteStringValue(CopyLogDetailsType.ToSerialString()); + writer.WriteEndObject(); + } + + internal static UnknownGranularCopyLogDetails DeserializeUnknownGranularCopyLogDetails(JsonElement element) + { + DataBoxOrderType copyLogDetailsType = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("copyLogDetailsType")) + { + copyLogDetailsType = property.Value.GetString().ToDataBoxOrderType(); + continue; + } + } + return new UnknownGranularCopyLogDetails(copyLogDetailsType); + } + } +} diff --git a/sdk/databox/Azure.ResourceManager.DataBox/src/Generated/Models/UnknownGranularCopyLogDetails.cs b/sdk/databox/Azure.ResourceManager.DataBox/src/Generated/Models/UnknownGranularCopyLogDetails.cs new file mode 100644 index 000000000000..8d1058ec86e3 --- /dev/null +++ b/sdk/databox/Azure.ResourceManager.DataBox/src/Generated/Models/UnknownGranularCopyLogDetails.cs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.DataBox.Models +{ + /// The UnknownGranularCopyLogDetails. + internal partial class UnknownGranularCopyLogDetails : GranularCopyLogDetails + { + /// Initializes a new instance of UnknownGranularCopyLogDetails. + /// Indicates the type of job details. + internal UnknownGranularCopyLogDetails(DataBoxOrderType copyLogDetailsType) : base(copyLogDetailsType) + { + CopyLogDetailsType = copyLogDetailsType; + } + } +} diff --git a/sdk/databox/Azure.ResourceManager.DataBox/src/autorest.md b/sdk/databox/Azure.ResourceManager.DataBox/src/autorest.md index 7d9da7919d02..65f9d6e1b3ba 100644 --- a/sdk/databox/Azure.ResourceManager.DataBox/src/autorest.md +++ b/sdk/databox/Azure.ResourceManager.DataBox/src/autorest.md @@ -8,7 +8,7 @@ azure-arm: true csharp: true library-name: DataBox namespace: Azure.ResourceManager.DataBox -require: https://github.com/Azure/azure-rest-api-specs/blob/df70965d3a207eb2a628c96aa6ed935edc6b7911/specification/databox/resource-manager/readme.md +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/databox/resource-manager/readme.md output-folder: $(this-folder)/Generated clear-output-folder: true skip-csproj: true